/* CRMON v3 — interfaz minimalista tipo "work OS" */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #1f2430;
  --ink-2: #5b6272;
  --ink-3: #8a90a0;
  --line: #e6e8ef;
  --line-2: #d4d8e2;
  --hover: #f1f3f8;
  --accent: #5b5bd6;
  --accent-ink: #ffffff;
  --accent-soft: #ececfd;
  --danger: #d83a52;
  --ok: #00a36c;
  --warn: #e2a400;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(20, 24, 40, .18);

  /* Estados (estilo tablero) */
  --st-borrador: #9aa1b1;
  --st-enviada: #579bfc;
  --st-aceptada: #00c875;
  --st-rechazada: #e2445c;
  --st-facturada: #a25ddc;
  --st-cancelada: #676879;
  --st-fcancelada: #fdab3d;
  --st-nuevo: #9aa1b1;
  --st-contactado: #579bfc;
  --st-interesado: #fdab3d;
  --st-cotizado: #a25ddc;
  --st-ganado: #00c875;
  --st-perdido: #e2445c;
  /* Etiquetas y avisos */
  --ok-bg: #dcf7ea; --ok-ink: #006b47;
  --bad-bg: #fde3e7; --bad-ink: #a3172e;
  --warn-bg: #fff1d1; --warn-ink: #7a5600; --warn-line: #f1dd9c;
  --side-w: 220px;
  color-scheme: light;
}
/* Tema oscuro: elegido explícitamente, o del sistema si el usuario no eligió */
:root[data-theme="dark"] {
  --bg: #14161c; --panel: #1c1f27; --ink: #e8eaf0; --ink-2: #a7adbb; --ink-3: #7d8394;
  --line: #2a2e39; --line-2: #383d4a; --hover: #232733; --accent: #7b7bf0; --accent-soft: #2a2a4a;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --ok-bg: #12382a; --ok-ink: #6ee7b7; --bad-bg: #401a22; --bad-ink: #fda4af;
  --warn-bg: #3a3014; --warn-ink: #fcd34d; --warn-line: #5c4a14;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161c; --panel: #1c1f27; --ink: #e8eaf0; --ink-2: #a7adbb; --ink-3: #7d8394;
    --line: #2a2e39; --line-2: #383d4a; --hover: #232733; --accent: #7b7bf0; --accent-soft: #2a2a4a;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    --ok-bg: #12382a; --ok-ink: #6ee7b7; --bad-bg: #401a22; --bad-ink: #fda4af;
    --warn-bg: #3a3014; --warn-ink: #fcd34d; --warn-line: #5c4a14;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
kbd { font: 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
[hidden] { display: none !important; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); transition: grid-template-columns .18s; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 10px 18px; letter-spacing: .02em; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.logo.logo-img { background: none; object-fit: contain; }
/* Identidad visual (Empresa) */
.marca-slot { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.marca-slot:first-of-type { border-top: 0; padding-top: 0; }
.marca-prev { flex: none; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.marca-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.marca-logo { width: 120px; height: 56px; }
.marca-icono { width: 56px; height: 56px; }
.marca-fav { width: 40px; height: 40px; }
#nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; margin-bottom: 2px;
}
#nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
#nav a:hover { background: var(--hover); color: var(--ink); }
#nav a.on { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 4px; font-size: 12.5px; padding: 0 10px; }
.side-foot a { color: var(--ink-3); }
.side-foot a:hover { color: var(--ink); }
main { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);
}
.search-btn {
  flex: 1; max-width: 520px; text-align: left; display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-3); padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.search-btn:hover { border-color: var(--line-2); }
.search-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; gap: 10px; }
.search-btn kbd { flex-shrink: 0; }
.search-btn .q { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.me { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.view { padding: 8px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); font-size: 13px; }
#banner .warnbar { margin: 0 28px 8px; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); font-size: 13px; }

/* Botones e inputs */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--ink);
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 4px 8px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 7px 10px; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.bad { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 70px; }
label.f { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
label.f small { color: var(--danger); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }

/* Tarjetas */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi .lbl { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b span { width: 100%; max-width: 46px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.funnel .fr { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
.funnel .track { height: 10px; background: var(--hover); border-radius: 5px; overflow: hidden; }
.funnel .track span { display: block; height: 100%; border-radius: 5px; }

/* Pills de estado */
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 96px; padding: 4px 10px;
  border-radius: 6px; color: #fff; font-size: 12.5px; font-weight: 600; border: 0; cursor: default; white-space: nowrap;
}
button.pill { cursor: pointer; }
button.pill:hover { filter: brightness(1.06); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--hover); color: var(--ink-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* Tablero agrupado */
.group { margin-bottom: 22px; }
.group-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; cursor: pointer; user-select: none; }
.group-h b { font-size: 15px; }
.group-h .caret { color: var(--ink-3); width: 14px; transition: transform .15s; }
.group.closed .caret { transform: rotate(-90deg); }
.group.closed .tbl-wrap { display: none; }
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tbl-wrap.bar { border-left-width: 6px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--hover); }
.tbl tfoot td { font-weight: 600; background: var(--hover); }
.tbl .desc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }

/* Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--hover); border-radius: var(--radius); padding: 8px; min-height: 200px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 10px; font-weight: 600; font-size: 13px; }
.col-h .dot { width: 10px; height: 10px; border-radius: 3px; }
.col-h .sum { margin-left: auto; color: var(--ink-3); font-weight: 500; font-size: 12px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--line-2); }
.kcard.drag { opacity: .4; }
.kcard .t { font-weight: 600; }
.kcard .s { color: var(--ink-3); font-size: 12.5px; }
.kcard .m { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.kcard .due { color: var(--danger); font-weight: 600; }

/* Editor de cotización */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.items { min-width: 980px; }
.items td { padding: 6px 8px; }
.items .input { padding: 5px 8px; border-color: transparent; background: transparent; }
.items .input:hover { border-color: var(--line-2); }
.items .input:focus { border-color: var(--accent); background: var(--panel); }
.items .c-desc { min-width: 260px; }
.items .c-sat { width: 110px; }
.items .c-cant { width: 90px; }
.items .c-precio { width: 130px; }
.items .c-imp { width: 120px; }
.items .del { opacity: 0; }
.items tr:hover .del { opacity: 1; }
.totals { position: sticky; top: 70px; }
.totals .tr, .totales-card .tr { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals .tr.big, .totales-card .tr.big { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.invoice-card { border: 1px solid color-mix(in srgb, var(--st-facturada) 35%, var(--line)); background: color-mix(in srgb, var(--st-facturada) 7%, var(--panel)); }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }

/* Popover / autocompletar */
.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto;
}
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-list button:hover, .ac-list button.sel { background: var(--hover); }
.ac-list .sub { font-size: 12px; color: var(--ink-3); }
.menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 4px; }
.menu .pill { width: 100%; }

/* Drawer, modal, toasts */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(15, 18, 30, .28); }
.drawer .panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
.drawer .ph { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer .pb { padding: 18px 20px; overflow: auto; flex: 1; }
.drawer .pf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 18, 30, .4); display: grid; place-items: start center; padding-top: 8vh; overflow: auto; }
.modal .box { background: var(--panel); border-radius: 12px; width: min(620px, calc(100% - 32px)); box-shadow: var(--shadow-lg); margin-bottom: 40px; }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mb { padding: 18px 20px; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0 6px 26px; position: relative; font-size: 13.5px; }
.checklist li::before { position: absolute; left: 0; font-weight: 700; }
.checklist li.e::before { content: "✕"; color: var(--danger); }
.checklist li.w::before { content: "!"; color: var(--warn); left: 4px; }
.checklist li.k::before { content: "✓"; color: var(--ok); }
.palette .input { font-size: 16px; padding: 12px 14px; }
.palette .res { max-height: 50vh; overflow: auto; margin-top: 10px; }
.palette .res a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.palette .res a:hover, .palette .res a.sel { background: var(--hover); }
.palette .res h3 { margin: 12px 10px 4px; }
/* Avisos estilo SweetAlert: toasts (esquina superior derecha) y diálogos (.swal) */
.toasts { position: fixed; right: 18px; top: 18px; z-index: 90; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { --c: var(--accent); pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--c); padding: 11px 12px 13px; border-radius: 10px;
  box-shadow: var(--shadow-lg); width: min(380px, calc(100vw - 36px)); font-size: 13.5px; line-height: 1.4; animation: tin .28s cubic-bezier(.2, .9, .3, 1.2); }
.toast.t-ok { --c: var(--ok); } .toast.t-error { --c: var(--danger); } .toast.t-warn { --c: var(--warn); } .toast.t-info { --c: var(--accent); }
.toast .ti { flex: none; width: 24px; height: 24px; color: var(--c); }
.toast .tx { flex: 1; min-width: 0; padding-top: 2px; overflow-wrap: anywhere; } .toast .tx b { display: block; margin-bottom: 1px; }
.toast .tc { flex: none; border: 0; background: none; color: var(--ink-3); cursor: pointer; width: 28px; height: 28px; margin: -4px -4px 0 0; border-radius: 6px; font-size: 13px; }
.toast .tc:hover { background: var(--hover); color: var(--ink); }
.toast .tp { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c); opacity: .35; transform-origin: left; animation: tbar linear forwards; }
.toast.pausa .tp { animation-play-state: paused; }
.toast.sale { animation: tout .18s ease-in forwards; }
.ti svg, .si svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ti svg > circle:first-child, .si svg > circle:first-child { stroke-width: 2.6; opacity: .3; }
.ti .punto, .si .punto { fill: currentColor; stroke: none; }
.ti .trazo, .si .trazo { stroke-dasharray: 60; stroke-dashoffset: 60; animation: trazo .45s .12s ease-out forwards; }
@keyframes tin { from { transform: translateX(40px); opacity: 0; } }
@keyframes tout { to { transform: translateX(40px); opacity: 0; } }
@keyframes tbar { to { transform: scaleX(0); } }
@keyframes trazo { to { stroke-dashoffset: 0; } }
.swal { position: fixed; inset: 0; z-index: 80; background: rgba(15, 18, 30, .45); display: grid; place-items: center; padding: 16px; animation: fin .15s; }
.swal.sale { animation: fout .16s forwards; pointer-events: none; } .swal.sale .sw { animation: swout .16s forwards; }
.sw { --c: var(--accent); background: var(--panel); color: var(--ink); width: min(440px, 100%); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 26px 26px 20px; text-align: center; animation: swin .3s cubic-bezier(.2, .9, .3, 1.25); max-height: calc(100vh - 32px); overflow: auto; }
.sw.sw-ok { --c: var(--ok); } .sw.sw-error { --c: var(--danger); } .sw.sw-warn { --c: var(--warn); } .sw.sw-pregunta { --c: var(--accent); }
.sw .si { width: 72px; height: 72px; margin: 0 auto 12px; color: var(--c); animation: pop .4s cubic-bezier(.2, .9, .3, 1.5); }
.sw h2 { margin: 0 0 6px; font-size: 19px; }
.sw .st { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.sw .sf { text-align: left; margin-top: 14px; }
.sw .sb { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.sw .sb .btn { min-width: 112px; min-height: 40px; justify-content: center; }
.sw.sacude { animation: sacude .3s; }
@keyframes fin { from { opacity: 0; } } @keyframes fout { to { opacity: 0; } }
@keyframes swin { from { transform: scale(.88); opacity: 0; } } @keyframes swout { to { transform: scale(.94); opacity: 0; } }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
@keyframes sacude { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 600px) { .toasts { left: 12px; right: 12px; top: 12px; justify-items: stretch; } .toast { width: auto; } .sw .sb .btn { flex: 1; } }
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.sale, .swal, .swal.sale, .sw, .sw .si, .swal.sale .sw { animation: none !important; }
  .ti .trazo, .si .trazo { animation: none; stroke-dashoffset: 0; }
}
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 14px 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-2); }
.timeline .when { color: var(--ink-3); font-size: 12px; }
.code { background: var(--hover); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--hover), var(--panel), var(--hover)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .editor, .dash { grid-template-columns: minmax(0, 1fr); }
  .totals { position: static; }
}
.kdue { color: var(--danger); font-weight: 600; }

/* Encabezado: iconos, notificaciones, tema y menú de usuario */
.acciones-top { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icono-btn {
  position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 16px;
}
.icono-btn:hover, .icono-btn.on { background: var(--panel); border-color: var(--line); color: var(--ink); }
.badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.me { border: 1px solid transparent; background: transparent; border-radius: 99px; padding: 3px 4px 3px 10px; cursor: pointer; font: inherit; }
.me:hover, .me.on { background: var(--panel); border-color: var(--line); }
.me .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pop {
  position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 300px; max-height: calc(100vh - 80px); overflow: auto; animation: aparecer .12s ease-out;
}
@keyframes aparecer { from { opacity: 0; transform: translateY(-4px); } }
.pop .cab { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop .op { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 16px; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.pop .op:hover { background: var(--hover); }
.pop .op i { font-style: normal; width: 18px; text-align: center; color: var(--ink-3); }
.pop .sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop.notif { width: 380px; }
.pop.notif .g { padding: 10px 16px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); display: flex; gap: 6px; }
.pop.notif a { display: flex; gap: 10px; padding: 9px 16px; color: var(--ink); border-left: 3px solid transparent; }
.pop.notif a:hover { background: var(--hover); }
.pop.notif a.leida { opacity: .55; }
.pop.notif a.alta { border-left-color: var(--danger); }
.pop.notif a.media { border-left-color: var(--warn); }
.pop.notif a b { display: block; font-weight: 600; font-size: 13px; }
.pop.notif a span { display: block; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.pop.notif a small { color: var(--ink-3); font-size: 11.5px; }
.pop.notif .vacio { padding: 26px 16px; text-align: center; color: var(--ink-3); }
/* Aviso de actualización: discreto, se oculta solo */
.upd { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 500; animation: aparecer .2s ease-out; }
.upd button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.upd .x { background: transparent; color: var(--accent); padding: 0 4px; }

/* Menú lateral colapsado (solo iconos) */
html.menu-colapsado { --side-w: 64px; }
html.menu-colapsado .side { padding: 16px 8px; }
html.menu-colapsado .brand { justify-content: center; padding: 4px 0 18px; }
html.menu-colapsado .brand .txt, html.menu-colapsado #nav a span { display: none; }
html.menu-colapsado .nav-g { font-size: 0; padding: 8px 0 2px; border-top: 1px solid var(--line); margin: 6px 8px 0; }
html.menu-colapsado #nav a { justify-content: center; padding: 9px 0; }
html.menu-colapsado #nav a i { font-size: 16px; }
#nav { scrollbar-width: thin; }
html.menu-colapsado #nav { scrollbar-width: none; }

/* Editor de cotización: conceptos a lo ancho y fila Facturación · Autorización · Totales */
.cot-fila3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cot-fila2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cot-fila3 .totales-card { position: sticky; top: 70px; }
@media (max-width: 1100px) { .cot-fila3, .cot-fila2 { grid-template-columns: minmax(0, 1fr); } .cot-fila3 .totales-card { position: static; } }
.nav-g { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 4px; }
#nav { overflow-y: auto; flex: 1; }
.menu-btn { display: none; font-size: 18px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.chips button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on, .tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); }
/* Importación de XML: zona de arrastre, avance y KPI como filtro */
.drop { flex: 0 0 300px; min-height: 120px; border: 2px dashed var(--line-2); border-radius: var(--radius); display: grid; place-content: center; gap: 4px; text-align: center; padding: 16px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop b { font-size: 15px; } .drop span { font-size: 12.5px; }
.barra { height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.barra i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease-out; }
.kpi-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.kpi-btn:hover { border-color: var(--line-2); } .kpi-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
@media (max-width: 760px) { .drop { flex-basis: 100%; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-row > div { background: var(--hover); border-radius: 8px; padding: 10px 12px; }
.stat-row b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12px; color: var(--ink-3); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal > div { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; font-size: 12px; }
.cal > div:nth-child(7n) { border-right: 0; }
.cal .dh { min-height: 0; font-weight: 600; color: var(--ink-3); text-align: center; background: var(--hover); }
.cal .fuera { background: var(--bg); color: var(--ink-3); }
.cal .hoy .d { background: var(--accent); color: #fff; border-radius: 50%; }
.cal .d { display: inline-grid; place-items: center; width: 22px; height: 22px; font-weight: 600; }
.cal .ev { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .ev.hecho { background: var(--hover); color: var(--ink-3); text-decoration: line-through; }
.cal .ev.lead { background: var(--warn-bg); color: var(--warn-ink); }
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; height: calc(100vh - 150px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat .lst { border-right: 1px solid var(--line); overflow-y: auto; }
.chat .lst a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat .lst a.on, .chat .lst a:hover { background: var(--hover); }
.chat .msgs { display: flex; flex-direction: column; min-height: 0; }
.chat .flujo { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.burbuja { max-width: 70%; padding: 8px 12px; border-radius: 12px; background: var(--hover); font-size: 13.5px; white-space: pre-wrap; }
.burbuja.agente { align-self: flex-end; background: var(--accent); color: #fff; }
.burbuja small { display: block; opacity: .7; font-size: 11px; margin-top: 2px; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--hover); }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.menu-abierto .side { transform: none; }
  html.menu-colapsado .brand .txt, html.menu-colapsado #nav a span { display: inline; }
  html.menu-colapsado #nav a { justify-content: flex-start; padding: 8px 10px; }
  html.menu-colapsado .nav-g { font-size: 11px; border-top: 0; margin: 0; padding: 14px 10px 4px; }
  html.menu-colapsado .side { padding: 16px 10px; }
  .top { padding: 10px 16px; }
  .search-btn kbd, .me .nombre, .upd .txt { display: none; }
  .top { gap: 6px; }
  .pop, .pop.notif { width: calc(100vw - 24px); left: 12px !important; }
  .view { padding: 4px 16px 60px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
}

/* ---------- visor de PDF y vista previa de timbrado */
.visor { position: relative; height: min(76vh, 900px); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #525659; }
.visor iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.visor-carga { position: absolute; inset: 0; display: grid; place-items: center; color: #e8e8e8; font-size: 13px; z-index: 1; pointer-events: none; }
.modal .box > .visor { margin: 0 18px 18px; }
.visor-acc { gap: 6px; margin-right: 6px; }
.timbrar { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0; }
.timbrar-datos { border-right: 1px solid var(--line); max-height: min(78vh, 920px); overflow: auto; }
.timbrar-previa { padding: 14px 18px 18px; min-width: 0; }
.timbrar-previa .visor { height: min(70vh, 860px); }
@media (max-width: 900px) {
  .timbrar { grid-template-columns: minmax(0, 1fr); }
  .timbrar-datos { border-right: 0; max-height: none; }
  .timbrar-previa .visor, .visor { height: 62vh; }
}
/* ---------- configuración de documentos */
.docs { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: 16px; align-items: start; }
.docs .previa { position: sticky; top: 70px; }
.docs .previa .visor { height: calc(100vh - 160px); min-height: 480px; }
.docs textarea.input { min-height: 96px; }
@media (max-width: 1000px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs .previa { position: static; } .docs .previa .visor { height: 70vh; } }
.docs .rango input[type=range] { width: 100%; accent-color: var(--accent); margin: 6px 0 0; min-height: 24px; }
.docs .rango b { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink); }
.docs .letra-chica { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; background: var(--bg); }

/* ---------- suscripciones */
.neg { color: var(--danger); }
.warnbar, .infobar { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warnbar { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.infobar { background: var(--accent-soft); color: var(--ink-2); border: 1px solid var(--line); }
.tag.info { background: var(--accent-soft); color: var(--accent); }
.canal { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; padding: 0 5px; margin-right: 3px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); }
.tbl.compacta td { padding: 6px 0; border: 0; font-size: 13px; }
.tbl tr.anulado td { opacity: .55; text-decoration: line-through; }
.tbl tr.anulado td:last-child { text-decoration: none; opacity: 1; }
.resumen-susc { position: sticky; top: 70px; }
@media (max-width: 1100px) { .resumen-susc { position: static; } }
.tbl .tag, .tbl .btn { white-space: nowrap; }
.susc-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); gap: 12px; align-items: center; }
.susc-op { display: inline-flex; gap: 10px; align-items: center; }
.susc-op[hidden] { display: none; }
.infobar .tag { margin-left: 2px; }
.conc-edit td { padding: 4px 6px; }
.conc-edit .input { height: 30px; padding: 4px 8px; font-size: 12.5px; }
.conc-edit .input:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; }
/* Finanzas */
.barra-cat { display: block; color: inherit; padding: 4px 0; border-radius: 6px; }
.barra-cat:hover { background: var(--hover); }
.bad-ink { color: var(--bad-ink); }
fieldset.card { margin: 0; min-width: 0; }
fieldset.card legend { font-weight: 600; }
.warn-ink { color: var(--warn-ink); }
@media print {
  #nav, header, .tabs, .kpis, .no-print, .toasts, #tabsF, .page-head, aside { display: none !important; }
  .imprimible { box-shadow: none; border: 0; }
}
.ok-ink { color: var(--ok-ink); }
.sug { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ---------- viáticos: tarjetas, avance de comprobación y captura de tickets desde el celular */
.via-card { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 6px 18px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, background-color .15s; }
.via-card:hover, .via-card:focus-visible { border-color: var(--accent); background: var(--hover); outline: none; }
.via-motivo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.via-montos { display: grid; gap: 3px; font-size: 13px; }
.via-montos > div:not(.via-prog) { display: flex; justify-content: space-between; gap: 8px; }
.via-prog { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.via-prog i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.via-prog i.sobre { background: var(--warn); }
.via-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.via-resumen > div { display: grid; gap: 2px; font-size: 12.5px; }
.via-resumen b { font-size: 18px; }
.via-gasto { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.via-gasto.click { cursor: pointer; } .via-gasto.click:hover { background: var(--hover); }
.via-gasto .num { font-weight: 600; text-align: right; }
.captura-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.captura { min-height: 76px; flex-direction: column; justify-content: center; gap: 4px; font-weight: 600; text-align: center; }
.btn.captura:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ticket-prev { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.ticket-prev img { max-height: 220px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -2px; margin-right: 4px; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .via-card { grid-template-columns: minmax(0, 1fr); }
  .via-kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .via-kpis .card { padding: 10px 12px; } .via-kpis .card > div:nth-child(2) { font-size: 19px !important; }
  .via-gasto { grid-template-columns: minmax(0, 1fr) auto; }
  .via-gasto > .btn { grid-column: 2; justify-self: end; min-height: 36px; min-width: 36px; }
  .captura-btns { grid-template-columns: 1fr; }
  .modal .mf { flex-wrap: wrap; } .modal .mf .btn { min-height: 44px; }
  #forma.seg { display: grid; grid-template-columns: 1fr 1fr; } #forma.seg button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .via-prog i { transition: none; } }
/* Contenido + columna lateral (se apila en pantallas angostas) */
.cols-lateral { display: grid; grid-template-columns: minmax(0, 1fr) var(--lat, 300px); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .cols-lateral { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tablero financiero: indicadores, gráficas SVG y estado de resultados */
.kpi-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
a.kpi-fin { color: inherit; text-decoration: none; display: block; }
.grafica { width: 100%; height: auto; display: block; overflow: visible; }
.grafica .g-grid { stroke: var(--line); stroke-width: 1; }
.grafica .g-cero { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 2 3; }
.grafica .g-eje { fill: var(--ink-3); font-size: 11px; }
.grafica .g-etq { font-size: 11.5px; font-weight: 600; }
.grafica .g-linea { stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.grafica .g-punto { stroke: var(--panel); stroke-width: 1.5; cursor: default; }
.g-s0 { stroke: var(--accent); } circle.g-s0 { fill: var(--accent); } .g-t0 { fill: var(--accent); }
.g-s1 { stroke: var(--warn); stroke-dasharray: 7 4; } circle.g-s1 { fill: var(--warn); } .g-t1 { fill: var(--warn-ink); }
.g-s2 { stroke: var(--ok); stroke-dasharray: 2 3; } circle.g-s2 { fill: var(--ok); } .g-t2 { fill: var(--ok-ink); }
.grafica circle.g-s1, .grafica circle.g-s2 { stroke-dasharray: none; }
.g-leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.g-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.g-muestra { display: inline-block; width: 20px; height: 0; border-top: 3px solid var(--accent); }
.g-muestra.g-s1 { border-top: 3px dashed var(--warn); } .g-muestra.g-s2 { border-top: 3px dotted var(--ok); }
.resultados tr.r-subtotal td { font-weight: 600; background: var(--hover); }
.resultados tr.r-total td { font-weight: 700; border-top: 2px solid var(--line-2); }
.resultados tr.r-det td { font-size: 12px; color: var(--ink-2); } .resultados tr.r-det td:first-child { padding-left: 26px; }
.resultados tr.r-margen td { font-size: 12px; color: var(--ink-2); }
.resultados td:first-child { position: sticky; left: 0; background: var(--panel); white-space: nowrap; z-index: 1; }
.resultados tr.r-subtotal td:first-child { background: var(--hover); }
.resultados .caret { display: inline-block; width: 10px; color: var(--ink-3); }
.fw { font-weight: 700; }

/* Conciliación manual: fila con el mismo importe que el depósito */
.sel-sug td { background: var(--accent-soft); }

/* ---------- estados de cuenta: tira de meses (auditoría) y enlace al archivo original */
.meses-ec { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.mes-ec { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--hover); color: var(--ink-2); text-decoration: none; font-size: 12px; min-height: 44px; }
.mes-ec b { font-size: 13px; text-transform: capitalize; } .mes-ec span { font-size: 11px; } .mes-ec i { font-style: normal; font-size: 10.5px; }
.mes-ec.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.mes-ec.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.mes-ec.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: transparent; }
a.mes-ec:hover, a.mes-ec:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ec-link { white-space: nowrap; }
/* Tira por año: 12 meses por renglón (6 en celular); seleccionable en Movimientos */
.anio-ec { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 0; }
.anio-ec + .anio-ec { border-top: 1px solid var(--line); padding-top: 8px; }
.anio-lbl { display: grid; gap: 4px; justify-items: start; } .anio-lbl b { font-size: 15px; }
.anio-ec .meses-ec { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.mes-ec.vacio { background: transparent; border-style: dashed; color: var(--ink-3); opacity: .55; }
button.mes-ec { font: inherit; cursor: pointer; }
button.mes-ec:hover, button.mes-ec:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mes-ec.sel { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 0 4px var(--accent-soft); }
.anios-prev { margin-top: 6px; } .anios-prev summary { cursor: pointer; color: var(--ink-2); font-size: 13px; padding: 4px 0; }
@media (max-width: 760px) {
  .anio-ec { grid-template-columns: minmax(0, 1fr); }
  .anio-ec .meses-ec { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
