:root {
  --navy: #071a33;
  --blue: #1264d6;
  --cyan: #23b7e5;
  --green: #0f9f70;
  --red: #c0392b;
  --orange: #d98216;
  --bg: #f0f4f9;
  --card: #ffffff;
  --text: #0e213b;
  --muted: #5a6a7e;
  --line: #dbe5f0;
  --shadow: 0 4px 20px rgba(7,26,51,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; background: var(--bg); scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); min-height: 100vh; }

/* ── Layout principal ─────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px; flex: 0 0 240px;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand h1 { font-size: 17px; font-weight: 900; color: #fff; letter-spacing: -.3px; }
.sidebar-brand small { display: block; font-size: 10px; color: #7fa3c8; margin-top: 2px; letter-spacing: .05em; }

.sidebar-empresa { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.empresa-selector { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px 10px; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.empresa-selector option { background: #071a33; }

.sidebar-nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.nav-section { padding: 8px 16px 4px; font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #4a6a88; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 16px; color: #b0c8e0; font: inherit; font-size: 13px;
  cursor: pointer; border-radius: 0; transition: .15s;
}
.nav-btn .icon { font-size: 16px; width: 22px; text-align: center; }
.nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-btn.active { background: rgba(18,100,214,.3); color: #fff; border-right: 3px solid var(--cyan); }

.sidebar-bottom { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #4a6a88; }

/* ── Contenido principal ────────────────────────────────────────────────────── */
.main-content { margin-left: 240px; flex: 1; min-height: 100vh; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 17px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-empresa { font-size: 12px; color: var(--muted); background: #f0f4f9; border-radius: 8px; padding: 6px 10px; }

.page { padding: 22px 24px; display: none; }
.page.active { display: block; }

/* ── KPI Cards ───────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.kpi-card .kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.kpi-card .kpi-valor { font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.kpi-card .kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-card.kpi-green .kpi-valor { color: var(--green); }
.kpi-card.kpi-red .kpi-valor { color: var(--red); }
.kpi-card.kpi-blue .kpi-valor { color: var(--blue); }
.kpi-card.kpi-orange .kpi-valor { color: var(--orange); }

/* ── Graficas ────────────────────────────────────────────────────────────── */
.graficas-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.chart-card h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.chart-canvas { width: 100%; height: 220px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── Tablas ──────────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.card-header h3 { font-size: 15px; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #f5f8fc; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
tbody td { padding: 9px 10px; border-bottom: 1px solid #f0f4f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
.td-monto { font-weight: 700; font-variant-numeric: tabular-nums; }
.td-monto.positivo { color: var(--green); }
.td-monto.negativo { color: var(--red); }

/* ── Badges / Pills ─────────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; letter-spacing: .03em; }
.badge-green { background: #eaf9f3; color: #0a7a52; }
.badge-red { background: #fef0ee; color: #9b2020; }
.badge-blue { background: #e7f3ff; color: #0e5baf; }
.badge-orange { background: #fef5e7; color: #8f5000; }
.badge-gray { background: #f0f4f9; color: var(--muted); }

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(18,100,214,.2); }
.btn-primary:hover { background: #0f56c0; }
.btn-secondary { background: #f0f4f9; color: var(--text); }
.btn-secondary:hover { background: #e2eaf6; }
.btn-danger { background: #fef0ee; color: var(--red); }
.btn-danger:hover { background: #fdddd9; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-icon { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; font-size: 15px; color: var(--muted); }
.btn-icon:hover { background: #f0f4f9; color: var(--text); }

/* ── Formularios ─────────────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: 13px; color: var(--text); background: #fff;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,100,214,.1); }

/* ── Filtros ─────────────────────────────────────────────────────────────── */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros select, .filtros input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 12px; color: var(--text); background: #fff; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,26,51,.5); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 20px; padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(7,26,51,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-close { background: #f0f4f9; border: 0; border-radius: 50%; width: 32px; height: 32px; font-size: 18px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #e2eaf6; }

/* ── Alertas ─────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 12px; line-height: 1.4; margin-bottom: 12px; }
.alert-info { background: #e7f3ff; border: 1px solid #b0d0f0; color: #0e5baf; }
.alert-success { background: #eaf9f3; border: 1px solid #a0e0c0; color: #0a6b47; }
.alert-warning { background: #fef5e7; border: 1px solid #f5d08a; color: #7a4200; }
.alert-danger { background: #fef0ee; border: 1px solid #f0b8b0; color: #8b1a1a; }

/* ── Estado vacío ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 1.5; }

/* ── Dashboard: últimas transacciones ────────────────────────────────────── */
.tx-list { display: grid; gap: 6px; }
.tx-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f4f9; }
.tx-item:last-child { border-bottom: 0; }
.tx-concepto { font-size: 12.5px; font-weight: 600; }
.tx-fecha { font-size: 11px; color: var(--muted); }
.tx-monto { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Reportes ────────────────────────────────────────────────────────────── */
.reporte-seccion { margin-bottom: 20px; }
.reporte-seccion h4 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.reporte-fila { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; font-size: 13px; border-bottom: 1px solid #f5f8fc; }
.reporte-fila.total { font-weight: 900; font-size: 14px; background: #f0f4f9; padding: 8px 10px; border-radius: 8px; border: none; margin-top: 6px; }
.reporte-fila.subtotal { font-weight: 700; }

/* ── Nómina ──────────────────────────────────────────────────────────────── */
.nomina-detalle { background: #f8fbfe; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0; }
.nomina-detalle table { font-size: 12px; }
.nomina-detalle thead th { font-size: 10px; }

/* ── Indicadores presupuesto ────────────────────────────────────────────── */
.presupuesto-bar { background: #e8eef5; border-radius: 999px; height: 8px; margin: 4px 0; overflow: hidden; }
.presupuesto-fill { height: 100%; border-radius: 999px; transition: width .4s; }
.presupuesto-fill.ok { background: var(--green); }
.presupuesto-fill.warn { background: var(--orange); }
.presupuesto-fill.over { background: var(--red); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 12px; font-weight: 700; z-index: 9999; opacity: 0; transition: opacity .25s; pointer-events: none; }
#toast.show { opacity: 1; }

/* ── Auth overlay ────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #071a33 0%, #1264d6 100%);
  display: flex; align-items: center; justify-content: center;
}
.auth-overlay.hidden { display: none; }
.auth-card {
  background: #fff; border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.auth-logo { font-size: 28px; font-weight: 800; color: var(--navy); text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.auth-msg { font-size: 12px; color: var(--red); min-height: 18px; margin-bottom: 8px; text-align: center; }
.auth-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-btns .btn { padding: 12px; font-size: 14px; }
.auth-note { font-size: 10px; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ── Modo Solo Lectura ────────────────────────────────────────────────────── */
.modo-banner {
  display: none; position: sticky; top: 57px; z-index: 48;
  background: linear-gradient(90deg, #d98216, #e8a030);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 8px 24px; text-align: center; letter-spacing: .03em;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
body.modo-lectura .modo-banner { display: block; }
body.modo-lectura .btn-mutacion,
body.modo-lectura .btns-mutacion { display: none !important; }
body.modo-lectura .btn-icon { pointer-events: none; opacity: .25; }

.modo-toggle {
  display: flex; align-items: center; gap: 7px;
  background: #f0f4f9; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 6px;
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  color: var(--text); transition: .15s;
}
.modo-toggle:hover { background: #e2eaf6; }
.modo-toggle .dot {
  width: 22px; height: 22px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 12px;
  background: var(--green); color: #fff; transition: background .2s;
}
body.modo-lectura .modo-toggle .dot { background: var(--orange); }
body.modo-lectura .modo-toggle .lbl-edit { display: none; }
body:not(.modo-lectura) .lbl-lectura { display: none; }

/* ── Modal de Confirmación ────────────────────────────────────────────────── */
.confirm-modal-body { padding: 12px 0; }
.confirm-accion { font-size: 15px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.confirm-detalle { font-size: 13px; color: var(--muted); line-height: 1.6; }
.confirm-warning { background: #fef5e7; border: 1px solid #f5d08a; border-radius: 10px; padding: 10px 14px; font-size: 12px; color: #7a4200; margin-top: 12px; }

/* ── Auditoría / Herramientas ─────────────────────────────────────────────── */
.auditoria-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.auditoria-tool {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px; box-shadow: var(--shadow); text-align: center;
}
.auditoria-tool .tool-icon { font-size: 32px; margin-bottom: 8px; }
.auditoria-tool h4 { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.auditoria-tool p { font-size: 11px; color: var(--muted); line-height: 1.4; margin-bottom: 12px; }
.auditoria-result {
  margin-top: 6px; font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; display: inline-block;
}
.auditoria-result.ok { background: #eaf9f3; color: #0a7a52; }
.auditoria-result.warn { background: #fef5e7; color: #8f5000; }
.auditoria-result.error { background: #fef0ee; color: #9b2020; }

.error-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.error-item {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; display: flex; gap: 10px; align-items: flex-start;
}
.error-item .ei-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.error-item .ei-body { flex: 1; }
.error-item .ei-titulo { font-weight: 700; color: var(--text); }
.error-item .ei-desc { color: var(--muted); line-height: 1.4; margin-top: 2px; }
.error-item.tipo-duplicado { border-left: 3px solid var(--orange); }
.error-item.tipo-nomina { border-left: 3px solid var(--red); }
.error-item.tipo-cuadre { border-left: 3px solid var(--blue); }

/* ── Importador CSV ───────────────────────────────────────────────────────── */
.import-zone {
  border: 2px dashed var(--line); border-radius: 16px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: .2s; background: #fafcff;
}
.import-zone:hover, .import-zone.drag-over { border-color: var(--blue); background: #f0f7ff; }
.import-zone .iz-icon { font-size: 40px; margin-bottom: 10px; }
.import-zone p { font-size: 13px; color: var(--muted); }
.import-zone b { color: var(--blue); }
.import-preview-wrap { overflow-x: auto; margin-top: 14px; }
.import-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.import-map select { font-size: 11px; padding: 6px 8px; }
.import-resumen { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; font-size: 12px; font-weight: 700; }
.import-resumen span { background: #f0f4f9; padding: 4px 10px; border-radius: 8px; }
.import-resumen .ok-tag { background: #eaf9f3; color: #0a7a52; }
.import-resumen .err-tag { background: #fef0ee; color: #9b2020; }

/* ── IA Contable ────────────────────────────────────────────────────────── */
.ia-chat-container {
  min-height: 200px; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: #f8fbfe; margin: 0 16px 0;
}
.ia-burbuja { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.ia-usuario { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ia-ia      { background: #fff; border: 1px solid var(--line); color: var(--navy); align-self: flex-start; border-bottom-left-radius: 4px; }
.ia-cargando { background: #f0f4f9; color: var(--muted); font-style: italic; align-self: flex-start; }
.ia-input-row { display: flex; gap: 8px; padding: 10px 16px; align-items: center; }
.ia-input { flex: 1; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; outline: none; }
.ia-input:focus { border-color: var(--blue); }

/* ── Sidebar scroll (para más items) ────────────────────────────────────── */
.sidebar-nav { overflow-y: auto; flex: 1; padding-bottom: 8px; }

/* ── Escáner de Documentos ──────────────────────────────────────────────── */
.scan-drop-zone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafd;
}
.scan-drop-zone:hover,
.scan-drop-zone.drag-over {
  border-color: var(--blue);
  background: #eef4ff;
}

/* ── Sidebar toggle (hamburger) ─────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--text); padding: 4px 8px; line-height: 1;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Sidebar oculta por defecto en móvil; se abre con toggle */
  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-brand h1, .sidebar-brand small, .nav-section, .sidebar-empresa, .sidebar-bottom p { display: none; }
  .sidebar-toggle { display: flex; align-items: center; }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .graficas-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page { padding: 14px 12px; }
  .topbar { padding: 10px 12px; }
}

/* ── Modo de Uso (Sencillo / Profesional) ──────────────────────────────────── */
body[data-modo="sencillo"] [data-solo-pro]    { display: none !important; }
body[data-modo="profesional"] [data-solo-simple] { display: none !important; }

/* Botón grande para Modo Sencillo */
.btn-grande {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 18px 20px; margin: 0;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
  font: inherit; font-size: 15px; font-weight: 700; color: var(--text);
  cursor: pointer; text-align: left; transition: .15s;
}
.btn-grande:hover { background: #f0f7ff; border-color: var(--blue); transform: translateY(-1px); }
.btn-grande .bg-icon {
  font-size: 26px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; flex-shrink: 0;
}
.btn-grande .bg-label { flex: 1; }
.btn-grande .bg-desc { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; display: block; }
.panel-simple { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .panel-simple { grid-template-columns: 1fr; } }

/* Resumen en lenguaje natural */
.resumen-natural {
  background: linear-gradient(135deg, #f0f7ff, #e8f3ff);
  border: 1.5px solid #c0d8f5; border-radius: 20px;
  padding: 22px 24px; margin-bottom: 20px;
}
.resumen-natural .rn-saludo { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; letter-spacing: .04em; }
.resumen-natural .rn-titulo { font-size: 18px; font-weight: 900; color: var(--navy); margin-bottom: 14px; line-height: 1.3; }
.resumen-natural .rn-dato { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.resumen-natural .rn-estado { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; margin-top: 12px; }
.rn-estado.bien    { background: #eaf9f3; color: #0a6b47; }
.rn-estado.atencion { background: #fef5e7; color: #7a4200; }

/* Selector de modo en Configuración */
.modo-selector { display: flex; gap: 12px; margin: 14px 0; }
.modo-opcion {
  flex: 1; padding: 16px 12px; border: 2px solid var(--line);
  border-radius: 14px; cursor: pointer; text-align: center;
  background: var(--card); transition: .15s;
}
.modo-opcion:hover { border-color: var(--blue); background: #f0f7ff; }
.modo-opcion.activo { border-color: var(--blue); background: #e7f3ff; }
.modo-opcion .mo-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.modo-opcion .mo-nombre { font-size: 13px; font-weight: 800; color: var(--navy); }
.modo-opcion .mo-desc { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* Modal de bienvenida / onboarding */
.onboarding-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
@media (max-width: 480px) { .onboarding-opciones { grid-template-columns: 1fr; } }
.onboarding-card {
  padding: 20px 14px; border: 2px solid var(--line); border-radius: 16px;
  cursor: pointer; text-align: center; transition: .15s; background: var(--card);
}
.onboarding-card:hover { border-color: var(--blue); }
.onboarding-card.seleccionado { border-color: var(--blue); background: #e7f3ff; }
.onboarding-card .oc-icon  { font-size: 36px; display: block; margin-bottom: 10px; }
.onboarding-card .oc-titulo { font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.onboarding-card .oc-desc  { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* Badge de modo en sidebar */
.modo-badge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .04em; margin-left: 4px; vertical-align: middle; }
.modo-badge-sencillo { background: #eaf9f3; color: #0a7a52; }
.modo-badge-pro      { background: #e7f3ff; color: #0e5baf; }
