/* ============================================================
   TradingContable - Estilo "DisputeFox" (light + dark)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ---------------- TEMA LIGHT ---------------- */
:root, [data-theme="light"] {
  --bg: #E6E9E4;
  --card: #F4F5F1;
  --card-soft: #EDEFEA;
  --text: #16181A;
  --text-soft: #888E91;
  --border: #DADDD6;
  --accent: #A9FF53;
  --accent-strong: #5FA512;
  --accent-soft-bg: #ECFFD4;
  --accent-soft-text: #4E8A12;
  --ink: #15171A;
  --ink-text: #FFFFFF;
  --pos: #6FB81E;
  --neg: #FF6534;
  --warn: #FFCC1C;
  --neutral: #E0E3E3;
  --hero-grad: linear-gradient(125deg, #EAFBD2 0%, #F4FCE8 45%, #FFFFFF 100%);
  --radius: 22px;
  --shadow: 0 2px 12px rgba(20,30,20,.05);
}

/* ---------------- TEMA DARK ---------------- */
[data-theme="dark"] {
  --bg: #161815;
  --card: #1F221D;
  --card-soft: #24271F;
  --text: #EFF2EC;
  --text-soft: #99A399;
  --border: #2E322C;
  --accent: #A9FF53;
  --accent-strong: #A9FF53;
  --accent-soft-bg: #2E3D14;
  --accent-soft-text: #C9FF8A;
  --ink: #A9FF53;
  --ink-text: #12150B;
  --pos: #A9FF53;
  --neg: #FF6534;
  --warn: #FFCC1C;
  --neutral: #2A2E2A;
  --hero-grad: linear-gradient(125deg, #1A2614 0%, #18210F 60%, #14160F 100%);
  --radius: 22px;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
}

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.hidden { display: none !important; }
.section { display: none; }
.section.active { display: block; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 32px; border: 1px solid var(--border); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-logo .dot, .brand .dot { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; color: #14181C; font-weight: 800; }
.login-logo b { font-size: 18px; letter-spacing: -.3px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card p.sub { color: var(--text-soft); font-size: 14px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card-soft); color: var(--text); font-size: 14px; outline: none; }
.field input:focus { border-color: var(--accent); }
.btn-primary { width: 100%; padding: 13px; border-radius: 12px; background: var(--ink); color: var(--ink-text); font-weight: 700; font-size: 15px; margin-top: 4px; }
.login-demo { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-soft); }
.login-demo a { color: var(--accent-strong); font-weight: 600; cursor: pointer; }
.login-error { background: rgba(229,72,77,.10); color: var(--neg); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }

/* ============================================================
   SHELL + NAV
   ============================================================ */
.shell { max-width: 1780px; margin: 0 auto; padding: 16px clamp(16px, 2.6vw, 40px) 36px; }
.topnav { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand b { font-size: 16px; letter-spacing: -.3px; }
.tabs { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.tab { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text-soft); font-size: 13.5px; font-weight: 500; }
.tab:hover { background: var(--card-soft); color: var(--text); }
.tab.active { background: var(--ink); color: var(--ink-text); border-color: var(--ink); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.theme-switch { display: inline-flex; gap: 4px; background: var(--card-soft); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.theme-switch button { width: 30px; height: 28px; border-radius: 999px; font-size: 13px; color: var(--text-soft); display: grid; place-items: center; }
.theme-switch button.active { background: var(--ink); color: var(--ink-text); }
.equity-pill { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.equity-pill small { font-size: 11px; color: var(--text-soft); }
.equity-pill b { font-size: 15px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #14181C; display: grid; place-items: center; font-weight: 800; font-size: 14px; cursor: pointer; }

/* ============================================================
   LAYOUT 2 COLUMNAS
   ============================================================ */
.dash { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1080px) { .dash { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel.flat { box-shadow: none; }
.p-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); font-weight: 700; margin-bottom: 4px; }
.p-h { font-size: 16px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }

/* ----- Checklist sistema (steps) ----- */
.steps { display: flex; align-items: center; }
.step { display: flex; align-items: center; gap: 10px; }
.step .ball { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--text-soft); transition: all .15s ease; }
.step.done .ball { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.step .stxt { font-size: 12.5px; font-weight: 600; line-height: 1.2; max-width: 130px; }
.step .stxt small { display: block; color: var(--text-soft); font-weight: 500; font-size: 11px; }
.step-line { flex: 1; border-top: 2px dashed var(--border); margin: 0 10px; min-width: 16px; }

/* ----- Chips estado ----- */
.chips { display: flex; gap: 26px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 10px; }
.chip .cnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.chip .clabel { font-size: 14px; font-weight: 600; }
.chip.green .cnum { background: #A9FF53; color: #1c3a00; }
.chip.orange .cnum { background: #FF6534; }
.chip.yellow .cnum { background: #FFCC1C; color: #5b4500; }

/* ----- Tabla ----- */
.ttable { width: 100%; border-collapse: collapse; }
.ttable th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-soft); text-align: left; padding: 8px 10px; font-weight: 600; }
.ttable td { padding: 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ttable td.num { font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag.pos { background: var(--accent-soft-bg); color: var(--accent-soft-text); }
.tag.neg { background: rgba(229,72,77,.14); color: var(--neg); }

/* ----- Barra de progreso degradado (Resumen) ----- */
.gradbar { height: 11px; border-radius: 6px; position: relative; margin: 16px 0 10px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 2px, rgba(255,255,255,.42) 2px 3px), linear-gradient(90deg, #E5484D, #F5A623, #84CC16); }
.gradbar .knob { position: absolute; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 4px solid var(--ink); transform: translateX(-50%); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.kv:first-of-type { border-top: none; }
.kv .k { color: var(--text-soft); }
.kv .v { font-weight: 700; }

/* ----- Donut + leyenda ----- */
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-wrap > div:first-child { width: 130px; flex-shrink: 0; }
.dlegend { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.dlegend .lrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dlegend .lrow i { width: 10px; height: 10px; border-radius: 3px; }
.dlegend .lrow .nm { flex: 1; }
.dlegend .lrow .pc { color: var(--text-soft); font-weight: 600; }

/* ----- Heatmap circular ----- */
.heatmap { display: flex; flex-direction: column; gap: 6px; }
.heat-row { display: flex; align-items: center; gap: 3px; }
.heat-row .m-label { width: 26px; font-size: 10px; color: var(--text-soft); font-weight: 600; }
.heat-cell { width: 9px; height: 9px; border-radius: 50%; background: var(--neutral); flex-shrink: 0; }
.heat-cell.pos { background: var(--accent); }
.heat-cell.neg { background: var(--neg); }
.heat-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text-soft); }
.heat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* ----- Boton negro ----- */
.btn-ink { width: 100%; background: var(--ink); color: var(--ink-text); padding: 13px; border-radius: 14px; font-weight: 700; font-size: 14px; margin-top: 12px; }
.btn-ink:hover { filter: brightness(1.05); }

/* ============================================================
   HERO (medidor)
   ============================================================ */
.hero { background: var(--hero-grad); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.hero h2 { font-size: 23px; font-weight: 700; letter-spacing: -.3px; }
.hero .greet { font-size: 14px; color: var(--text-soft); margin-top: 2px; }
.hero .seg { display: inline-flex; gap: 4px; background: rgba(255,255,255,.55); padding: 5px; border-radius: 999px; margin: 14px 0 2px; }
[data-theme="dark"] .hero .seg { background: rgba(255,255,255,.08); }
.hero .seg button { padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.hero .seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.hero .gauge { max-width: 330px; margin: 4px auto 0; }
.hero .btn-ink { max-width: 270px; margin: 6px auto 0; }

/* ----- 6 mini tarjetas ----- */
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1280px) and (min-width: 1081px) { .mini-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .mini-grid { grid-template-columns: repeat(2, 1fr); } }
.mini { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px 15px; position: relative; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s ease, transform .1s ease; }
.mini[data-goto]:hover { border-color: var(--accent); }
.mini[data-goto]:hover .arrow { color: var(--accent-strong); }
.mini:active { transform: translateY(1px); }
.mini .arrow { position: absolute; top: 12px; right: 12px; color: var(--text-soft); font-size: 14px; }
.mini .mlabel { font-size: 12.5px; font-weight: 600; padding-right: 16px; }
.mini .mval { font-size: 25px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.5px; }
.mini .mdesc { font-size: 11px; color: var(--text-soft); line-height: 1.3; }
.badge2 { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-top: 9px; }
.badge2.green { background: var(--accent-soft-bg); color: var(--accent-soft-text); }
.badge2.orange { background: #FDE6D2; color: #C2410C; }
.badge2.red { background: rgba(229,72,77,.14); color: var(--neg); }
[data-theme="dark"] .badge2.orange { background: #3a2a12; color: #FDBA74; }

/* ----- placeholder ----- */
.soon { display: grid; place-items: center; min-height: 320px; text-align: center; color: var(--text-soft); }
.soon .badge { background: var(--accent); color: #14181C; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.soon h2 { color: var(--text); font-size: 20px; margin-bottom: 6px; }

/* ============================================================
   REGISTRO DE OPERACION (estilo zona de cuenta)
   ============================================================ */
.reg-head { display: flex; align-items: center; justify-content: space-between; }
.reg-toggle { display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: var(--ink-text); font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 999px; }
.reg-toggle:hover { filter: brightness(1.06); }
.reg-cols { display: grid; grid-template-columns: 1.05fr .7fr 1fr .8fr .85fr .8fr .55fr auto; gap: 10px; padding: 12px 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-soft); font-weight: 600; border-bottom: 1px solid var(--border); }
.reg-row { display: grid; grid-template-columns: 1.05fr .7fr 1fr .8fr .85fr .8fr .55fr auto; gap: 10px; padding: 12px 6px; align-items: center; font-size: 13.5px; }
.reg-row .pts { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft-bg); color: var(--accent-soft-text); font-weight: 700; font-size: 12px; }
.f-pts-box { padding: 9px 11px; border-radius: 10px; border: 1px dashed var(--border); background: var(--card-soft); color: var(--accent-strong); font-weight: 700; font-size: 14px; }
.reg-row .chev { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; color: var(--text-soft); justify-self: end; }
.reg-form { margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 14px; }
.reg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .reg-grid { grid-template-columns: repeat(2, 1fr); } }
.reg-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.reg-grid input, .reg-grid select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-soft); color: var(--text); font-size: 13.5px; outline: none; }
.reg-grid input:focus, .reg-grid select:focus { border-color: var(--accent); }
.reg-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.reg-actions .btn-ink { width: auto; margin: 0; padding: 11px 22px; }
.reg-msg { font-size: 13px; font-weight: 600; color: var(--accent-strong); }

/* ----- Barras de % texturizadas (instrumentos) ----- */
.barlist { display: flex; flex-direction: column; gap: 11px; flex: 1; }
.barrow { display: grid; grid-template-columns: 78px 1fr 38px; align-items: center; gap: 10px; font-size: 12.5px; }
.barrow .nm { font-weight: 600; }
.barrow .pc { text-align: right; color: var(--text-soft); font-weight: 700; }
.ondbar { height: 9px; border-radius: 5px; background: var(--neutral); overflow: hidden; }
.ondbar > span { display: block; height: 100%; border-radius: 5px; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 2px, rgba(255,255,255,.5) 2px 3px); }

/* ----- compactar para reducir scroll ----- */
.col { gap: 14px; }
.row2 { gap: 14px; }
.panel { padding: 16px 18px; }
.p-h { margin-bottom: 12px; }

/* ----- Detalle de la cuenta como franja horizontal ----- */
.acct-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.acct-item { display: flex; flex-direction: column; gap: 2px; }
.acct-item .k { font-size: 12px; color: var(--text-soft); }
.acct-item .v { font-size: 15px; font-weight: 700; }
.acct-row .btn-ink { width: auto; margin: 0 0 0 auto; padding: 11px 22px; }

/* panel que crece para alinear su base con la otra columna */
.panel.grow { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.panel.grow .p-h { margin-bottom: 14px; }

/* ===== Gestión de fondos desplegable dentro de la franja de chips ===== */
.chips-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.fondos-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--card-soft); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px; padding: 9px 15px; border-radius: 999px; }
.fondos-toggle:hover { background: var(--bg); }
.fondos { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }

/* ============================================================
   UNA SOLA PANTALLA (sin scroll) - overrides finales
   ============================================================ */
.shell { min-height: 100vh; display: flex; flex-direction: column; padding: 11px clamp(16px, 2.2vw, 40px) 14px; max-width: none; margin: 0; }
.section.active { flex: 1; display: flex; min-height: calc(100vh - 92px); }
.dash { flex: 1; min-height: 0; }
.col { min-height: 0; }
/* columna derecha: medidor 2/3 + tarjetas 1/3, ocupando todo el alto */
.hero { flex: 2 1 auto; display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; }
.mini-grid { flex: 1 1 auto; grid-template-rows: 1fr 1fr; min-height: 0; }
.mini { display: flex; flex-direction: column; justify-content: center; }
/* columna izquierda: la fila calendario/instrumento se estira para llenar */
.row2.fill { flex: 1 1 auto; }
.row2.fill .panel { display: flex; flex-direction: column; }
.topnav { margin-bottom: 11px; padding: 7px 14px; }
.brand .dot { width: 28px; height: 28px; }
.tab { padding: 6px 13px; font-size: 13px; }

.dash { gap: 13px; grid-template-rows: 1fr; min-height: 0; }
.col { gap: 11px; }
.row2 { gap: 11px; }
.panel { padding: 12px 15px; }
.p-h { font-size: 14px; margin-bottom: 7px; }
.p-title { font-size: 10px; }

.steps .ball { width: 29px; height: 29px; font-size: 12px; }
.step .stxt { font-size: 12px; }
.chip .cnum { width: 28px; height: 28px; }
.chip .clabel { font-size: 13px; }

.reg-cols { padding: 8px 6px 6px; }
.reg-row { padding: 9px 6px; }

.donut-wrap > div:first-child { width: 178px; }
.heat-cell { width: 8px; height: 8px; }
.heat-row { gap: 3px; }
.heat-row .m-label { width: 24px; font-size: 10px; }
.heat-legend { margin-top: 8px; }

.hero { padding: 13px 16px; }
.hero h2 { font-size: 20px; }
.hero .greet { font-size: 13px; }
.hero .seg { margin: 9px 0 0; }
.hero .gauge { flex: 1; display: flex; align-items: center; justify-content: center; max-width: none; margin: 0; }
.hero .gauge svg { max-width: 480px; width: 100%; }
.hero .btn-ink { margin-top: 2px; padding: 10px; }

.mini-grid { gap: 11px; }
.mini { padding: 11px 13px; }
.mini .mval { font-size: 20px; margin: 4px 0 1px; }
.mini .mdesc { font-size: 10.5px; }
.badge2 { margin-top: 6px; }

/* ===== Banda "fundamentales del día" (bajo calendario/instrumentos) ===== */
.band-dia { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.band-item { display: flex; flex-direction: column; gap: 2px; }
.band-item .k { font-size: 10.5px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.band-item .v { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }

/* ===== Form de movimiento (Gestión de fondos) ===== */
.mov-form { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mov-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.mov-form input, .mov-form select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-soft); color: var(--text); font-size: 13.5px; }
.mov-form .btn-ink { width: auto; margin: 0; padding: 10px 20px; }
.fondos-btn { background: var(--ink); color: var(--ink-text); font-weight: 700; font-size: 13px; padding: 10px 18px; border-radius: 12px; margin-left: auto; }

/* ===== Calendario: llena todo el panel ===== */
#heatmap { flex: 1; justify-content: space-between; }
.row2.fill #heatmap .heat-cell { width: 11px; height: 11px; }
.row2.fill #heatmap .heat-row { gap: 3px; }

/* ===== Balance a la vista (en Operaciones por instrumento) ===== */
.bal-summary { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px; }
.bal-summary .bitem { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.bal-summary .bitem .k { color: var(--text-soft); }
.bal-summary .bitem .v { font-weight: 700; }
.bal-summary .bitem.big .k { font-size: 13px; }
.bal-summary .bitem.big .v { font-size: 19px; }

/* ============================================================
   SECCIONES (Operaciones, Movimientos, Calendario, Reportes, Notas, Config)
   ============================================================ */
.page { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.op-form { margin: 6px 0 14px; border-top: 1px dashed var(--border); padding-top: 14px; }
.tablewrap { overflow: auto; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-soft); padding: 9px 10px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dtable td { padding: 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.dtable td.num { font-variant-numeric: tabular-nums; }
.dtable .del { cursor: pointer; color: var(--neg); font-weight: 700; border: 1px solid var(--border); border-radius: 7px; padding: 3px 9px; background: var(--card-soft); }
.dtable .del:hover { background: rgba(229,72,77,.12); }

/* Calendario grande */
.cal-nav { display: flex; gap: 8px; }
.cal-nav button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--card-soft); font-size: 17px; color: var(--text); }
.cal-nav button:hover { background: var(--bg); }
.heatmap.big .heat-cell { width: 15px; height: 15px; cursor: pointer; }
.heatmap.big .heat-row { gap: 5px; }
.heatmap.big .heat-row .m-label { width: 36px; font-size: 12px; }
.heatmap.big .heat-cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-detail { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; min-height: 24px; }
.cal-detail .cd-op { display: flex; gap: 14px; padding: 5px 0; }

/* Reportes */
#rep-bars { width: 100%; }
.bc-chart { width: 100%; }
.bc-labels { display: flex; margin-top: 8px; }
.bc-labels > div { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.bc-labels .bv { font-size: 12.5px; font-weight: 700; }
.bc-labels .bl { font-size: 12px; color: var(--text-soft); }

/* Notas */
.notas-layout { flex-direction: row; align-items: stretch; }
.notas-side { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; }
.notas-main { flex: 1; display: flex; flex-direction: column; }
.nt-folder { padding: 9px 11px; border-radius: 10px; cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; }
.nt-folder:hover { background: var(--card-soft); }
.nt-folder.active { background: var(--accent-soft-bg); color: var(--accent-soft-text); font-weight: 600; }
.nt-folder small { color: var(--text-soft); }
.nt-note { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.nt-note:hover { border-color: var(--accent); }
.nt-note b { font-size: 14px; }
.nt-note small { color: var(--text-soft); display: block; margin-top: 2px; }
.nt-note .tagf { font-size: 11px; color: var(--accent-strong); font-weight: 600; }
.nt-title { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-soft); color: var(--text); font-size: 15px; font-weight: 700; margin-bottom: 8px; outline: none; }
.nt-bodywrap { position: relative; }
.nt-bodywrap textarea { width: 100%; min-height: 150px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-soft); color: var(--text); font-size: 14px; resize: vertical; outline: none; font-family: inherit; }
.slash-menu { position: absolute; top: 44px; left: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 30; }
.slash-menu .sm-h { font-size: 11px; color: var(--text-soft); padding: 4px 10px; text-transform: uppercase; letter-spacing: .4px; }
.slash-menu div.sm-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.slash-menu div.sm-item:hover { background: var(--card-soft); }

/* ============================================================
   MÓVIL (solo lectura) — hasta 768px
   ============================================================ */
@media (max-width: 768px) {
  /* el contenido fluye y hace scroll vertical natural */
  .shell { height: auto; min-height: 0; padding: 10px 12px 28px; }
  .section.active { display: block; min-height: 0; }
  .dash { display: block; grid-template-rows: auto; height: auto; }
  .dash > .col { display: block; margin-bottom: 12px; }
  .col > * { margin-bottom: 12px; }

  /* barra superior: marca + acciones arriba, pestañas deslizables abajo */
  .topnav { flex-wrap: wrap; gap: 10px; padding: 9px 12px; }
  .topnav .brand { flex: 1 1 auto; }
  .nav-right { order: 2; gap: 10px; }
  .tabs { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 3px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; white-space: nowrap; }

  /* medidor y tarjetas */
  .hero { flex: none; }
  .hero .gauge { flex: none; }
  .hero .gauge svg { max-width: 100%; }
  .mini-grid { display: grid; grid-template-columns: 1fr 1fr; flex: none; }
  .row2, .row2.fill { grid-template-columns: 1fr; flex: none; }

  /* calendario y tablas: scroll horizontal si no caben */
  .heatmap { overflow-x: auto; }
  .heatmap.big .heat-cell { width: 10px; height: 10px; }
  .heatmap.big .heat-row { gap: 3px; }
  .tablewrap { overflow-x: auto; }
  .reg-cols, .reg-row { font-size: 11px; gap: 6px; }

  /* chips, balance, notas */
  .chips-bar { flex-wrap: wrap; }
  .chips { gap: 16px; flex-wrap: wrap; }
  .bal-summary { grid-template-columns: 1fr; }
  .notas-layout { flex-direction: column; }
  .notas-side { width: 100%; }
  .acct-row { gap: 16px; }
  .acct-row .btn-ink { margin: 8px 0 0; width: 100%; }
}

@media (max-width: 460px) {
  .mini-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 19px; }
  .topnav .equity-pill { display: none; }
}
