:root {
  --bg-deep: #040b18;
  --bg-panel: rgba(8, 20, 42, 0.82);
  --bg-card: rgba(12, 28, 58, 0.75);
  --border-glow: rgba(56, 189, 248, 0.35);
  --border-soft: rgba(59, 130, 246, 0.2);
  --text: #e8f4ff;
  --muted: #7da4c7;
  --accent: #3b82f6;
  --accent-bright: #38bdf8;
  --accent-glow: rgba(59, 130, 246, 0.45);
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --font: "Exo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── LOGIN SKYNET WIRELESS (misma referencia que Conecta Portal) ─── */

.login-skynet-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.login-skynet-bg {
  position: fixed;
  inset: 0;
  background: url('/static/img/skynet-futuristic-bg.jpg') center center / cover no-repeat;
  z-index: 0;
}

.login-skynet-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 20, 0.35) 0%, rgba(5, 11, 20, 0.72) 45%, rgba(5, 11, 20, 0.92) 100%);
  z-index: 1;
}

.login-skynet-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-skynet-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-skynet-logo {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(26, 140, 255, 0.45);
}

.login-skynet-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
}

.login-skynet-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  background: linear-gradient(90deg, #38bdf8, #1a8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.login-skynet-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: #e6f0ff;
  margin-top: 2px;
}

.login-skynet-card {
  width: 100%;
  background: rgba(10, 22, 40, 0.82);
  border: 1px solid rgba(26, 140, 255, 0.22);
  border-radius: 18px;
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-skynet-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  text-align: center;
}

.login-skynet-card .subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
  text-align: center;
}

.login-skynet-divider {
  height: 1px;
  background: rgba(26, 140, 255, 0.25);
  margin: 1rem 0 1.25rem;
}

.login-skynet-or {
  width: 100%;
  text-align: center;
  margin: 1.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-skynet-or span {
  position: relative;
  padding: 0 0.75rem;
}

.login-skynet-or span::before,
.login-skynet-or span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 80px;
  height: 1px;
  background: rgba(26, 140, 255, 0.2);
}

.login-skynet-or span::before { right: 100%; }
.login-skynet-or span::after { left: 100%; }

.login-skynet-features {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.login-feature-card {
  text-align: center;
  padding: 1rem 0.65rem;
  background: rgba(10, 22, 40, 0.65);
  border: 1px solid rgba(26, 140, 255, 0.18);
  border-radius: 14px;
}

.login-feature-card strong {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.4rem;
  color: #e6f0ff;
}

.login-feature-card p {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.login-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(26, 140, 255, 0.12);
  border: 1px solid rgba(26, 140, 255, 0.25);
  color: var(--accent-bright);
}

.login-feature-icon svg { width: 20px; height: 20px; }

.login-skynet-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.login-skynet-footer p { margin: 0.2rem 0; }

.login-powered {
  opacity: 0.65;
  font-size: 0.72rem !important;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Brand */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-lockup.compact { padding: 1.25rem 1rem; }

.sidebar-logo {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(26, 140, 255, 0.35);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }

.brand-name.sm-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, #38bdf8, #1a8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #e6f0ff;
  margin-top: 0.1rem;
}

.login-form { display: grid; gap: 1rem; }

.field {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 2.75rem;
  background: rgba(6, 16, 36, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder { color: #4a6a8a; }

.field input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--accent-bright);
  pointer-events: none;
}

.field-icon svg { width: 100%; height: 100%; }

.field-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
}

.field-toggle:hover { color: var(--accent-bright); }
.field-toggle svg { width: 100%; height: 100%; }

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.link-muted {
  color: var(--accent-bright);
  text-decoration: none;
  opacity: 0.85;
}

.link-muted:hover { opacity: 1; text-decoration: underline; }

.btn-login {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: white;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.5);
}

/* ─── APP SHELL (panel interno — tema claro tipo WispHub) ─── */

.app-shell {
  --app-bg: #eef2f7;
  --app-surface: #ffffff;
  --app-border: #e3e8ef;
  --app-text: #2d3748;
  --app-muted: #718096;
  --app-primary: #2c7be5;
  --app-primary-hover: #1a68d1;
  --app-primary-soft: #e8f1fc;
  --app-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --app-shadow-lg: 0 4px 12px rgba(16, 24, 40, 0.08);

  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
}

.app-bg { display: none; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

.app-shell .brand-lockup.compact {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.app-shell .brand-name.sm-text {
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--app-primary);
  letter-spacing: 0.1em;
}

.app-shell .brand-tag {
  color: var(--app-muted);
  letter-spacing: 0.22em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
}

.nav-section-label {
  margin: 0.85rem 0.5rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.nav-section-label:first-child { margin-top: 0.25rem; }

.app-shell .nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  color: var(--app-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.app-shell .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--app-muted); }

.app-shell .nav-item:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.app-shell .nav-item:hover svg { color: var(--app-primary); }

.app-shell .nav-item.active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}

.app-shell .nav-item.active svg { color: var(--app-primary); }

.app-shell .nav-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.app-shell .logout-form {
  margin: 0;
  padding: 0;
}
.app-shell .logout-form .nav-item.logout {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.app-shell .nav-item.logout {
  color: #c53030;
  margin-top: 0.25rem;
}

.app-shell .nav-item.logout:hover {
  background: #fff5f5;
  color: #c53030;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--app-border);
  background: #fafbfc;
}

.app-shell .user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: var(--app-primary-soft);
}

.app-shell .user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--app-primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.app-shell .user-pill strong { display: block; font-size: 0.85rem; color: var(--app-text); }
.app-shell .user-pill small { color: var(--app-muted); font-size: 0.75rem; text-transform: capitalize; }

.app-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.topbar-main { min-width: 0; flex: 1; }

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-primary-soft);
}

.theme-switcher-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-muted);
  padding: 0 0.35rem 0 0.5rem;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--app-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-btn svg { width: 15px; height: 15px; }

.theme-btn:hover {
  color: var(--app-primary);
  background: var(--app-surface);
}

.theme-btn.active {
  color: var(--app-primary);
  background: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
}

.form-hint {
  margin: -0.35rem 0 0;
  font-size: 0.82rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.breadcrumb a {
  color: var(--app-primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-sep { opacity: 0.5; }

.page-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--app-text);
  background: none;
  -webkit-text-fill-color: initial;
}

.container {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Cards & content */
.app-shell .card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--app-shadow);
}

.app-shell .card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--app-text);
}

.app-shell .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--app-border);
}

.app-shell .card-header h1 { margin: 0; }

.stack { display: grid; gap: 1rem; }

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.app-shell label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--app-text);
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  font-family: var(--font);
  border-radius: 8px;
  border: 1px solid var(--app-border);
  padding: 0.7rem 0.85rem;
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.9rem;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.15);
}

.app-shell .btn {
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.15s, transform 0.1s;
}

.app-shell .btn.primary {
  background: var(--app-primary);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
}

.app-shell .btn.primary:hover {
  background: var(--app-primary-hover);
  transform: translateY(-1px);
}

.app-shell .btn.small { padding: 0.35rem 0.65rem; font-size: 0.78rem; border-radius: 6px; }
.app-shell .btn.ok { background: #38a169; color: white; }
.app-shell .btn.ok:hover { background: #2f855a; }
.app-shell .btn.danger { background: #e53e3e; color: white; }
.app-shell .btn.danger:hover { background: #c53030; }

.app-shell .muted { color: var(--app-muted); }

.app-shell .alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.app-shell .alert.error { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.app-shell .alert.ok { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.app-shell .alert.warn { background: #fffaf0; border: 1px solid #fbd38d; color: #975a16; }
.app-shell .alert.info { background: var(--app-primary-soft); border: 1px solid #bee3f8; color: #2b6cb0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-shell .stat {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--app-shadow);
}

.app-shell .stat::before { display: none; }

.app-shell .stat span { display: block; color: var(--app-muted); font-size: 0.82rem; margin-bottom: 0.25rem; }
.app-shell .stat strong { font-size: 1.5rem; font-weight: 700; color: var(--app-primary); }

.app-shell .table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--app-border);
}

.app-shell table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

.app-shell th {
  padding: 0.75rem 0.65rem;
  text-align: left;
  background: #f7fafc;
  color: var(--app-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--app-border);
}

.app-shell td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--app-border);
  vertical-align: top;
  color: var(--app-text);
}

.app-shell tr:hover td { background: #f7fafc; }
.app-shell tr:last-child td { border-bottom: none; }

.app-shell .badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.app-shell .badge.pendiente_revision { background: #fffaf0; color: #975a16; border: 1px solid #fbd38d; }
.app-shell .badge.aprobado { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.app-shell .badge.rechazado { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.app-shell .links a { color: var(--app-primary); margin-right: 0.5rem; text-decoration: none; font-weight: 500; }
.app-shell .links a:hover { text-decoration: underline; }

.coming-soon-panel {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.coming-soon-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  margin-bottom: 1rem;
}

.coming-soon-icon svg { width: 28px; height: 28px; }

.coming-soon-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--app-text);
}

.coming-soon-panel p {
  margin: 0;
  color: var(--app-muted);
  max-width: 420px;
  margin-inline: auto;
  font-size: 0.92rem;
}

.expense-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.expense-chip {
  padding: 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fafbfc;
  text-align: center;
  font-size: 0.82rem;
  color: var(--app-muted);
}

.expense-chip strong {
  display: block;
  color: var(--app-text);
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

/* ─── Tema negro (sidebar oscuro + barra azul Skynet + contenido claro) ─── */

[data-theme="dark"] .app-shell,
.theme-dark.app-shell {
  --app-bg: #ecf0f5;
  --app-surface: #ffffff;
  --app-border: #d2d6de;
  --app-text: #333333;
  --app-muted: #777777;
  --app-primary: #3b82f6;
  --app-primary-hover: #2563eb;
  --app-primary-soft: rgba(59, 130, 246, 0.12);
  --app-accent-bright: #38bdf8;
  --app-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --app-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --app-sidebar-bg: #0a1628;
  --app-sidebar-border: rgba(59, 130, 246, 0.15);
  --app-sidebar-text: #b8c7ce;
  --app-sidebar-muted: #5a7a9a;
  --app-sidebar-hover: rgba(59, 130, 246, 0.1);
  --app-sidebar-active: rgba(59, 130, 246, 0.14);
  --app-topbar-text: #ffffff;
}

[data-theme="dark"] .app-shell .sidebar,
.theme-dark.app-shell .sidebar {
  background: var(--app-sidebar-bg);
  border-right-color: var(--app-sidebar-border);
  box-shadow: none;
}

[data-theme="dark"] .app-shell .brand-lockup.compact,
.theme-dark.app-shell .brand-lockup.compact {
  border-bottom-color: var(--app-sidebar-border);
}

[data-theme="dark"] .app-shell .brand-name.sm-text,
.theme-dark.app-shell .brand-name.sm-text {
  background: linear-gradient(90deg, #38bdf8, #1a8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .app-shell .brand-tag,
.theme-dark.app-shell .brand-tag {
  color: var(--app-sidebar-text);
}

[data-theme="dark"] .nav-section-label,
.theme-dark .nav-section-label {
  color: var(--app-sidebar-muted);
}

[data-theme="dark"] .app-shell .nav-item,
.theme-dark.app-shell .nav-item {
  color: var(--app-sidebar-text);
}

[data-theme="dark"] .app-shell .nav-item svg,
.theme-dark.app-shell .nav-item svg {
  color: var(--app-sidebar-muted);
}

[data-theme="dark"] .app-shell .nav-item:hover,
.theme-dark.app-shell .nav-item:hover {
  background: var(--app-sidebar-hover);
  color: #ffffff;
}

[data-theme="dark"] .app-shell .nav-item:hover svg,
.theme-dark.app-shell .nav-item:hover svg {
  color: #ffffff;
}

[data-theme="dark"] .app-shell .nav-item.active,
.theme-dark.app-shell .nav-item.active {
  background: var(--app-sidebar-active);
  color: #e8f4ff;
  border-left: 3px solid var(--app-accent-bright);
  padding-left: calc(0.8rem - 3px);
}

[data-theme="dark"] .app-shell .nav-item.active svg,
.theme-dark.app-shell .nav-item.active svg {
  color: var(--app-accent-bright);
}

[data-theme="dark"] .sidebar-footer,
.theme-dark .sidebar-footer {
  background: #061428;
  border-top-color: var(--app-sidebar-border);
}

[data-theme="dark"] .app-shell .user-pill,
.theme-dark.app-shell .user-pill {
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .app-shell .user-pill strong,
.theme-dark.app-shell .user-pill strong {
  color: #ffffff;
}

[data-theme="dark"] .app-shell .user-pill small,
.theme-dark.app-shell .user-pill small {
  color: var(--app-sidebar-text);
}

[data-theme="dark"] .app-shell .user-avatar,
.theme-dark.app-shell .user-avatar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

[data-theme="dark"] .app-shell .nav-item.logout,
.theme-dark.app-shell .nav-item.logout {
  color: #f56954;
}

[data-theme="dark"] .app-shell .nav-item.logout:hover,
.theme-dark.app-shell .nav-item.logout:hover {
  background: rgba(245, 105, 84, 0.12);
  color: #f56954;
}

[data-theme="dark"] .topbar,
.theme-dark .topbar {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .breadcrumb,
.theme-dark .breadcrumb {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .breadcrumb a,
.theme-dark .breadcrumb a {
  color: #ffffff;
}

[data-theme="dark"] .app-shell .page-title,
.theme-dark.app-shell .page-title {
  color: var(--app-topbar-text);
}

[data-theme="dark"] .theme-switcher,
.theme-dark .theme-switcher {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .theme-switcher-label,
.theme-dark .theme-switcher-label {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .theme-btn,
.theme-dark .theme-btn {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .theme-btn:hover,
.theme-dark .theme-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .theme-btn.active,
.theme-dark .theme-btn.active {
  color: #2563eb;
  background: #ffffff;
  border-color: #ffffff;
}

[data-theme="dark"] .app-shell input:focus,
[data-theme="dark"] .app-shell select:focus,
[data-theme="dark"] .app-shell textarea:focus,
.theme-dark.app-shell input:focus,
.theme-dark.app-shell select:focus,
.theme-dark.app-shell textarea:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .app-shell .stat strong,
.theme-dark.app-shell .stat strong {
  color: var(--app-primary);
}

[data-theme="dark"] .app-shell th,
.theme-dark.app-shell th {
  background: #f9f9f9;
  color: var(--app-muted);
}

[data-theme="dark"] .app-shell tr:hover td,
.theme-dark.app-shell tr:hover td {
  background: #f5f5f5;
}

[data-theme="dark"] .app-shell .links a,
.theme-dark.app-shell .links a {
  color: var(--app-primary);
}

/* Configuración operativa */
.config-guide { margin-bottom: 1rem; }
.config-guide h1 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.guide-steps {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
  line-height: 1.55;
}
.guide-steps li { margin-bottom: 0.45rem; }
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.config-grid .card h2 { font-size: 1rem; margin-bottom: 0.35rem; }
.config-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 10rem;
  overflow-y: auto;
}
.config-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.9rem;
}
.compact-form { margin-top: 0.5rem; }
.compact-form label { font-size: 0.85rem; }
.compact-form .btn { align-self: flex-start; }
.config-edit { position: relative; display: inline-block; }
.config-edit summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}
.config-edit summary::-webkit-details-marker { display: none; }
.config-edit[open] summary { margin-bottom: 0.5rem; }
.config-edit form {
  position: absolute;
  right: 0;
  z-index: 5;
  min-width: 14rem;
  padding: 0.75rem;
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.config-edit.wide form { min-width: 18rem; }
.inline-form { display: inline; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }
.row-inactive td { opacity: 0.65; }

@media (max-width: 900px) {
  .config-grid { grid-template-columns: 1fr; }
}

/* Guías y ejemplos para técnicos */
.tecnico-help {
  margin-bottom: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface, #fff);
  overflow: hidden;
}
.tecnico-help summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}
.tecnico-help summary::-webkit-details-marker { display: none; }
.tecnico-help[open] summary { border-bottom: 1px solid var(--app-border); }
.ejemplo-box { padding: 0.85rem 1rem; font-size: 0.85rem; line-height: 1.5; }
.ejemplo-box h3 { font-size: 0.88rem; margin: 0.75rem 0 0.35rem; }
.ejemplo-box h3:first-child { margin-top: 0; }
.ejemplo-tabla { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.82rem; }
.ejemplo-tabla th {
  text-align: left;
  vertical-align: top;
  width: 7.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  color: var(--app-muted);
  font-weight: 600;
}
.ejemplo-tabla td { padding: 0.35rem 0; }
.ejemplo-tabla code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.ejemplo-nota {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-left: 3px solid var(--app-primary);
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
}
.ejemplo-lista {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
}
.ejemplo-lista li { margin-bottom: 0.3rem; }
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--app-muted);
  font-weight: 400;
  margin: 0.15rem 0 0.35rem;
  line-height: 1.35;
}
.admin-help { margin-top: 0.75rem; }
.config-full { grid-column: 1 / -1; }

/* Botón y modal de guía (técnicos) */
.guia-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface, #fff);
}
.guia-bar .muted { margin: 0; font-size: 0.85rem; }
.guia-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  border: 1px solid rgba(44, 123, 229, 0.25);
  white-space: nowrap;
}
.guia-open-btn .guia-icon { width: 1rem; height: 1rem; }
.guia-modal {
  border: none;
  padding: 0;
  max-width: min(32rem, calc(100vw - 1.5rem));
  width: 100%;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}
.guia-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.guia-modal-panel {
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
}
.guia-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-primary-soft);
}
.guia-modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-primary);
}
.guia-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  color: var(--app-muted);
  border-radius: 6px;
}
.guia-modal-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--app-text); }
.guia-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.guia-modal-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface, #fff);
}
.theme-dark .guia-modal-close:hover { background: rgba(255, 255, 255, 0.08); }
.theme-dark .ejemplo-tabla code { background: rgba(255, 255, 255, 0.08); }
.theme-dark .ejemplo-nota { background: rgba(255, 255, 255, 0.04); }

/* Tarjetas corporativas */
.tarjeta-panel { margin-bottom: 1rem; }
.tarjeta-visual {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #475569 100%);
  color: #f8fafc;
  margin-bottom: 1rem;
}
.tarjeta-visual strong { font-size: 1.1rem; }
.tarjeta-digits { margin-left: 0.5rem; opacity: 0.85; font-size: 0.9rem; }
.tarjeta-visual .muted { color: rgba(248, 250, 252, 0.75) !important; }
.tarjeta-uso { margin: 0.35rem 0 0; font-size: 0.82rem; opacity: 0.9; }
.tarjeta-ciclos { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .tarjeta-ciclos { grid-template-columns: 1fr 1fr; } }
.ciclo-box {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: #fafbfc;
}
.ciclo-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; font-size: 0.88rem; font-weight: 600; }
.ciclo-total { margin: 0.5rem 0 0; font-size: 1.05rem; }
.ciclo-pago { margin: 0.25rem 0; font-size: 0.85rem; }
.gasto-lista { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.82rem; }
.gasto-lista li {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; justify-content: space-between;
  padding: 0.35rem 0; border-top: 1px solid var(--app-border);
}
.tarjeta-fields[hidden] { display: none !important; }
.tarjeta-ciclos-admin .ciclo-box { background: var(--app-surface, #fff); }

/* Técnico móvil + GPS */
.geo-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-primary-soft);
  margin-bottom: 0.25rem;
}
.geo-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--app-primary);
  flex-shrink: 0;
}
.geo-card-icon svg { width: 100%; height: 100%; }
.geo-card-body { flex: 1; min-width: 0; }
.geo-card-body strong { display: block; margin-bottom: 0.2rem; font-size: 0.92rem; }
.geo-card-body p { margin: 0 0 0.5rem; font-size: 0.82rem; line-height: 1.4; }
.geo-coords { font-family: ui-monospace, monospace; font-size: 0.78rem !important; }
.geo-card.geo-pending { border-color: #bee3f8; background: #ebf8ff; }
.geo-card.geo-ok { border-color: #9ae6b4; background: #f0fff4; }
.geo-card.geo-warn, .geo-card.geo-error { border-color: #fbd38d; background: #fffaf0; }

.tecnico-form label { font-size: 0.95rem; }
.tecnico-form input, .tecnico-form select, .tecnico-form textarea {
  font-size: 1rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
}
.tecnico-form input[type="file"] { min-height: auto; padding: 0.5rem 0; }
.btn-block { width: 100%; justify-content: center; min-height: 3rem; font-size: 1rem; }
.form-submit-bar { margin-top: 0.5rem; padding-top: 0.25rem; }

@media (max-width: 768px) {
  .tecnico-mobile.app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .tecnico-mobile .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    border-right: none;
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tecnico-mobile .brand-lockup.compact,
  .tecnico-mobile .sidebar-footer .user-pill,
  .tecnico-mobile .nav-section-label,
  .tecnico-mobile .sidebar-footer .logout span,
  .tecnico-mobile .topbar .breadcrumb,
  .tecnico-mobile .page-title { display: none; }
  .tecnico-mobile .sidebar-nav {
    flex-direction: row;
    flex: 1;
    justify-content: space-around;
    padding: 0.35rem 0.25rem;
    gap: 0;
  }
  .tecnico-mobile .nav-item {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.45rem 0.5rem;
    font-size: 0.72rem;
    text-align: center;
    min-width: 4.5rem;
  }
  .tecnico-mobile .nav-item svg { width: 1.35rem; height: 1.35rem; }
  .tecnico-mobile .sidebar-footer {
    border: none;
    padding: 0.35rem;
    width: auto;
    flex-shrink: 0;
  }
  .tecnico-mobile .sidebar-footer .logout {
    flex-direction: column;
    font-size: 0.72rem;
    padding: 0.45rem;
  }
  .tecnico-mobile .app-main { padding-bottom: 5.5rem; }
  .tecnico-mobile .container { padding: 0.85rem; }
  .tecnico-mobile .topbar {
    padding: 0.65rem 0.85rem;
    min-height: auto;
  }
  .tecnico-mobile .form-submit-bar {
    position: sticky;
    bottom: 5.25rem;
    background: linear-gradient(transparent, var(--app-bg) 25%);
    padding: 0.75rem 0 0.25rem;
    z-index: 5;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--app-border);
  }
  .brand-lockup.compact { flex: 1; border-bottom: none; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    order: 3;
  }
  .nav-section-label { display: none; }
  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    order: 4;
  }
  .user-pill { margin: 0; flex: 1; }
  .topbar { flex-direction: column; }
  .theme-switcher { width: 100%; justify-content: flex-end; }
  .login-skynet-title { font-size: 1.85rem; }
  .login-skynet-features { grid-template-columns: 1fr; }
}

/* ─── WispHub-style content (barra verde, KPIs, paneles) ─── */

.wh-page-header {
  background: linear-gradient(135deg, #00a65a 0%, #008d4c 55%, #006837 100%);
  color: #fff;
  margin: -1.25rem -1.25rem 1.25rem;
  padding: 1.1rem 1.35rem;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 8px rgba(0, 104, 55, 0.25);
}

.wh-page-header-inner { display: flex; align-items: flex-start; gap: 0.75rem; }

.wh-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.wh-page-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  opacity: 0.92;
}

.wh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.wh-kpi-card {
  display: block;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 4px solid #00a65a;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--app-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wh-kpi-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-lg);
}

.wh-kpi-ok { border-left-color: #00a65a; }
.wh-kpi-warn { border-left-color: #f39c12; }
.wh-kpi-danger { border-left-color: #dd4b39; }

.wh-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.wh-kpi-label {
  display: block;
  font-size: 0.78rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.wh-kpi-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--app-text);
  margin-top: 0.2rem;
}

.wh-kpi-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.wh-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.wh-panel-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-border);
  background: #f9fafb;
}

.wh-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
}

.wh-panel-head .muted { margin: 0.2rem 0 0; font-size: 0.82rem; }

.wh-panel-body { padding: 0.85rem 1rem; }

.wh-panel-foot { margin: 0.75rem 0 0; font-size: 0.85rem; }

.wh-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.wh-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.wh-quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--app-text);
  font-size: 0.86rem;
  font-weight: 600;
  background: #fafbfc;
  transition: background 0.15s, border-color 0.15s;
}

.wh-quick-link svg { width: 18px; height: 18px; color: #00a65a; flex-shrink: 0; }

.wh-quick-link:hover {
  background: rgba(0, 166, 90, 0.08);
  border-color: rgba(0, 166, 90, 0.35);
  color: #008d4c;
}

.wh-quick-external { border-style: dashed; }

.wh-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dd4b39;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: auto;
}

.wh-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.wh-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.wh-search svg { width: 16px; height: 16px; color: var(--app-muted); }

.wh-search input {
  flex: 1;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
}

.wh-toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }

.wh-btn-export {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #00a65a !important;
  color: #fff !important;
  border-color: #008d4c !important;
}

.wh-btn-export svg { width: 14px; height: 14px; }

.wh-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.wh-filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-muted);
}

.wh-filter-bar input[type="date"] {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  font: inherit;
}

.wh-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.wh-bar-chart { display: flex; flex-direction: column; gap: 0.65rem; }

.wh-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.2fr) 2fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
}

.wh-bar-label { font-weight: 600; color: var(--app-text); }

.wh-bar-track {
  height: 10px;
  background: #ecf0f5;
  border-radius: 999px;
  overflow: hidden;
}

.wh-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00a65a, #3c8dbc);
  border-radius: 999px;
  min-width: 2%;
}

.wh-bar-value { font-weight: 700; color: var(--app-text); white-space: nowrap; }

.wh-table-compact { font-size: 0.84rem; }

.wh-coming-soon { max-width: 560px; margin: 0 auto; }

.nav-group {
  margin: 0.15rem 0;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  color: var(--app-text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-group-title::-webkit-details-marker { display: none; }

.nav-group-title::after {
  content: "▾";
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--app-muted);
  transition: transform 0.15s;
}

.nav-group:not([open]) .nav-group-title::after { transform: rotate(-90deg); }

.nav-group-title svg { width: 18px; height: 18px; color: var(--app-muted); }

.nav-group-title:hover { background: var(--app-primary-soft); }

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0 0.15rem 0.5rem;
  margin-left: 0.75rem;
  border-left: 2px solid var(--app-border);
}

.nav-item.nav-sub {
  padding: 0.5rem 0.75rem;
  font-size: 0.84rem;
}

.nav-item.nav-external { opacity: 0.9; }

.grupo-categorias-block { scroll-margin-top: 1rem; }

.grupo-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 166, 90, 0.12);
  color: #008d4c;
  font-size: 0.75rem;
  font-weight: 600;
}

.fase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}

.fase-head h2 { flex: 1 1 200px; margin: 0; }

.fase-estado-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.fase-estado-badge.completada { background: #d4edda; color: #155724; }
.fase-estado-badge.en_progreso { background: #fff3cd; color: #856404; }
.fase-estado-badge.pendiente { background: #e9ecef; color: #495057; }

.fase-semanas { font-size: 0.82rem; margin-left: auto; }

.fase-block { border-left: 4px solid #dee2e6; }
.fase-completada { border-left-color: #00a65a; }
.fase-en_progreso { border-left-color: #f39c12; }

.modulo-estado {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.modulo-estado.hecho { background: #d4edda; color: #155724; }
.modulo-estado.parcial { background: #fff3cd; color: #856404; }
.modulo-estado.pendiente { background: #f8f9fa; color: #6c757d; }

.fases-lista-prioridad {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.fases-lista-prioridad.fases-ok li::marker { color: #00a65a; }
.fases-lista-prioridad.fases-risk li::marker { color: #dd4b39; }

.text-deuda { color: #c53030; }