:root {
  --bg: #e4eceb;
  --surface: #ffffff;
  --surface-soft: #f5faf9;
  --text: #0c1a18;
  --muted: #4a635e;
  --border: rgba(12, 90, 80, 0.14);
  --primary: #0a7c6e;
  --primary-hover: #086658;
  --primary-light: #12a090;
  --accent: #5eead4;
  --accent-line-start: #0d9488;
  --accent-line-mid: #2dd4bf;
  --accent-line-end: #0f766e;
  --sidebar-bg: #042f2a;
  --sidebar-border: rgba(255, 255, 255, 0.09);
  --sidebar-text: #ecfdf9;
  --sidebar-muted: rgba(236, 253, 249, 0.62);
  --in: #0d9488;
  --out: #c2410c;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(6, 40, 35, 0.04), 0 12px 40px -8px rgba(6, 45, 40, 0.14);
  --shadow-sm: 0 2px 8px rgba(6, 40, 35, 0.06);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Outfit", var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 0% -10%, rgba(94, 234, 212, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(10, 124, 110, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(6, 78, 70, 0.08), transparent 55%),
    linear-gradient(180deg, #eef5f4 0%, var(--bg) 45%, #dce8e6 100%);
}

.app {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: transparent;
}

/* —— Sidebar —— */
.sidebar {
  background: linear-gradient(175deg, #065f56 0%, var(--sidebar-bg) 38%, #021a17 100%);
  color: var(--sidebar-text);
  padding: 1.35rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 8px 0 40px rgba(2, 20, 18, 0.35);
  position: relative;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(94, 234, 212, 0.15) 40%, transparent 85%);
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  position: relative;
  z-index: 1;
}

.sidebar__logo-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(165deg, #ffffff 0%, #f0fdf9 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  padding: 0.35rem;
  overflow: hidden;
}

.sidebar__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar__app-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.sidebar__app-tag {
  font-size: 0.72rem;
  color: var(--sidebar-muted);
  letter-spacing: 0.02em;
  text-transform: none;
}

  .sidebar__logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0.25rem;
  }

  .sidebar__site {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.sidebar__nav {
  flex: 1;
  padding-top: 1rem;
  position: relative;
  z-index: 1;
}

.sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.sidebar__link-icon {
  opacity: 0.55;
  font-size: 0.65rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__link--active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 4px 16px rgba(0, 0, 0, 0.12);
}

.sidebar__link--active .sidebar__link-icon {
  opacity: 1;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(94, 234, 212, 0.45);
}

a.sidebar__link:not(.sidebar__link--active):hover {
  background: rgba(255, 255, 255, 0.08);
}

button.sidebar__link {
  font: inherit;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

button.sidebar__link.sidebar__link--active {
  color: var(--sidebar-text);
}

/* Reportes: grupo desplegable */
.sidebar__group {
  margin: 0;
}

.sidebar__details {
  border-radius: 10px;
}

.sidebar__summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sidebar-text);
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.sidebar__summary::-webkit-details-marker {
  display: none;
}

.sidebar__summary::marker {
  content: "";
}

.sidebar__summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__summary-icon {
  opacity: 0.55;
  font-size: 0.65rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__chevron {
  margin-left: auto;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  opacity: 0.55;
}

.sidebar__chevron::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15rem;
  transition: transform 0.2s ease;
}

.sidebar__details[open] .sidebar__chevron::after {
  transform: rotate(225deg);
  margin-top: 0.1rem;
}

.sidebar__sublist {
  list-style: none;
  margin: 0.4rem 0 0.15rem;
  padding: 0 0 0.35rem 0.65rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  margin-left: 1.35rem;
}

.sidebar__sublist li {
  margin: 0.15rem 0;
}

.sidebar__sublink {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--sidebar-muted);
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar__sublink:hover {
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__sublink--active {
  color: #b8f5e8 !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar__link--soon {
  color: var(--sidebar-muted);
  cursor: default;
  pointer-events: none;
}

.sidebar__badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}

.sidebar__hint {
  margin: 1rem 0 0;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--sidebar-muted);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__session-user {
  margin: 0 0 0.55rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fecaca;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar__logout:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(252, 165, 165, 0.45);
  color: #fff;
}

.sidebar__logout-icon {
  font-size: 0.95rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.85rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .sidebar__brand {
    border-bottom: none;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
  }

  .sidebar__nav {
    flex: 1 1 auto;
    padding-top: 0;
    min-width: 0;
  }

  .sidebar__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
  }

  .sidebar__group {
    flex: 1 1 100%;
    order: 3;
  }

  .sidebar__details {
    width: 100%;
  }

  .sidebar__sublist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 0.25rem;
  }

  .sidebar__sublist li {
    margin: 0;
  }

  .sidebar__sublink {
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
  }

  .sidebar__link {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
  }

  .sidebar__hint {
    display: none;
  }

  .sidebar__footer {
    margin-top: 0;
    flex: 1 1 100%;
    padding-top: 0.5rem;
    border-top: none;
  }

  .sidebar__session-user {
    display: none;
  }

  .sidebar__logout {
    width: auto;
    padding: 0.5rem 0.75rem;
  }

  .sidebar__logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0.25rem;
  }

  .header__logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
}

/* —— Header —— */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.85rem 1.45rem;
  background: linear-gradient(118deg, #047857 0%, #065f46 38%, #042f2e 100%);
  color: #f0fdf9;
  box-shadow: 0 4px 24px rgba(4, 60, 50, 0.35);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  right: -5%;
  top: -60%;
  width: min(55vw, 28rem);
  height: 220%;
  background: radial-gradient(circle at 30% 40%, rgba(94, 234, 212, 0.18), transparent 55%);
  pointer-events: none;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.header__logo-wrap {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  padding: 0.3rem;
}

.header__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.header__org {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.88;
}

.header__subtitle {
  margin: 0.28rem 0 0;
  font-size: 0.86rem;
  opacity: 0.9;
  max-width: 36rem;
}

.header__meta {
  font-size: 0.78rem;
  font-weight: 500;
  text-align: right;
  position: relative;
  z-index: 1;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.02em;
}

.header__meta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.65rem;
}

.header__terminal {
  opacity: 0.88;
  font-size: 0.74rem;
}

/* —— Main & cards —— */
.main {
  padding: 1.5rem 1.85rem 2.25rem;
  overflow: auto;
  flex: 1;
}

.panel-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.45rem 1.45rem;
  margin-bottom: 1.1rem;
  overflow: hidden;
}

.panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-line-start), var(--accent-line-mid), var(--accent-line-end));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-card--compact {
  padding-bottom: 1.2rem;
}

.panel-card__head {
  margin-bottom: 1rem;
}

.panel-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.panel-card__title--inline {
  margin-bottom: 0.85rem;
}

.panel-card__desc {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 52rem;
}

.panel-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.panel-card__grid--filters {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.panel-card__actions {
  display: flex;
  align-items: flex-end;
}

/* Evita que el botón quede en una celda estrecha u oculta detrás de otros ítems del grid. */
.panel-card__grid > .panel-card__actions {
  grid-column: 1 / -1;
}

.panel-card__actions .btn {
  min-width: 160px;
}

.panel-card__actions--row {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.field--span {
  grid-column: span 2;
}

.consulta-presets__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.consulta-presets__btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .field--span {
    grid-column: span 1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select {
  font: inherit;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface-soft) 0%, #fff 100%);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(6, 40, 35, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow:
    inset 0 1px 2px rgba(6, 40, 35, 0.04),
    0 0 0 3px rgba(13, 148, 136, 0.18);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 0.78rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn--primary {
  background: linear-gradient(180deg, #14b8a6 0%, var(--primary) 45%, #0f5c54 100%);
  color: #fff;
  box-shadow:
    0 4px 16px rgba(13, 148, 136, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 42%, #0a7c6e 100%);
  box-shadow:
    0 6px 22px rgba(13, 148, 136, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.banner {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.banner--error {
  background: linear-gradient(135deg, #fef2f2, #fff);
  color: var(--error-text);
  border-color: rgba(185, 28, 28, 0.2);
}

.banner--warn {
  background: linear-gradient(135deg, #fffbeb, #fffef5);
  color: #854d0e;
  border-color: rgba(234, 179, 8, 0.25);
}

.banner--ok {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf9);
  color: #14532d;
  border-color: rgba(16, 185, 129, 0.28);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.stat {
  position: relative;
  background: linear-gradient(165deg, #ffffff 0%, var(--surface-soft) 100%);
  padding: 1.1rem 1.15rem 1.05rem 1.3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.stat__value--sm {
  font-size: 0.98rem;
  font-weight: 600;
  word-break: break-all;
}

.stat__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.stat--in::before {
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
}

.stat--out::before {
  background: linear-gradient(180deg, #fb923c, var(--out));
}

.stat--in .stat__value {
  color: var(--in);
}

.stat--out .stat__value {
  color: var(--out);
}

.stat--time::before {
  background: linear-gradient(180deg, #94a3b8, #475569);
}

.table-section__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
  overflow: auto;
  max-height: calc(100vh - 280px);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th,
.table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f0faf8 0%, #e8f4f1 100%);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  z-index: 1;
  border-bottom: 1px solid rgba(12, 90, 80, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.th-sub {
  display: inline;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.85;
}

.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.06), rgba(13, 148, 136, 0.02));
}

.table__empty td {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.table tfoot tr.table__total td {
  background: #e8f5f1;
  border-top: 2px solid var(--brand, #0b6e62);
  font-weight: 600;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.table tbody tr.table__group td {
  background: #e0f2ef;
  color: #084d45;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid #b8ddd6;
}

.stat--he::before {
  background: #7c4dff;
}

.stat--he .stat__value {
  color: #5e35b1;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--in {
  background: rgba(11, 110, 98, 0.12);
  color: var(--in);
}

.badge--out {
  background: rgba(194, 65, 12, 0.12);
  color: var(--out);
}

.badge--access {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.badge--neutral {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Vistas de módulos (reportes) */
.module-placeholder__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.module-placeholder__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 40rem;
}

/* —— Reporte de marcaje —— */
.report-empty {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0 1.5rem;
}

.report-empty__card {
  max-width: 28rem;
  text-align: center;
  background: linear-gradient(165deg, #ffffff 0%, var(--surface-soft) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.1rem 1.85rem 2.35rem;
  position: relative;
  overflow: hidden;
}

.report-empty__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-line-start), var(--accent-line-mid), var(--accent-line-end));
}

.report-empty__icon {
  display: block;
  font-size: 1.85rem;
  opacity: 0.4;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 2px 8px rgba(13, 148, 136, 0.2));
}

.report-empty__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
}

.report-empty__text {
  margin: 0 0 1.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: left;
}

.report-empty__cta {
  max-width: 16rem;
  margin: 0 auto;
}

.report-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f0fdf9 0%, #e8f5f2 45%, #dff0ec 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.report-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-line-start), var(--accent-line-mid), var(--accent-line-end));
}

.report-hero__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.report-hero__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}

.report-hero__text {
  position: relative;
  z-index: 1;
}

.report-hero__kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  position: relative;
  z-index: 1;
}

.report-kpi {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  min-width: 5.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(6, 45, 40, 0.08);
}

.report-kpi__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.report-kpi__value--sm {
  font-size: 0.95rem;
}

.report-kpi__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.report-kpi--in .report-kpi__value {
  color: var(--in);
}

.report-kpi--out .report-kpi__value {
  color: var(--out);
}

.report-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.field--empleados-multi {
  grid-column: 1 / -1;
}

.empleados-multi {
  padding: 0;
  border: none;
  background: transparent;
}

.empleados-multi__collapse {
  border-radius: 10px;
}

.empleados-multi__collapse-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(11, 46, 40, 0.05);
  font-size: 0.86rem;
  line-height: 1.35;
}

.empleados-multi__collapse-summary::-webkit-details-marker {
  display: none;
}

.empleados-multi__collapse-summary::marker {
  content: "";
}

.empleados-multi__collapse-summary:hover {
  border-color: rgba(11, 110, 98, 0.35);
}

.empleados-multi__collapse[open] > .empleados-multi__collapse-summary {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
  box-shadow: none;
}

.empleados-multi__sum-chevron {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  background: rgba(11, 110, 98, 0.1);
  color: var(--primary);
  font-size: 0.65rem;
  flex-shrink: 0;
}

.empleados-multi__sum-chevron::before {
  content: "▶";
  display: block;
  transform: translateX(0.05rem);
  transition: transform 0.18s ease;
}

.empleados-multi__collapse[open] .empleados-multi__sum-chevron::before {
  transform: rotate(90deg) translateX(0.05rem);
}

.empleados-multi__sum-text {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}

.empleados-multi__sum-action {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: auto;
}

.empleados-multi__collapse[open] .empleados-multi__sum-action {
  display: none;
}

.empleados-multi__collapse-body {
  padding: 0.45rem 0.55rem 0.55rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: #fafcfb;
}

.empleados-multi__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.empleados-multi__search-drawer {
  flex: 1 1 8rem;
  min-width: 0;
}

.empleados-multi__search-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.25rem 0;
  user-select: none;
}

.empleados-multi__search-summary::-webkit-details-marker {
  display: none;
}

.empleados-multi__search-summary::marker {
  content: "";
}

.empleados-multi__search-summary:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empleados-multi__search-inner {
  padding: 0.3rem 0 0;
  max-width: 100%;
}

.empleados-multi__search {
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
}

.empleados-multi__quick {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.empleados-multi__hint {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.empleados-multi__list {
  max-height: min(150px, 22vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.25rem 0;
}

.empleados-multi__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid #eef3f1;
}

.empleados-multi__item:last-child {
  border-bottom: none;
}

.empleados-multi__item:hover {
  background: #f6faf9;
}

.empleados-multi__item--hidden {
  display: none;
}

.empleados-multi__item input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.empleados-multi__item span {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.report-table-block {
  margin-top: 0.25rem;
}

.report-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.report-table-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.btn--ghost {
  width: auto;
  padding: 0.58rem 1.05rem;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(6, 40, 35, 0.06);
}

.btn--ghost:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.12);
}

.table-wrap--report {
  max-height: min(55vh, 520px);
}

.report-export {
  margin-bottom: 0.25rem;
}

.report-export__toolbar {
  margin-bottom: 0.75rem;
}

.report-export__cols-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.report-export__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: center;
}

.export-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.export-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.report-export__col-actions {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.report-export__sep {
  color: var(--muted);
  opacity: 0.6;
}

.btn-link {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-link:hover {
  color: var(--primary-hover);
  background: rgba(13, 148, 136, 0.1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-export__preview-note {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.table-wrap--preview {
  max-height: 240px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table--preview th {
  position: static;
  font-size: 0.68rem;
}

.table--preview td {
  font-size: 0.82rem;
}

.report-export__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.report-export__actions .btn {
  width: auto;
  min-width: 7.5rem;
}

/* —— Dashboard —— */
.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  padding: 1.5rem 1.65rem 1.6rem;
  margin-bottom: 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(128deg, #ecfdf8 0%, #dff6f0 35%, #d0ebe4 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-line-start), var(--accent-line-mid), var(--accent-line-end));
}

.dashboard-hero__text {
  position: relative;
  z-index: 1;
  max-width: 38rem;
}

.dashboard-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
}

.dashboard-hero__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.dashboard-hero__lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-hero__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.dashboard-hero__btn {
  width: auto;
  min-width: 9.5rem;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.dashboard-empty {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 1rem;
}

.dashboard-empty__card {
  max-width: 26rem;
  text-align: center;
  padding: 2rem 1.75rem 2.2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #fff 0%, var(--surface-soft) 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dashboard-empty__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-line-start), var(--accent-line-mid), var(--accent-line-end));
}

.dashboard-empty__icon {
  display: block;
  font-size: 1.6rem;
  opacity: 0.38;
  margin-bottom: 0.75rem;
}

.dashboard-empty__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.dashboard-empty__text {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: left;
}

.dashboard-empty__cta {
  max-width: 14rem;
  margin: 0 auto;
}

.dashboard-loaded {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.dashboard-kpi {
  position: relative;
  padding: 1rem 1rem 0.95rem 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #fff 0%, var(--surface-soft) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dashboard-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

.dashboard-kpi--in::before {
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
}

.dashboard-kpi--out::before {
  background: linear-gradient(180deg, #fb923c, var(--out));
}

.dashboard-kpi--emp::before {
  background: linear-gradient(180deg, #64748b, #475569);
}

.dashboard-kpi__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.dashboard-kpi__value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.dashboard-kpi--in .dashboard-kpi__value {
  color: var(--in);
}

.dashboard-kpi--out .dashboard-kpi__value {
  color: var(--out);
}

.dashboard-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.dashboard-meta-item__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.dashboard-meta-item__value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-zero-range {
  margin: 0;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.dashboard-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.35), rgba(45, 212, 191, 0.5), rgba(13, 148, 136, 0.35));
}

.dashboard-panel__head {
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 1;
}

.dashboard-panel__title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dashboard-panel__desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 1;
}

.dashboard-bars__empty {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.25rem;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.dashboard-bar-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.dashboard-bar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  overflow: hidden;
}

.dashboard-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d9488, #2dd4bf);
  min-width: 4px;
  transition: width 0.35s ease;
}

.dashboard-bar-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.dashboard-punct__empty {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.dashboard-panel--punct .dashboard-panel__head {
  margin-bottom: 0.35rem;
}

.dashboard-punct-filter {
  margin: 0 0 0.75rem;
  position: relative;
  z-index: 1;
}

.dashboard-punct-filter select {
  width: 100%;
}

.dashboard-punct-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.25rem 0 0.15rem;
  min-height: 12rem;
}

.dashboard-punct-svg {
  width: min(100%, 11.5rem);
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.1));
}

.dashboard-punct-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0;
  padding: 0;
}

.dashboard-punct-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dashboard-punct-legend__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-punct-legend__label strong {
  font-weight: 700;
  margin-left: 0.15rem;
}

.dashboard-punct-legend__swatch {
  display: block;
  width: 2.75rem;
  height: 0.45rem;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.dashboard-punct-legend__swatch--p {
  background: linear-gradient(90deg, #60a5fa, #1d4ed8);
}

.dashboard-punct-legend__swatch--t {
  background: linear-gradient(90deg, #f87171, #b91c1c);
}

.dashboard-door-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.dashboard-door-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.dashboard-door-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-door-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary);
}

.dashboard-door-list__empty {
  font-size: 0.84rem;
  color: var(--muted);
  padding: 0.35rem 0;
}

@media (max-width: 520px) {
  .dashboard-bar-row {
    grid-template-columns: 4.5rem 1fr 2rem;
  }
}

/* —— Personal (CRUD empleados) —— */
.personal-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.personal-top {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e4eeeb;
}

.personal-top__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.personal-top__title {
  margin: 0;
}

.personal-top__badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: #0b6e62;
  background: rgba(11, 110, 98, 0.1);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  line-height: 1.3;
}

.personal-top__new {
  margin-left: auto;
  min-width: 9.5rem;
}

.personal-top__search-row {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.personal-search {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
}

.personal-search__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.personal-search input {
  width: 100%;
}

.personal-top__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(180deg, #f8fcfb 0%, #f2f8f6 100%);
  border: 1px solid #dce9e5;
  border-radius: 10px;
}

.btn--compact {
  padding: 0.42rem 0.8rem;
  font-size: 0.8rem;
  min-width: 0;
  white-space: nowrap;
}

.personal-top__tools .btn--compact {
  background: #fff;
}

.personal-top__tools .btn--compact:hover {
  background: #f0faf8;
}

.table--personal thead th.personal-th-sort {
  cursor: pointer;
  user-select: none;
  color: #3d6b63;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.table--personal thead th.personal-th-sort:hover {
  color: var(--primary);
  background: linear-gradient(180deg, #e8f7f3 0%, #dff1ec 100%);
}

.table--personal thead th.personal-th-sort:focus-visible {
  outline: 2px solid rgba(10, 124, 110, 0.45);
  outline-offset: -2px;
}

.table--personal thead th.personal-th-sort--active {
  color: var(--primary);
  background: linear-gradient(180deg, #dff3ee 0%, #d2ebe5 100%);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.table--personal thead th.personal-th-sort--actions {
  cursor: default;
}

.personal-th-sort__caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.35rem;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.personal-th-sort--active .personal-th-sort__caret {
  opacity: 1;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
  transform: translateY(-1px);
}

.personal-th-sort--active.personal-th-sort--desc .personal-th-sort__caret {
  border-bottom: none;
  border-top: 5px solid currentColor;
  transform: translateY(1px);
}

.personal-table-wrap {
  max-height: none;
  border-radius: 10px;
  border: 1px solid #e4eeeb;
}

@media (max-width: 640px) {
  .personal-top__new {
    width: 100%;
    margin-left: 0;
  }

  .personal-top__search-row .btn--compact {
    width: 100%;
  }

  .personal-top__tools .btn--compact {
    flex: 1 1 calc(50% - 0.45rem);
    justify-content: center;
  }
}

.personal-table__actions {
  white-space: nowrap;
}

.personal-table__del {
  color: #b91c1c;
}

.personal-table__del:hover {
  color: #991b1b;
}

.personal-dialog {
  width: min(100% - 2rem, 26rem);
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(6, 35, 30, 0.35);
  background: var(--surface);
}

.personal-dialog::backdrop {
  background: rgba(6, 30, 26, 0.45);
  backdrop-filter: blur(3px);
}

.personal-dialog__form {
  padding: 1.35rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.personal-dialog__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.personal-dialog .field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.personal-dialog .field--checkbox input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.personal-dialog .field--checkbox > span {
  font-weight: 500;
  color: var(--text);
}

.personal-dialog__hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

.personal-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.personal-dialog__actions .btn {
  width: auto;
  min-width: 6.5rem;
}

/* —— Horas extra —— */
.he-festivos__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.he-festivos__fecha {
  min-width: 10rem;
}

.he-festivos__nota {
  flex: 1 1 12rem;
  min-width: 8rem;
}

.he-festivos__btn .btn {
  width: auto;
  min-width: 9rem;
}

.he-festivos__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.he-festivos__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.he-festivos__empty {
  font-size: 0.86rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

/* —— Login —— */
.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(145deg, #042f2e 0%, #065f46 45%, #047857 100%);
}

body.login-page {
  margin: 0;
  min-height: 100vh;
}

body.auth-pending .app {
  visibility: hidden;
}

.login-card__lead {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.login-card {
  width: min(100%, 22rem);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.login-card__logo {
  display: block;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.login-card__org {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.login-card__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.login-card__form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-card__error {
  margin: 0;
  font-size: 0.82rem;
  color: #b91c1c;
}

.login-card__submit {
  margin-top: 0.25rem;
  width: 100%;
}

.header__user {
  margin-right: 0.5rem;
  opacity: 0.92;
}

.header__meta .btn-link {
  color: #ccfbf1;
  font-size: 0.78rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-perms {
  margin: 0;
  padding: 0.75rem 0 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-perms legend {
  padding: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.table--admin th,
.table--admin td {
  font-size: 0.82rem;
}

.admin-perm-yes {
  color: #047857;
  font-weight: 700;
}

.admin-perm-no {
  color: var(--muted);
}

.admin-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-badge--ok {
  background: rgba(4, 120, 87, 0.12);
  color: #047857;
}

.admin-badge--off {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

