.layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* Sidebar */
.sidebar {
  position: sticky; top: 80px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 14px;
  box-shadow: 0 1px 3px rgba(26,34,54,0.06);
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-left: 8px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #1e3a8a;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar nav a:hover { background: #eff6ff; }
.sidebar nav a.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #2b5edb 100%);
  color: #fff;
}
.sidebar nav a small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 2px;
}

/* Content */
.content { min-width: 0; }

.cliente-header {
  background: linear-gradient(135deg, #0b1e40 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(11,30,64,0.2);
}
.cliente-header h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; }
.cliente-header .nombres-encontrados { font-size: 13px; color: #cbd5e1; margin-bottom: 4px; }
.cliente-header .nombres-encontrados em { color: #7cc8ff; font-style: normal; font-weight: 600; }

.cli-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.cli-metric {
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  border-left: 4px solid #2b5edb;
  box-shadow: 0 1px 3px rgba(26,34,54,0.06);
}
.cli-metric.bad  { border-left-color: #ef4444; }
.cli-metric.good { border-left-color: #10b981; }
.cli-metric .label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.cli-metric .value { font-size: 22px; font-weight: 800; color: #0f172a; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cli-metric.bad .value { color: #b91c1c; }
.cli-metric.good .value { color: #047857; }

.cli-section { background: #fff; border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(26,34,54,0.06); }
.cli-section h3 { margin: 0 0 14px; font-size: 16px; color: #0f172a; font-weight: 700; }

/* Tabla operaciones */
.tbl-ops { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl-ops th, .tbl-ops td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.tbl-ops th { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.tbl-ops td.num, .tbl-ops th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-ops td.maq { font-weight: 600; color: #1e3a8a; }
.tbl-ops td.bad { color: #b91c1c; font-weight: 600; }

/* Tabla cuotas */
.tbl-cuotas { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl-cuotas th, .tbl-cuotas td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; text-align: left; vertical-align: top; }
.tbl-cuotas th { font-size: 10px; text-transform: uppercase; color: #6b7280; font-weight: 700; letter-spacing: 0.3px; }
.tbl-cuotas td.num, .tbl-cuotas th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-cuotas td.fecha { white-space: nowrap; color: #475569; }
.tbl-cuotas tr.pagado { background: #f0fdf4; }
.tbl-cuotas tr.impago { background: #fef2f2; }
.tbl-cuotas .badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700; }
.tbl-cuotas .badge.si { background: #d1fae5; color: #065f46; }
.tbl-cuotas .badge.no { background: #fee2e2; color: #991b1b; }
.tbl-cuotas .obs-cell { font-size: 11px; color: #475569; line-height: 1.4; max-width: 320px; }

/* Observaciones list */
.obs-list { list-style: none; padding: 0; margin: 0; }
.obs-list li {
  padding: 10px 14px;
  background: #fefce8;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

/* Hoja extra (raw dump) */
.hoja-extra-table {
  font-size: 11px;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, monospace;
}
.hoja-extra-table td {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hoja-extra-table tr:first-child td { background: #eff6ff; font-weight: 600; }
.hoja-extra-wrap { overflow-x: auto; max-height: 400px; overflow-y: auto; }

.empty {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-style: italic;
}
