/* ===== Conta · Academia ===== */
:root {
  /* Marca Ivan Training&Lifestyle (manual IC_IVAN; #2D2D44 es el bueno, no la errata #14191f) */
  --bg: #F4F4F6;          /* fondo claro neutro */
  --panel: #FFFFFF;
  --ink: #2D2D44;         /* azul oscuro: texto sobre claro */
  --ink2: #1E1E2C;        /* azul casi negro: bloques oscuros */
  --teal: #3FBFB0;        /* turquesa: solo detalles, nunca texto sobre blanco */
  --muted: #5C5C70;       /* gris azulado legible sobre blanco */
  --line: #DCDCE3;
  --brand: #2D2D44;
  --brand-ink: #1E1E2C;
  --terracota: #3FBFB0;
  --terracota-deep: #2FA396;
  --green: #1F7A50;
  --red: #B42318;
  --orange: #9A5B00;
  --purple: #5B4B8A;
  --sidebar: #1E1E2C;
  --sidebar-ink: #FFFFFF;
  --radius: 0px;
  --shadow: none;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3, .kpi-val, .liq-total b { font-family: "Montserrat", sans-serif; font-weight: 700; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
#app { min-height: 100%; }
.boot, .loading { padding: 40px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
a { color: var(--brand); text-decoration: none; }
.link { color: var(--brand); font-weight: 600; }
.r { text-align: right; }

/* ===== Botones ===== */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cdd5e4; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.ic {
  border: none; background: transparent; cursor: pointer; font-size: 15px;
  width: 30px; height: 30px; border-radius: 8px; color: var(--muted);
}
/* Iconos de Lucide (js/iconos.js): del color y tamaño del texto que los rodea. */
.lic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; }
.btn .lic { margin-right: .3em; }
.ic .lic { width: 17px; height: 17px; vertical-align: middle; }
.ic:hover { background: #eef1f7; color: var(--ink); }
.ic.danger:hover { background: #fde8e8; color: var(--red); }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1100px 600px at 50% -5%, #EDE4D3, var(--bg)); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 38px 34px; width: 100%; max-width: 410px; text-align: center; }
.brand-big { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand-big .logo-mark { width: 72px; height: 72px; }
.brand-big h1 { font-size: 27px; margin: 0; letter-spacing: -.3px; color: var(--ink); }
.brand-big h1 span { color: var(--terracota); }
.login-card form { text-align: left; }
.login-card .muted { text-align: center; }
.brand-dot { width: 14px; height: 14px; border-radius: 5px; background: var(--terracota); }
.login-card form { margin-top: 18px; display: grid; gap: 14px; }
.login-card label, .form-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.login-card input { padding: 11px 13px; }
.login-error { color: var(--red); font-size: 13px; min-height: 16px; margin: 0; }

input, select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid #bfd3ff; border-color: var(--brand); }

/* ===== Shell ===== */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; font-size: 18px; color: var(--ink); }
.brand .logo-mark { width: 30px; height: 30px; flex: none; }
img.logo-mark { object-fit: contain; border-radius: 8px; }
.nav { display: grid; gap: 3px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #6E6757; font-weight: 600; font-size: 14px; transition: .15s; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(44,36,22,.06); color: var(--ink); }
.nav-item.active { background: var(--terracota); color: #fff; }
.sidebar-foot { padding-top: 12px; border-top: 1px solid rgba(44,36,22,.1); }
.sidebar-foot .btn { color: var(--sidebar-ink); border-color: rgba(44,36,22,.16); background: transparent; }
.sidebar-foot .btn:hover { background: rgba(44,36,22,.06); }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px;
  background: rgba(245,240,232,.88); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; flex: 1; }
.hamburger { display: none; border: none; background: none; font-size: 22px; cursor: pointer; }
.content-inner { padding: 24px 26px 60px; }

/* ===== Layout helpers ===== */
.stack-lg { display: grid; gap: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.sec-tit { font-size: 15px; margin: 22px 0 4px; }
.sec-tit:first-child { margin-top: 0; }

/* ===== Dashboard ===== */
.dash-head { display: flex; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button em { font-style: normal; opacity: .6; font-size: 11px; }
.seg button.on { background: var(--brand); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border-left: 4px solid var(--brand); }
.kpi.azul { border-left-color: var(--brand); }
.kpi.verde { border-left-color: var(--green); }
.kpi.naranja { border-left-color: var(--orange); }
.kpi.morado { border-left-color: var(--purple); }
.kpi.rojo { border-left-color: var(--red); }
.kpi-tit { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 23px; font-weight: 700; letter-spacing: -.5px; margin: 5px 0 2px; }
.kpi-sub { font-size: 11px; color: var(--muted); }

.liq { display: grid; gap: 9px; }
.liq-row { display: flex; justify-content: space-between; font-size: 14px; color: #475569; }
.liq-total { display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
  padding: 12px 14px; border-radius: 11px; font-size: 15px; }
.liq-total b { font-size: 19px; }
.liq-total.pagar { background: #fef2f2; color: var(--red); }
.liq-total.devolver { background: #f0fdf4; color: var(--green); }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: none; }
.mini-main { display: grid; }
.mini-izq { font-weight: 600; font-size: 14px; }
.mini-sub { font-size: 12px; color: var(--muted); }
.mini-der { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* ===== Tablas ===== */
.list-toolbar { margin-bottom: 16px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla thead th { text-align: left; padding: 13px 16px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); background: #fafbfd; border-bottom: 1px solid var(--line); }
.tabla th.r { text-align: right; }
.tabla tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover { background: #f8faff; }
td.acciones { text-align: right; white-space: nowrap; }
.chip { background: #eef2f9; color: #475569; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.tabla .c-check { width: 34px; padding-right: 0; }
.tabla .c-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.tabla .badge[data-ingreso] { cursor: pointer; }

/* Barra para apuntar el ingreso en el banco de varias facturas a la vez */
.barra-ingreso { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; bottom: 16px; z-index: 5; margin-top: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .13); }
.barra-ingreso[hidden] { display: none; }
.barra-ingreso label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #334155; }
.barra-ingreso input[type="date"] { width: auto; }

.badge { border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; display: inline-block; }
.badge.verde { background: #dcfce7; color: #15803d; }
.badge.azul { background: #dbeafe; color: var(--brand-ink); }
.badge.rojo { background: #fee2e2; color: var(--red); }
.badge.gris { background: #eef2f9; color: var(--muted); }
.badge.naranja { background: #ffedd5; color: var(--orange); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--panel);
  border: 1px dashed var(--line); border-radius: var(--radius); }
.empty.sm { padding: 22px; border: none; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid;
  place-items: center; padding: 16px; z-index: 100; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; width: 100%; max-height: 92vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .col-2 { grid-column: 1 / -1; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; }
.form-grid label.check input { width: auto; }

/* ===== Líneas de factura ===== */
.lineas { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.lineas-head, .linea-row { display: grid; grid-template-columns: 1fr 80px 100px 70px 110px 34px; gap: 8px; align-items: center; }
.lineas-head { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 4px 8px; }
.linea-row { margin-bottom: 8px; }
.linea-row input { padding: 8px 9px; }
.li-importe { text-align: right; font-weight: 600; font-size: 13px; }
.totales { margin-top: 16px; display: grid; gap: 6px; max-width: 320px; margin-left: auto; }
.tot-row { display: flex; justify-content: space-between; font-size: 14px; color: #475569; }
.tot-row.total { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 17px; color: var(--ink); }
.tot-row.total b { font-size: 19px; }

.scan-box { margin-bottom: 18px; padding: 14px; border: 1px dashed var(--brand); border-radius: 12px; background: #f1efe7; text-align: center; }
.scan-box .muted { margin: 8px 0 0; }
.scan-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scan-btns .btn { flex: 1; min-width: 130px; }
.adj-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; font-size: 13px; background: var(--panel); }
.adj-item .adj-del { margin-left: auto; }
.calc-box { margin-top: 14px; display: flex; gap: 16px; justify-content: flex-end; padding: 12px 14px;
  background: #f8faff; border-radius: 10px; font-size: 14px; color: #475569; }
.calc-box b { color: var(--ink); }
.form-actions { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.saved { color: var(--green); font-weight: 600; font-size: 14px; }

/* ===== Estudio de marca ===== */
.preset-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.preset-chip { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 8px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 92px; transition: .15s; }
.preset-chip:hover { border-color: var(--brand); }
.preset-chip.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.preset-chip .sw { display: flex; gap: 3px; }
.preset-chip .sw i { width: 18px; height: 18px; border-radius: 5px; display: block; }
.preset-chip > span { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; }
.marca-preview { display: flex; gap: 14px; align-items: center; margin: 4px 0 18px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--sidebar); }
.marca-prev-logo { flex: none; width: 52px; height: 52px; display: inline-flex; }
.marca-prev-logo svg, .marca-prev-logo img { width: 52px; height: 52px; }
input[type=color] { height: 42px; padding: 4px; cursor: pointer; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 200; opacity: 0; transition: .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--red); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 230px; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .hamburger { display: block; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .lineas-head { display: none; }
  .linea-row { grid-template-columns: 1fr 1fr; }
  .content-inner { padding: 18px 14px 60px; }
  .tabla { font-size: 13px; }
}

/* ===== Pendientes / Por revisar ===== */
.badge.terracota { background: #f6e2d3; color: var(--terracota-deep); }
.card-title { font-size: 18px; margin: 0 0 12px; }
.pend-list { display: flex; flex-direction: column; gap: 10px; }
.pend { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.pend.alta { border-left: 4px solid var(--terracota); }
.pend.done { opacity: .6; }
.pend.done .pend-titulo { text-decoration: line-through; }
.pend-check { padding-top: 2px; }
.pend-check input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.pend-main { flex: 1; min-width: 0; }
.pend-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pend-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.pend-detalle { font-size: 14px; margin-top: 4px; }
.pend-hechas { margin-top: 18px; }
.pend-hechas summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }

/* ===== Extractos de banco ===== */
.ext-grid { display: flex; flex-direction: column; gap: 16px; }
.ext-item { border-top: 1px solid var(--line); padding-top: 12px; }
.ext-item:first-child { border-top: none; padding-top: 0; }
.ext-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ext-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ext-thumb { display: block; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.ext-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ext-thumb.pdf { display: flex; align-items: center; justify-content: center; background: #f1efe7; color: var(--muted); font-weight: 700; font-size: 13px; }
.ext-acc { display: flex; gap: 4px; flex-shrink: 0; }

/* ===== Zona de subida de archivos ===== */
.upload-zone { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--brand); border-radius: 12px; background: #f1efe7; }
.upload-list { flex-basis: 100%; }

/* ===== Panel de estado de conciliación (vista Banco) ===== */
.estado-conc { border-left: 4px solid var(--terracota); display: flex; flex-direction: column; gap: 8px; }
.estado-row { font-size: 14px; line-height: 1.45; }


/* ===== Marca Ivan Training&Lifestyle (19 nov 2026) ===== */
[hidden] { display: none !important; }
/* Colores planos y esquinas rectas en todo */
.btn, .ic, input, select, textarea, .seg, .seg button, .kpi, .panel, .card, .modal, .badge, .chip,
.liq-total, .login-card, .empty, .toast, .scan-box, .adj-item, .calc-box, .nav-item, .barra-ingreso { border-radius: 0 !important; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--ink2); }   /* botón turquesa con texto oscuro */
.btn.primary:hover { background: var(--terracota-deep); border-color: var(--terracota-deep); }
.btn.ghost-dark { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); }
.btn.ghost-dark:hover { border-color: #fff; }
.seg button.on { background: var(--ink); color: #fff; }
input:focus, select:focus { outline: 2px solid var(--teal); border-color: var(--ink); }
.tabla thead th { background: #F4F4F6; }
.tabla tbody tr:hover { background: #F8F8FA; }
.tabla .c-check input { accent-color: var(--ink); }
.card { overflow-x: auto; }
.tabla tr.subtotal td { background: #F4F4F6; font-weight: 600; font-size: 13px; }
.tabla tr.total td { background: var(--ink); color: #fff; font-weight: 700; }
.kpi { border-left: 4px solid var(--teal); }
.kpi.verde, .kpi.azul, .kpi.morado, .kpi.naranja, .kpi.rojo { border-left-color: var(--teal); }
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.liq-total.pagar { background: #FDECEA; color: var(--red); }
.liq-total.devolver { background: #E7F6F4; color: var(--green); }
.badge.verde { background: #E7F6F4; color: var(--green); }
.badge.naranja { background: #FFF1DB; color: var(--orange); }
.nota { margin: 0; padding: 12px 16px; background: #E7F6F4; border-left: 4px solid var(--teal); font-size: 14px; }
.acciones-tri { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar { background: rgba(244,244,246,.92); }

/* Columna lateral oscura con el logo en blanco y turquesa */
.sidebar { background: var(--ink2); color: #fff; }
.brand { flex-direction: column; align-items: flex-start; gap: 8px; padding: 6px 8px 22px; color: #fff; }
.brand img { width: 170px; max-width: 100%; height: auto; }
.brand-app { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.nav { align-content: start; }
.nav-item { color: rgba(255,255,255,.78); }
.tabla td b { white-space: nowrap; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--teal); color: var(--ink2); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-foot .btn { color: #fff; border-color: rgba(255,255,255,.5); }
.sidebar-mail { color: rgba(255,255,255,.7); margin: 0 0 8px; word-break: break-all; }

/* Entrada: bloque oscuro, como el panel */
.login-wrap { background: var(--ink2); }
.login-card { background: var(--ink); border: none; color: #fff; text-align: center; }
.login-logo { width: 220px; max-width: 100%; margin: 0 auto 6px; display: block; }
.login-card h1 { color: var(--teal); font-size: 24px; margin: 6px 0 4px; }   /* titular turquesa sobre oscuro (5,9:1) */
.login-sub { color: #fff; margin: 0 0 16px; font-size: 14px; }
.login-nota { color: rgba(255,255,255,.8); font-size: 12px; margin: 8px 0 14px; }
.login-card form { display: grid; gap: 10px; margin-top: 10px; }
.login-card input { background: #fff; }
.login-error { color: #fff; font-size: 13px; margin-top: 12px; min-height: 16px; }

@media (max-width: 900px) {
  .kpis-4 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 12px 16px; }
  .content-inner { padding: 16px 16px 60px; }
  .acciones-tri .btn { flex: 1; white-space: normal; }
}
@media (max-width: 600px) {
  .tabla .m-oc { display: none; }
  .tabla thead th, .tabla tbody td { padding: 11px 10px; }
}
