/* =========================================================
   Presupuestos · estilos
   Paleta tipo editor de código. Cambiá los colores acá.
   ========================================================= */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('../fonts/plex-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('../fonts/plex-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('../fonts/plex-600.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('../fonts/plex-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('../fonts/jbmono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('../fonts/jbmono-500.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-display: swap; src: url('../fonts/jbmono-600.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-display: swap; src: url('../fonts/jbmono-700.woff2') format('woff2'); }

:root {
  --bg: #0B0F14;
  --bg-nav: #10161E;
  --panel: #121922;
  --field: #0E141B;
  --line: #1F2935;
  --line-2: #243040;
  --line-3: #2E3B4C;
  --hover: #18212C;
  --text: #E6EDF3;
  --muted: #A9B6C6;
  --dim: #8D9AAB;
  --accent: #2DD4BF;
  --accent-ink: #06121A;
  --accent-soft: #7DE3D3;
  --ok: #3FD68A;
  --warn: #F5B544;
  --bad: #FF8A80;
  --late: #B4AEFF;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 10px;
  --r-lg: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: #B5F1E7; }
h1, h2, h3 { margin: 0; letter-spacing: -0.3px; }
h1 { font-size: 30px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--field); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; color: var(--accent-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.txt { color: var(--text); }
.small { font-size: 13px; }
.xsmall { font-size: 11px; }
.upper { text-transform: uppercase; letter-spacing: 0.8px; }
.fw-normal { font-weight: 400; }
.r { text-align: right; }
.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ic { flex: none; }
.kicker { font-size: 12px; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: 240px; flex: none; background: var(--bg-nav); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 4px 7px; line-height: 1.2; }
.brand-mark-lg { font-size: 22px; border-radius: 10px; padding: 10px 14px; align-self: flex-start; }
.brand-name { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.side-links { display: flex; flex-direction: column; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.is-active { background: var(--hover); color: var(--text); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.side-user form { margin: 0; }
.side-user-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-user-txt strong { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-txt small { font-size: 12px; color: var(--dim); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #1C2633; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.main { flex: 1; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: filter .15s, background .15s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(255,138,128,.35); color: var(--bad); }
.btn-danger:hover { background: rgba(255,138,128,.08); color: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-dashed { align-self: flex-start; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px dashed var(--line-3); background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.btn-dashed:hover { color: var(--text); border-color: var(--accent); }
.icon-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn-bordered { width: 44px; height: 44px; border: 1px solid var(--line-2); }

/* ---------- Encabezados ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search label { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--dim); min-width: 280px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; }
.search label:focus-within { border-color: var(--accent); }

/* ---------- Mensajes ---------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; border: 1px solid; }
.flash-ok { color: var(--ok); background: rgba(63,214,138,.08); border-color: rgba(63,214,138,.25); }
.flash-error { color: var(--bad); background: rgba(255,138,128,.08); border-color: rgba(255,138,128,.3); }
.flash-warn { color: var(--warn); background: rgba(245,181,68,.08); border-color: rgba(245,181,68,.28); }
.flash span { color: var(--text); flex: 1; }
.send-banner { flex-wrap: wrap; }

/* ---------- Resumen / tarjetas ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.stat:hover { border-color: var(--line-3); color: var(--text); }
.stat-label { font-size: 13px; color: var(--dim); }
.stat-num { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--dim); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.pad { padding: 22px 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; font-size: 13px; color: var(--dim); }
.pager { display: inline-flex; gap: 14px; align-items: center; }
.pager a { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.chip:hover { color: var(--text); }
.chip.is-on { border-color: var(--accent); color: var(--text); }
.empty { padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }

.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-borrador { color: var(--muted); background: rgba(169,182,198,.12); }
.badge-pendiente { color: var(--warn); background: rgba(245,181,68,.12); }
.badge-aceptado { color: var(--ok); background: rgba(63,214,138,.12); }
.badge-rechazado { color: var(--bad); background: rgba(255,138,128,.12); }
.badge-vencido { color: var(--late); background: rgba(180,174,255,.12); }
.badge-admin { color: var(--accent-ink); background: var(--accent); }

/* ---------- Listados ---------- */
.list { display: flex; flex-direction: column; }
.list-head, .list-row { display: grid; grid-template-columns: 80px minmax(0, 2.4fr) 96px 150px 110px 140px; gap: 16px; align-items: center; padding: 10px 20px; }
.list-head { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px; }
.list-row { position: relative; border-bottom: 1px solid var(--hover); min-height: 60px; }
.list-row:hover { background: rgba(24,33,44,.55); }
.row-link { position: absolute; inset: 0; z-index: 0; }
.list-row > span { position: relative; z-index: 1; pointer-events: none; }
.list-row .c-acc, .list-row .c-acc * { pointer-events: auto; }
.c-cli { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-cli strong { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-cli small { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-num, .c-fecha { font-size: 13px; }
.c-total { font-size: 14px; font-weight: 500; text-align: right; }
.c-acc { display: flex; justify-content: flex-end; gap: 2px; }
.c-acc form { margin: 0; }
.list-cli .list-head, .list-cli .list-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) 110px 110px; }
.c-contacto { display: flex; flex-direction: column; color: var(--muted); min-width: 0; }
.c-contacto small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Formularios ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.push-right { margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2.tight { gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.in, .field > input, .field > select, .field > textarea { width: 100%; min-width: 0; height: 42px; padding: 0 12px; background: var(--field); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-size: 14px; outline: none; }
textarea.in, .field > textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.in { padding: 0 8px; }
.in:focus, .field > input:focus, .field > textarea:focus, .field > select:focus { border-color: var(--accent); }
.in.num { text-align: right; font-family: var(--mono); }
input[type="date"].in { color-scheme: dark; }
.input-group { display: flex; align-items: center; gap: 6px; background: var(--field); border: 1px solid var(--line-2); border-radius: 8px; padding-left: 12px; color: var(--dim); min-height: 42px; }
.input-group:focus-within { border-color: var(--accent); }
.input-group input { flex: 1; min-width: 0; height: 42px; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; padding: 0 4px; }
.input-group .btn { margin-right: 4px; }
.in-unit { display: flex; align-items: stretch; height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--field); overflow: hidden; }
.in-unit:focus-within { border-color: var(--accent); }
.in-unit .in { border: 0; height: 100%; border-radius: 0; background: transparent; }
.in-unit select, .in-unit .unit { border: 0; border-left: 1px solid var(--line-2); background: var(--panel); color: var(--text); padding: 0 8px; display: flex; align-items: center; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.seg { display: flex; height: 42px; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; background: var(--field); }
.seg label { flex: 1; display: flex; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.seg input:checked + span { background: #1E2A38; color: var(--text); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.switch { position: relative; display: inline-flex; width: 52px; height: 30px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .knob { width: 100%; height: 100%; border-radius: 999px; border: 1px solid var(--line-3); background: var(--field); position: relative; transition: background .15s; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #5B6B7E; transition: transform .15s, background .15s; }
.switch input:checked + .sr + .knob { background: rgba(45,212,191,.2); border-color: var(--accent); }
.switch input:checked + .sr + .knob::after { transform: translateX(22px); background: var(--accent); }
.switch input:focus-visible + .sr + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-direction: column; gap: 24px; }
.editor-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: -32px -40px 0; padding: 18px 40px; border-bottom: 1px solid var(--line); background: var(--bg-nav); }
.editor-title { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.editor-title > div { display: flex; flex-direction: column; gap: 2px; }
.editor-title h1 { font-size: 22px; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.editor-grid { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.editor-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.editor-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }

.sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 24px 0; flex-wrap: wrap; list-style: none; }
.sec-head::-webkit-details-marker { display: none; }
summary.sec-head { cursor: pointer; align-items: center; }
summary.sec-head .ic { color: var(--dim); transition: transform .15s; }
details[open] > summary.sec-head .ic { transform: rotate(180deg); }
.sec-head h2 { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.sec-n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.sec-peek { display: none; }
.sec-body { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 14px; }
.sec-danger .sec-head h2 { color: var(--muted); }

.lines-scroll { overflow-x: auto; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.lines-head { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); padding: 0 2px 8px; }
.line, .lines-head { display: grid; gap: 10px; align-items: center; }
.line-h { grid-template-columns: 170px minmax(120px, 1fr) 70px 108px 112px 36px; }
.line-i { grid-template-columns: minmax(160px, 1fr) 70px 120px 112px 36px; }
.line-a { grid-template-columns: 124px minmax(140px, 1fr) 110px 112px 36px; }
.line-x { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 40px; }
.line-t { grid-template-columns: minmax(140px, 1fr) 130px 100px 40px; }
.line .in { height: 40px; font-size: 13px; }
.line-sub { text-align: right; font-size: 14px; font-weight: 500; white-space: nowrap; }
.line-a .line-sub { color: var(--ok); }
.line-a.is-recargo .line-sub { color: var(--warn); }
.stepper { display: flex; align-items: center; }
.stepper .in { flex: 1; }
.step { display: none; }
.iva-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.iva-row > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.iva-ctrl { display: flex; align-items: center; gap: 12px; }
.iva-ctrl .in-unit { width: 100px; }
.pct-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; color: var(--muted); }
.pct-box .in-unit { width: 110px; }
.pct-box select.in { width: auto; }

.summary { overflow: hidden; }
.sum-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.sum-row .mono { color: var(--text); white-space: nowrap; }
.sum-sep { padding-top: 12px; border-top: 1px dashed var(--line-2); }
.sum-adj .mono { color: var(--ok); }
.sum-adj.is-recargo .mono { color: var(--warn); }
#s-ajustes { display: flex; flex-direction: column; gap: 12px; }
#s-ajustes:empty { display: none; }
.sum-total { padding: 20px 22px; background: var(--field); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.total-num { font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1.15; word-break: break-all; }
.side-actions { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.mobile-bar { display: none; }

/* ---------- Ajustes ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { height: 34px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.tabs a:hover { color: var(--text); border-color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 20px; align-items: start; }
.settings-grid > section { scroll-margin-top: 20px; }
.logo-slot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-3); border-radius: var(--r); }
.logo-slot > span:last-child { display: flex; flex-direction: column; font-size: 13px; }
.logo-box { width: 44px; height: 44px; border-radius: 8px; background: var(--field); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: #5B6B7E; font-size: 11px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }
.user-row.is-off { opacity: .6; }
.user-txt { display: flex; flex-direction: column; flex: 1; min-width: 160px; font-size: 14px; }
.user-txt strong { font-weight: 500; }
.user-menu { width: 100%; }
.user-menu > summary, .add-user > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker, .add-user > summary::-webkit-details-marker { display: none; }
.user-menu[open] > form { margin-top: 12px; }
.add-user[open] > form { margin-top: 14px; }

/* ---------- Login / instalador ---------- */
.page-login, .page-install { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; }
.login { width: 100%; max-width: 420px; padding: 72px 24px calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 36px; min-height: 100vh; min-height: 100dvh; }
.login-top { display: flex; flex-direction: column; gap: 22px; }
.login-top h1 { font-size: 30px; }
.login-top p { font-size: 15px; margin-top: 8px; }
.prompt { font-size: 12px; color: var(--dim); padding: 10px 12px; background: var(--bg-nav); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field { font-size: 13px; }
.login-form .field > input, .login-form .input-group { height: 50px; font-size: 16px; border-radius: 10px; border-color: var(--line-3); background: var(--panel); }
.login-form .input-group input { font-size: 16px; height: 48px; }
.login-form .input-group { padding-left: 10px; }
.login-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.install { width: 100%; max-width: 760px; padding: 48px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.req { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.req li { display: flex; gap: 10px; align-items: center; }
.req .ok .ic { color: var(--ok); }
.req .bad { color: var(--bad); }
.req .warn { color: var(--warn); }

/* ---------- Barra inferior, botón flotante, hoja de instalación ---------- */
.tabbar { display: none; }
.fab { display: none; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(5,8,11,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--line-3); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 12px 24px calc(28px + var(--safe-b)); display: flex; flex-direction: column; gap: 18px; }
.sheet-grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line-3); }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-head img { border-radius: 14px; }
.sheet-head h2 { font-size: 18px; }
.sheet-head span { font-size: 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: #C4CEDB; }
.checks li { display: flex; gap: 10px; align-items: center; }
.checks .ic { color: var(--ok); }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.sheet-actions .btn { min-height: 50px; }
.ios-hint { font-size: 13px; text-align: center; }

/* =========================================================
   Celular
   ========================================================= */
@media (max-width: 860px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .main { padding: 20px 16px calc(110px + var(--safe-b)); gap: 18px; }
  h1 { font-size: 26px; }
  .hide-mobile { display: none !important; }
  .page-head { align-items: stretch; }
  .head-actions { width: 100%; }
  .search { flex: 1; }
  .search label { min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; border-radius: 14px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 12px; }
  .panel-head { padding: 14px 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 34px; }

  .list { padding: 10px; gap: 10px; }
  .list-head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "num estado" "cli total" "acc acc"; gap: 8px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
  .list-row .c-num { grid-area: num; font-size: 12px; }
  .list-row .c-estado { grid-area: estado; justify-self: end; }
  .list-row .c-cli { grid-area: cli; }
  .list-row .c-cli strong { font-size: 15px; font-weight: 600; }
  .list-row .c-total { grid-area: total; align-self: end; font-size: 15px; font-weight: 600; }
  .list-row .c-fecha { display: none; }
  .list-row .c-acc { grid-area: acc; justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
  .list-cli .list-row { grid-template-areas: "cli cant" "contacto contacto" "acc acc"; }
  .list-cli .c-contacto { grid-area: contacto; }
  .list-cli .c-cant { grid-area: cant; }
  .panel-foot { padding: 6px 16px 14px; }

  .tabbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(68px + var(--safe-b)); padding: 6px 12px var(--safe-b); background: var(--bg-nav); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-size: 11px; font-weight: 500; }
  .tabbar a.is-active { color: var(--accent); font-weight: 600; }
  .fab { display: flex; position: fixed; right: 18px; bottom: calc(86px + var(--safe-b)); z-index: 21; width: 60px; height: 60px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
  .fab:hover { color: var(--accent-ink); }

  .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .panel.pad { padding: 18px 16px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .tabs a { flex: none; }

  /* Editor en el celular */
  .page-editor .main { padding-bottom: calc(150px + var(--safe-b)); }
  .editor { gap: 12px; }
  .editor-head { margin: -20px -16px 0; padding: 12px 16px; gap: 8px; flex-wrap: nowrap; }
  .editor-title { gap: 10px; flex-wrap: nowrap; min-width: 0; }
  .editor-title .kicker { display: none; }
  .editor-title h1 { font-size: 18px; white-space: nowrap; }
  .editor-actions .btn { min-height: 44px; padding: 0 12px; }
  .editor-grid { gap: 12px; }
  .editor-main { gap: 12px; flex-basis: 100%; }
  .editor-side { position: static; flex-basis: 100%; }
  .editor-side .summary { order: 2; }
  .editor-side .side-actions { order: 1; }
  .sec { border-radius: 14px; }
  .sec-head { padding: 14px 16px 0; }
  details.sec:not([open]) > .sec-head { padding-bottom: 14px; }
  details.sec:not([open]) .sec-peek { display: block; flex-basis: 100%; order: 3; font-size: 15px; font-weight: 600; color: var(--text); padding-left: 32px; margin-top: -4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  details.sec:not([open]) .sec-peek:empty::before { content: 'Tocá para completar'; color: var(--dim); font-weight: 400; }
  .sec-body { padding: 14px 16px 16px; gap: 12px; }
  .lines-scroll { overflow: visible; }
  .lines-head { display: none !important; }
  .line-h { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "rol rol" "tarea tarea" "horas tarifa" "sub sub"; padding: 12px; gap: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; position: relative; }
  .line-h [data-f="rol"] { grid-area: rol; color: var(--accent); font-weight: 600; }
  .line-h [data-f="tarea"] { grid-area: tarea; }
  .line-h .stepper { grid-area: horas; }
  .line-h [data-f="tarifa"] { grid-area: tarifa; }
  .line-h .line-sub { grid-area: sub; }
  .line-h .line-del, .line-i .line-del, .line-a .line-del { position: absolute; top: -10px; right: -8px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); }
  .line-h .line-sub, .line-i .line-sub, .line-a .line-sub { padding-right: 22px; }
  .stepper { border: 1px solid var(--line-2); border-radius: 10px; height: 44px; background: var(--panel); }
  .stepper .in { border: 0; background: transparent; text-align: center; height: 42px; padding: 0 2px; font-size: 15px; font-weight: 600; }
  .step { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; flex: none; }
  .line .in { height: 44px; font-size: 15px; }
  .line-i { grid-template-columns: 80px minmax(0, 1fr); grid-template-areas: "con con" "cant precio" "sub sub"; padding: 12px; gap: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; position: relative; }
  .line-i [data-f="concepto"] { grid-area: con; }
  .line-i [data-f="cantidad"] { grid-area: cant; }
  .line-i [data-f="precio"] { grid-area: precio; }
  .line-i .line-sub { grid-area: sub; }
  .line-a { grid-template-columns: minmax(0, 1fr) 130px; grid-template-areas: "tipo valor" "motivo motivo" "sub sub"; padding: 12px; gap: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; position: relative; }
  .line-a [data-f="tipo"] { grid-area: tipo; }
  .line-a [data-f="motivo"] { grid-area: motivo; }
  .line-a .in-unit { grid-area: valor; height: 44px; }
  .line-a .line-sub { grid-area: sub; }
  .line-t { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "rol rol" "ars usd"; padding: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; position: relative; }
  .line-t [name="t_rol[]"] { grid-area: rol; }
  .line-t [name="t_ars[]"] { grid-area: ars; }
  .line-t [name="t_usd[]"] { grid-area: usd; }
  .line-t .line-del { position: absolute; top: -10px; right: -8px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); }
  .btn-dashed { width: 100%; min-height: 44px; font-size: 14px; }

  .mobile-bar { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg-nav); border-top: 1px solid var(--line); }
  .mobile-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .mobile-total > span:first-child { display: flex; flex-direction: column; }
  .mobile-total small { font-size: 12px; }
  #m-total { font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
  .mobile-bar .btn { min-height: 48px; font-size: 15px; }
  .summary .sum-total { display: none; }
}

@media (max-width: 380px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

@media (display-mode: standalone) {
  .install-trigger { display: none !important; }
}
