/* ==========================================================================
   INVERSIONES VALLE NORTE — SISTEMA DE DISEÑO PREMIUM v2.0
   Paleta Marca: #6522e1 (Violeta) · #8c13b6 (Púrpura)
   Estética: Dark Sidebar + Light Content · Glassmorphism · Micro-animations
   ========================================================================== */

/* 1. VARIABLES & TOKENS GLOBALES */
:root {
  /* Marca Valle Norte */
  --primary:        #6522e1;
  --primary-dark:   #4e18b3;
  --primary-accent: #8c13b6;
  --primary-hover:  #5319be;
  --primary-grad:   linear-gradient(135deg, #6522e1 0%, #8c13b6 100%);
  --primary-grad-r: linear-gradient(135deg, #8c13b6 0%, #6522e1 100%);
  --primary-glow:   rgba(101, 34, 225, 0.4);
  --sidebar-bg:     linear-gradient(180deg, #1a0840 0%, #2d0f6e 40%, #4a1090 100%);

  /* Superficies & Fondos */
  --bg-body:        #f0f2f8;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-card-subtle: #f5f4fc;
  --bg-glass:       rgba(255, 255, 255, 0.88);
  --bg-input:       #fafafe;

  /* Bordes & Sombras */
  --border:         #e4e1f0;
  --border-focus:   #6522e1;
  --shadow-xs:      0 1px 2px rgba(101,34,225,0.06);
  --shadow-sm:      0 2px 8px rgba(101,34,225,0.08);
  --shadow-md:      0 6px 20px rgba(101,34,225,0.12);
  --shadow-lg:      0 16px 40px rgba(101,34,225,0.18);
  --shadow-xl:      0 24px 60px rgba(0,0,0,0.2);
  --radius:         14px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --radius-pill:    9999px;

  /* Tipografía */
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --text-main:    #12102b;
  --text-muted:   #5e5c80;
  --text-subtle:  #9896bb;
  --text-inverse: #ffffff;

  /* Estados Funcionales */
  --success:    #0ea370;
  --success-bg: rgba(14, 163, 112, 0.1);
  --warning:    #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger:     #dc2626;
  --danger-bg:  rgba(220, 38, 38, 0.1);
  --info:       #0891b2;
  --info-bg:    rgba(8, 145, 178, 0.1);

  /* Sidebar */
  --sidebar-text:        rgba(255,255,255,0.75);
  --sidebar-text-hover:  #ffffff;
  --sidebar-link-hover:  rgba(255,255,255,0.1);
  --sidebar-link-active: rgba(255,255,255,0.15);
  --sidebar-width:       258px;

  /* Dimensiones Táctiles */
  --btn-h: 36px;
  --touch-min: 36px;
}

/* 2. RESET & NORMALIZACIÓN */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; height: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-main);
  min-height: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* 3. SCROLLBARS */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #c4bfe8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =========================================================
   4. LAYOUT PRINCIPAL
   ========================================================= */
.desktop-layout { display: flex; min-height: 100vh; }

/* =========================================================
   5. SIDEBAR PREMIUM DARK
   ========================================================= */
.desktop-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  z-index: 50;
}

.desktop-sidebar::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(140,19,182,0.5) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.desktop-sidebar::after {
  content: '';
  position: absolute;
  bottom: 60px; left: -60px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(101,34,225,0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar-logo-zone {
  padding: 26px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
}
.sidebar-logo-zone img {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sidebar-logo-tagline {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}

.sidebar-user-badge {
  margin: 14px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  z-index: 1;
}
.sidebar-user-badge__label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.sidebar-user-badge__name {
  font-size: 14px; font-weight: 700; color: #fff;
}
.sidebar-user-badge__footer {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.sidebar-role-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.sidebar-online {
  font-size: 11px; color: #4ade80; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.sidebar-online::before {
  content: '';
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}

.sidebar-nav {
  display: flex; flex-direction: column;
  gap: 2px; padding: 10px 10px;
  flex-grow: 1; position: relative; z-index: 1;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 8px 14px 4px;
}
.sidebar-link {
  display: flex; align-items: center;
  gap: 12px; padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 14px; font-weight: 500;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  position: relative; overflow: hidden;
}
.sidebar-link:hover {
  background: var(--sidebar-link-hover);
  color: var(--sidebar-text-hover);
  transform: translateX(2px);
}
.sidebar-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), 0 4px 12px rgba(0,0,0,0.15);
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: #c084fc;
  border-radius: 0 3px 3px 0;
}
.sidebar-link i {
  width: 20px; text-align: center;
  font-size: 15px; opacity: 0.8;
  transition: opacity 0.2s;
}
.sidebar-link.active i, .sidebar-link:hover i { opacity: 1; }

.sidebar-bottom {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative; z-index: 1;
}
.sidebar-bottom .btn-logout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: var(--font-sans);
  height: auto; min-height: auto; max-height: none;
}
.sidebar-bottom .btn-logout:hover {
  background: rgba(220,38,38,0.2);
  border-color: rgba(220,38,38,0.3);
  color: #fca5a5;
}

/* =========================================================
   6. ÁREA PRINCIPAL DE CONTENIDO
   ========================================================= */
.desktop-main {
  flex-grow: 1;
  padding: 28px 32px;
  max-width: 1300px;
  overflow-x: clip;
}

/* =========================================================
   7. MOBILE HEADER
   ========================================================= */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(26, 8, 64, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  z-index: 85;
  box-sizing: border-box;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  height: calc(41px + max(12px, env(safe-area-inset-top, 12px)));
  min-height: calc(41px + max(12px, env(safe-area-inset-top, 12px)));
}
.mobile-header img {
  height: 28px; width: auto;
  filter: brightness(0) invert(1);
}
.header-badge-bcv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9999px !important;
  box-sizing: border-box;
}
.header-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 9999px !important;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.header-btn-logout:hover,
.header-btn-logout:active {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

/* =========================================================
   8. BOTTOM TAB BAR — LIGHT GLASS
   ========================================================= */
.bottom-tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(101, 34, 225, 0.07);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px; font-weight: 600;
  flex: 1; height: 100%;
  transition: all 0.2s;
  gap: 3px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tab-item i {
  font-size: 17px;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1);
}
.tab-item:hover {
  color: var(--primary);
}
.tab-item.active {
  color: var(--primary);
}
.tab-item.active i {
  transform: translateY(-2px) scale(1.1);
  color: var(--primary);
}

/* =========================================================
   9. BOTONES
   ========================================================= */
button, .btn {
  height: var(--btn-h);
  min-height: 36px; max-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px; font-weight: 600;
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none; user-select: none;
  position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 150%; }

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #ebe8f8; border-color: #c4b8f0; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-subtle); }

.btn-sm {
  height: 30px; min-height: 30px; max-height: 30px;
  padding: 0 10px; font-size: 12px;
}
.btn-block { width: 100%; }

/* =========================================================
   10. INPUTS & FORMULARIOS
   ========================================================= */
input, select, textarea {
  font-size: 13.5px !important;
  font-family: var(--font-sans);
  width: 100%; height: var(--btn-h);
  padding: 0 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(101,34,225,0.12);
  background: #fff;
}
label {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  display: block; margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* =========================================================
   11. TARJETAS
   ========================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  margin-bottom: 14px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
}
.card-header {
  display: flex; justify-content: space-between;
  align-items: center;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-main);
  display: flex; align-items: center; gap: 10px;
}
.card-title i { color: var(--primary); font-size: 15px; }

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: all 0.25s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-icon.purple  { background: rgba(101,34,225,0.12); color: var(--primary); }
.stat-icon.magenta { background: rgba(140,19,182,0.12); color: var(--primary-accent); }
.stat-icon.green   { background: var(--success-bg); color: var(--success); }
.stat-icon.amber   { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red     { background: var(--danger-bg); color: var(--danger); }
.stat-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.stat-value { font-size: 22px; font-weight: 900; color: var(--text-main); line-height: 1.2; }
.stat-sub { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

/* =========================================================
   12. BADGES
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-success { background: var(--success-bg); color: #059669; }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-primary { background: rgba(101,34,225,0.1); color: var(--primary); }
.badge-info    { background: var(--info-bg); color: var(--info); }

/* =========================================================
   13. MODALES
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(18,16,43,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center;
  justify-content: center;
  padding: 16px; z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 460px; width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.93) translateY(16px);
}
.modal-overlay.active .modal-box { transform: scale(1) translateY(0); }

/* Banners de modales de extremo a extremo (sin márgenes ni padding residual) */
.modal-card,
.modal > .card,
.modal .card,
div[id^="modal-"] > .card,
div[id^="modal-"] .card {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg, 16px) !important;
  margin: 0 !important;
}

.modal-header-banner {
  background: var(--primary-grad);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

/* =========================================================
   14. TOASTS
   ========================================================= */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  pointer-events: none;
}
.toast {
  background: #12102b;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  border: none !important;
  animation: toastDrop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.toast-success,
.toast-error,
.toast-warning,
.toast-info {
  border: none !important;
}
@keyframes toastDrop {
  from { transform: translateY(-120%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   15. SEGMENTED NAV (SUB-HEADER FIJO)
   ========================================================= */
.segmented-nav {
  display: flex; gap: 6px;
  background: var(--bg-body);
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 10px 0 12px 0;
  margin-bottom: 14px;
}
.btn-segment {
  flex: 1; padding: 9px 8px;
  font-size: 12.5px; font-weight: 700;
  border: 1px solid rgba(101,34,225,0.12);
  border-radius: 8px;
  background: rgba(101,34,225,0.06);
  color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  height: auto; min-height: auto; max-height: none;
}
.btn-segment:hover {
  background: rgba(101,34,225,0.12);
  color: var(--primary);
}
.btn-segment.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* =========================================================
   16. LOGIN SCREEN
   ========================================================= */
body.is-login-screen {
  background: var(--sidebar-bg);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
body.is-login-screen .desktop-sidebar,
body.is-login-screen .bottom-tab-bar,
body.is-login-screen .mobile-header {
  display: none !important;
}
body.is-login-screen .desktop-layout {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: 100dvh !important;
  padding-bottom: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.is-login-screen .desktop-main {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.is-login-screen #app-content,
body.is-login-screen .view-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  overflow: hidden !important;
}

/* =========================================================
   17. PAGE HEADER
   ========================================================= */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 22px; font-weight: 900;
  color: var(--text-main);
  display: flex; align-items: center; gap: 10px; line-height: 1.2;
}
.page-header h1 .icon-bg {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--primary-grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  box-shadow: 0 4px 10px var(--primary-glow);
  flex-shrink: 0;
}
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* =========================================================
   18. TABLAS
   ========================================================= */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg-card-subtle);
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main); vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg-card-subtle); }

/* =========================================================
   19. GRILLAS
   ========================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* =========================================================
   20. UTILIDADES
   ========================================================= */
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-mono    { font-family: var(--font-mono); }
.fw-700       { font-weight: 700; }
.fw-900       { font-weight: 900; }
.fs-sm        { font-size: 12px; }
.fs-xs        { font-size: 11px; }
.mb-0         { margin-bottom: 0 !important; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mt-8         { margin-top: 8px; }
.divider      { height: 1px; background: var(--border); margin: 16px 0; }

/* =========================================================
   21. RESPONSIVE MÓVIL (MAX-WIDTH: 768px)
   ========================================================= */
@media (max-width: 768px) {
  .desktop-sidebar { display: none !important; }
  .desktop-layout {
    display: block !important;
    min-height: 100vh;
    padding-bottom: 70px;
  }
  .desktop-main {
    padding: 8px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }
  .mobile-header  { display: flex !important; }
  .segmented-nav {
    position: sticky !important;
    top: calc(41px + max(12px, env(safe-area-inset-top, 12px))) !important;
    z-index: 80 !important;
    background: var(--bg-body) !important;
    margin-top: -8px !important;
    margin-left: -10px !important;
    margin-right: -10px !important;
    padding: 8px 10px 10px 10px !important;
    border-bottom: 1px solid rgba(101, 34, 225, 0.1) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
    margin-bottom: 12px !important;
  }
  .bottom-tab-bar { display: flex !important; }
  .card { padding: 12px 10px !important; margin-bottom: 10px !important; border-radius: 10px !important; }
  .mobile-col-hidden, .hide-on-mobile, th.hide-on-mobile, td.hide-on-mobile { display: none !important; }
  .grid-2, .grid-3, .grid-4 { display: block !important; }
  .grid-2 > *, .grid-3 > *, .grid-4 > * { margin-bottom: 10px; }
  .page-header h1 { font-size: 18px; }
  .stat-value { font-size: 18px; }
}

/* =========================================================
   22. RESPONSIVE ESCRITORIO (MIN-WIDTH: 769px)
   ========================================================= */
@media (min-width: 769px) {
  .bottom-tab-bar   { display: none !important; }
  .mobile-header    { display: none !important; }
  .mobile-col-hidden { display: block !important; }
  .hide-on-mobile   { display: table-cell !important; }
  .desktop-layout   { display: flex !important; min-height: 100vh; }
  .desktop-sidebar  { display: flex !important; }
  .segmented-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 80 !important;
    background: var(--bg-body) !important;
    margin-top: -28px !important;
    margin-left: -32px !important;
    margin-right: -32px !important;
    padding: 16px 32px 14px 32px !important;
    border-bottom: 1px solid rgba(101, 34, 225, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 20px !important;
  }
}
