/* ==========================================================================
   Portal Privado de Clientes — Unión Contable Global (Asesores Contables)
   Diseño ERP Corporativo · Paleta Oficial:
   Azul Marino #0B2447 / #3F5B8F · Azul Claro #19A7CE / #0A5CF5 · Blanco #FFFFFF · Gris #5A6577 / #E2E8F0
   ========================================================================== */

:root {
  --navy-950: #071730;
  --navy-900: #0B2447;
  --navy-800: #163560;
  --navy-600: #3F5B8F;
  --blue-accent: #0A5CF5;
  --blue-hover: #0848C4;
  --cyan-500: #19A7CE;
  --cyan-300: #7DD3FC;
  --cyan-50: #E6F7FC;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-50: #ECFDF5;
  --rose-700: #BE123C;
  --rose-50: #FFF1F2;
  --amber-700: #B45309;
  --amber-50: #FFFBEB;
  --surface: #F8FAFC;
  --surface-alt: #F1F5F9;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --text-main: #0B2447;
  --text-muted: #5A6577;
  --text-subtle: #64748B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 10px rgba(11, 36, 71, 0.04);
  --shadow-lg: 0 24px 60px rgba(7, 23, 48, 0.42);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: clip; max-width: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.nowrap { white-space: nowrap !important; word-break: keep-all !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   1. PANTALLA DE ACCESO BLINDADO (SPLIT SHOWCASE + LOGIN OTP)
   ========================================================================== */
.auth-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 14%, rgba(25, 167, 206, 0.24) 0%, transparent 44%),
    radial-gradient(circle at 12% 84%, rgba(10, 92, 245, 0.2) 0%, transparent 46%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 58%, #102D58 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 20px 20px 36px;
}

.auth-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(25, 167, 206, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 167, 206, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
}

.auth-topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
}

.auth-top-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  transition: color 0.15s;
}
.auth-top-link strong, .auth-top-link .mono { color: var(--cyan-300); }
.auth-top-link:hover { color: var(--white); }

.auth-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(350px, 450px);
  gap: 44px;
  align-items: center;
}

/* Columna Izquierda */
.auth-showcase { color: var(--white); }

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.auth-brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(25, 167, 206, 0.45));
}
.auth-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--white);
  line-height: 1.2;
}
.auth-brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan-500);
  margin-top: 2px;
}
.auth-brand-slogan {
  font-size: 0.82rem;
  font-style: italic;
  color: #CBD5E1;
  margin-top: 3px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(25, 167, 206, 0.15);
  border: 1px solid rgba(25, 167, 206, 0.35);
  color: var(--cyan-300);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.auth-showcase h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 14px;
}

.auth-lead {
  font-size: 0.96rem;
  color: #CBD5E1;
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 24px;
}

.auth-features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-feat {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.12);
}
.auth-feat-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(25, 167, 206, 0.18);
  color: var(--cyan-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-feat strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.auth-feat p {
  font-size: 0.77rem;
  color: #94A3B8;
  line-height: 1.4;
}

/* Columna Derecha: Tarjeta Login */
.auth-card-col {
  width: 100%;
}

.auth-card {
  background: var(--white);
  border: 1px solid rgba(25, 167, 206, 0.3);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.auth-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pill-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald-600);
  background: var(--emerald-50);
  border: 1px solid rgba(5, 150, 105, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-600);
}
.api-status-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.auth-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 5px;
}
.auth-card .auth-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.p-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.p-field label {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--navy-900);
}
.p-field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--navy-900);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.p-field input:focus {
  border-color: var(--blue-accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(10, 92, 245, 0.14);
}
.field-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.otp-context-box {
  background: var(--cyan-50);
  border: 1px solid rgba(25, 167, 206, 0.28);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 14px;
}
.otp-company-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 2px;
}
.otp-hint-text {
  font-size: 0.8rem;
  color: var(--navy-600);
  line-height: 1.4;
}
.otp-input {
  text-align: center;
  font-family: var(--font-mono) !important;
  font-size: 1.6rem !important;
  font-weight: 800;
  letter-spacing: 0.35em;
}
.otp-secondary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Botones */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.16s, background 0.16s, border-color 0.16s;
  text-decoration: none;
  white-space: nowrap;
}
.p-btn:disabled { opacity: 0.58; cursor: not-allowed; transform: none; }
.p-btn-primary {
  background: linear-gradient(135deg, var(--blue-accent), var(--navy-600));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(10, 92, 245, 0.24);
}
.p-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--blue-hover), var(--navy-900));
  transform: translateY(-1px);
}
.p-btn-emerald {
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700));
  color: var(--white);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.24);
}
.p-btn-emerald:hover:not(:disabled) { transform: translateY(-1px); }
.p-btn-outline {
  background: var(--white);
  border-color: var(--border);
  color: var(--navy-900);
}
.p-btn-outline:hover:not(:disabled) {
  border-color: var(--cyan-500);
  color: var(--blue-accent);
  background: var(--surface);
}
.p-btn-outline-dark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--white);
}
.p-btn-outline-dark:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.p-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}
.p-btn-ghost:hover { color: var(--navy-900); background: var(--surface-alt); }
.p-btn-sm { padding: 7px 12px; font-size: 0.78rem; border-radius: 8px; }
.p-btn-full { width: 100%; }

/* Alertas */
.alert-box {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-error { background: var(--rose-50); color: var(--rose-700); border-color: rgba(190, 18, 60, 0.24); }
.alert-info { background: var(--cyan-50); color: var(--navy-900); border-color: rgba(25, 167, 206, 0.32); }
.alert-ok { background: var(--emerald-50); color: #065F46; border-color: rgba(5, 150, 105, 0.28); }

.auth-security-strip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-alt);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.auth-demo-box {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-box-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.demo-box-copy strong { font-size: 0.81rem; color: var(--navy-900); }
.demo-box-copy span { font-size: 0.75rem; color: var(--text-muted); }

.auth-foot-note {
  margin-top: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: #CBD5E1;
  line-height: 1.5;
}
.auth-foot-note a { color: var(--cyan-300); text-decoration: none; font-weight: 700; }
.auth-foot-note a:hover { text-decoration: underline; }

/* ==========================================================================
   2. SUITE PRIVADA AUTENTICADA (SIDEBAR + TOPBAR + WORKSPACE ERP)
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 23, 48, 0.56);
  backdrop-filter: blur(2px);
  z-index: 45;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: var(--white);
  border-right: 1px solid rgba(25, 167, 206, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.14);
  margin-bottom: 16px;
}
.sb-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(25, 167, 206, 0.45));
}
.sb-brand-name {
  font-weight: 800;
  font-size: 0.91rem;
  color: var(--white);
  line-height: 1.18;
}
.sb-brand-sub {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-500);
  margin-top: 2px;
}

.sb-section-label {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94A3B8;
  padding: 0 10px 8px;
}
.sb-section-gap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.1);
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sb-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #CBD5E1;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sb-item-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sb-item-left svg { flex-shrink: 0; opacity: 0.85; }
.sb-item:hover { background: rgba(25, 167, 206, 0.12); color: var(--white); }
.sb-item.active {
  background: rgba(10, 92, 245, 0.24);
  border-color: rgba(25, 167, 206, 0.45);
  color: var(--white);
  font-weight: 700;
}
.sb-item.active .sb-item-left svg { color: var(--cyan-300); opacity: 1; }

.sb-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cyan-300);
  flex-shrink: 0;
}

.sb-foot {
  border-top: 1px solid rgba(226, 232, 240, 0.14);
  padding-top: 14px;
  margin-top: 16px;
  font-size: 0.74rem;
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-sec-badge { color: #6EE7B7; font-weight: 700; }
.sb-idle-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  color: var(--cyan-300);
  background: rgba(25, 167, 206, 0.14);
  border: 1px solid rgba(25, 167, 206, 0.28);
  border-radius: 7px;
  padding: 4px 8px;
}
.sb-help-copy { font-size: 0.73rem; line-height: 1.4; }
.sb-wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(5, 150, 105, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #A7F3D0;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.77rem;
}
.sb-wa-link:hover { background: rgba(5, 150, 105, 0.34); }
.sb-back-site {
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.74rem;
  text-align: center;
  padding-top: 2px;
}
.sb-back-site:hover { color: var(--white); }

/* MAIN WORKSPACE */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.demo-banner {
  background: #0F2F5A;
  color: #E0F2FE;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(25, 167, 206, 0.35);
  font-size: 0.8rem;
}
.demo-banner-text strong { color: var(--cyan-300); }
.demo-banner .p-btn-outline {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
}
.demo-banner .p-btn-outline:hover { background: rgba(255, 255, 255, 0.22); color: var(--white); }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sb-mobile-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy-900);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.entity-header {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.entity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.entity-name-rif {
  font-size: clamp(0.72rem, 2.2vw, 1rem);
  font-weight: 800;
  color: var(--navy-900);
}
.badge-tax {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cyan-50);
  color: var(--navy-600);
  border: 1px solid rgba(25, 167, 206, 0.28);
}
.badge-tax.spe { background: var(--amber-50); color: var(--amber-700); border-color: rgba(180, 83, 9, 0.25); }
.badge-tax.demo { background: var(--emerald-50); color: var(--emerald-600); border-color: rgba(5, 150, 105, 0.25); }
.entity-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute;
  left: 11px;
  color: var(--text-subtle);
  pointer-events: none;
}
.global-search {
  width: 240px;
  padding: 8px 30px 8px 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.83rem;
  color: var(--navy-900);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.global-search:focus { border-color: var(--blue-accent); background: var(--white); }
.search-clear {
  position: absolute;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: #CBD5E1;
  color: var(--navy-900);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-body {
  padding: 24px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

/* PRINT-ONLY HEADER (100 % CLIENTE) */
.print-client-header { display: none; }

/* ==========================================================================
   3. TARJETAS KPI CORPORATIVAS (SOBRIAS — CERO TARJETAS ARCOÍRIS)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
}
.kpi-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.kpi-pct {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--emerald-600);
}
.kpi-val {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.22;
}
.kpi-val.emerald { color: var(--emerald-600); }
.kpi-val.blue { color: var(--blue-accent); }
.kpi-sub { font-size: 0.76rem; color: var(--text-muted); }

.kpi-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
  margin-top: 4px;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-500), var(--emerald-600));
  transition: width 0.35s ease;
}

/* ==========================================================================
   4. PANELES, TARJETAS, FILTROS Y VISTAS ORGANIZADAS
   ========================================================================== */
.panel-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}
.panel-head p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tira de Estado Rápido (Resumen) */
.compliance-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  margin-bottom: 20px;
}
.compliance-banner-left h3 {
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 3px;
}
.compliance-banner-left p {
  font-size: 0.8rem;
  color: #CBD5E1;
}
.compliance-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Solvencias 1-Clic */
.solv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.solv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.solv-card:hover {
  border-color: var(--cyan-500);
  background: var(--white);
  box-shadow: 0 6px 18px rgba(11, 36, 71, 0.06);
}
.solv-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ent-pill {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cyan-50);
  color: var(--navy-600);
}
.ent-pill.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.ent-pill.amber { background: var(--amber-50); color: var(--amber-700); }
.ent-pill.neutral { background: var(--surface-alt); color: var(--text-muted); }

.badge-new {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--blue-accent);
  color: var(--white);
  vertical-align: middle;
}

.solv-name {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--navy-900);
  word-break: break-word;
  margin-top: 8px;
}
.solv-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.doc-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* Selectores de Período (Pills de Año y Mes) */
.period-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.period-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 4px;
}
.pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.month-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.period-pill {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy-900);
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.14s;
}
.period-pill:hover { border-color: var(--cyan-500); color: var(--blue-accent); }
.period-pill.active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--white);
}
.period-pill .pill-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}
.period-pill.active .pill-num {
  background: rgba(25, 167, 206, 0.28);
  color: var(--cyan-300);
}

.view-mode-toggle {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.vmode-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.vmode-btn.active {
  background: var(--navy-900);
  color: var(--white);
}

/* Chips de Entes */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s;
}
.chip-btn:hover { border-color: var(--cyan-500); color: var(--navy-900); }
.chip-btn.active { background: var(--blue-accent); border-color: var(--blue-accent); color: var(--white); }
.chip-count {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  opacity: 0.85;
}

/* Grupos Organizados por Ente / Carpeta */
.entity-group {
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  margin-bottom: 14px;
}
.entity-group:last-child { margin-bottom: 0; }
.entity-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.entity-group-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.entity-group-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan-500);
}
.entity-group-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Tabla de Documentos */
.table-wrap { overflow-x: auto; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.doc-table th, .doc-table td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--surface-alt);
  vertical-align: middle;
}
.doc-table th {
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface);
}
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover td { background: #F8FAFC; }
.doc-table td.td-actions { width: 1%; white-space: nowrap; }
.doc-table td.td-actions .doc-actions { flex-wrap: nowrap; }
.doc-title { font-weight: 700; color: var(--navy-900); word-break: break-word; }
.doc-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* Cartelera Fiscal por Categorías */
.cartelera-progress-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.cartelera-progress-meta strong { font-size: 0.9rem; color: var(--navy-900); }
.cartelera-progress-meta span { display: block; font-size: 0.78rem; color: var(--text-muted); }
.cartelera-progress-bar-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.cartelera-cat-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-600);
  margin: 18px 0 10px;
}
.cartelera-cat-title:first-of-type { margin-top: 0; }

.cartelera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cartelera-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.cartelera-slot.ready {
  background: var(--emerald-50);
  border-color: rgba(5, 150, 105, 0.28);
}
.slot-title { font-size: 0.85rem; font-weight: 800; color: var(--navy-900); }
.slot-file { font-size: 0.75rem; color: #065F46; margin-top: 2px; word-break: break-word; }
.slot-missing { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* ==========================================================================
   4B. EXPLORADOR DE CARPETAS FIEL A GOOGLE DRIVE (DISEÑO CORPORATIVO UCG)
   ========================================================================== */
.root-folders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.root-folder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s, transform 0.15s, box-shadow 0.16s;
}
.root-folder-card:hover {
  border-color: var(--cyan-500);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 36, 71, 0.08);
}
.root-folder-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.folder-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-600));
  color: var(--cyan-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.folder-icon-badge.cyan {
  background: linear-gradient(135deg, var(--blue-accent), var(--cyan-500));
  color: var(--white);
}
.root-folder-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.25;
}
.root-folder-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.root-folder-arrow {
  color: var(--blue-accent);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Barra de Navegación Breadcrumbs (Ruta Real de Carpetas) */
.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.breadcrumb-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.crumb-btn {
  border: 0;
  background: transparent;
  color: var(--navy-600);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.crumb-btn:hover { background: var(--cyan-50); color: var(--blue-accent); }
.crumb-btn.current {
  background: var(--navy-900);
  color: var(--white);
  cursor: default;
}
.crumb-sep {
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
}

/* Cuadrícula de Carpetas Numeradas (Estilo Drive Corporativo) */
.drive-sub-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.14s, box-shadow 0.15s;
}
.folder-card:hover {
  border-color: var(--blue-accent);
  background: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 36, 71, 0.07);
}
.folder-card-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cyan-50);
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(25, 167, 206, 0.25);
}
.folder-card-ico.year-ico {
  background: var(--navy-900);
  color: var(--cyan-300);
  border-color: var(--navy-900);
}
.folder-card-ico.special-ico {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border-color: rgba(5, 150, 105, 0.25);
}
.folder-card-body { min-width: 0; flex: 1; }
.folder-card-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.28;
  word-break: break-word;
}
.folder-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.folder-card-chev {
  color: #94A3B8;
  flex-shrink: 0;
  transition: transform 0.14s, color 0.14s;
}
.folder-card:hover .folder-card-chev {
  color: var(--blue-accent);
  transform: translateX(2px);
}
.folder-card.folder-empty {
  opacity: 0.68;
  border-style: dashed;
  background: #FAFBFD;
}
.folder-card.folder-empty:hover { opacity: 1; }
.folder-card.folder-latest {
  border-color: var(--cyan-500);
  background: var(--white);
  box-shadow: 0 5px 16px rgba(10, 92, 245, 0.08);
}
.folder-latest-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--blue-accent);
  color: var(--white);
  vertical-align: middle;
}

/* Bloques Organizados por Periodicidad (Mensuales · Trimestrales · Anuales · Otras) */
.drive-cat-block {
  margin-bottom: 22px;
}
.drive-cat-block:last-of-type { margin-bottom: 14px; }
.drive-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-600);
  margin-bottom: 11px;
}
.drive-cat-head.cat-mensual { border-left-color: var(--blue-accent); }
.drive-cat-head.cat-trimestral { border-left-color: var(--emerald-600); }
.drive-cat-head.cat-anual { border-left-color: var(--navy-900); }
.drive-cat-head.cat-otros { border-left-color: var(--cyan-500); }

.drive-cat-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.drive-cat-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy-900);
}
.drive-cat-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.cat-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2.5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.cat-tag.mensual { background: var(--cyan-50); color: var(--blue-accent); }
.cat-tag.trimestral { background: var(--emerald-50); color: var(--emerald-600); }
.cat-tag.anual { background: #E2E8F0; color: var(--navy-900); }
.cat-tag.otros { background: var(--surface-alt); color: var(--navy-600); }

/* Acceso Directo al Último Mes y Filtro de Periodicidad (UX Intuitiva) */
.drive-quick-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: linear-gradient(90deg, var(--cyan-50), #F8FAFC);
  border: 1px solid rgba(25, 167, 206, 0.3);
  margin-bottom: 14px;
}
.drive-quick-copy {
  font-size: 0.79rem;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drive-quick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-accent);
  flex-shrink: 0;
}
.freq-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.freq-btn {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy-600);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s;
}
.freq-btn:hover { border-color: var(--cyan-500); color: var(--navy-900); }
.freq-btn.active { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.freq-btn.freq-trimestral.active { background: var(--emerald-600); border-color: var(--emerald-600); }
.freq-btn.freq-mensual.active { background: var(--blue-accent); border-color: var(--blue-accent); }

.kpi-card.kpi-clickable {
  cursor: pointer;
  transition: border-color 0.16s, transform 0.14s, box-shadow 0.16s;
}
.kpi-card.kpi-clickable:hover {
  border-color: var(--cyan-500);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 36, 71, 0.08);
}

/* Nota de Privacidad Expediente */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--cyan-50);
  border: 1px solid rgba(25, 167, 206, 0.28);
  color: var(--navy-900);
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.privacy-note svg { color: var(--blue-accent); flex-shrink: 0; margin-top: 2px; }

/* Calendario Tributario y Soporte Rápido */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cal-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cal-item h3 { font-size: 0.88rem; font-weight: 800; color: var(--navy-900); }
.cal-item p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.cal-due { font-size: 0.74rem; font-weight: 700; color: var(--blue-accent); }

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.support-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.support-card h3 { font-size: 0.88rem; font-weight: 800; color: var(--navy-900); margin-bottom: 4px; }
.support-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

/* ==========================================================================
   5. MODAL VISOR SEGURO, TOAST Y BARRA INFERIOR MÓVIL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 23, 48, 0.76);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}
.modal-head {
  padding: 13px 18px;
  background: var(--navy-900);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-title-group { min-width: 0; display: flex; flex-direction: column; }
.modal-title { font-size: 0.91rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-subtitle { font-size: 0.73rem; color: #94A3B8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-body {
  flex: 1;
  background: #1E293B;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.modal-body iframe { width: 100%; height: 100%; border: 0; background: #FFF; }
.modal-body img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 12px; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 140;
  background: var(--navy-900);
  color: var(--white);
  border: 1px solid rgba(25, 167, 206, 0.5);
  border-radius: 11px;
  padding: 12px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(7, 23, 48, 0.42);
  max-width: calc(100vw - 40px);
}

.empty-panel {
  text-align: center;
  padding: 36px 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 44;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  box-shadow: 0 -6px 20px rgba(11, 36, 71, 0.07);
}
.mb-nav-item {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 8px;
  cursor: pointer;
}
.mb-nav-item.active {
  color: var(--blue-accent);
  background: var(--cyan-50);
}

/* ==========================================================================
   6. RESPONSIVE MÓVIL Y TABLET
   ========================================================================== */
@media (max-width: 1080px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 540px; gap: 26px; }
  .auth-features-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solv-grid, .support-grid, .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 901px) {
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0, 0, 0, 0.45); }
  .sb-mobile-toggle { display: inline-flex; }
  .global-search { width: 195px; }
}

@media (max-width: 768px) {
  .mobile-bottom-nav { display: grid; }
  .workspace-body { padding: 14px 14px 86px; }
  .toast { bottom: 76px; right: 14px; }
}

@media (max-width: 640px) {
  .auth-screen { padding: 14px 14px 28px; }
  .auth-showcase h1 { font-size: 1.48rem; }
  .auth-card { padding: 20px; }
  .auth-security-strip { grid-template-columns: 1fr; }
  .demo-banner { padding: 10px 14px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .search-wrap { flex: 1; min-width: 0; }
  .global-search { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 13px 14px; }
  .kpi-val { font-size: 1.15rem; }
  .solv-grid, .cartelera-grid, .cal-grid, .support-grid, .folder-grid, .root-folders-grid { grid-template-columns: 1fr; }
  .panel-card { padding: 16px; }

  /* Transformación limpia de tablas a tarjetas en móvil (cero scroll horizontal incómodo) */
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table tr {
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  .doc-table td {
    padding: 4px 0;
    border-bottom: 0;
  }
  .doc-table td[data-label]::before {
    content: attr(data-label) ': ';
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
  }
  .doc-table td.td-main::before,
  .doc-table td.td-actions::before { content: none; }
  .doc-table td.td-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
  .modal-box { height: 92vh; }
}

/* ==========================================================================
   8. TEMA EJECUTIVO LUMINOSO — PORTAL PRIVADO DE CLIENTES (DISTINCIÓN VISUAL)
   Diferencia el Portal de Clientes (claro, sereno, sidebar blanco) del
   Módulo Interno del Equipo SUMA+ (oscuro, operativo, cinta interna azul).
   ========================================================================== */
body.theme-client-light .auth-screen {
  background:
    radial-gradient(900px 540px at 88% 10%, rgba(25, 167, 206, 0.16) 0%, transparent 56%),
    radial-gradient(760px 480px at 8% 88%, rgba(10, 92, 245, 0.09) 0%, transparent 56%),
    linear-gradient(160deg, #FFFFFF 0%, #F4F9FD 55%, #EAF3FB 100%);
  border-top: 4px solid var(--cyan-500);
}
body.theme-client-light .auth-grid-bg {
  background-image:
    linear-gradient(rgba(11, 36, 71, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 36, 71, 0.04) 1px, transparent 1px);
}
body.theme-client-light .auth-topbar {
  border-bottom-color: var(--border);
}
body.theme-client-light .auth-top-link {
  color: var(--navy-600);
}
body.theme-client-light .auth-top-link strong,
body.theme-client-light .auth-top-link .mono {
  color: var(--navy-900);
}
body.theme-client-light .auth-top-link:hover {
  color: var(--blue-accent);
}
body.theme-client-light .auth-showcase {
  color: var(--navy-900);
}
body.theme-client-light .auth-brand-logo {
  filter: drop-shadow(0 6px 14px rgba(11, 36, 71, 0.14));
}
body.theme-client-light .auth-brand-title {
  color: var(--navy-900);
}
body.theme-client-light .auth-brand-sub {
  color: var(--cyan-500);
}
body.theme-client-light .auth-brand-slogan {
  color: var(--text-muted);
}
body.theme-client-light .auth-kicker {
  background: #E6F7FC;
  border-color: rgba(25, 167, 206, 0.35);
  color: var(--navy-900);
}
body.theme-client-light .auth-showcase h1 {
  color: var(--navy-900);
}
body.theme-client-light .auth-lead {
  color: var(--text-muted);
}
body.theme-client-light .auth-feat {
  background: var(--white);
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(11, 36, 71, 0.05);
}
body.theme-client-light .auth-feat-ico {
  background: #E6F7FC;
  color: var(--blue-accent);
  border-color: rgba(25, 167, 206, 0.25);
}
body.theme-client-light .auth-feat strong {
  color: var(--navy-900);
}
body.theme-client-light .auth-feat p {
  color: var(--text-muted);
}
body.theme-client-light .auth-card {
  border: 1px solid #D7E3F0;
  border-top: 4px solid var(--cyan-500);
  box-shadow: 0 22px 50px rgba(11, 36, 71, 0.11);
}
body.theme-client-light .auth-foot-note {
  color: var(--text-muted);
}
body.theme-client-light .auth-foot-note a {
  color: var(--blue-accent);
  font-weight: 700;
}

/* Sidebar Blanco Luminoso en el Espacio del Cliente */
body.theme-client-light .sidebar {
  background: var(--white);
  color: var(--navy-900);
  border-right: 1px solid var(--border);
  border-top: 4px solid var(--cyan-500);
}
body.theme-client-light .sb-brand {
  border-bottom-color: var(--border);
}
body.theme-client-light .sb-brand img {
  filter: drop-shadow(0 4px 10px rgba(11, 36, 71, 0.14));
}
body.theme-client-light .sb-brand-name {
  color: var(--navy-900);
}
body.theme-client-light .sb-brand-sub {
  color: var(--cyan-500);
}
body.theme-client-light .sb-section-label {
  color: #64748B;
}
body.theme-client-light .sb-section-gap {
  border-top-color: var(--surface-alt);
}
body.theme-client-light .sb-item {
  color: var(--text-muted);
}
body.theme-client-light .sb-item:hover {
  background: #F1F7FC;
  color: var(--navy-900);
}
body.theme-client-light .sb-item.active {
  background: #E6F7FC;
  border-color: rgba(25, 167, 206, 0.45);
  color: var(--navy-900);
  box-shadow: inset 3px 0 0 var(--cyan-500);
}
body.theme-client-light .sb-item.active .sb-item-left svg {
  color: var(--blue-accent);
}
body.theme-client-light .sb-count {
  background: var(--surface-alt);
  color: var(--navy-600);
}
body.theme-client-light .sb-item.active .sb-count {
  background: var(--navy-900);
  color: var(--white);
}
body.theme-client-light .sb-foot {
  border-top-color: var(--border);
  color: var(--text-muted);
}
body.theme-client-light .sb-sec-badge {
  color: var(--emerald-600);
}
body.theme-client-light .sb-idle-pill {
  background: #F1F5F9;
  border-color: var(--border);
  color: var(--navy-600);
}
body.theme-client-light .sb-wa-link {
  background: #ECFDF5;
  border-color: rgba(5, 150, 105, 0.35);
  color: #065F46;
}
body.theme-client-light .sb-wa-link:hover {
  background: #D1FAE5;
}
body.theme-client-light .sb-back-site {
  color: var(--navy-600);
}
body.theme-client-light .sb-back-site:hover {
  color: var(--blue-accent);
}
body.theme-client-light .topbar {
  border-top: 4px solid var(--cyan-500);
}

/* ==========================================================================
   7. IMPRESIÓN LIMPIA (100 % PROPIEDAD DEL CLIENTE — SIN BRANDING DEL SOFTWARE)
   ========================================================================== */
@media print {
  .sidebar, .sidebar-backdrop, .topbar, .demo-banner, .mobile-bottom-nav,
  .p-btn, .period-bar, .chip-group, .compliance-banner, .toast, .privacy-note,
  .drive-toolbar, .root-folders-grid, .view-mode-toggle, .drive-quick-strip, .freq-bar {
    display: none !important;
  }
  .app-shell { display: block; }
  body { background: #FFFFFF; color: #000000; }
  .workspace-body { padding: 0; max-width: 100%; }
  .print-client-header {
    display: block;
    border-bottom: 2px solid #0B2447;
    padding-bottom: 10px;
    margin-bottom: 18px;
  }
  .print-entity-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0B2447;
  }
  .print-entity-sub {
    font-size: 0.82rem;
    color: #5A6577;
    margin-top: 2px;
  }
  .panel-card, .kpi-card, .cartelera-slot, .solv-card {
    box-shadow: none !important;
    break-inside: avoid;
  }
}
