/* Mi bloque de codigo
   ETL Hostinger – Modern UI
────────────────────────────────────────────────────────── */
:root {
  --bg:           #edf1f7;
  --surface:      #ffffff;
  --surface-soft: #f7fafd;
  --text:         #0e1726;
  --muted:        #60748c;
  --line:         #dce5f0;
  --border:       var(--line);
  --primary:      #1f4f94;
  --primary-lt:   #e8f1fb;
  --primary-dark: #173b70;
  --danger:       #dc2626;
  --success:      #15803d;
  --warning:      #b45309;
  --sidebar:      #0b1d32;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(14,23,38,.05);
  --shadow:    0 2px 12px rgba(14,23,38,.08);
  --shadow-lg: 0 8px 32px rgba(14,23,38,.13);
  --transition: .18s ease;
}

/* Mi nota: Dark mode */
body.dark-mode {
  --bg:           #09111b;
  --surface:      #101b2a;
  --surface-soft: #152234;
  --text:         #edf4ff;
  --muted:        #9ab0c8;
  --line:         #27384d;
  --border:       var(--line);
  --primary:      #74a8f4;
  --primary-lt:   rgba(80, 148, 236, .16);
  --primary-dark: #b8d5ff;
  --success:      #34d399;
  --warning:      #fbbf24;
  --danger:       #fb7185;
  --sidebar:      #071827;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.34);
  --shadow:    0 14px 36px rgba(0,0,0,.22), 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-lg: 0 24px 60px rgba(0,0,0,.36), 0 1px 0 rgba(255,255,255,.04) inset;
  color-scheme: dark;
}

body.dark-mode {
  background:
    radial-gradient(circle at 18% 0%, rgba(45, 212, 191, .08), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(116, 168, 244, .10), transparent 34%),
    linear-gradient(180deg, #09111b 0%, #0c1622 48%, #0a121c 100%);
}

body.dark-mode .main {
  background: transparent;
}

body.dark-mode .panel,
body.dark-mode .card,
body.dark-mode .login-card {
  background: linear-gradient(180deg, rgba(18, 30, 46, .96), rgba(14, 24, 37, .96));
  border-color: rgba(126, 158, 195, .18);
  box-shadow: var(--shadow);
}

body.dark-mode .panel:hover,
body.dark-mode .card:hover {
  border-color: rgba(116, 168, 244, .28);
}

/* Mi nota: Inputs en dark */
body.dark-mode .input,
body.dark-mode input[type=text],
body.dark-mode input[type=email],
body.dark-mode input[type=password],
body.dark-mode input[type=number],
body.dark-mode select,
body.dark-mode textarea {
  background: #0b1420;
  color: var(--text);
  border-color: rgba(126, 158, 195, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
body.dark-mode .input:focus,
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(116,168,244,.16), inset 0 1px 0 rgba(255,255,255,.03);
}

/* Mi nota: Tablas en dark */
body.dark-mode table thead tr { background: rgba(21,34,52,.92); }
body.dark-mode table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
body.dark-mode table tbody tr:hover { background: rgba(116,168,244,.08); }
body.dark-mode table tbody td,
body.dark-mode table tfoot td { border-color: var(--line); }
body.dark-mode th { color: #a9bdd5; }

/* Mi nota: Topbar y sidebar */
body.dark-mode .topbar {
  background: rgba(8, 17, 27, .88);
  border-bottom-color: rgba(126, 158, 195, .16);
  box-shadow: 0 10px 34px rgba(0,0,0,.22);
}

/* Mi nota: Charts — sin filtro, los colores se manejan desde JS */
body.dark-mode canvas { filter: none; }

/* Mi nota: Badges en dark — ajustar fondos claros */
body.dark-mode .badge-verde   { background: #052e16; color: #4ade80; }
body.dark-mode .badge-amarillo{ background: #2d1a00; color: #fbbf24; }
body.dark-mode .badge-rojo    { background: #2d0a0a; color: #f87171; }
body.dark-mode .badge-gris    { background: #1e2d40; color: #94a3b8; }
body.dark-mode .badge-azul    { background: #0c1f3d; color: #60a5fa; }

/* Mi nota: Scrollbar en dark */
body.dark-mode ::-webkit-scrollbar-track { background: #09111b; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #26384d; border-radius: 999px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #3a516b; }

/* Mi nota: Flash messages en dark */
body.dark-mode .flash-success { background: #052e16; color: #4ade80; border-color: #14532d; }
body.dark-mode .flash-danger  { background: #2d0a0a; color: #f87171; border-color: #7f1d1d; }
body.dark-mode .flash-warning { background: #2d1a00; color: #fbbf24; border-color: #78350f; }

/* Mi nota: A2F en dark */
body.dark-mode .profile-2fa-app-card,
body.dark-mode .profile-2fa-qr-copy code {
  background: #0f1923;
}
body.dark-mode .profile-2fa-app-card:hover,
body.dark-mode .profile-2fa-app-card.is-selected {
  background: #162638;
}
body.dark-mode .profile-2fa-step.is-green,
body.dark-mode .profile-2fa-active {
  background: #052e16;
  border-color: #14532d;
}
body.dark-mode .profile-2fa-step.is-blue {
  background: #0c1f3d;
  border-color: #1d4ed8;
}
body.dark-mode .profile-2fa-step.is-purple {
  background: #24143d;
  border-color: #6d28d9;
}
body.dark-mode .profile-2fa-step.is-green strong,
body.dark-mode .profile-2fa-active strong { color: #4ade80; }
body.dark-mode .profile-2fa-active p { color: #86efac; }
body.dark-mode .profile-2fa-qr-box,
body.dark-mode .profile-2fa-app-icon {
  background: #fff;
}

/* Mi nota: Subnav en dark */
body.dark-mode .subnav a {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--muted);
}
body.dark-mode .subnav a:hover {
  background: var(--primary-lt);
  color: var(--primary);
  border-color: var(--primary);
}
body.dark-mode .subnav a.is-active {
  background: var(--primary-lt);
  color: var(--primary);
  border-color: rgba(31,79,148,.4);
}

/* Mi nota: Check-row-diag (filtros tipo pill) en dark */
body.dark-mode .check-row-diag {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}
body.dark-mode .check-row-diag:hover {
  border-color: #d97706;
  background: #2d1a00;
  color: #fbbf24;
}
body.dark-mode .check-row-diag.is-active {
  border-color: #d97706;
  background: #2d1a00;
  color: #fbbf24;
}

/* Mi nota: User menu en dark */
body.dark-mode .user-menu-trigger {
  background: rgba(16,27,42,.82);
  border-color: rgba(126,158,195,.22);
  box-shadow: 0 10px 26px rgba(0,0,0,.20);
}
body.dark-mode .user-menu-trigger:hover {
  background: var(--surface-soft);
  border-color: rgba(116,168,244,.42);
  box-shadow: 0 10px 28px rgba(18,78,150,.18);
}
body.dark-mode .user-menu-trigger.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(116,168,244,.15);
}
body.dark-mode .user-menu-dropdown {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.3);
}
body.dark-mode .user-menu-item:hover { background: var(--surface-soft); }
body.dark-mode .user-menu-item-danger:hover { background: #2d0a0a; color: #f87171; }

/* Mi nota: SweetAlert en dark */
body.dark-mode .swal2-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
}
body.dark-mode .swal2-title { color: var(--text) !important; }
body.dark-mode .swal2-html-container { color: var(--muted) !important; }
body.dark-mode .swal2-styled.swal2-confirm { background: #1f4f94 !important; }
body.dark-mode .swal2-styled.swal2-cancel {
  background: var(--surface-soft) !important;
  color: var(--text) !important;
}

/* Mi nota: Topbar input de búsqueda */
body.dark-mode .topbar .eyebrow { color: #91a8c2; }


/* Mi nota: Panel de settings / SMTP */
body.dark-mode .settings-section {
  background: var(--surface-soft);
  border-color: var(--line);
}

/* Mi nota: Filter panel bg en dark */
body.dark-mode .filter-panel {
  background: var(--surface);
  border-color: var(--line);
}

/* Mi nota: Sales status: hero + filtros en dark */
body.dark-mode .status-hero {
  background: radial-gradient(circle at top left, rgba(31,79,148,.08), transparent 34%),
              linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
}
body.dark-mode .status-filters-panel {
  background: var(--surface);
}

/* Mi nota: Filter chip group en dark */
body.dark-mode .filter-chip-group {
  background: var(--surface-soft);
  border-color: var(--line);
}
body.dark-mode .filter-chip {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}
body.dark-mode .filter-chip:hover {
  background: var(--primary-lt);
  border-color: rgba(31,79,148,.4);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(31,79,148,.12);
}
body.dark-mode .filter-chip.is-selected {
  background: var(--primary-lt);
  border-color: rgba(31,79,148,.4);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(31,79,148,.12);
}
body.dark-mode .filter-chip input {
  border-color: #3d5269;
  background: var(--surface);
}
body.dark-mode .filter-chip input::after { background: #fff; }
body.dark-mode .filter-collapsible > summary { border-bottom-color: var(--line); }
body.dark-mode .filter-chip[data-pago="pagado"].is-selected      { background: #052e16; border-color: rgba(74,222,128,.3);  color: #4ade80; }
body.dark-mode .filter-chip[data-pago="pago parcial"].is-selected { background: #2d1a00; border-color: rgba(251,191,36,.3);  color: #fbbf24; }
body.dark-mode .filter-chip[data-pago="pendiente"].is-selected   { background: #2d0a0a; border-color: rgba(248,113,113,.3); color: #f87171; }

/* Mi nota: Payment summary cards en dark */
body.dark-mode .ps-card {
  background: var(--surface-soft);
  border-color: var(--line);
}
body.dark-mode .ps-card--ps-pagado.ps-card--active    { background: #052e16; }
body.dark-mode .ps-card--ps-parcial.ps-card--active   { background: #2d1a00; }
body.dark-mode .ps-card--ps-pendiente.ps-card--active { background: #2d0a0a; }
body.dark-mode .ps-card--ps-pagado    .ps-icon { background: #052e16; }
body.dark-mode .ps-card--ps-parcial   .ps-icon { background: #2d1a00; }
body.dark-mode .ps-card--ps-pendiente .ps-icon { background: #2d0a0a; }

/* Mi nota: Integration result en dark */
body.dark-mode .integration-result.ok    { background: #052e16; color: #4ade80; border-color: #14532d; }
body.dark-mode .integration-result.error { background: #2d0a0a; color: #f87171; border-color: #7f1d1d; }

/* Mi nota: Perm cards (users form) en dark */
body.dark-mode .perm-card {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--muted);
}
body.dark-mode .perm-card.checked,
body.dark-mode .perm-card input:checked ~ .perm-card {
  background: var(--primary-lt) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Mi nota: Botón toggle dark mode */
.dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
  border: 1px solid #d8e5f3;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
  flex-shrink: 0;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 12px rgba(31,79,148,.12);
}
.dark-toggle svg {
  display: block;
  width: 17px;
  height: 17px;
}
.dark-toggle:hover {
  background: #e8f1fb;
  border-color: rgba(31,79,148,.24);
  color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31,79,148,.16);
}
body.dark-mode .dark-toggle {
  background: linear-gradient(180deg, rgba(21,34,52,.96) 0%, rgba(11,20,32,.96) 100%);
  color: #fbbf24;
  border-color: rgba(126,158,195,.24);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
body.dark-mode .dark-toggle:hover {
  background: rgba(33,51,73,.94);
  border-color: rgba(251,191,36,.32);
  color: #fcd34d;
  box-shadow: 0 12px 28px rgba(0,0,0,.30);
}

* { box-sizing: border-box; }
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font: inherit; }

/* Mi nota: Shell */
.app-shell { min-height: 100vh; max-width: 100%; overflow-x: hidden; }
.app-shell-auth {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
  align-items: stretch;
}
.app-shell-guest { display: block; }

/* Mi nota: Sidebar */
.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  align-self: stretch;
  min-height: 100%;
  height: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

body.dark-mode .sidebar {
  background:
    radial-gradient(circle at 36% 0%, rgba(45, 212, 191, .10), transparent 26%),
    linear-gradient(180deg, #071827 0%, #061422 58%, #050f1a 100%);
  box-shadow: inset -1px 0 0 rgba(126,158,195,.14);
}

body.dark-mode .brand-robot-wrap::after {
  background: linear-gradient(to bottom, transparent, #071827);
}

.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px; }
.login-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px; }
.brand small, .login-brand small { display: block; color: #7a9cc0; font-size: 11.5px; margin-top: 1px; }
.brand strong { font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-robot-wrap {
  position: relative;
  width: 68px;
  height: 54px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0 0 34px 34px;
}
.brand-robot-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, #0b1d32);
}
.brand-logo {
  width: 68px;
  height: auto;
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  mix-blend-mode: screen;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2f6fbd 0%, #1f4f94 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(31,79,148,.35);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 26px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 9.5px 12px;
  border-radius: var(--radius-sm);
  color: #94b3cc;
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}
.nav a:hover {
  background: rgba(255,255,255,.07);
  color: #dcedf8;
  border-left-color: rgba(79,156,255,.35);
}
.nav a.is-active {
  background: rgba(79,156,255,.22);
  color: #4df8e8;
  border-left-color: #4f9cff;
  font-weight: 600;
}

.nav-group {
  margin-top: 4px;
}
.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9.5px 12px;
  border-radius: var(--radius-sm);
  color: #94b3cc;
  background: transparent;
  border-left: 3px solid transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.nav-group-label:hover {
  background: rgba(255,255,255,.07);
  color: #dcedf8;
  border-left-color: rgba(79,156,255,.35);
}
.nav-group.is-active .nav-group-label {
  background: rgba(79,156,255,.22);
  color: #4df8e8;
  border-left-color: #4f9cff;
  font-weight: 600;
}
.nav-group-caret {
  font-size: 11px;
  line-height: 1;
  transition: transform var(--transition);
}
.nav-group.is-open .nav-group-caret {
  transform: rotate(180deg);
}
.nav-submenu[hidden] { display: none !important; }
.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 2px 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(148,179,204,.18);
}
.nav-submenu a {
  padding: 8px 8px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-section {
  padding: 18px 12px 6px;
  color: #4a6478;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Mi nota: Sidebar menu/submenu style inspired by EmpleadoCODET TECHNOLOGY */
.sidebar .nav {
  gap: 5px;
  margin-top: 26px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.sidebar .nav a,
.sidebar .nav-group-label {
  min-height: 42px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(214, 224, 238, .82);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.22;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar .nav a:hover,
.sidebar .nav-group-label:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar .nav a.is-active,
.sidebar .nav-group.is-active .nav-group-label {
  background: rgba(148, 163, 184, .20);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #4f9cff;
}

body.dark-mode .sidebar .nav a,
body.dark-mode .sidebar .nav-group-label {
  color: rgba(220, 232, 247, .78);
}

body.dark-mode .sidebar .nav a:hover,
body.dark-mode .sidebar .nav-group-label:hover {
  background: rgba(116,168,244,.10);
  color: #fff;
}

body.dark-mode .sidebar .nav a.is-active,
body.dark-mode .sidebar .nav-group.is-active .nav-group-label {
  background: linear-gradient(90deg, rgba(116,168,244,.24), rgba(45,212,191,.08));
  color: #fff;
  box-shadow: inset 3px 0 0 #63b3ff, 0 10px 22px rgba(0,0,0,.16);
}

.sidebar .nav-group {
  margin-top: 0;
}

.sidebar .nav-group-label span:first-child {
  min-width: 0;
  white-space: normal;
}

.sidebar .nav-group-caret {
  color: rgba(214, 224, 238, .76);
  font-size: 11px;
}

.sidebar .nav-submenu {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 8px 0 8px 12px;
  padding-left: 18px;
  border-left: 1px solid rgba(214, 224, 238, .18);
}

.sidebar .nav-submenu a {
  min-height: 36px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(214, 224, 238, .72);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  white-space: normal;
}

.sidebar .nav-submenu a:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.sidebar .nav-submenu a.is-active {
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 2px 0 0 #4f9cff;
}

/* Mi nota: Main */
.main { min-width: 0; max-width: 100%; overflow-x: hidden; }
.main-auth  { min-height: 100vh; display: flex; flex-direction: column; padding-top: 68px; }
.main-guest { min-height: 100vh; display: flex; flex-direction: column; }

/* Mi nota: Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 68px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-auth {
  position: fixed;
  top: 0;
  right: 0;
  left: 200px;
  z-index: 260;
}
.topbar-guest { padding-inline: clamp(24px, 5vw, 52px); }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: grid; gap: 1px; text-align: right; line-height: 1.3; }
.topbar-user strong { font-size: 13.5px; font-weight: 600; }
.topbar-user span { color: var(--muted); font-size: 12px; }

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f6fbd, #1f4f94);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(31,79,148,.25);
}

/* Mi nota: Content */
.content { padding: 22px 26px; min-width: 0; max-width: 100%; overflow-x: hidden; }
.content-auth { width: min(1720px, 100%); margin: 0 auto; }
.content-guest { padding: clamp(28px, 5vw, 54px); flex: 1; display: flex; }
.content-guest > * { width: 100%; }
.content-guest > .panel { width: min(560px, 100%); margin: auto; }

/* Mi nota: Cards & Panels */
.panel, .card, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 20px 22px; margin-bottom: 16px; min-width: 0; max-width: 100%; }
.compact-panel { margin-bottom: 0; }
.panel h2 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.panel > p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; font-size: 13.5px; }

body.dark-mode .panel h2,
body.dark-mode .card strong,
body.dark-mode .metric-card strong {
  color: #f4f8ff;
}

body.dark-mode .panel > p,
body.dark-mode .metric-card p,
body.dark-mode .metric-card span {
  color: #9fb4cc;
}
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
}
.section-heading h2 { margin: 0; }
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.quick-actions a,
.traffic-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.quick-actions a {
  padding: 8px 11px;
}
.traffic-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 32px;
  padding: 5px 8px;
  text-align: right;
}
.quick-actions a:hover,
.traffic-link:hover {
  border-color: rgba(31,79,148,.32);
  background: var(--primary-lt);
}
.invoice-health {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.invoice-health-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.invoice-health-head h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 3px;
}
.invoice-health-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.invoice-health-meter {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.invoice-health-meter > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.invoice-health-meter span,
.invoice-health-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.invoice-health-meter strong {
  color: #0284c7;
  font-size: 22px;
  font-weight: 850;
}
.invoice-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.invoice-health-grid > div {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 10px 11px;
}
.invoice-health-grid strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  margin-top: 3px;
}
.invoice-health-grid .is-danger strong { color: #dc2626; }
.invoice-health-grid .is-warning strong { color: #d97706; }
.ops-summary {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.ops-summary-hero {
  border: 1px solid rgba(15,118,110,.18);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(20,184,166,.13), rgba(37,99,235,.06));
  padding: 18px 20px;
}
.ops-summary-hero span,
.ops-summary-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.ops-summary-hero strong {
  color: var(--text);
  display: block;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 850;
  letter-spacing: -0.04em;
  margin: 4px 0;
}
.ops-summary-hero small,
.ops-summary-card small {
  color: var(--muted);
  font-size: 12px;
}
.ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ops-summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: inherit;
  min-height: 118px;
  padding: 14px 15px;
  text-decoration: none;
}
.ops-summary-card strong {
  color: var(--text);
  display: block;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 6px 0 7px;
}
.ops-summary-card.is-good strong { color: #16a34a; }
.ops-summary-card.is-danger strong { color: #dc2626; }
.ops-summary-card.is-warning strong { color: #d97706; }
.ops-summary-card:hover {
  border-color: rgba(31,79,148,.28);
  transform: translateY(-1px);
}
.ops-meter {
  height: 7px;
  background: #dce5ef;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}
.ops-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

/* Mi nota: Metric cards */
.grid { display: grid; gap: 14px; }
.cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.card.metric-card {
  padding: 20px 22px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.card.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-lt), var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}
.card.metric-card:nth-child(2)::before { background: linear-gradient(90deg, #bfdbfe, #3b82f6); }
.card.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #d1fae5, #10b981); }
.card.metric-card:nth-child(4)::before { background: linear-gradient(90deg, #fef3c7, #f59e0b); }
.card.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

body.dark-mode .card.metric-card {
  background:
    linear-gradient(180deg, rgba(18,31,48,.98), rgba(13,23,36,.98));
  border-color: rgba(126,158,195,.16);
}

body.dark-mode .card.metric-card::before {
  opacity: .88;
}

body.dark-mode .card.metric-card:hover {
  border-color: rgba(116,168,244,.34);
  box-shadow: var(--shadow-lg);
}
.metric-card p { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric-card strong { display: block; font-size: 27px; font-weight: 700; margin-bottom: 5px; letter-spacing: -0.03em; }
.metric-card span { color: var(--muted); font-size: 12px; }
.inventory-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.inventory-metric-grid .metric-card {
  min-height: 112px;
  border-radius: 8px;
  cursor: default;
}

/* Mi nota: Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state-icon { font-size: 40px; line-height: 1; opacity: .5; }
.empty-state p { margin: 0; font-size: 14px; line-height: 1.6; }
.empty-state p strong { color: var(--primary); }

/* Mi nota: Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.button:active { transform: scale(0.97); }
.button-primary {
  background: linear-gradient(135deg, #2f6fbd 0%, #1f4f94 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31,79,148,.28);
}
.button-primary:hover {
  background: linear-gradient(135deg, #265fa8 0%, #173b70 100%);
  box-shadow: 0 4px 16px rgba(31,79,148,.38);
}
.button-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.button-secondary:hover { background: var(--line); }

body.dark-mode .button-primary,
body.dark-mode .button-resync {
  background: linear-gradient(135deg, #2d6fbd 0%, #1d4f91 100%);
  box-shadow: 0 12px 26px rgba(37,99,235,.22);
}

body.dark-mode .button-primary:hover,
body.dark-mode .button-resync:hover {
  box-shadow: 0 14px 30px rgba(37,99,235,.30);
}

body.dark-mode .button-secondary {
  background: rgba(21,34,52,.82);
  color: #dce8f7;
  border-color: rgba(126,158,195,.22);
}

body.dark-mode .button-secondary:hover {
  background: rgba(39,56,77,.86);
}
.button-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(185,28,28,.22);
}
.button-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 4px 16px rgba(185,28,28,.32);
}
.button-odoo {
  background: linear-gradient(135deg, #714b67 0%, #4c2a4e 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(113,75,103,.25);
}
.button-odoo:hover { opacity: .88; box-shadow: 0 4px 14px rgba(113,75,103,.38); }
.button-resync {
  background: linear-gradient(135deg, #1f4f94 0%, #173b70 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(31,79,148,.25);
  gap: 6px;
}
.button-resync:hover { opacity: .88; box-shadow: 0 4px 14px rgba(31,79,148,.35); }
.button-full { width: 100%; justify-content: center; }

/* Mi nota: Forms */
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,79,148,.12);
}
label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
.filter-grid, .settings-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
.filter-actions, .inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack-form { display: grid; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row-diag {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid #dce5f0;
  background: #f4f7fb;
  color: #506176;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.check-row-diag:hover { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.check-row-diag.is-active { border-color: #f59e0b; background: #fef3c7; color: #92400e; font-weight: 600; }
.check-row-diag input { accent-color: #d97706; }

/* Mi nota: Subnav */
.subnav { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.subnav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition);
}
.subnav a:hover {
  border-color: rgba(31,79,148,.4);
  color: var(--primary-dark);
  background: var(--primary-lt);
  transform: translateY(-1px);
}

/* Mi nota: Flash messages */
.flash-stack { padding: 14px 26px 0; }
.flash-stack-auth { width: min(1720px, 100%); margin: 0 auto; }
.flash-stack-guest { width: min(1180px, 100%); margin: 0 auto; padding-inline: clamp(24px, 5vw, 52px); }
.flash {
  position: relative;
  padding: 14px 18px 14px 22px;
  border-radius: 18px;
  margin-bottom: 10px;
  border: 1px solid;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.flash::before,
.login-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.32;
}
.flash-success { background: #f3fbf6; color: #166534; border-color: #ccead5; }
.flash-danger  { background: #fff4f4; color: #b42318; border-color: #f7c7c7; }
.flash-warning { background: #fff9ed; color: #b45309; border-color: #f8ddb0; }

/* Mi nota: SweetAlert */
.etl-swal-popup {
  border-radius: 22px;
  padding: 1.4rem;
}
.etl-swal-popup .swal2-title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
}
.etl-swal-popup .swal2-html-container {
  color: var(--muted);
  line-height: 1.55;
}
.etl-swal-loading .swal2-loader {
  border-color: #1f4f94 transparent #1f4f94 transparent;
}
.etl-swal-toast {
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(14,23,38,.12);
}
.etl-swal-toast .swal2-title {
  font-size: 13.5px;
  font-weight: 700;
}

/* Mi nota: Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--line); }
th {
  padding: 9px 10px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: none; }

/* Mi nota: Badges */
.badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; text-transform: capitalize;
  background: var(--surface-soft); color: var(--muted);
}
.badge-verde    { background: #f0fdf4; color: var(--success); }
.badge-amarillo { background: #fffbeb; color: var(--warning); }
.badge-naranja  { background: #fff7ed; color: #c2410c; }
.badge-rojo     { background: #fef2f2; color: var(--danger); }
.badge-gris     { background: #f8fafc; color: #475467; }
.badge-azul     { background: #eff6ff; color: #1d4ed8; }

/* Mi nota: Data list */
.data-list { display: grid; gap: 0; }
.data-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.data-list div:last-child { border-bottom: none; }
.data-list dt { color: var(--muted); font-size: 13px; }
.data-list dd { margin: 0; font-weight: 700; font-size: 13.5px; }

/* Mi nota: Perfil - autenticacion en dos pasos */
.profile-2fa-panel {
  grid-column: 1 / -1;
}
.profile-2fa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.profile-2fa-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.profile-2fa-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}
.profile-2fa-kicker,
.profile-2fa-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}
.profile-2fa-kicker {
  background: #eff6ff;
  color: #1d4ed8;
}
.profile-2fa-status.is-active {
  background: #dcfce7;
  color: #166534;
}
.profile-2fa-status.is-inactive {
  background: #fee2e2;
  color: #b91c1c;
}
.radio-app-2fa {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.profile-2fa-apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.profile-2fa-app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.profile-2fa-app-card:hover,
.profile-2fa-app-card.is-selected {
  border-color: var(--app-color, var(--primary));
  background: var(--app-bg, var(--primary-lt));
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.profile-2fa-app-card strong,
.profile-2fa-app-card small {
  display: block;
}
.profile-2fa-app-card strong {
  font-size: 13.5px;
  font-weight: 800;
}
.profile-2fa-app-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.profile-2fa-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .12);
}
.profile-2fa-app-icon svg {
  width: 32px;
  height: 32px;
}
.profile-2fa-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.profile-2fa-step {
  min-height: 92px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid;
}
.profile-2fa-step strong,
.profile-2fa-step span {
  display: block;
}
.profile-2fa-step strong {
  margin-bottom: 5px;
  font-size: 13px;
}
.profile-2fa-step span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.profile-2fa-step.is-green {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.profile-2fa-step.is-green strong { color: #166534; }
.profile-2fa-step.is-blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.profile-2fa-step.is-blue strong { color: #1d4ed8; }
.profile-2fa-step.is-purple {
  background: #faf5ff;
  border-color: #ddd6fe;
}
.profile-2fa-step.is-purple strong { color: #6d28d9; }
.profile-2fa-generate {
  width: fit-content;
}
.profile-2fa-setup {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.profile-2fa-qr-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.profile-2fa-qr-box {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 16px;
  border: 4px solid #dbeafe;
  background: #fff;
}
.profile-2fa-qr-box img {
  width: 100%;
  height: 100%;
  display: block;
}
.profile-2fa-qr-copy strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 6px;
}
.profile-2fa-qr-copy p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.profile-2fa-qr-copy code {
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  letter-spacing: .18em;
  word-break: break-all;
}
.profile-2fa-confirm {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}
.profile-2fa-code {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .24em;
}
.profile-2fa-active {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: #f0fdf4;
  margin-bottom: 16px;
}
.profile-2fa-active-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #dcfce7;
  color: #15803d;
}
.profile-2fa-active-icon svg {
  width: 30px;
  height: 30px;
}
.profile-2fa-active strong {
  display: block;
  color: #14532d;
  font-size: 15px;
  margin-bottom: 4px;
}
.profile-2fa-active p {
  margin: 0;
  color: #166534;
  font-size: 13px;
}
.profile-2fa-disable {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
}

/* Mi nota: Progress track (reutilizable, respeta dark mode) */
.progress-track {
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.progress-track-lg { height: 12px; }
.progress-track-sm { height: 8px; }

/* Mi nota: Table group/total header rows */
.tr-group td { background: var(--surface-soft); font-weight: 600; color: var(--text); }
.tr-total td { background: var(--surface-soft); font-weight: 700; }

/* Mi nota: Chart containers */
.chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 14px;
}
.chart-wrap-sm  { height: 180px; }
.chart-wrap-md  { height: 250px; }
.chart-wrap-lg  { height: 300px; }
.chart-wrap-donut {
  width: min(420px, 100%);
  height: 320px;
  margin: 8px auto 0;
}
.chart-kpi-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 0;
}
.finance-pie-card {
  display: grid;
  grid-template-columns: minmax(210px, 300px) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 320px;
  padding: 12px 6px 4px;
}
.finance-pie {
  width: min(300px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  background:
    conic-gradient(
      #14b8a6 0 var(--margin-pct),
      #94a3b8 var(--margin-pct) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.75),
    0 18px 35px rgba(15,23,42,.16);
  position: relative;
}
.finance-pie::after {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(148,163,184,.18);
}
.finance-pie-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}
.finance-pie-center span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.finance-pie-center strong {
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.finance-pie-summary {
  display: grid;
  gap: 12px;
}
.finance-pie-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface-soft);
  position: relative;
  overflow: hidden;
}
.finance-pie-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #94a3b8;
}
.finance-pie-item.is-margin::before { background: #14b8a6; }
.finance-pie-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.finance-pie-item strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.finance-pie-item small {
  color: var(--muted);
  font-size: 12px;
}
.business-focus {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.1fr);
  gap: 14px;
  min-height: 320px;
  align-items: stretch;
  padding-top: 8px;
}
.business-focus-main,
.business-focus-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.business-focus-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border-color: rgba(220,38,38,.18);
  background:
    linear-gradient(180deg, rgba(254,242,242,.82), rgba(255,255,255,.92));
}
.business-focus-main span,
.business-focus-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.business-focus-main strong {
  color: #dc2626;
  display: block;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 850;
  letter-spacing: -0.04em;
  margin: 8px 0 6px;
}
.business-focus-main p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 18px;
}
.business-focus-main a,
.business-focus-item {
  text-decoration: none;
}
.business-focus-main a {
  align-self: flex-start;
  background: #dc2626;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 13px;
}
.business-focus-list {
  display: grid;
  gap: 10px;
}
.business-focus-item {
  color: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label value"
    "sub value";
  align-items: center;
  min-height: 86px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.business-focus-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #94a3b8;
}
.business-focus-item.is-danger::before { background: #dc2626; }
.business-focus-item.is-warning::before { background: #d97706; }
.business-focus-item.is-good::before { background: #16a34a; }
.business-focus-item span { grid-area: label; }
.business-focus-item strong {
  grid-area: value;
  color: var(--text);
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.04em;
}
.business-focus-item small {
  grid-area: sub;
  color: var(--muted);
  font-size: 12px;
}
.business-focus-item:hover {
  border-color: rgba(31,79,148,.28);
  transform: translateY(-1px);
}
.monthly-trend-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.monthly-trend-row {
  display: grid;
  grid-template-columns: 115px minmax(180px, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  min-height: 52px;
  padding: 8px 12px;
}
.monthly-trend-label strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}
.monthly-trend-label span,
.monthly-trend-values span {
  color: var(--muted);
  font-size: 11px;
}
.monthly-trend-track {
  height: 10px;
  background: #dce5ef;
  border-radius: 999px;
  overflow: hidden;
}
.monthly-trend-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  box-shadow: 0 6px 14px rgba(20,184,166,.22);
}
.monthly-trend-values {
  text-align: right;
}
.monthly-trend-values strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.15;
}

/* Dashboard polish */
.dashboard-page {
  display: grid;
  gap: 16px;
}
.dashboard-page > .panel,
.dashboard-page > .grid,
.dashboard-page > .analytics-grid {
  margin-bottom: 0;
}
.dashboard-page .panel {
  overflow: hidden;
}
.dashboard-filter-panel {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}
.dashboard-filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.dashboard-filter-head h2 {
  margin: 0 0 5px;
  font-size: 16px;
}
.dashboard-filter-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-pdf-link {
  height: 34px;
  align-self: flex-start;
  justify-content: center;
  padding-inline: 16px;
  white-space: nowrap;
}
.dashboard-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.dashboard-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.dashboard-filter-field .input {
  height: 38px;
}
.dashboard-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dashboard-filter-actions .button {
  height: 38px;
  justify-content: center;
  white-space: nowrap;
}
.dashboard-page .filter-grid .button {
  justify-content: center;
}

body.dark-mode .dashboard-page .panel,
body.dark-mode .dashboard-page .card.metric-card {
  background:
    linear-gradient(180deg, rgba(18,31,48,.98), rgba(13,23,36,.98));
  border-color: rgba(126,158,195,.20);
}
body.dark-mode .dashboard-page .metric-card strong,
body.dark-mode .dashboard-page .ops-summary-hero strong,
body.dark-mode .dashboard-page .finance-pie-center strong,
body.dark-mode .dashboard-page .business-focus-item strong,
body.dark-mode .dashboard-page .monthly-trend-values strong {
  color: #f4f8ff;
}
body.dark-mode .dashboard-page .metric-card p,
body.dark-mode .dashboard-page .metric-card span,
body.dark-mode .dashboard-page .ops-summary-hero small,
body.dark-mode .dashboard-page .ops-summary-card small,
body.dark-mode .dashboard-page .finance-pie-item small,
body.dark-mode .dashboard-page .business-focus-main p,
body.dark-mode .dashboard-page .business-focus-item small,
body.dark-mode .dashboard-page .monthly-trend-label span,
body.dark-mode .dashboard-page .monthly-trend-values span {
  color: #a7bad1;
}
body.dark-mode .dashboard-page .quick-actions a,
body.dark-mode .dashboard-page .traffic-link {
  background: rgba(15,26,41,.92);
  border-color: rgba(126,158,195,.26);
  color: #b8d5ff;
}
body.dark-mode .dashboard-page .quick-actions a:hover,
body.dark-mode .dashboard-page .traffic-link:hover {
  background: rgba(116,168,244,.16);
  border-color: rgba(116,168,244,.38);
}
body.dark-mode .dashboard-page .ops-summary-hero {
  background:
    linear-gradient(135deg, rgba(20,184,166,.14), rgba(116,168,244,.08));
  border-color: rgba(20,184,166,.28);
}
body.dark-mode .dashboard-page .ops-summary-card,
body.dark-mode .dashboard-page .finance-pie-item,
body.dark-mode .dashboard-page .business-focus-item,
body.dark-mode .dashboard-page .invoice-health-grid > div,
body.dark-mode .dashboard-page .monthly-trend-row {
  background: rgba(21,34,52,.88);
  border-color: rgba(126,158,195,.22);
}
body.dark-mode .dashboard-page .business-focus-main {
  background:
    linear-gradient(180deg, rgba(127,29,29,.24), rgba(69,10,10,.18)),
    rgba(21,34,52,.92);
  border-color: rgba(248,113,113,.34);
}
body.dark-mode .dashboard-page .business-focus-main strong,
body.dark-mode .dashboard-page .ops-summary-card.is-danger strong,
body.dark-mode .dashboard-page .invoice-health-grid .is-danger strong {
  color: #fca5a5;
}
body.dark-mode .dashboard-page .business-focus-main a {
  background: #ef4444;
  color: #fff;
}
body.dark-mode .dashboard-page .finance-pie {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.10),
    0 22px 44px rgba(0,0,0,.30);
}
body.dark-mode .dashboard-page .finance-pie::after {
  background: #101b2a;
  box-shadow: inset 0 0 0 1px rgba(126,158,195,.18);
}
body.dark-mode .dashboard-page .progress-track,
body.dark-mode .dashboard-page .ops-meter,
body.dark-mode .dashboard-page .monthly-trend-track {
  background: rgba(126,158,195,.20);
}
/* Mi nota: Barras horizontales con muchos elementos necesitan más espacio */
.chart-wrap-hbar { height: 340px; }
.chart-wrap canvas { display: block; }

body.dark-mode .chart-wrap {
  border-radius: 12px;
}

/* Mi nota: Detail two-column layout */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}
.detail-section-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
@media (max-width: 860px) {
  .detail-cols { grid-template-columns: 1fr; }
}

/* Mi nota: Subnav active state */
.subnav a.is-active {
  background: var(--primary-lt);
  color: var(--primary-dark);
  border-color: rgba(31,79,148,.3);
}

/* Mi nota: Currency toggle */
.currency-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 2px;
  gap: 2px;
}

body.dark-mode .currency-toggle {
  background: rgba(10,20,32,.88);
  border-color: rgba(126,158,195,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 24px rgba(0,0,0,.16);
}
.ct-btn {
  border: none;
  background: transparent;
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  text-align: center;
}
.ct-btn:hover { color: var(--text); }
.ct-btn.ct-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31,79,148,.28);
}

body.dark-mode .ct-btn {
  color: #93a9c2;
}

body.dark-mode .ct-btn:hover {
  color: #edf4ff;
}

body.dark-mode .ct-btn.ct-active {
  background: linear-gradient(135deg, #6ea3ef, #2f6fbd);
  color: #fff;
  box-shadow: 0 8px 18px rgba(45,111,189,.28);
}

/* Mi nota: Payment summary bar */
.payment-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ps-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ps-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); cursor: pointer; }
.ps-card--active { outline: 2px solid currentColor; outline-offset: -2px; opacity: 1; }
.ps-card--ps-pagado.ps-card--active    { outline-color: var(--success); background: #f0fdf4; }
.ps-card--ps-parcial.ps-card--active   { outline-color: var(--warning); background: #fffbeb; }
.ps-card--ps-pendiente.ps-card--active { outline-color: var(--danger);  background: #fef2f2; }
.ps-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800;
  flex-shrink: 0;
}
.ps-card--ps-pagado   { border-left: 3px solid var(--success); }
.ps-card--ps-parcial  { border-left: 3px solid var(--warning); }
.ps-card--ps-pendiente{ border-left: 3px solid var(--danger); }
.ps-card--ps-pagado   .ps-icon { background: #f0fdf4; color: var(--success); }
.ps-card--ps-parcial  .ps-icon { background: #fffbeb; color: var(--warning); }
.ps-card--ps-pendiente .ps-icon{ background: #fef2f2; color: var(--danger); }
.ps-body { display: flex; flex-direction: column; gap: 2px; }
.ps-label { font-size: 13px; font-weight: 700; }
.ps-count { font-size: 12px; color: var(--muted); }
.ps-amount { font-size: 17px; font-weight: 700; margin-top: 4px; }
.ps-debt { font-size: 12px; color: var(--danger); }

@media (max-width: 900px) {
  .payment-summary-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .payment-summary-bar { grid-template-columns: 1fr; }
}

/* Mi nota: Login (full-screen) */
body.page-guest {
  background: linear-gradient(145deg, #0d2d6e 0%, #1546a0 45%, #0d3d8a 100%);
  background-attachment: fixed;
}
body.page-guest .topbar-guest,
body.page-guest .flash-stack-guest { display: none; }
body.page-guest .content-guest {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-center {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 42px 40px 38px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  text-align: center;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1546a0 0%, #0d2d6e 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(13,45,110,.35);
}
.login-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #0e1726;
  letter-spacing: -0.02em;
}
.login-subtitle {
  margin: 0;
  color: #60748c;
  font-size: 13.5px;
  line-height: 1.5;
}
.login-divider {
  border: none;
  border-top: 2px solid #1546a0;
  width: 36px;
  margin: 16px auto 20px;
  border-radius: 99px;
}
.login-alert {
  position: relative;
  text-align: left;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.5;
  border: 1px solid;
}
.login-alert-warning { background: #fff9ed; color: #92400e; border-color: #f8ddb0; }
.login-alert-error,
.login-alert-danger  { background: #fff4f4; color: #991b1b; border-color: #f7c7c7; }
.login-alert-success { background: #f3fbf6; color: #14532d; border-color: #ccead5; }
.login-form { display: grid; gap: 14px; margin-top: 4px; }
.login-field {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: #8aa0bc;
  pointer-events: none;
  line-height: 1;
}
.login-input {
  width: 100%;
  padding: 13px 44px 13px 40px;
  border-radius: 10px;
  border: 1.5px solid #dce5f0;
  background: #f4f7fb;
  font-size: 14px;
  color: #0e1726;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.login-input::placeholder { color: #a0b0c4; }
.login-input:focus {
  border-color: #1546a0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,70,160,.12);
}
.login-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #8aa0bc;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}
.login-eye:hover { color: #1546a0; }
.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #1a56c4 0%, #0d2d6e 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13,45,110,.30);
  transition: opacity .18s, transform .15s, box-shadow .18s;
}
.login-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(13,45,110,.38);
}
.login-btn:active { transform: translateY(0); opacity: 1; }

/* Mi nota: Sales status */
.status-page { display: grid; gap: 14px; margin-bottom: 16px; }
.status-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 18px; align-items: center;
  background: radial-gradient(circle at top left, rgba(31,79,148,.08), transparent 34%), linear-gradient(180deg, #fff 0%, #f7fafd 100%);
}
.status-hero-kicker { margin: 0 0 6px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.status-hero-copy h2 { margin-bottom: 6px; }
.status-hero-copy p:last-child { margin: 0; }
.status-hero-actions { display: grid; justify-items: end; gap: 12px; }
.status-filters-panel { background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,251,255,.98) 100%); }
.status-filters-header { margin-bottom: 14px; }
.status-filters-header p { margin: 0; }
.status-filter-form { display: grid; gap: 14px; }
.status-filter-grid-top {
  display: grid; gap: 12px;
  grid-template-columns: minmax(200px,1.4fr) minmax(180px,1fr) minmax(180px,1fr) repeat(2, minmax(140px,.9fr)) repeat(3, minmax(100px,.65fr));
  align-items: end;
}
.status-chip-sections { display: grid; gap: 12px; }
.status-chip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.status-filter-footer { display: grid; grid-template-columns: minmax(260px,1fr) auto; gap: 14px; align-items: end; }
.status-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

/* Mi nota: Filter chips */
.filter-chip-group {
  display: grid; gap: 8px; min-width: 0; padding: 12px 14px 14px;
  border: 1px solid rgba(31,79,148,.08); border-radius: var(--radius);
  background: radial-gradient(circle at top left, rgba(31,79,148,.06), transparent 42%), linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.filter-chip-group-wide { width: 100%; }
.filter-chip-label { color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.filter-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.9); color: #506176; cursor: pointer;
  font-weight: 600; font-size: 13px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.filter-chip:hover { transform: translateY(-1px); border-color: rgba(31,79,148,.35); background: #eef5ff; box-shadow: 0 8px 16px rgba(31,79,148,.10); }
.filter-chip input {
  appearance: none; width: 16px; height: 16px; margin: 0;
  border: 1.5px solid #b8c6d8; border-radius: 5px; background: #fff;
  display: inline-grid; place-items: center;
}
.filter-chip input::after { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #fff; transform: scale(0); transition: transform .14s ease; }
.filter-chip input:checked { border-color: var(--primary); background: linear-gradient(135deg, #2f6fbd 0%, #1f4f94 100%); box-shadow: 0 4px 10px rgba(31,79,148,.22); }
.filter-chip input:checked::after { transform: scale(1); }
.filter-chip.is-selected { border-color: rgba(31,79,148,.30); background: linear-gradient(180deg, #eef5ff 0%, #e8f1fb 100%); color: var(--primary-dark); box-shadow: 0 10px 22px rgba(31,79,148,.12); }

/* Filter collapsible (details/summary) */
.filter-collapsible { display: block; }
.filter-collapsible > summary {
  list-style: none; cursor: pointer; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(31,79,148,.08); margin-bottom: 16px;
  user-select: none;
}
.filter-collapsible > summary::-webkit-details-marker { display: none; }
.filter-collapsible > summary h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.filter-collapsible > summary p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.filter-summary-left { flex: 1; min-width: 0; }
.filter-toggle-icon {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 4px;
  color: var(--primary); transition: transform .22s ease;
}
.filter-collapsible:not([open]) > summary .filter-toggle-icon { transform: rotate(-90deg); }
.filter-collapsible[open] > *:not(summary) { animation: filterReveal .18s ease; }
@keyframes filterReveal {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Active filter count badge */
.filter-active-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  vertical-align: middle;
}

/* Group category accent borders */
.filter-chip-group[data-group="entrega"]  { border-left: 3px solid #3b82f6; padding-left: 13px; }
.filter-chip-group[data-group="semaforo"] { border-left: 3px solid #8b5cf6; padding-left: 13px; }
.filter-chip-group[data-group="factura"]  { border-left: 3px solid #6366f1; padding-left: 13px; }
.filter-chip-group[data-group="pago"]     { border-left: 3px solid #14b8a6; padding-left: 13px; }
.filter-chip-group[data-group="tipo_rp"]  { border-left: 3px solid #64748b; padding-left: 13px; }

/* Semáforo color dots */
.chip-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.chip-dot--verde    { background: #22c55e; }
.chip-dot--amarillo { background: #eab308; }
.chip-dot--rojo     { background: #ef4444; }
.chip-dot--gris     { background: #94a3b8; }

/* Pago chips — color semántico al seleccionar */
.filter-chip[data-pago="pagado"].is-selected      { border-color: rgba(22,163,74,.4);  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%); color: #166534; }
.filter-chip[data-pago="pago parcial"].is-selected { border-color: rgba(217,119,6,.4); background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); color: #92400e; }
.filter-chip[data-pago="pendiente"].is-selected   { border-color: rgba(220,38,38,.35); background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%); color: #991b1b; }

/* Mi nota: Invoice / payment detail */
.payment-list { display: flex; flex-direction: column; gap: 4px; }
.payment-row {
  display: flex; gap: 10px; align-items: center;
  padding: 4px 8px; border-radius: 6px;
  background: #f0fdf9; font-size: 13px;
}
.payment-date { color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.payment-amount { color: var(--text); }
.invoices-table td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }

/* Mi nota: Table totals */
.table-total-row td {
  border-top: 2px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.table-total-row td:last-child { color: var(--primary); }

.cobranza-action-buttons {
  margin-left: auto;
}

/* Mi nota: Integration result */
.integration-result { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.integration-result.ok    { background: #f0fdf4; color: var(--success); }
.integration-result.error { background: #fef2f2; color: var(--danger); }
.link-strong { color: var(--primary); font-weight: 700; }

/* Mi nota: Responsive */
@media (max-width: 1100px) {
  .analytics-grid,
  .status-hero, .status-chip-row,
  .status-filter-footer { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-pie-card { grid-template-columns: 1fr; }
  .business-focus { grid-template-columns: 1fr; }
  .dashboard-page .invoice-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-filter-form { gap: 10px; }
  .status-filter-grid-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-hero-actions { justify-items: stretch; }
  .status-filter-actions { justify-content: flex-start; }
  .login-card { max-width: 100%; }
}

/* Mi nota: Tablet grande (iPad landscape) */
@media (max-width: 860px) {
  .status-hero-actions { grid-template-columns: 1fr; }
  .codet360-advice { grid-template-columns: 1fr; }
  .codet360-chart-zone-grid { grid-template-columns: 1fr; }
  .codet360-kpi-chips { grid-template-columns: repeat(2, 1fr); }
}

/* Mi nota: Tablet intermedio */
@media (max-width: 768px) {
  .dashboard-filter-head {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-pdf-link {
    align-self: stretch;
  }
  .dashboard-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-filter-actions {
    grid-column: 1 / -1;
  }
  .dashboard-filter-actions .button {
    flex: 1 1 auto;
  }
  .status-filter-grid-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-2fa-header,
  .profile-2fa-active {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-2fa-apps,
  .profile-2fa-steps,
  .profile-2fa-qr-card,
  .profile-2fa-confirm,
  .profile-2fa-disable {
    grid-template-columns: 1fr;
  }
  .profile-2fa-qr-box {
    margin: 0 auto;
  }
  .profile-2fa-generate,
  .profile-2fa-confirm .button,
  .profile-2fa-disable .button {
    width: 100%;
    justify-content: center;
  }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px; }
  .panel { padding: 16px 16px; }
  .chart-wrap-lg  { height: 260px; }
  .chart-wrap-hbar{ height: 300px; }
  .chart-wrap-md  { height: 220px; }
  .filter-chip-group { padding: 10px 11px 12px; }
  .filter-chip { font-size: 12px; padding: 6px 10px; min-height: 32px; }
  .cobranza-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .cobranza-action-bar,
  .cobranza-analysis-toolbar {
    align-items: stretch !important;
  }
  .cobranza-sync-info,
  .cobranza-action-buttons,
  .cobranza-analysis-filter {
    width: 100%;
  }
  .cobranza-action-buttons,
  .cobranza-analysis-filter {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch !important;
  }
  .cobranza-action-buttons .button,
  .cobranza-action-buttons form,
  .cobranza-action-buttons form .button,
  .cobranza-analysis-filter .button,
  .cobranza-analysis-filter a {
    width: 100%;
    justify-content: center;
  }
  .cobranza-filter-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end !important;
  }
  .cobranza-filter-form > div {
    min-width: 0 !important;
    width: 100%;
  }
  .cobranza-filter-form input,
  .cobranza-filter-form select,
  .cobranza-filter-form button,
  .cobranza-filter-form a,
  .cobranza-analysis-filter select,
  .cobranza-analysis-filter button,
  .cobranza-analysis-filter a {
    width: 100%;
    max-width: none !important;
  }
  .cobranza-analysis-main-grid,
  .cobranza-analysis-split-grid {
    grid-template-columns: 1fr !important;
  }
  .cobranza-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.sidebar-mobile-actions { display: none; }

/* Mi nota: Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .22s ease, opacity .22s ease, width .22s ease;
}
.hamburger span:nth-child(1) { width: 22px; }
.hamburger span:nth-child(2) { width: 16px; }
.hamburger span:nth-child(3) { width: 22px; }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 22px; }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 22px; }

/* Mi nota: Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-open { display: block; z-index: 299; }

@media (max-width: 960px) {
  .app-shell-auth {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: min(82vw, 300px);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
    overflow-y: auto;
    padding: 18px 12px;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar { display: flex; flex-direction: column; }
  .main-auth { width: 100%; padding-top: 54px; }
  .topbar-auth { left: 0; }
  .hamburger { display: flex; }
  .login-card { padding: 30px 22px; }
  .sidebar-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 14px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .sidebar-mobile-actions .currency-toggle {
    width: 100%;
    background: rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.2);
  }
  .sidebar-mobile-actions .ct-btn {
    color: rgba(255,255,255,.75);
    font-size: 12px;
    flex: 1;
    padding: 5px 0;
  }
  .sidebar-mobile-actions .ct-btn.ct-active {
    background: var(--primary);
    color: #fff;
  }
  .sidebar-mobile-actions .button-secondary {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.75);
    font-size: 13px;
  }
  .sidebar-mobile-actions .button-secondary:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
  }
  .sidebar-dark-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-family: inherit;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
  }
  .sidebar-dark-toggle:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.22);
    color: #fff;
  }
  .sdt-left {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .sdt-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255,255,255,.12);
    flex-shrink: 0;
    transition: background .2s;
  }
  .sidebar-dark-toggle:hover .sdt-icon-wrap {
    background: rgba(255,255,255,.2);
  }
  .sdt-label {
    font-weight: 500;
    letter-spacing: .01em;
  }
  /* Mi nota: iOS-style switch */
  .sdt-switch {
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.15);
    position: relative;
    flex-shrink: 0;
    transition: background .25s, border-color .25s;
  }
  .sdt-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    transition: transform .25s cubic-bezier(.4,0,.2,1), background .25s;
  }
  /* Mi nota: Active (dark mode ON) state */
  .dark-mode .sdt-switch {
    background: var(--primary);
    border-color: var(--primary-dark);
  }
  .dark-mode .sdt-thumb {
    transform: translateX(16px);
    background: #fff;
  }
  .dark-mode .sdt-icon-wrap {
    background: rgba(255,255,255,.15);
  }
  .sidebar .brand {
    padding-inline: 6px;
  }
  .sidebar .nav {
    gap: 4px;
    margin-top: 20px;
  }
  .sidebar .nav a,
  .sidebar .nav-group-label {
    min-height: 42px;
    padding: 10px 10px;
    font-size: 13.5px;
    line-height: 1.25;
  }
  .sidebar .nav-group-label span:first-child {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sidebar .nav-submenu {
    margin: 5px 0 5px 8px;
    padding-left: 8px;
    gap: 4px;
  }
  .sidebar .nav-submenu a {
    min-height: 38px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 640px) {
  .topbar { height: 54px; padding: 0 14px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar .eyebrow { display: none; }
  .topbar-actions > *:not(.user-menu) { display: none; }
  .user-menu-name { display: none; }
  .user-menu-caret { display: none; }
  .user-menu-trigger { padding: 4px; border-radius: 50%; border: none; background: none; box-shadow: none; }
  .content { padding: 12px 12px; }
  .panel { padding: 14px 12px; }
  .analytics-grid, .cards-grid, .inventory-metric-grid { grid-template-columns: 1fr; }
  .status-filter-grid-top { grid-template-columns: 1fr; }
  .chart-wrap-lg  { height: 200px; }
  .chart-wrap-hbar{ height: 280px; }
  .chart-wrap-md  { height: 180px; }
  .chart-wrap-sm  { height: 150px; }
  .dashboard-page { gap: 12px; }
  .dashboard-filter-panel { padding: 14px 12px; }
  .dashboard-filter-form {
    grid-template-columns: 1fr;
  }
  .dashboard-filter-actions {
    width: 100%;
  }
  .dashboard-pdf-link {
    width: 100%;
  }
  .dashboard-page .filter-grid { grid-template-columns: 1fr; }
  .dashboard-page .filter-actions,
  .dashboard-page .quick-actions { width: 100%; }
  .dashboard-page .filter-actions .button,
  .dashboard-page .quick-actions a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .dashboard-page .section-heading { align-items: stretch; }
  .dashboard-page .cards-grid { gap: 10px; }
  .dashboard-page .card.metric-card { padding: 16px; }
  .dashboard-page .ops-summary-hero,
  .dashboard-page .business-focus-main { padding: 16px; }
  .dashboard-page .business-focus-main a {
    align-self: stretch;
    text-align: center;
  }
  .dashboard-page .traffic-link { min-width: 44px; }
  .dashboard-page .invoice-health-grid > div,
  .dashboard-page .monthly-trend-row,
  .dashboard-page .finance-pie-item,
  .dashboard-page .business-focus-item { padding: 12px; }
  .finance-pie-card { gap: 16px; }
  .finance-pie { width: min(250px, 100%); }
  .finance-pie-center strong { font-size: 28px; }
  .business-focus { min-height: 0; }
  .business-focus-main { padding: 18px; }
  .business-focus-item { grid-template-columns: 1fr; grid-template-areas: "label" "value" "sub"; }
  .monthly-trend-row {
    grid-template-columns: 1fr;
    gap: 7px;
    min-height: 0;
  }
  .monthly-trend-values {
    text-align: left;
  }
  .monthly-trend-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .invoice-health-head {
    flex-direction: column;
  }
  .invoice-health-grid {
    grid-template-columns: 1fr;
  }
  .ops-summary-grid {
    grid-template-columns: 1fr;
  }
  .data-list div { grid-template-columns: 1fr; }
  .content-guest { padding: 20px; }
  .login-card { padding: 26px 18px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .metric-card strong { font-size: 22px; }
  .sidebar {
    width: min(88vw, 320px);
  }
  .sidebar .nav a,
  .sidebar .nav-group-label {
    min-height: 44px;
    font-size: 14px;
  }
  .sidebar .nav-submenu a {
    min-height: 40px;
    font-size: 13.5px;
  }
  .cobranza-kpis,
  .cobranza-filter-form,
  .cobranza-action-buttons,
  .cobranza-analysis-filter,
  .cobranza-week-grid {
    grid-template-columns: 1fr !important;
  }
  .cobranza-sync-info {
    gap: 8px !important;
  }
  .cobranza-action-bar,
  .cobranza-analysis-toolbar {
    gap: 10px !important;
  }
  .cobranza-table-panel {
    padding-inline: 0 !important;
  }
  .cobranza-table-panel > :not(div[style*="overflow-x"]) {
    margin-inline: 12px;
  }
  .cobranza-table-panel div[style*="overflow-x"] {
    padding-inline: 12px;
  }
  .cobros-table-wrap {
    overflow: visible !important;
    padding-inline: 12px !important;
  }
  .cobros-mobile-table,
  .cobros-mobile-table thead,
  .cobros-mobile-table tbody,
  .cobros-mobile-table tfoot,
  .cobros-mobile-table tr,
  .cobros-mobile-table td {
    display: block !important;
    width: 100% !important;
  }
  .cobros-mobile-table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    min-width: 0 !important;
  }
  .cobros-mobile-table thead {
    display: none !important;
  }
  .cobros-mobile-table tbody tr {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden !important;
    padding: 10px 12px !important;
  }
  .cobros-mobile-table tbody td {
    display: grid !important;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 8px 0 !important;
    max-width: none !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: right !important;
    white-space: normal !important;
  }
  .cobros-mobile-table tbody td:last-child {
    border-bottom: 0 !important;
  }
  .cobros-mobile-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
  }
  .cobros-mobile-table tbody td:first-child {
    display: block !important;
    padding-bottom: 10px !important;
    text-align: left !important;
  }
  .cobros-mobile-table tbody td:first-child::before {
    display: block;
    margin-bottom: 4px;
  }
  .cobros-mobile-table tbody td span,
  .cobros-mobile-table tbody td a,
  .cobros-mobile-table tbody td strong {
    min-width: 0;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-overflow: clip !important;
  }
  .cobros-mobile-table tfoot {
    display: none !important;
  }
  .inventory-table-wrap {
    overflow: visible !important;
  }
  .inventory-mobile-table,
  .inventory-mobile-table thead,
  .inventory-mobile-table tbody,
  .inventory-mobile-table tr,
  .inventory-mobile-table td {
    display: block !important;
    width: 100% !important;
  }
  .inventory-mobile-table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    min-width: 0 !important;
  }
  .inventory-mobile-table thead {
    display: none !important;
  }
  .inventory-mobile-table tbody tr {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden !important;
    padding: 10px 12px !important;
  }
  .inventory-mobile-table tbody td {
    display: grid !important;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 8px 0 !important;
    max-width: none !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: right !important;
    white-space: normal !important;
  }
  .inventory-mobile-table tbody td:last-child {
    border-bottom: 0 !important;
  }
  .inventory-mobile-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
  }
  .inventory-mobile-table tbody td:nth-child(1),
  .inventory-mobile-table tbody td:nth-child(2),
  .inventory-mobile-table tbody td:nth-child(3) {
    text-align: left !important;
  }
  .inventory-mobile-table tbody td span,
  .inventory-mobile-table tbody td a,
  .inventory-mobile-table tbody td strong,
  .inventory-mobile-table tbody td small {
    min-width: 0;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-overflow: clip !important;
  }
  .cobranza-chart-wrap-lg { height: 220px !important; }
  .cobranza-chart-wrap-md { height: 210px !important; }
  .cobranza-chart-wrap-sm { height: 190px !important; }
  .cobranza-chart-wrap-hbar { height: 340px !important; }
}

/* Mi nota: Simple login override */
body.page-guest {
  background: linear-gradient(135deg, #0b4b96 0%, #83add7 100%);
  background-attachment: fixed;
}
body.page-guest::before,
body.page-guest::after {
  display: none;
}
body.page-guest .content-guest {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 370px;
  padding: 42px 28px 30px;
  background: #ffffff;
  border: none;
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(14, 23, 38, .16);
  text-align: center;
  display: block;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo-image {
  display: block;
  width: min(220px, 78%);
  height: auto;
  object-fit: contain;
}
.login-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0e2f62;
}
.login-subtitle {
  margin: 0;
  color: #7a8ea8;
  font-size: 13px;
  line-height: 1.55;
}
.login-divider {
  width: 44px;
  margin: 14px auto 22px;
  border: none;
  border-top: 3px solid #2b6ec7;
  border-radius: 999px;
}
.login-alert {
  position: relative;
  text-align: left;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.5;
  border: 1px solid;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid #d1def0;
  border-radius: 999px;
  background: #edf3fb;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-field:focus-within {
  border-color: #2b6ec7;
  background: #f7fbff;
  box-shadow: 0 0 0 3px rgba(43, 110, 199, .12);
}
.login-field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #2b6ec7;
  pointer-events: none;
}
.login-field-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.login-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #173154;
  font-size: 14px;
  padding: 12px 54px 12px 42px;
}
.login-input::placeholder {
  color: #8fa5c0;
}
.login-eye {
  position: absolute;
  right: 14px;
  border: none;
  background: transparent;
  color: #7f95b0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.login-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #0d3f7a 0%, #2d7bd5 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 63, 122, .18);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(13, 63, 122, .22);
  opacity: .96;
}
.login-btn:active {
  transform: translateY(0);
}
@media (max-width: 640px) {
  body.page-guest .content-guest {
    padding: 16px;
  }
  .login-card {
    max-width: 100%;
    padding: 36px 22px 26px;
    border-radius: 24px;
  }
  .login-logo-image {
    width: min(190px, 72%);
  }
}

/* Mi nota: Dark mode: login */
body.dark-mode.page-guest {
  background: linear-gradient(135deg, #061b3a 0%, #1a3a5c 100%);
}
body.dark-mode .login-card {
  background: #1a2535;
  border: 1px solid #253347;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
}
body.dark-mode .login-title {
  color: #cddcef;
}
body.dark-mode .login-subtitle {
  color: #7a90a8;
}
body.dark-mode .login-field {
  background: #0f1923;
  border-color: #253347;
}
body.dark-mode .login-field:focus-within {
  border-color: #2b6ec7;
  background: #111e2e;
  box-shadow: 0 0 0 3px rgba(43, 110, 199, .18);
}
body.dark-mode .login-input {
  color: #e2eaf4 !important;
  background: transparent !important;
}
body.dark-mode .login-input::placeholder {
  color: #4a6078;
}
body.dark-mode .login-eye {
  color: #7a90a8;
}
body.dark-mode .login-eye:hover {
  color: #a0b8d8;
}
body.dark-mode .login-alert-warning { background: #2d1a00; color: #fbbf24; border-color: #78350f; }
body.dark-mode .login-alert-error,
body.dark-mode .login-alert-danger  { background: #2d0a0a; color: #f87171; border-color: #7f1d1d; }
body.dark-mode .login-alert-success { background: #052e16; color: #4ade80; border-color: #14532d; }

/* Mi nota: User menu dropdown */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  padding: 5px 14px 5px 5px;
  color: var(--text);
  font-family: inherit;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .14s;
  box-shadow: 0 1px 4px rgba(14,23,38,.07);
}
.user-menu-trigger:hover {
  background: var(--surface-soft);
  border-color: rgba(31,79,148,.45);
  box-shadow: 0 3px 10px rgba(31,79,148,.14);
  transform: translateY(-1px);
}
.user-menu-trigger.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,79,148,.12);
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.user-menu-caret {
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  color: var(--muted);
  flex-shrink: 0;
}
.user-menu-trigger.is-open .user-menu-caret { transform: rotate(180deg); }

.user-menu-dropdown {
  position: fixed;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.07);
  z-index: 9999;
  overflow: hidden;
  animation: menu-in .16s cubic-bezier(.4,0,.2,1);
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1f4f94 0%, #173b70 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.user-menu-header::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.user-menu-header strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.user-menu-header span   { display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; text-transform: capitalize; }

.user-menu-items { padding: 8px; }

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, color .14s;
  box-sizing: border-box;
}
.user-menu-item svg { color: var(--muted); flex-shrink: 0; }
.user-menu-item:hover { background: var(--surface-soft); }
.user-menu-item:hover svg { color: var(--primary); }
.user-menu-item-danger { color: #dc2626; }
.user-menu-item-danger svg { color: #dc2626; }
.user-menu-item-danger:hover { background: #fef2f2; color: #b91c1c; }
.user-menu-items form { margin: 0; }
.user-menu-divider { height: 1px; background: var(--line); margin: 4px 8px; }
