/* ============================================================
   ALISA CAPITAL — Sistema de diseño
   Paleta institucional + tipografía Montserrat / Inter
   ============================================================ */
:root {
  /* Brand */
  --azul-institucional: #011432;
  --azul-noche: #071027;
  --dorado: #B08A42;
  --dorado-soft: #f1e7d3;
  --gris-acero: #838793;
  --gris-claro: #E6E8EC;
  --marfil: #F7F4EF;

  /* Sistema */
  --bg: var(--marfil);
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --border: #e9e7e1;
  --border-strong: var(--gris-claro);
  --text: var(--azul-institucional);
  --text-muted: var(--gris-acero);
  --text-soft: #a8acb6;

  --primary: var(--azul-institucional);
  --primary-dark: #000a1f;
  --primary-soft: #e7ebf2;
  --accent: var(--dorado);
  --accent-soft: var(--dorado-soft);

  --success: #1e7d52;
  --success-soft: #e3f2eb;
  --warning: #b87900;
  --warning-soft: #fbf0d4;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;

  --shadow-sm: 0 1px 2px rgba(1, 20, 50, 0.06);
  --shadow: 0 6px 20px rgba(1, 20, 50, 0.08);
  --shadow-lg: 0 24px 50px rgba(1, 20, 50, 0.18);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 252px;

  --font-display: 'Montserrat', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, .page-title, .card-title, .kpi-value {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
code { font-family: 'SF Mono', Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; color: var(--azul-institucional); }

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.anim-fade-in { animation: fadeIn 0.9s ease-out both; }
.anim-slide-up { animation: slideUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 0.25s; }
.view-enter { animation: fadeInSoft 0.35s ease-out both; }

/* ============================================================
   LOGO
   ============================================================ */
.login-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.logo-img { max-height: 90px; max-width: 280px; object-fit: contain; }
.logo-img-light { filter: none; }
.logo-img-dark { filter: none; max-height: 50px; }
.logo-fallback {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-fallback .logo-mark {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--dorado), #d6ad5c);
  color: var(--azul-institucional);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(176, 138, 66, 0.3);
}
.logo-fallback .logo-words {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-fallback .logo-words strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.06em;
}
.logo-fallback .logo-words span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.34em;
  margin-top: 3px;
  color: var(--dorado);
}
.logo-fallback-light .logo-words strong { color: var(--azul-institucional); }
.logo-fallback-dark .logo-words strong { color: white; }
.logo-fallback-dark .logo-words span { color: var(--dorado); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow: hidden;
  background: var(--azul-noche);
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(176, 138, 66, 0.18), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(176, 138, 66, 0.08), transparent 50%),
    linear-gradient(135deg, var(--azul-noche) 0%, var(--azul-institucional) 100%);
  z-index: 0;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 95%, rgba(176, 138, 66, 0.04) 95%),
    linear-gradient(90deg, transparent 95%, rgba(176, 138, 66, 0.04) 95%);
  background-size: 40px 40px;
  opacity: 0.6;
}
.login-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--dorado);
}
.login-card-head { text-align: center; margin-bottom: 20px; }
.login-card-head h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  color: var(--azul-institucional);
}
.login-card-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gris-acero);
}

.tabs {
  display: flex;
  background: var(--marfil);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gris-acero);
  transition: all 0.18s;
  font-family: var(--font-body);
}
.tab.active {
  background: var(--surface);
  color: var(--azul-institucional);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.login-form .form-row { margin-bottom: 16px; }
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--azul-institucional);
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(176, 138, 66, 0.18);
}
.hint { font-size: 12px; color: var(--text-soft); margin: 6px 0 0; }
.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.footer-note { color: rgba(255, 255, 255, 0.55); font-size: 12px; margin-top: 22px; text-align: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--azul-institucional);
  color: white;
  border: 1px solid var(--azul-institucional);
}
.btn-primary:hover {
  background: var(--azul-noche);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(1, 20, 50, 0.2);
}
.btn-secondary {
  background: var(--surface);
  color: var(--azul-institucional);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--marfil); border-color: var(--gris-acero); }
.btn-accent {
  background: var(--dorado);
  color: white;
  border: 1px solid var(--dorado);
}
.btn-accent:hover { background: #9a7637; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--marfil); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f7d2cf; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #186544; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   SHELL LAYOUT
   ============================================================ */
.shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--azul-institucional);
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  gap: 4px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  border-right: 1px solid rgba(176, 138, 66, 0.15);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
  position: relative;
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--dorado);
}
.role-badge-wrap { padding: 0 6px 14px; text-align: center; }
.role-badge {
  font-size: 10.5px;
  background: rgba(176, 138, 66, 0.14);
  color: var(--dorado);
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  border: 1px solid rgba(176, 138, 66, 0.3);
}
.nav-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-body);
  text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(176, 138, 66, 0.2), rgba(176, 138, 66, 0.05));
  color: white;
  border-left: 3px solid var(--dorado);
  padding-left: 11px;
}
.nav-icon { width: 18px; text-align: center; opacity: 0.95; font-size: 15px; }
.logout-btn {
  color: rgba(255, 255, 255, 0.5);
  margin-top: 14px;
  font-weight: 500;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.06); color: white; }

.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.hamburger {
  display: none;
  font-size: 22px;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text);
}
.hamburger:hover { background: var(--marfil); }
.page-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--azul-institucional); }
.topbar-spacer { flex: 1; }
.view-root { padding: 24px 32px 80px; flex: 1; }

.bottom-nav { display: none; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-label {
  font-size: 11px;
  color: var(--gris-acero);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--azul-institucional);
  font-family: var(--font-display);
}
.kpi-sub {
  font-size: 12px;
  color: var(--gris-acero);
  margin-top: 6px;
}
.kpi-sub.up { color: var(--success); font-weight: 600; }
.kpi-sub.down { color: var(--danger); font-weight: 600; }
.kpi.kpi-accent { border-top: 3px solid var(--dorado); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--azul-institucional);
  font-family: var(--font-display);
}
.section-header .actions { display: flex; gap: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card.padded-lg { padding: 28px; }
.card-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--azul-institucional);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--dorado);
  border-radius: 2px;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gris-acero);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 13px 15px;
  background: var(--marfil);
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
table.data tr:last-child td { border-bottom: none; }
table.data tr.row-clickable { cursor: pointer; transition: background 0.12s; }
table.data tr.row-clickable:hover { background: var(--marfil); }
table.data tr.row-group td {
  background: linear-gradient(90deg, rgba(176, 138, 66, 0.06), transparent);
  font-weight: 600;
  color: var(--azul-institucional);
  border-bottom: 1px solid var(--dorado);
}
table.data tr.row-subtotal td {
  background: var(--marfil);
  font-weight: 600;
  color: var(--azul-institucional);
  font-size: 13px;
}
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--gris-acero); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--azul-institucional); }
.badge-accent { background: var(--accent-soft); color: var(--dorado); }
.badge-muted { background: var(--gris-claro); color: var(--gris-acero); }

/* ============================================================
   ALERTS BANNERS
   ============================================================ */
.alert-banner {
  background: var(--warning-soft);
  border-left: 4px solid var(--warning);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.alert-banner.danger { background: var(--danger-soft); border-color: var(--danger); }
.alert-banner.info { background: var(--primary-soft); border-color: var(--azul-institucional); }
.alert-banner-icon { font-size: 20px; }
.alert-banner-body { flex: 1; }
.alert-banner-title { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; color: var(--azul-institucional); }
.alert-banner-text { font-size: 13px; color: var(--gris-acero); }

/* ============================================================
   FORM GRID
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.chart-card h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--azul-institucional);
  font-family: var(--font-display);
}
.chart-canvas-wrap { position: relative; height: 240px; }
.chart-canvas-wrap.tall { height: 300px; }

/* ============================================================
   PROGRESO CIRCULAR / LINEAL
   ============================================================ */
.progress-circle-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.progress-circle {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress-circle .ring-bg {
  fill: none;
  stroke: var(--gris-claro);
  stroke-width: 12;
}
.progress-circle .ring-fg {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}
.progress-circle-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.progress-circle-label .pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--azul-institucional);
  line-height: 1;
}
.progress-circle-label .lbl {
  font-size: 10.5px;
  color: var(--gris-acero);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.progress-info { flex: 1; min-width: 200px; }
.progress-info .row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.progress-info .row:last-child { border-bottom: none; }
.progress-info .row .lbl { color: var(--gris-acero); }
.progress-info .row .val { font-weight: 600; color: var(--azul-institucional); }

/* Progress bar */
.progress {
  height: 8px;
  background: var(--gris-claro);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--azul-institucional), var(--dorado));
  transition: width 0.6s ease-out;
}

/* ============================================================
   DETAIL PANEL
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.detail-item {
  background: var(--marfil);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--dorado);
}
.detail-item .label {
  font-size: 10.5px;
  color: var(--gris-acero);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.detail-item .value {
  font-size: 17px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--azul-institucional);
  font-family: var(--font-display);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gris-acero);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  padding: 6px 0;
}
.back-link:hover { color: var(--azul-institucional); }

/* ============================================================
   TABS
   ============================================================ */
.view-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.view-tab {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gris-acero);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}
.view-tab:hover { color: var(--azul-institucional); }
.view-tab.active {
  color: var(--azul-institucional);
  border-bottom-color: var(--dorado);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  border-top: 3px solid var(--dorado);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.modal h3 {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--azul-institucional);
  font-family: var(--font-display);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ============================================================
   CLIENTE PORTAL
   ============================================================ */
.cliente-hero {
  background:
    radial-gradient(ellipse at top right, rgba(176, 138, 66, 0.25), transparent 60%),
    linear-gradient(135deg, var(--azul-noche), var(--azul-institucional));
  color: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  border-top: 3px solid var(--dorado);
  position: relative;
  overflow: hidden;
}
.cliente-hero h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-family: var(--font-display);
  font-weight: 700;
}
.cliente-hero p { margin: 0; opacity: 0.85; font-size: 14px; }
.cliente-hero .saldo {
  margin-top: 22px;
  font-size: 11px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dorado);
  font-weight: 700;
}
.cliente-hero .saldo-amount {
  font-size: 36px;
  font-weight: 800;
  margin-top: 6px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.cliente-progress-card {
  background: linear-gradient(135deg, var(--marfil), white);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.cliente-progress-msg {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--azul-institucional);
  text-align: center;
  margin: 0 0 14px;
}
.cliente-progress-msg .pct-num {
  color: var(--dorado);
  font-size: 24px;
}
.cliente-next-payment {
  background: linear-gradient(135deg, var(--azul-institucional), var(--azul-noche));
  color: white;
  padding: 22px;
  border-radius: var(--radius);
  border-left: 4px solid var(--dorado);
  margin-bottom: 18px;
}
.cliente-next-payment .label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--dorado);
}
.cliente-next-payment .when {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}
.cliente-next-payment .amount {
  font-size: 14px;
  margin-top: 8px;
  opacity: 0.9;
}
.cliente-next-payment .amount strong { font-size: 22px; font-weight: 700; color: white; }
.cliente-next-payment .badge { margin-top: 10px; }

/* ============================================================
   AMORTIZACIÓN
   ============================================================ */
.amort-table { font-size: 13px; }
.amort-table th, .amort-table td { padding: 9px 13px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--gris-acero);
}
.empty-icon { font-size: 38px; margin-bottom: 8px; opacity: 0.5; }

/* ============================================================
   CAPITAL PROPIO — TARJETA HERO
   ============================================================ */
.capital-hero {
  background: linear-gradient(135deg, var(--azul-institucional), var(--azul-noche));
  color: white;
  padding: 26px;
  border-radius: var(--radius);
  border-top: 3px solid var(--dorado);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.capital-hero h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dorado);
  font-weight: 700;
}
.capital-hero .amount {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--font-display);
  margin: 4px 0;
  letter-spacing: -0.02em;
}
.capital-hero .meta {
  opacity: 0.85;
  font-size: 13px;
  margin-top: 8px;
}
.capital-hero .row {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}
.capital-hero .row .lbl { opacity: 0.7; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 14px 18px; }
  .view-root { padding: 18px 18px 100px; }
  .kpi-value { font-size: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .cliente-hero { padding: 24px; }
  .cliente-hero .saldo-amount { font-size: 28px; }
  .card { padding: 18px; }
  .card.padded-lg { padding: 20px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 40;
    box-shadow: 0 -4px 12px rgba(1, 20, 50, 0.06);
  }
  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 8px 4px;
    font-size: 10.5px;
    border-radius: 8px;
    color: var(--gris-acero);
    text-align: center;
    justify-content: center;
    border-left: none !important;
    padding-left: 4px !important;
  }
  .bottom-nav .nav-item.active {
    background: transparent;
    color: var(--azul-institucional);
    border-left: none;
  }
  .bottom-nav .nav-item.active .nav-icon { color: var(--dorado); }
  .bottom-nav .nav-icon { font-size: 20px; opacity: 1; }
}

@media (max-width: 480px) {
  .login-card { padding: 24px 20px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 20px; }
  .progress-circle { width: 120px; height: 120px; }
  .progress-circle-label .pct { font-size: 22px; }
  .cliente-hero .saldo-amount { font-size: 26px; }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 39, 0.5);
  z-index: 45;
}
.sidebar-backdrop.open { display: block; animation: fadeIn 0.2s ease-out; }
