/* SICSE Conta — estilos */
:root {
  --paper: #f5f2eb;
  --card: #fffdf9;
  --ink: #17201d;
  --ink-2: #33403b;
  --muted: #66716c;
  --line: #e4ddcf;
  --line-2: #efe9dd;
  --brand: #0e5a4b;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe9;
  --brand-hover: #0b4a3e;
  --ok: #1c7a4c;
  --ok-soft: #e2f2e8;
  --warn: #a55a12;
  --warn-soft: #fbeedd;
  --err: #a8261d;
  --err-soft: #fbe6e3;
  --side: #10241f;
  --side-ink: #d7e3de;
  --side-muted: #8fa59d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 32, 29, .05), 0 4px 16px rgba(23, 32, 29, .04);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  background: var(--paper); color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.num, td.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num, th.num { text-align: right; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* ---------- Layout app ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 20px 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.05rem; padding: 4px 10px 14px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: #2fa37f; display: grid; place-items: center;
  color: #0b231d; font-weight: 900; font-size: .95rem;
}
.side .cuenta-nombre { font-size: .78rem; color: var(--side-muted); padding: 0 10px 12px; text-transform: uppercase; letter-spacing: .06em; }
.side a.nav {
  display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; font-weight: 500;
}
.side a.nav:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side a.nav.on { background: rgba(47,163,127,.18); color: #fff; }
.side .nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side .grupo { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 10px 6px; }
.side .contrib-activo { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px; margin: 6px 0; }
.side .contrib-activo b { display: block; color: #fff; font-size: .9rem; line-height: 1.25; }
.side .contrib-activo span { font-size: .78rem; color: var(--side-muted); }
.side .pie { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side form { margin: 0; }
.side button.nav { all: unset; display: flex; gap: 10px; align-items: center; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; width: 100%; box-sizing: border-box; font-weight: 500; }
.side button.nav:hover { background: rgba(255,255,255,.06); }

.main { min-width: 0; padding: 26px 32px 60px; max-width: 1240px; }
.topbar { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .det { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.kpi.destacado { background: var(--brand); color: #fff; border-color: var(--brand); }
.kpi.destacado .lbl, .kpi.destacado .det { color: #c5e3d8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #cfc6b4; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--err); border-color: #e9c3be; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 11px; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { all: unset; color: var(--brand); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-err { background: var(--err-soft); color: var(--err); }
.b-brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.verde { background: #2a9d63; } .dot.ambar { background: #e09a2b; } .dot.rojo { background: #cf3b2f; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-soft); border-color: #bfe0cc; color: #155a38; }
.flash.error { background: var(--err-soft); border-color: #efc2bc; color: #861d16; }
.flash.aviso { background: var(--warn-soft); border-color: #f0d3ad; color: #7d430d; }
.nota { background: var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: .9rem; color: var(--ink-2); }
.nota.warn { background: var(--warn-soft); color: #7d430d; }
.nota ul { margin: 6px 0 0; padding-left: 18px; }

/* Tablas */
.tabla-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf7f0; }
td .sub { display: block; font-size: .8rem; color: var(--muted); }
tr.cancelado td { color: var(--muted); text-decoration: line-through; }
tr.cancelado td .badge { text-decoration: none; }
.vacio { text-align: center; padding: 34px 10px; color: var(--muted); }

/* Formularios */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.campo { margin-bottom: 16px; }
.campo .ayuda { font-size: .82rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], select, textarea, input[type=file] {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d8d0c0; border-radius: 9px; background: #fff; color: var(--ink);
}
input[type=file] { padding: 8px; background: var(--line-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14,90,75,.25); border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 10px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.fila { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filtros > * { flex: 1 1 140px; }
.filtros .campo { margin: 0; }
.filtros label { font-size: .78rem; color: var(--muted); }
.filtros input, .filtros select { padding: 8px 10px; }

/* Pestañas de contribuyente */
.contrib-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.contrib-head h1 { margin: 0; font-size: 1.45rem; }
.contrib-head .meta { color: var(--muted); font-size: .9rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* Previa */
.previa-total { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.previa-total .monto { font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.calc { width: 100%; }
.calc td { padding: 7px 0; border: 0; }
.calc td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc tr.sub td { border-top: 1px solid var(--line-2); font-weight: 600; padding-top: 9px; }
.calc tr.total td { border-top: 2px solid var(--ink); font-weight: 800; font-size: 1.08rem; padding-top: 10px; }
.calc tr.info td { color: var(--muted); font-size: .88rem; }
.periodo-nav { display: flex; align-items: center; gap: 6px; }
.periodo-nav select { width: auto; padding: 7px 10px; }

/* Barras simples */
.barras { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; margin-top: 8px; }
.barra { display: flex; gap: 2px; align-items: flex-end; height: 100%; position: relative; }
.barra span { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.barra .i { background: var(--brand); }
.barra .g { background: #d9a35a; }
.barras-eje { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; font-size: .72rem; color: var(--muted); text-align: center; margin-top: 4px; }
.leyenda { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Lista de vencimientos */
.venc { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.venc:last-child { border-bottom: 0; }
.venc .fecha { width: 48px; text-align: center; flex: none; background: var(--line-2); border-radius: 8px; padding: 4px 0; }
.venc .fecha b { display: block; font-size: 1.15rem; line-height: 1.1; }
.venc .fecha span { font-size: .68rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.venc .fecha.urgente { background: var(--warn-soft); color: var(--warn); }
.venc .txt { min-width: 0; flex: 1; }
.venc .txt b { display: block; font-weight: 600; }
.venc .txt small { display: block; }

/* Público */
.pub-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; max-width: 1180px; margin: 0 auto; }
.pub-nav .brand { color: var(--ink); padding: 0; }
.pub-nav .brand-mark { background: var(--brand); color: #fff; }
.pub-nav nav { display: flex; gap: 18px; align-items: center; }
.pub-nav nav a:not(.btn) { color: var(--ink-2); font-weight: 600; }
.hero { max-width: 1180px; margin: 0 auto; padding: 44px 28px 30px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.7rem; line-height: 1.08; letter-spacing: -.03em; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.hero-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(16,36,31,.10); }
.hero-card .fila-previa { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.hero-card .fila-previa:last-child { border: 0; font-weight: 800; font-size: 1.1rem; }
.seccion { max-width: 1180px; margin: 0 auto; padding: 40px 28px; }
.seccion > h2 { font-size: 1.7rem; margin-bottom: 8px; letter-spacing: -.02em; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature p { color: var(--ink-2); margin: 0; font-size: .95rem; }
.planes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; }
.plan.destacado { border: 2px solid var(--brand); }
.plan .precio { font-size: 2.1rem; font-weight: 800; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.plan .precio small { font-size: .9rem; font-weight: 500; }
.plan ul { padding-left: 18px; color: var(--ink-2); margin: 14px 0 20px; flex: 1; }
.plan li { margin-bottom: 5px; }
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 20px; }
.auth { width: 100%; max-width: 430px; }
.auth .card { padding: 28px; }
.auth h1 { font-size: 1.45rem; }
.pub-pie { text-align: center; color: var(--muted); font-size: .85rem; padding: 30px 20px 40px; }
.legal { max-width: 760px; margin: 0 auto; padding: 20px 28px 60px; }
.legal h2 { margin-top: 1.6em; }

.paginacion { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.paginacion a, .paginacion span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: .88rem; }
.paginacion span.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.subida { border: 2px dashed #d3c9b5; border-radius: 12px; padding: 18px; text-align: center; background: #fbf8f2; }
.subida input[type=file] { background: transparent; border: 0; max-width: 320px; margin: 8px auto; display: block; }

details.ayuda-det { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); }
details.ayuda-det + details.ayuda-det { margin-top: 8px; }
details.ayuda-det summary { cursor: pointer; font-weight: 600; }
details.ayuda-det p { margin: 10px 0 0; color: var(--ink-2); }

.solo-movil { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1020px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .features, .planes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.menu-abierto .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar .brand { padding: 0; font-size: 1rem; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .main { padding: 18px 16px 50px; }
  .g2 { grid-template-columns: 1fr; }
  .solo-movil { display: initial; }
  .oculto-movil { display: none; }
}
@media (max-width: 600px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .features, .planes { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .pub-nav { padding: 14px 16px; }
  .pub-nav nav a:not(.btn) { display: none; }
  .seccion, .hero { padding-left: 16px; padding-right: 16px; }
  .kpi .val { font-size: 1.3rem; }
  .previa-total .monto { font-size: 1.9rem; }
  .card { padding: 16px; }
  .tabla-wrap { margin: 0 -16px; padding: 0 16px; }
}

/* ---------- Fase 2: contabilidad ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 18px; }
.subnav a { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--ink-2); background: var(--line-2); }
.subnav a:hover { text-decoration: none; background: var(--line); }
.subnav a.on { background: var(--brand); color: #fff; }
.tipo-pol { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 800; font-size: .8rem; }
.tipo-pol.I { background: var(--ok-soft); color: var(--ok); }
.tipo-pol.E { background: var(--err-soft); color: var(--err); }
.tipo-pol.D { background: var(--brand-soft); color: var(--brand); }
tr.mayor td { font-weight: 700; background: #faf7f0; }
tr.mayor td a { color: var(--ink); }
tr.nivel2 td:first-child { padding-left: 22px; }
tr.totales td { border-top: 2px solid var(--ink); font-weight: 800; }
.cuadre { display: flex; gap: 10px; flex-wrap: wrap; }
.renglones td { padding: 6px 4px; }
.renglones input, .renglones select { padding: 7px 8px; }
.renglones .imp { width: 120px; text-align: right; }
.mono-num { font-variant-numeric: tabular-nums; }
.envio-card h3 { display: flex; align-items: center; gap: 8px; }
.envio-card .codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; background: var(--line-2); padding: 2px 6px; border-radius: 5px; }
.diot-prov select { padding: 6px 8px; font-size: .86rem; }
