/**
 * Tema TH Fundación — azul, verde, naranja y blanco
 */
:root {
  --th-blue-950: #0c1929;
  --th-blue-900: #0c4a6e;
  --th-blue-800: #075985;
  --th-blue-700: #0369a1;
  --th-blue-600: #0284c7;
  --th-blue-500: #0ea5e9;
  --th-blue-100: #e0f2fe;
  --th-blue-50: #f0f9ff;

  --th-green-700: #047857;
  --th-green-600: #059669;
  --th-green-500: #10b981;
  --th-green-400: #34d399;
  --th-green-100: #d1fae5;

  --th-orange-700: #c2410c;
  --th-orange-600: #ea580c;
  --th-orange-500: #f97316;
  --th-orange-400: #fb923c;
  --th-orange-100: #ffedd5;

  --th-white: #ffffff;
  --th-surface: #f8fafc;
  --th-surface-2: #f1f5f9;
  --th-text: #0f172a;
  --th-text-muted: #64748b;
  --th-border: rgba(14, 165, 233, 0.15);

  --th-sidebar-bg: linear-gradient(165deg, #0c4a6e 0%, #0e7490 48%, #0f766e 100%);
  --th-sidebar-hover: rgba(255, 255, 255, 0.12);
  --th-sidebar-accent: var(--th-orange-500);

  --th-radius: 12px;
  --th-radius-sm: 8px;
  --th-shadow: 0 4px 24px rgba(12, 74, 110, 0.08);
  --th-shadow-lg: 0 12px 40px rgba(12, 74, 110, 0.12);
}

/* ——— Shell (páginas con sidebar) ——— */
.app-shell {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--th-text);
  min-height: 100vh;
  display: flex;
  background: linear-gradient(180deg, var(--th-blue-50) 0%, var(--th-surface) 35%, var(--th-white) 100%);
}

.app-shell * {
  box-sizing: border-box;
}

.app-shell main {
  margin-left: 220px;
  padding: 2rem 2.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: calc(100% - 220px);
  min-width: 0; /* evita desbordes horizontales en flex */
}

.app-topbar {
  width: 100%;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  border: 1px solid var(--th-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: relative;
}

.app-topbar::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--th-blue-600), var(--th-green-500), var(--th-orange-500));
  opacity: 0.85;
}

.app-topbar h1,
.app-topbar h5 {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--th-blue-900);
  margin: 0;
  letter-spacing: -0.02em;
}

.app-shell .user-btn {
  background: var(--th-blue-50);
  border: 1px solid var(--th-border);
  color: var(--th-blue-900);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--th-radius-sm);
  transition: background 0.2s, box-shadow 0.2s;
}

.app-shell .user-btn:hover {
  background: var(--th-blue-100);
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.12);
}

.app-shell .dropdown-content {
  background: var(--th-white);
  border: 1px solid var(--th-border);
  box-shadow: var(--th-shadow-lg);
  border-radius: var(--th-radius-sm);
  overflow: hidden;
}

.app-shell .dropdown-content a {
  color: var(--th-blue-900);
}

.app-shell .dropdown-content a:hover {
  background: var(--th-blue-50);
}

/* ——— Menú usuario (topbar) ——— */
.app-topbar .user-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.app-topbar .dropdown-content.user-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 240px;
  max-width: min(320px, 92vw);
  z-index: 1100;
  padding: 0;
  background: var(--th-white);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  box-shadow: var(--th-shadow-lg);
  overflow: hidden;
  animation: user-menu-in 0.18s ease-out;
}

@keyframes user-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-topbar .dropdown-content.user-menu-panel.show {
  display: block;
}

.user-menu-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--th-white);
  background: linear-gradient(135deg, var(--th-blue-700), var(--th-green-600));
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.25);
}

.user-menu-greeting {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-muted);
  line-height: 1.2;
}

.user-menu-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--th-blue-900);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.user-menu-caret {
  font-size: 0.75rem;
  color: var(--th-text-muted);
  transition: transform 0.2s ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-caret {
  transform: rotate(180deg);
}

.user-menu-panel-header {
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, var(--th-blue-50) 0%, var(--th-white) 100%);
  border-bottom: 1px solid var(--th-border);
}

.user-menu-panel-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--th-blue-900);
  line-height: 1.3;
}

.user-menu-panel-role {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--th-blue-700);
  background: rgba(14, 165, 233, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.user-menu-panel-actions {
  padding: 0.35rem 0;
}

.app-topbar .user-menu-panel-actions a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  color: var(--th-blue-900);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  border-radius: 0;
}

.app-topbar .user-menu-panel-actions a i {
  width: 1.15rem;
  text-align: center;
  color: var(--th-blue-600);
  opacity: 0.9;
}

.app-topbar .user-menu-panel-actions a:hover {
  background: var(--th-blue-50);
  color: var(--th-blue-800);
}

.app-topbar .user-menu-panel-actions a.user-menu-logout {
  border-top: 1px solid var(--th-border);
  margin-top: 0.25rem;
  color: var(--th-orange-700);
  font-weight: 600;
}

.app-topbar .user-menu-panel-actions a.user-menu-logout i {
  color: var(--th-orange-600);
}

.app-topbar .user-menu-panel-actions a.user-menu-logout:hover {
  background: var(--th-orange-100);
  color: var(--th-orange-700);
}

/* ——— Sidebar ——— */
.app-shell nav.app-nav {
  background: var(--th-sidebar-bg);
  color: var(--th-white);
  width: 220px;
  min-height: 100vh;
  padding: 0.75rem 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 32px rgba(12, 74, 110, 0.25);
}

.app-shell nav.app-nav a.nav-brand {
  border-left: none !important;
  padding: 0.25rem 0.4rem !important;
  margin: 0 auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.app-shell nav.app-nav a.nav-brand:hover {
  background: transparent !important;
  border-left-color: transparent !important;
}

.app-shell nav.app-nav .nav-brand img {
  width: auto;
  height: auto;
  max-width: min(188px, calc(100% - 0.5rem));
  max-height: 52px;
  margin: 0.35rem auto;
  display: block;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.app-shell nav.app-nav .app-nav__top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.app-shell nav.app-nav .menu-links {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.15rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.app-shell nav.app-nav hr.app-nav__divider {
  width: 100%;
  margin: 0;
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.app-shell nav.app-nav hr:not(.app-nav__divider) {
  width: 82%;
  margin: 0.5rem auto 0.75rem;
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.app-shell nav.app-nav .menu-section-label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  margin: 0.65rem 0 0.3rem 0.75rem;
}

.app-shell nav.app-nav .menu-section-label i {
  width: 0.85rem;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.65);
}

.app-shell nav.app-nav .menu-section-label span {
  min-width: 0;
}

.app-shell nav.app-nav a:not(.submenu-toggle) {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  padding: 0.55rem 0.65rem;
  width: calc(100% - 1rem);
  margin: 0.18rem auto;
  border-radius: var(--th-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  transition: background 0.2s, transform 0.15s;
  border-left: 3px solid transparent;
}

.app-shell nav.app-nav a:not(.submenu-toggle):hover {
  background: var(--th-sidebar-hover);
  border-left-color: var(--th-orange-400);
}

.app-shell nav.app-nav .submenu {
  width: calc(100% - 1rem);
  margin: 0 auto;
}

.app-shell nav.app-nav .submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  color: var(--th-white);
  text-decoration: none;
  border-radius: var(--th-radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}

.app-shell nav.app-nav .submenu-toggle__text {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
  line-height: 1.25;
}

.app-shell nav.app-nav .submenu-toggle__text > i {
  width: 1rem;
  flex-shrink: 0;
  text-align: center;
  opacity: 0.92;
}

.app-shell nav.app-nav .submenu-toggle__caret {
  flex-shrink: 0;
  font-size: 0.72rem;
  opacity: 0.8;
  margin-left: 0.15rem;
}

.app-shell nav.app-nav .submenu-toggle:hover {
  background: var(--th-sidebar-hover);
  border-left-color: var(--th-green-400);
}

.app-shell nav.app-nav .submenu-items {
  display: none;
  flex-direction: column;
  padding: 0.35rem 0 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--th-radius-sm);
  margin-top: 0.25rem;
}

.app-shell nav.app-nav .submenu-items a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.app-shell nav.app-nav .submenu-items a > i {
  width: 1rem;
  flex-shrink: 0;
  text-align: center;
  opacity: 0.9;
  font-size: 0.85em;
}

.app-shell nav.app-nav .submenu-items a:hover {
  color: var(--th-white);
  padding-left: 0.55rem;
  background: rgba(255, 255, 255, 0.08);
}

.app-shell .toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.22);
  color: var(--th-white);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  width: 100%;
  text-align: center;
  border-radius: var(--th-radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.app-shell .toggle-btn:hover {
  background: rgba(0, 0, 0, 0.32);
}

.app-shell .toggle-btn:focus-visible {
  outline: 2px solid var(--th-orange-400);
  outline-offset: 2px;
}

.app-shell .toggle-btn__icon {
  font-size: 1.15rem;
}

/* Backdrop móvil (insertado por JS al abrir menú) */
.app-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.48);
}

.app-nav-backdrop.is-visible {
  display: block;
  animation: th-backdrop-in 0.22s ease;
}

@keyframes th-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
  }

  .app-shell main {
    margin-left: 0;
    max-width: 100%;
    padding: 0.85rem 0.75rem;
    min-width: 0;
  }

  .app-shell nav.app-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: auto;
    box-shadow: 0 2px 16px rgba(12, 74, 110, 0.22);
    padding: 0;
    z-index: 1050;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .app-shell nav.app-nav .app-nav__top {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.6rem;
    width: 100%;
  }

  .app-shell .toggle-btn {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
  }

  .app-shell nav.app-nav .app-nav__top .nav-brand {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.15rem 0.35rem !important;
    min-width: 0;
  }

  .app-shell nav.app-nav .app-nav__top .nav-brand img {
    width: auto !important;
    max-width: min(220px, 48vw);
    max-height: 44px;
    margin: 0 auto !important;
  }

  .app-shell nav.app-nav hr.app-nav__divider {
    display: none;
  }

  .app-shell .menu-links {
    display: none;
    flex-direction: column;
    width: 100%;
    max-height: min(75vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem 0 0.85rem;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 12%);
  }

  .app-shell .menu-links.show {
    display: flex;
  }

  .app-topbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.75rem 0.85rem 1rem;
    margin-bottom: 1rem;
    gap: 0.65rem;
  }

  .app-topbar h1,
  .app-topbar h5 {
    font-size: 1.08rem;
    word-break: break-word;
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0.35rem;
  }

  .app-topbar .user-dropdown {
    width: auto;
    flex: 0 0 auto;
    align-self: flex-start;
  }

  .app-shell .user-btn {
    width: auto;
    min-height: 44px;
    justify-content: center;
    padding: 0.45rem 0.75rem;
  }

  .app-topbar .dropdown-content.user-menu-panel {
    left: auto;
    right: 0;
    min-width: 240px;
    max-width: min(320px, calc(100vw - 1.5rem));
    width: auto;
  }

  .th-stat-grid {
    margin-top: 0.75rem;
    gap: 0.65rem;
  }

  .th-stat-card {
    min-width: 0;
    flex: 1 1 100%;
    max-width: none;
    padding: 1rem 1.15rem;
  }

  .th-stat-grid--single .th-stat-card {
    max-width: none;
  }

  .th-dashboard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .th-dashboard-action {
    justify-content: center;
  }

  .th-pending-card__head {
    flex-wrap: wrap;
    padding: 0.75rem 0.85rem;
  }

  .th-pending-card__badge {
    order: 3;
    margin-left: auto;
  }

  .th-pending-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .th-pending-card__footer .th-pending-btn,
  .th-pending-card__footer .th-pending-card__form {
    width: 100%;
    justify-content: center;
  }

  .th-chart-panel {
    padding: 0.85rem;
  }

  .contenedor-tabla {
    padding: 0.75rem 0.5rem;
    border-radius: var(--th-radius-sm);
  }

  /* Títulos de página dentro del área principal */
  .app-shell main h1,
  .app-shell main .h1 {
    font-size: clamp(1.15rem, 4vw, 1.45rem);
  }

  .app-shell main h2,
  .app-shell main .h2,
  .app-shell main h3,
  .app-shell main .h3 {
    font-size: clamp(1.02rem, 3.5vw, 1.22rem);
    line-height: 1.3;
  }

  .app-shell main h4,
  .app-shell main .h4 {
    font-size: 1rem;
  }

  .app-shell main .th-section-title {
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    line-height: 1.3;
  }

  .app-shell .container,
  .app-shell .container-fluid {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .app-shell .container-fluid.px-0.inventario-page {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px)) !important;
  }

  .app-shell .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--th-radius-sm);
    border: 1px solid var(--th-border);
    background: var(--th-white);
  }

  .app-shell .table-responsive::-webkit-scrollbar {
    height: 6px;
  }

  .app-shell .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(12, 74, 110, 0.28);
    border-radius: 6px;
  }

  .app-shell .table thead th {
    font-size: 0.78rem;
    padding: 0.45rem 0.5rem;
    white-space: nowrap;
  }

  .app-shell .table tbody td {
    font-size: 0.8125rem;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
  }

  .app-shell .table.table-sm thead th {
    font-size: 0.72rem;
    padding: 0.4rem 0.45rem;
  }

  .app-shell .table.table-sm tbody td {
    font-size: 0.75rem;
    padding: 0.35rem 0.45rem;
  }

  .app-shell .table td .d-flex {
    flex-wrap: wrap;
    gap: 0.35rem !important;
  }

  .app-shell .btn:not(.user-btn):not(.toggle-btn),
  .app-shell .btn-aprobar,
  .app-shell .btn-rechazar,
  .app-shell .btn-detalles {
    min-height: 42px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
  }

  .app-shell .btn-sm {
    min-height: 38px;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
  }

  .app-shell .btn-group {
    flex-wrap: wrap;
  }

  .app-shell .modal-dialog {
    margin: 0.5rem auto;
    max-width: min(100vw - 1rem, 1140px);
  }

  .app-shell .modal-fullscreen-sm-down .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell ul.nav-tabs#datosTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 0.2rem;
    scrollbar-width: thin;
  }

  .app-shell ul.nav-tabs#datosTabs .nav-item {
    flex-shrink: 0;
  }

  .app-shell ul.nav-tabs#datosTabs .nav-link {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 576px) {
  .app-shell main {
    padding: 0.65rem 0.5rem;
  }

  .app-topbar h1,
  .app-topbar h5 {
    font-size: 1rem;
  }

  .app-shell .card-body,
  .app-shell .card-header {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .app-shell .table tbody .btn,
  .app-shell .table tbody .btn-sm,
  .app-shell .table tbody .btn-aprobar,
  .app-shell .table tbody .btn-rechazar,
  .app-shell .table tbody .btn-detalles {
    width: 100%;
    max-width: 320px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 0 !important;
    margin-bottom: 0.35rem;
  }

  .app-shell .pagination {
    gap: 0.25rem;
  }

  .app-shell .pagination .page-link {
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .app-shell .toggle-btn__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .app-shell .toggle-btn {
    position: relative;
  }
}
.app-shell .btn-primary {
  background: linear-gradient(180deg, var(--th-blue-600), var(--th-blue-700));
  border: none;
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.35);
}

.app-shell .btn-primary:hover {
  background: linear-gradient(180deg, var(--th-blue-500), var(--th-blue-600));
}

.app-shell .btn-success {
  background: linear-gradient(180deg, var(--th-green-500), var(--th-green-600));
  border: none;
}

.app-shell .btn-outline-primary {
  color: var(--th-blue-700);
  border-color: var(--th-blue-500);
}

.app-shell .btn-outline-primary:hover {
  background: var(--th-blue-50);
  color: var(--th-blue-900);
}

.app-shell .table-primary {
  --bs-table-bg: var(--th-blue-100);
  --bs-table-color: var(--th-blue-950);
}

/* ——— Tablas unificadas (todas las .table del shell) ——— */
.app-shell .table {
  --bs-table-bg: var(--th-white);
  --bs-table-striped-bg: rgba(12, 74, 110, 0.065);
  --bs-table-active-bg: rgba(224, 242, 254, 0.9);
  --bs-table-hover-bg: rgba(224, 242, 254, 0.5);
  --bs-table-border-color: #e2e8f0;
  color: var(--th-text);
  margin-bottom: 0;
  vertical-align: middle;
}

.app-shell .table > :not(caption) > * > * {
  border-color: var(--bs-table-border-color);
}

.app-shell .table > thead > tr > th,
.app-shell .table thead th {
  background: linear-gradient(180deg, var(--th-blue-800) 0%, var(--th-blue-900) 100%) !important;
  color: var(--th-white) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 0.85rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.app-shell .table.table-sm > thead > tr > th,
.app-shell .table.table-sm thead th {
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
}

.app-shell .table > tbody > tr > td {
  padding: 0.55rem 0.85rem;
}

.app-shell .table.table-sm > tbody > tr > td {
  padding: 0.45rem 0.65rem;
}

/* Encabezados de fila en tbody (formularios tipo inventario): no usar gradiente de cabecera */
.app-shell .table > tbody > tr > th {
  background: linear-gradient(180deg, var(--th-surface-2) 0%, #e8eef4 100%) !important;
  color: var(--th-blue-900) !important;
  border-color: var(--bs-table-border-color) !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 0.85rem;
  vertical-align: middle;
}

.app-shell .table.table-sm > tbody > tr > th {
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
}

.app-shell .table caption {
  caption-side: top;
  padding: 0.35rem 0.25rem 0.65rem;
  font-weight: 600;
  color: var(--th-blue-900);
  font-size: 0.9rem;
}

.app-shell .modal .table > thead > tr > th,
.app-shell .modal .table thead th {
  background: linear-gradient(180deg, var(--th-blue-800) 0%, var(--th-blue-900) 100%) !important;
  color: var(--th-white) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

/* Clase legada usada en solicitudes/inventario: sin reglas duplicadas */
.app-shell .table.tabla-solicitudes {
  width: 100%;
}

/* ——— Tablas solicitudes / inventario (contenedor tarjeta) ——— */
.contenedor-tabla {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--th-white);
  border-radius: var(--th-radius);
  padding: 1.25rem;
  box-shadow: var(--th-shadow);
  border: 1px solid var(--th-border);
}

/* Tablas muy anchas (p. ej. inventario): usar todo el ancho del main */
.contenedor-tabla.contenedor-tabla-wide {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  padding: 0.5rem 0.35rem;
  border-radius: var(--th-radius-sm);
}

.btn-aprobar {
  background: linear-gradient(180deg, var(--th-green-500), var(--th-green-600));
  color: var(--th-white);
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--th-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.35rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-aprobar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.45);
}

.btn-rechazar {
  background: var(--th-white);
  color: var(--th-orange-700);
  border: 2px solid var(--th-orange-500);
  padding: 0.35rem 0.85rem;
  border-radius: var(--th-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.35rem;
  transition: background 0.2s, color 0.2s;
}

.btn-rechazar:hover {
  background: var(--th-orange-100);
  color: var(--th-orange-700);
}

.btn-detalles {
  display: inline-block;
  background: linear-gradient(180deg, var(--th-blue-500), var(--th-blue-600));
  color: var(--th-white) !important;
  padding: 0.4rem 0.85rem;
  border-radius: var(--th-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}

.btn-detalles:hover {
  color: var(--th-white) !important;
  filter: brightness(1.05);
}

/* ——— Dashboard cards ——— */
.th-stat-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.th-stat-card {
  background: var(--th-white);
  padding: 1.35rem 1.75rem;
  border-radius: var(--th-radius);
  text-align: center;
  box-shadow: var(--th-shadow);
  border: 1px solid var(--th-border);
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 280px;
  transition: transform 0.2s ease, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.th-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--th-radius) var(--th-radius) 0 0;
}

.th-stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, var(--th-blue-600), var(--th-blue-500));
}

.th-stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--th-orange-500), var(--th-orange-400));
}

.th-stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--th-green-600), var(--th-green-400));
}

.th-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--th-shadow-lg);
}

.th-stat-card p {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--th-text-muted);
}

.th-stat-card strong {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.th-stat-card:nth-child(1) strong {
  color: var(--th-blue-700);
}

.th-stat-card:nth-child(2) strong {
  color: var(--th-orange-600);
}

.th-stat-card:nth-child(3) strong {
  color: var(--th-green-600);
}

.th-dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0.5rem 3.5rem;
}

.th-dashboard-welcome {
  text-align: center;
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--th-text-muted);
}

.th-dashboard-welcome strong {
  color: var(--th-blue-900);
}

.th-stat-grid--single {
  justify-content: center;
  margin-top: 1rem;
}

.th-stat-grid--single .th-stat-card {
  flex: 0 1 auto;
  min-width: 260px;
  max-width: 360px;
  width: 100%;
  padding: 1.75rem 2rem;
}

.th-stat-card--disponibles::before {
  background: linear-gradient(90deg, var(--th-green-600), var(--th-green-400));
}

.th-stat-card--disponibles .th-stat-card__icon {
  font-size: 1.75rem;
  color: var(--th-green-600);
  margin-bottom: 0.35rem;
}

.th-stat-card--disponibles .th-stat-card__label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--th-text-muted);
}

.th-stat-card--disponibles .th-stat-card__value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--th-green-600);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.th-stat-card--disponibles .th-stat-card__hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--th-text-muted);
}

.th-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.th-dashboard-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--th-radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--th-blue-800);
  background: var(--th-white);
  border: 1px solid var(--th-border);
  box-shadow: var(--th-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.th-dashboard-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--th-shadow-lg);
  color: var(--th-blue-900);
  background: var(--th-blue-50, #f0f9ff);
}

.th-dashboard-action--primary {
  background: linear-gradient(135deg, var(--th-blue-600), var(--th-blue-500));
  color: var(--th-white);
  border-color: transparent;
}

.th-dashboard-action--primary:hover {
  color: var(--th-white);
  background: linear-gradient(135deg, var(--th-blue-700), var(--th-blue-600));
  filter: brightness(1.05);
}

.th-dashboard-action--stats {
  cursor: pointer;
  font-family: inherit;
  color: var(--th-blue-800);
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border-color: rgba(99, 102, 241, 0.25);
}

.th-dashboard-action--stats:hover {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4338ca;
}

.th-dashboard-alert {
  max-width: 720px;
  margin: 1rem auto 0;
  text-align: center;
}

.th-dashboard-pending {
  max-width: 960px;
  margin: 2rem auto 0;
  padding: 1.35rem 1.15rem 1.5rem;
  background: linear-gradient(180deg, #fafbfd 0%, var(--th-white) 100%);
  border-radius: calc(var(--th-radius) + 2px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}

.th-dashboard-pending:last-of-type {
  margin-bottom: 1rem;
}

.th-dashboard-pending__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--th-blue-900);
}

.th-dashboard-pending__title i {
  color: var(--th-blue-500);
  opacity: 0.85;
}

.th-dashboard-pending__subtitle {
  text-align: center;
  margin: 0 0 1.15rem;
  font-size: 0.86rem;
  color: var(--th-text-muted);
  line-height: 1.45;
}

/* ——— Pendientes: tarjetas interactivas ——— */
.th-pending-list__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0 0.15rem;
}

.th-pending-list__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--th-text-muted);
  background: rgba(148, 163, 184, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.th-pending-list__toggle-all {
  border: none;
  background: transparent;
  color: var(--th-blue-600);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: var(--th-radius-sm);
  transition: color 0.15s, background 0.15s;
}

.th-pending-list__toggle-all:hover {
  color: var(--th-blue-800);
  background: rgba(59, 130, 246, 0.08);
}

.th-pending-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.th-pending-card {
  background: var(--th-white);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--th-radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.th-pending-card:hover {
  border-color: rgba(59, 130, 246, 0.25);
}

.th-pending-card.is-open {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.th-pending-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.th-pending-card__head:hover {
  background: rgba(241, 245, 249, 0.8);
}

.th-pending-card__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--th-blue-100, #dbeafe), var(--th-blue-50, #eff6ff));
  color: var(--th-blue-700);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-pending-card__summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.th-pending-card__name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--th-blue-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-pending-card__range {
  font-size: 0.8rem;
  color: var(--th-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.th-pending-card__days {
  color: var(--th-blue-600);
  font-weight: 600;
}

.th-pending-card__badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.th-pending-card__chevron {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--th-text-muted);
  transition: transform 0.25s ease;
}

.th-pending-card.is-open .th-pending-card__chevron {
  transform: rotate(180deg);
}

.th-pending-card__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  animation: thPendingFadeIn 0.25s ease;
}

.th-pending-card__body[hidden] {
  display: none;
}

@keyframes thPendingFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.th-pending-card__meta {
  margin: 0.85rem 0 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.th-pending-card__meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-text-muted);
  margin-bottom: 0.15rem;
}

.th-pending-card__meta dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--th-blue-900);
}

.th-pending-card__detalle {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-pending-card__detalle li {
  font-size: 0.84rem;
  padding: 0.35rem 0.55rem;
  background: rgba(241, 245, 249, 0.7);
  border-radius: var(--th-radius-sm);
}

.th-pending-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.th-pending-card__form {
  display: inline;
  margin: 0;
}

.th-pending-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--th-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.th-pending-btn--ghost {
  color: var(--th-blue-700);
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
}

.th-pending-btn--ghost:hover {
  background: var(--th-blue-50, #eff6ff);
  color: var(--th-blue-800);
}

.th-pending-btn--ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.th-pending-btn--ok:hover {
  background: #d1fae5;
}

.th-pending-btn--no {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.th-pending-btn--no:hover {
  background: #ffedd5;
}

.th-chart-panel {
  background: var(--th-white);
  border-radius: var(--th-radius);
  padding: 1rem;
  box-shadow: var(--th-shadow);
  border: 1px solid var(--th-border);
}

.th-section-title {
  text-align: center;
  color: var(--th-blue-900);
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ——— Tarjetas métricas (solicitar vacaciones) ——— */
.th-card-metric .card {
  border-radius: var(--th-radius);
  overflow: hidden;
  box-shadow: var(--th-shadow);
  border: 1px solid var(--th-border) !important;
}

.th-card-metric .card-header {
  font-weight: 600;
  font-size: 0.9rem;
  border: none !important;
  padding: 0.65rem 1rem;
}

.th-card-metric .card-body {
  background: var(--th-white);
  padding: 1rem;
}

.th-card-metric .card-title {
  font-size: 1.5rem !important;
  font-weight: 800;
  margin: 0;
}

.th-card-metric--disp .card-header {
  background: linear-gradient(180deg, var(--th-green-600), var(--th-green-700)) !important;
  color: var(--th-white) !important;
}

.th-card-metric--disp .card-title {
  color: var(--th-green-700);
}

.th-card-metric--sol .card-header {
  background: linear-gradient(180deg, var(--th-orange-500), var(--th-orange-600)) !important;
  color: var(--th-white) !important;
}

.th-card-metric--sol .card-title {
  color: var(--th-orange-700);
}

.th-card-metric--rest .card-header {
  background: linear-gradient(180deg, var(--th-blue-600), var(--th-blue-800)) !important;
  color: var(--th-white) !important;
}

.th-card-metric--rest .card-title {
  color: var(--th-blue-700);
}

/* Métricas superiores más compactas (solo esta página) */
.vac-solicitud .th-card-metric .card-header {
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
}
.vac-solicitud .th-card-metric .card-body {
  padding: 0.4rem 0.55rem;
}
.vac-solicitud .th-card-metric .card-title {
  font-size: 1.12rem !important;
}

/* ——— Solicitar vacaciones: calendario, panel y jornadas ——— */
.vac-solicitud .vac-solicitud-body {
  margin-top: 0.1rem;
}

.vac-cal-card {
  background: var(--th-white);
  border-radius: var(--th-radius);
  border: 1px solid var(--th-border);
  box-shadow: var(--th-shadow);
  padding: 0.75rem 0.85rem 0.85rem;
  height: 100%;
}

.vac-cal-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.vac-cal-card__head .bi {
  font-size: 1.15rem;
  color: var(--th-blue-600);
  margin-top: 0.05rem;
}

.vac-cal-card__title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--th-blue-900);
  line-height: 1.2;
}

.vac-cal-card__subtitle {
  display: block;
  font-size: 0.72rem;
  color: var(--th-text-muted);
  font-weight: 500;
  margin-top: 0.08rem;
}

.vac-cal-card__hint {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.vac-cal-card__hint--rules {
  padding: 0.45rem 0.55rem;
  background: rgba(var(--th-primary-rgb, 13, 110, 253), 0.06);
  border-radius: 0.35rem;
}

.vac-cal-card__hint--rules .bi {
  margin-right: 0.25rem;
}

.vac-cal-host .flatpickr-calendar {
  width: 100% !important;
  max-width: 100%;
  box-shadow: none !important;
  border-radius: var(--th-radius-sm);
  border: 1px solid var(--th-border);
  background: linear-gradient(180deg, var(--th-blue-50) 0%, var(--th-white) 48%);
  font-family: inherit;
}

.vac-cal-host .flatpickr-months {
  padding: 0.3rem 0.25rem 0.15rem;
  border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0;
}

.vac-cal-host .flatpickr-current-month .flatpickr-monthDropdown-months,
.vac-cal-host .flatpickr-current-month input.cur-year {
  font-weight: 700;
  color: var(--th-blue-900);
}

.vac-cal-host .flatpickr-weekdays {
  background: rgba(12, 74, 110, 0.06);
  padding: 0.2rem 0;
}

.vac-cal-host span.flatpickr-weekday {
  color: var(--th-blue-800);
  font-weight: 600;
  font-size: 0.62rem;
}

.vac-cal-host .flatpickr-day {
  border-radius: 6px;
  margin: 1px;
  line-height: 30px;
  max-width: 30px;
  height: 30px;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--th-text);
}

.vac-cal-host .flatpickr-day.today {
  border-color: var(--th-orange-500);
  color: var(--th-orange-700);
  font-weight: 700;
}

.vac-cal-host .flatpickr-day.flatpickr-disabled,
.vac-cal-host .flatpickr-day.prevMonthDay,
.vac-cal-host .flatpickr-day.nextMonthDay {
  opacity: 0.45;
}

.vac-panel {
  background: var(--th-white);
  border-radius: var(--th-radius);
  border: 1px solid var(--th-border);
  box-shadow: var(--th-shadow);
  overflow: hidden;
  height: 100%;
}

.vac-panel__head {
  padding: 0.65rem 0.85rem;
  background: linear-gradient(180deg, var(--th-blue-50) 0%, var(--th-white) 65%);
  border-bottom: 1px solid var(--th-border);
}

.vac-panel__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--th-blue-900);
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
}

.vac-panel__title .bi {
  color: var(--th-blue-600);
  margin-right: 0.3rem;
  font-size: 0.95em;
}

.vac-panel__subtitle {
  margin: 0;
  font-size: 0.76rem;
  color: var(--th-text-muted);
  line-height: 1.35;
}

.vac-panel__body {
  padding: 0.65rem 0.85rem 0.75rem;
}

.vac-panel__actions {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--th-border);
}

.vac-selecciones {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.vac-empty {
  text-align: center;
  padding: 1.15rem 0.65rem;
  border: 2px dashed var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface);
  color: var(--th-text-muted);
}

.vac-empty .bi {
  font-size: 1.55rem;
  color: var(--th-blue-400);
  display: block;
  margin-bottom: 0.45rem;
}

.vac-empty__title {
  font-weight: 700;
  color: var(--th-blue-900);
  margin: 0 0 0.2rem;
  font-size: 0.86rem;
}

.vac-empty__text {
  margin: 0;
  font-size: 0.76rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.vac-fecha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: var(--th-white);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  box-shadow: 0 1px 6px rgba(12, 74, 110, 0.05);
}

.vac-fecha-row--implicit {
  background: rgba(var(--th-primary-rgb, 13, 110, 253), 0.04);
  border-style: dashed;
}

.vac-fecha-row__implicit-note {
  flex: 1 1 100%;
  font-size: 0.75rem;
  color: var(--th-text-muted);
  padding-left: 2.45rem;
}

.vac-fecha-row__implicit-note .bi {
  margin-right: 0.2rem;
}

.vac-fecha-row__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: min(100%, 200px);
  flex: 1 1 180px;
}

.vac-fecha-row__badge {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--th-blue-600), #0d9488);
  color: var(--th-white);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(3, 105, 161, 0.25);
}

.vac-fecha-row__badge .bi {
  font-size: 0.9rem;
}

.vac-fecha-row__text {
  min-width: 0;
}

.vac-fecha-row__date {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--th-blue-900);
  line-height: 1.2;
  text-transform: capitalize;
}

.vac-fecha-row__iso {
  display: block;
  font-size: 0.68rem;
  color: var(--th-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.08rem;
}

.vac-fecha-row__jornada {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 2 1 240px;
  align-items: center;
}

.vac-jornada-card {
  position: relative;
  cursor: pointer;
  margin: 0;
  flex: 1 1 72px;
  min-width: 68px;
}

.vac-jornada-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.vac-jornada-card__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.12rem;
  padding: 0.38rem 0.32rem 0.42rem;
  border: 2px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 4rem;
  justify-content: center;
}

.vac-jornada-card__box .bi {
  font-size: 1.02rem;
  color: var(--th-blue-600);
}

.vac-jornada-card__title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--th-blue-900);
  line-height: 1.15;
}

.vac-jornada-card__hint {
  font-size: 0.58rem;
  color: var(--th-text-muted);
  font-weight: 600;
}

.vac-jornada-card:hover .vac-jornada-card__box {
  border-color: var(--th-blue-400);
  background: var(--th-blue-50);
}

.vac-jornada-card input:focus-visible + .vac-jornada-card__box {
  outline: 2px solid var(--th-blue-500);
  outline-offset: 2px;
}

.vac-jornada-card input:checked + .vac-jornada-card__box {
  border-color: var(--th-blue-600);
  background: linear-gradient(180deg, var(--th-blue-50) 0%, var(--th-white) 100%);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.vac-jornada-card input:checked + .vac-jornada-card__box .bi {
  color: var(--th-blue-800);
}

@media (max-width: 768px) {
  .vac-fecha-row {
    flex-direction: column;
    align-items: stretch;
    padding: 0.45rem 0.5rem;
    gap: 0.45rem;
  }

  .vac-fecha-row__meta {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  /* Tres jornadas en fila, compactas y misma anchura */
  .vac-fecha-row__jornada {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.3rem;
  }

  .vac-jornada-card {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  .vac-jornada-card__box {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.08rem;
    min-height: 0;
    padding: 0.35rem 0.2rem 0.4rem;
    width: 100%;
    box-sizing: border-box;
  }

  .vac-jornada-card__box .bi {
    font-size: 0.95rem;
    flex-shrink: 0;
    line-height: 1;
  }

  .vac-jornada-card__title {
    font-size: 0.62rem;
    line-height: 1.15;
    font-weight: 700;
    word-break: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .vac-jornada-card__hint {
    font-size: 0.5rem;
    line-height: 1.1;
    font-weight: 600;
  }
}

/* Pantallas muy angostas: si no cabe bien, vuelve a apilar */
@media (max-width: 340px) {
  .vac-fecha-row__jornada {
    flex-direction: column;
    gap: 0.35rem;
  }

  .vac-jornada-card {
    flex: none;
    width: 100%;
  }

  .vac-jornada-card__title {
    font-size: 0.68rem;
    -webkit-line-clamp: 3;
  }

  .vac-jornada-card__hint {
    font-size: 0.55rem;
  }
}

/* Flatpickr (calendario vacaciones) */
.app-shell .flatpickr-day.selected,
.app-shell .flatpickr-day.startRange,
.app-shell .flatpickr-day.endRange {
  background: var(--th-blue-600);
  border-color: var(--th-blue-700);
}
.app-shell .flatpickr-day:hover {
  background: var(--th-blue-100);
}

/* ——— Login ——— */
html:has(body.page-login),
html.page-login-html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.page-login,
body.page-login *,
body.page-login *::before,
body.page-login *::after {
  box-sizing: border-box;
}

body.page-login {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--th-text);
  background:
    url("../fondo-azul.jpg") no-repeat center center fixed;
  background-size: cover;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.page-login .login-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin: auto;
  flex: 0 1 440px;
}

body.page-login::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(14, 165, 233, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 75%, rgba(52, 211, 153, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(251, 146, 60, 0.12) 0%, transparent 45%),
    linear-gradient(
      135deg,
      rgba(12, 74, 110, 0.88) 0%,
      rgba(14, 116, 144, 0.82) 40%,
      rgba(15, 118, 110, 0.86) 100%
    );
  background-size: 200% 200%, 200% 200%, 100% 100%, 200% 200%;
  animation: th-login-gradient 16s ease infinite;
  z-index: 0;
}

body.page-login::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(12, 74, 110, 0.45) 100%);
  z-index: 0;
  pointer-events: none;
}

@keyframes th-login-gradient {
  0%, 100% { background-position: 0% 50%, 100% 50%, center, 0% 50%; }
  50% { background-position: 100% 50%, 0% 50%, center, 100% 50%; }
}

.page-login .login-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.page-login .login-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, black 20%, transparent 75%);
}

.page-login .login-bg__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  transform: translate(-50%, -52%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 68%);
  animation: th-login-glow 8s ease-in-out infinite;
}

@keyframes th-login-glow {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -52%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -52%) scale(1.06); }
}

.page-login .login-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: th-login-float 18s ease-in-out infinite;
}

.page-login .login-bg__orb--1 {
  width: 360px;
  height: 360px;
  top: -100px;
  left: -80px;
  background: rgba(14, 165, 233, 0.4);
}

.page-login .login-bg__orb--2 {
  width: 300px;
  height: 300px;
  bottom: -90px;
  right: -70px;
  background: rgba(52, 211, 153, 0.35);
  animation-delay: -6s;
}

.page-login .login-bg__orb--3 {
  width: 220px;
  height: 220px;
  top: 38%;
  right: 12%;
  background: rgba(251, 146, 60, 0.28);
  animation-delay: -12s;
}

.page-login .login-bg__ring {
  position: absolute;
  top: 18%;
  right: 8%;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  animation: th-login-ring 22s linear infinite;
}

.page-login .login-bg__ring::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

@keyframes th-login-ring {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes th-login-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.06); }
  66% { transform: translate(-16px, 14px) scale(0.94); }
}

.page-login .login-box {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  border-radius: calc(var(--th-radius) + 4px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 24px 48px rgba(12, 74, 110, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  animation: th-login-enter 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes th-login-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page-login .login-box--shake {
  animation: th-login-shake 0.45s ease;
}

@keyframes th-login-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.page-login .login-header {
  margin-bottom: 1.75rem;
}

.page-login .login-header__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(170px, 100%);
  margin: 0 auto 1rem;
  animation: th-login-logo 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes th-login-logo {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page-login .login-header__title {
  margin: 0 0 0.35rem;
  color: var(--th-blue-900);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.page-login .login-header__subtitle {
  margin: 0;
  color: var(--th-text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.page-login .login-form {
  text-align: left;
  width: 100%;
  min-width: 0;
}

.page-login .login-field {
  margin-bottom: 0.85rem;
  min-width: 0;
}

.page-login .login-field__label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--th-blue-900);
}

.page-login .login-field__control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.page-login .login-field__icon {
  position: absolute;
  left: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--th-text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.page-login .login-field__icon svg {
  width: 16px;
  height: 16px;
}

.page-login .login-field__input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  border: 1.5px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--th-radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--th-text);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.page-login .login-field--password .login-field__input {
  padding-right: 2.5rem;
}

.page-login .login-field__input::placeholder {
  color: #94a3b8;
}

.page-login .login-field__input:hover {
  border-color: rgba(14, 165, 233, 0.35);
}

.page-login .login-field__input:focus {
  outline: none;
  border-color: var(--th-blue-500);
  background: var(--th-white);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

.page-login .login-field__input:focus + .login-field__toggle,
.page-login .login-field__control:focus-within .login-field__icon {
  color: var(--th-blue-600);
}

.page-login .login-field__toggle {
  position: absolute;
  right: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--th-text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.page-login .login-field__toggle svg {
  width: 16px;
  height: 16px;
}

.page-login .login-field__toggle:hover {
  color: var(--th-blue-700);
  background: rgba(14, 165, 233, 0.08);
}

.page-login .login-field__toggle:focus-visible {
  outline: 2px solid var(--th-blue-500);
  outline-offset: 2px;
}

.page-login .login-field__eye--hide {
  display: none;
}

.page-login .login-field__toggle.is-active .login-field__eye--show {
  display: none;
}

.page-login .login-field__toggle.is-active .login-field__eye--hide {
  display: block;
}

.page-login .login-field__hint {
  display: block;
  min-height: 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--th-orange-700);
}

.page-login .login-field--invalid .login-field__input {
  border-color: var(--th-orange-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.page-login .login-field--invalid .login-field__icon {
  color: var(--th-orange-600);
}

.page-login .login-submit {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--th-radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--th-white);
  cursor: pointer;
  background: linear-gradient(135deg, var(--th-blue-500) 0%, var(--th-blue-700) 55%, var(--th-blue-800) 100%);
  background-size: 200% 200%;
  box-shadow: 0 6px 20px rgba(3, 105, 161, 0.38);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s, background-position 0.3s;
}

.page-login .login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(3, 105, 161, 0.45);
  background-position: 100% 0;
}

.page-login .login-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.page-login .login-submit:focus-visible {
  outline: 2px solid var(--th-white);
  outline-offset: 3px;
}

.page-login .login-submit:disabled {
  cursor: wait;
  filter: brightness(0.96);
}

.page-login .login-submit__loader {
  display: none;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--th-white);
  border-radius: 50%;
  animation: th-login-spin 0.7s linear infinite;
}

@keyframes th-login-spin {
  to { transform: rotate(360deg); }
}

.page-login .login-submit.is-loading .login-submit__text {
  display: none;
}

.page-login .login-submit.is-loading .login-submit__loader {
  display: block;
}

.page-login .login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--th-radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  animation: th-login-alert 0.35s ease both;
}

@keyframes th-login-alert {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-login .login-alert.error {
  background: var(--th-orange-100);
  color: var(--th-orange-700);
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.page-login .login-alert svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

@media (max-width: 768px) {
  body.page-login {
    display: block;
    align-items: stretch;
    background:
      linear-gradient(
        135deg,
        rgba(12, 74, 110, 0.92) 0%,
        rgba(14, 116, 144, 0.88) 45%,
        rgba(15, 118, 110, 0.92) 100%
      ),
      url("../fondo-azul.jpg") no-repeat center center;
    background-size: cover, cover;
    background-attachment: scroll, scroll;
    -webkit-overflow-scrolling: touch;
  }

  body.page-login::before,
  body.page-login::after {
    position: absolute;
  }

  .page-login .login-shell {
    max-width: 100%;
    width: 100%;
    margin: 0.5rem auto 1rem;
    flex: none;
  }

  .page-login .login-box {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
      0 16px 36px rgba(12, 74, 110, 0.18),
      0 0 0 1px rgba(14, 165, 233, 0.12);
  }

  .page-login .login-bg__orb--1 {
    width: 180px;
    height: 180px;
    top: -60px;
    left: -40px;
  }

  .page-login .login-bg__orb--2 {
    width: 160px;
    height: 160px;
    bottom: -50px;
    right: -35px;
  }

  .page-login .login-bg__orb--3 {
    width: 120px;
    height: 120px;
    top: 42%;
    right: 4%;
  }

  .page-login .login-bg__ring,
  .page-login .login-bg__glow {
    display: none;
  }

  .page-login .login-bg__orb {
    animation: none;
    opacity: 0.35;
  }

  .page-login .login-field__input {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    font-size: 16px;
    background: #ffffff;
  }

  .page-login .login-field__toggle {
    width: 44px;
    height: 44px;
    right: 0.15rem;
  }

  .page-login .login-submit {
    min-height: 48px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body.page-login {
    padding:
      max(0.65rem, env(safe-area-inset-top, 0px))
      max(0.65rem, env(safe-area-inset-right, 0px))
      max(0.65rem, env(safe-area-inset-bottom, 0px))
      max(0.65rem, env(safe-area-inset-left, 0px));
  }

  .page-login .login-shell {
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .page-login .login-box {
    padding: 1.35rem 1rem 1.2rem;
    border-radius: var(--th-radius);
  }

  .page-login .login-header {
    margin-bottom: 1.35rem;
  }

  .page-login .login-header__logo {
    max-width: 120px;
    margin-bottom: 0.75rem;
  }

  .page-login .login-header__title {
    font-size: 1.15rem;
  }

  .page-login .login-header__subtitle {
    font-size: 0.8125rem;
  }

  .page-login .login-field {
    margin-bottom: 0.75rem;
  }

  .page-login .login-field__label {
    font-size: 0.875rem;
  }

  .page-login .login-alert {
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  body.page-login {
    align-items: flex-start;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  }

  .page-login .login-shell {
    margin-top: 0;
    margin-bottom: 0.35rem;
  }

  .page-login .login-box {
    padding: 1rem 1.15rem 0.95rem;
  }

  .page-login .login-header {
    margin-bottom: 0.85rem;
  }

  .page-login .login-header__logo {
    max-width: 88px;
    margin-bottom: 0.35rem;
  }

  .page-login .login-header__title {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
  }

  .page-login .login-header__subtitle {
    font-size: 0.75rem;
  }

  .page-login .login-field {
    margin-bottom: 0.55rem;
  }

  .page-login .login-field__hint {
    min-height: 0;
    margin-top: 0.2rem;
  }

  .page-login .login-submit {
    min-height: 42px;
    margin-top: 0.15rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .page-login .login-shell {
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-login::before,
  .page-login .login-bg__glow,
  .page-login .login-bg__orb,
  .page-login .login-bg__ring,
  .page-login .login-box,
  .page-login .login-header__logo,
  .page-login .login-alert {
    animation: none;
  }

  .page-login .login-submit:hover:not(:disabled) {
    transform: none;
  }
}

/* ——— Pantalla «En desarrollo» ——— */
.th-en-desarrollo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(16, 185, 129, 0.06), transparent 60%),
    var(--th-bg, #f1f5f9);
}

.th-en-desarrollo__card {
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 2.25rem 2rem 2rem;
  background: var(--th-white);
  border-radius: calc(var(--th-radius) + 4px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.th-en-desarrollo__visual {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-en-desarrollo__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(59, 130, 246, 0.25);
}

.th-en-desarrollo__ring--1 {
  animation: thEnDevSpin 18s linear infinite;
}

.th-en-desarrollo__ring--2 {
  inset: 0.65rem;
  border-color: rgba(16, 185, 129, 0.22);
  animation: thEnDevSpin 12s linear infinite reverse;
}

@keyframes thEnDevSpin {
  to {
    transform: rotate(360deg);
  }
}

.th-en-desarrollo__icon-wrap {
  position: relative;
  z-index: 1;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--th-blue-50, #eff6ff), var(--th-white));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.th-en-desarrollo__icon {
  font-size: 1.75rem;
  color: var(--th-blue-600);
}

.th-en-desarrollo__badge {
  position: absolute;
  bottom: -0.35rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}

.th-en-desarrollo__title {
  margin: 0 0 0.65rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--th-blue-900);
  letter-spacing: -0.02em;
}

.th-en-desarrollo__text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.th-en-desarrollo__features {
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.th-en-desarrollo__features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--th-blue-800);
}

.th-en-desarrollo__features i {
  color: var(--th-green-600);
  font-size: 1rem;
  flex-shrink: 0;
}

.th-en-desarrollo__progress {
  height: 6px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.th-en-desarrollo__progress-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--th-blue-500), var(--th-green-500));
  animation: thEnDevProgress 2.5s ease-in-out infinite alternate;
}

@keyframes thEnDevProgress {
  from {
    opacity: 0.85;
  }
  to {
    opacity: 1;
  }
}

.th-en-desarrollo__progress-label {
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--th-text-muted);
}

.th-en-desarrollo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.th-en-desarrollo__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--th-radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.th-en-desarrollo__btn--primary {
  color: var(--th-white);
  background: linear-gradient(135deg, var(--th-blue-600), var(--th-blue-500));
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.th-en-desarrollo__btn--primary:hover {
  color: var(--th-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
}

.th-en-desarrollo__btn--ghost {
  color: var(--th-blue-700);
  background: var(--th-white);
  border: 1px solid var(--th-border);
}

.th-en-desarrollo__btn--ghost:hover {
  background: var(--th-blue-50, #eff6ff);
  color: var(--th-blue-900);
}

@media (max-width: 480px) {
  .th-en-desarrollo__card {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .th-en-desarrollo__actions {
    flex-direction: column;
  }

  .th-en-desarrollo__btn {
    width: 100%;
    justify-content: center;
  }
}

/* ——— Modal estadísticas colaboradores ——— */
.th-stats-modal .modal-content {
  border: none;
  border-radius: calc(var(--th-radius) + 4px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.th-stats-modal .modal-header {
  background: linear-gradient(135deg, var(--th-blue-900), var(--th-blue-700));
  color: var(--th-white);
  border-bottom: none;
  padding: 1rem 1.25rem;
}

.th-stats-modal .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.th-stats-modal .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.th-stats-modal__intro {
  text-align: center;
  font-size: 0.9rem;
  color: var(--th-text-muted);
  margin-bottom: 1.25rem;
}

.th-stats-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--th-text-muted);
  font-size: 0.9rem;
}

.th-stats-chart-card {
  background: #fafbfd;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--th-radius);
  padding: 1rem;
  height: 100%;
}

.th-stats-chart-card__title {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--th-blue-900);
  margin: 0 0 0.75rem;
}

.th-stats-chart-card__canvas-wrap {
  position: relative;
  height: 220px;
}

.th-stats-chart-card__canvas-wrap--tall {
  height: min(320px, 50vh);
}

@media (max-width: 768px) {
  .th-stats-chart-card__canvas-wrap {
    height: 200px;
  }
}
