/* Expresscar CRM — azul de marca + verde canto de vidrio laminado.
   Barlow (señalética vial) para texto; Barlow Condensed itálica (eco del logo) solo en títulos y cifras clave. */
:root {
  --navy: #0a0a5c; --navy-2: #15157a; --navy-3: #2a2a9e; --chart: #3b4bc8;
  --glass: #2e8c80; --glass-2: #1f6e64; --glass-soft: #e3f1ef;
  --ink: #171a2b; --ink-2: #3a3f55; --muted: #5d6275; --faint: #8a8fa3;
  --bg: #f3f4f8; --surface: #fff; --sunk: #f8f9fb; --line: #dfe3eb; --line-2: #edf0f5;
  --warn: #b77d00; --warn-soft: #fbf1d9; --bad: #c2372b; --bad-soft: #fbe7e4;
  --r: 10px; --r-sm: 7px; --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --shadow-pop: 0 12px 32px rgba(10, 10, 92, .14), 0 2px 6px rgba(10, 10, 92, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Barlow, system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--navy-3); text-decoration: none; } a:hover { text-decoration: underline; }
.logo svg { width: 100%; height: auto; display: block; }
.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- estructura ---------- */
#app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
#nav { background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh; overflow: auto; padding: 20px 12px 24px; scrollbar-width: thin; scrollbar-color: var(--navy-3) transparent; }
#nav .logo { color: #fff; padding: 2px 10px 20px; }
#menu h4 { margin: 18px 12px 4px; font-size: 12.5px; font-weight: 500; color: #8f91c4; }
#menu a { display: flex; align-items: center; gap: 11px; color: #d9daf0; padding: 6px 10px; border-radius: var(--r-sm); font-size: 14.5px; position: relative; }
#menu a .ic { color: #8f91c4; }
#menu a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
#menu a.on { background: var(--navy-2); color: #fff; font-weight: 500; }
#menu a.on .ic { color: #6fd0c2; }
#menu a.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--glass); }
.col { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 32px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar .m-only, #menuBtn { display: none; }
main { padding: 28px 32px 64px; width: 100%; max-width: 1440px; }
.printhead { display: none; }

/* búsqueda global */
.gsearch { position: relative; flex: 1; max-width: 560px; }
.gsearch input { padding-left: 38px; padding-right: 36px; background: var(--sunk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238a8fa3' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m16.5 16.5-4-4'/%3E%3C/svg%3E") 12px 50% no-repeat; border-color: transparent; }
.gsearch input:hover { border-color: var(--line); }
.gsearch input:focus { background-color: var(--surface); }
.gsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 12px Barlow, sans-serif; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: var(--surface); }
.gsearch input:focus + kbd { display: none; }
.pop { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; min-width: 220px; }
.gsearch .pop { left: 0; right: 0; top: calc(100% + 6px); max-height: 420px; overflow: auto; }
.pop .item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); background: none; border: 0; height: auto; font: 14.5px Barlow, sans-serif; text-align: left; cursor: pointer; }
.pop .item:hover, .pop .item:focus-visible { background: var(--bg); text-decoration: none; }
.pop .item .ic { color: var(--faint); }
.pop .item b { display: block; font-weight: 500; } .pop .item small { color: var(--muted); font-size: 13px; }
.pop .item.danger { color: var(--bad); }
.pop .item[disabled] { color: var(--faint); cursor: default; background: none; }
.pop .empty { margin: 8px 10px; color: var(--muted); }

/* usuario */
.usermenu { position: relative; margin-left: auto; }
.mebtn { background: none; border: 0; height: 44px; padding: 0 8px 0 4px; color: var(--ink); gap: 10px; border-radius: 99px; }
.mebtn:hover { background: var(--bg); }
.mename { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.mename b { font-weight: 600; font-size: 14px; } .mename small { color: var(--muted); font-size: 12.5px; }
.usermenu .pop { right: 0; top: calc(100% + 6px); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font: italic 700 15px var(--display); flex: none; letter-spacing: .02em; }

/* ---------- tipografía y encabezados ---------- */
h1 { font: italic 700 32px/1.1 var(--display); letter-spacing: -.005em; color: var(--navy); margin: 0 0 20px; }
h2 { font: italic 600 20px/1.2 var(--display); color: var(--navy); margin: 28px 0 10px; }
h3 { font: italic 700 23px/1.2 var(--display); color: var(--navy); margin: 0 0 12px; }
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.phead h1 { margin: 0; }
.phead .sub { margin: 4px 0 0; color: var(--muted); }
.phead .sub:first-letter { text-transform: uppercase; }
.phead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 14px; }
td.n, th.n, .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- controles ---------- */
button, .btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--navy); background: var(--navy); color: #fff;
  font: 500 14.5px Barlow, sans-serif; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { background: var(--navy-3); border-color: var(--navy-3); text-decoration: none; }
button .ic, .btn .ic { width: 17px; height: 17px; }
button.sec, .btn.sec { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: 0 1px 1px rgba(10, 10, 92, .04); }
button.sec:hover, .btn.sec:hover { border-color: #b9bfcd; background: var(--sunk); }
button.danger { background: var(--surface); color: var(--bad); border-color: #ebc3be; }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
button.link { background: none; border: 0; height: auto; padding: 0; color: inherit; text-decoration: underline; }
.iconbtn { background: none; border: 1px solid transparent; color: var(--muted); width: 36px; height: 36px; padding: 0; justify-content: center; }
.iconbtn:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
:focus-visible { outline: 2px solid var(--glass); outline-offset: 2px; }
input, select, textarea { font: 15px Barlow, sans-serif; color: var(--ink); height: 38px; padding: 0 11px; border: 1px solid #d2d7e2; border-radius: var(--r-sm); width: 100%; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 11px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #aeb5c6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--glass); box-shadow: 0 0 0 3px rgba(46, 140, 128, .16); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--sunk); color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 500; color: var(--muted); }

/* ---------- composición ---------- */
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .grow { flex: 1; min-width: 220px; }
.bar input[type=search] { padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8fa3' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") 12px 50% no-repeat; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
form.card > h2 { padding-top: 22px; border-top: 1px solid var(--line-2); }
form.card > h2:first-of-type { padding-top: 0; border-top: 0; margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 18px; }
.grid .wide { grid-column: 1 / -1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 20px; min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel > header h2 { margin: 0; }
.panel table th { background: none; position: static; }
.panel table th, .panel table td { padding-left: 0; }
.two { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.emptybox { display: grid; justify-items: center; gap: 10px; padding: 28px 12px; text-align: center; color: var(--muted); }
.emptybox .ic { width: 28px; height: 28px; color: var(--faint); }
.emptybox p { margin: 0; }
.loading { display: grid; gap: 12px; padding-top: 8px; }
.loading i { display: block; height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), #f7f8fb, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.loading i:first-child { width: 30%; height: 30px; } .loading i:nth-child(2) { width: 70%; } .loading i:nth-child(3) { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- tablas ---------- */
.tbl.open { overflow: visible; max-height: none; }
.ic.dots { stroke-width: 3.4; color: var(--ink-2); }
.tbl { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-height: 72vh; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 260px; }
.items td, .totals td { white-space: normal; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--sunk); border-bottom-color: var(--line); position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6f8fc; }
tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--glass); }
tr.off td { color: var(--faint); }
.low { color: var(--bad); font-weight: 600; }

/* ---------- estados ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 13px; font-weight: 500; background: #eceef6; color: var(--navy); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.entregada, .tag.aceptada, .tag.recibida, .tag.cerrada, .tag.aprobada { background: var(--glass-soft); color: var(--glass-2); }
.tag.anulada, .tag.rechazada { background: var(--bad-soft); color: var(--bad); }
.tag.en_proceso, .tag.en_revision, .tag.terminada, .tag.pendiente { background: var(--warn-soft); color: #8a5f00; }

/* ---------- indicadores: una franja; la primera cifra manda ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; overflow: hidden; }
.kpi { padding: 15px 20px; color: inherit; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.kpi:nth-child(4n) { border-right: 0; }
.kpi:nth-last-child(-n+4) { border-bottom: 0; }
a.kpi:hover { background: var(--sunk); text-decoration: none; }
.kpi span { display: block; font-size: 13.5px; color: var(--muted); }
.kpi b { display: block; font: italic 700 29px/1.15 var(--display); color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi b.alert { color: var(--bad); }
.kpis > .kpi:first-child { background: var(--navy); color: #fff; }
.kpis > .kpi:first-child span { color: #b9bbe6; }
.kpis > .kpi:first-child b { color: #fff; font-size: 38px; }
a.kpi:first-child:hover { background: var(--navy-2); }

/* ---------- gráfico de columnas ---------- */
.chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: var(--h) 22px; column-gap: 10px; }
.chart .yaxis { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--faint); text-align: right; margin: -7px 0; font-variant-numeric: tabular-nums; }
.chart .plot { position: relative; border-bottom: 1px solid var(--line); }
.chart .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-2); display: block; }
.chart .col { position: absolute; bottom: 0; top: 0; display: flex; align-items: flex-end; justify-content: center; outline-offset: -2px; }
.chart .col b { display: block; width: calc(100% - 4px); max-width: 26px; background: var(--chart); border-radius: 4px 4px 0 0; }
.chart .col:hover b, .chart .col:focus-visible b { background: var(--navy); }
.chart .tip { position: absolute; top: -4px; left: 50%; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 3; }
.chart .tip strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart .col:hover .tip, .chart .col:focus-visible .tip { opacity: 1; }
.chart .xaxis { grid-column: 2; position: relative; font-size: 12px; color: var(--faint); }
.chart .xaxis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }

/* lista de alertas */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li + li { border-top: 1px solid var(--line-2); }
.alerts a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); }
.alerts a:hover { text-decoration: none; background: var(--sunk); }
.alerts b { display: block; font-weight: 500; } .alerts small { color: var(--muted); font-size: 13px; }
.alerts strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

/* ---------- usuarios ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 12px; }
.chip span { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--sunk); border-color: #b9bfcd; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; } .chip.on span { color: #b9bbe6; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; font-weight: 600; } .who small { color: var(--muted); font-size: 13.5px; }
.who .you { display: inline; font-weight: 500; font-size: 12px; color: var(--glass-2); background: var(--glass-soft); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
tr.off .avatar { background: #c5c9d6; }
.role-propietario { color: var(--navy); font-weight: 600; }
.rowmenu { position: relative; display: inline-block; }
.rowmenu .pop { right: 0; top: calc(100% + 4px); text-align: left; }
.roles { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.roles legend { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.role { flex-direction: row; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--ink); font-weight: 400; }
.role input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--navy); }
.role b { display: block; font-weight: 600; } .role small { color: var(--muted); font-size: 13.5px; }
.role:has(input:checked) { border-color: var(--navy); background: #f4f5fc; box-shadow: inset 0 0 0 1px var(--navy); }
.secret { display: flex; gap: 8px; align-items: center; background: var(--sunk); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.secret code { flex: 1; font: 600 20px/1 Consolas, ui-monospace, monospace; letter-spacing: .04em; color: var(--navy); }

/* ---------- diálogo ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(540px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(10, 10, 92, .28); color: var(--ink); }
dialog::backdrop { background: rgba(10, 10, 60, .45); backdrop-filter: blur(2px); }
dialog[open] { animation: dlg .16s ease-out; }
@keyframes dlg { from { transform: translateY(6px) scale(.99); opacity: 0; } }
.dlgf { display: grid; gap: 14px; padding: 26px 28px 22px; }
.dlgf p { margin: 0; }
.dlgbar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- documentos ---------- */
.items th, .items td { padding: 6px 8px; }
.items input { height: 34px; }
.items .sub { font-weight: 500; }
.items .del { color: var(--faint); text-decoration: none; font-size: 16px; padding: 4px 6px; }
.items .del:hover { color: var(--bad); }
.totals { margin: 18px 0 0 auto; width: 320px; border: 0; }
.totals td { border: 0; padding: 4px 0; color: var(--muted); }
.totals td.n { color: var(--ink); }
.totals tr:has(#tTotal) td { border-top: 1px solid var(--line); padding-top: 10px; font: italic 700 24px var(--display); color: var(--navy); }
.totals input { height: 32px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.checks label { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; font-size: 14.5px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); }
.checks input { width: 16px; height: 16px; accent-color: var(--warn); }
.firma { margin-top: 48px; width: 280px; border-top: 1px solid var(--ink); padding-top: 6px; font-size: 13.5px; color: var(--muted); }

/* ---------- avisos ---------- */
.err { color: var(--bad); margin: 0; font-size: 14px; }
.err:empty { display: none; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 11px 18px 11px 16px; border-radius: 8px; z-index: 50; border-left: 4px solid var(--glass); box-shadow: var(--shadow-pop); animation: toast .18s ease-out; }
.toast.bad { border-left-color: var(--bad); }
@keyframes toast { from { transform: translateY(8px); opacity: 0; } }

/* ---------- ingreso: marca a la izquierda (curva del parabrisas), formulario sobrio a la derecha ---------- */
#login { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.1fr) 1fr; background: var(--surface); }
.brandside { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.brandside::before { content: ""; position: absolute; left: -30%; right: -30%; top: 64%; height: 120%; border-radius: 50% 50% 0 0 / 26% 26% 0 0; border-top: 2px solid var(--glass); background: var(--navy-2); }
.brandside > * { position: relative; }
.brandside .logo { width: min(420px, 100%); color: #fff; }
.brandside p { margin: 0; max-width: 30ch; font: italic 600 27px/1.2 var(--display); color: #d9daf0; }
.brandside small { position: absolute; bottom: 32px; left: 64px; color: #8f91c4; font-size: 13.5px; }
.formside { display: grid; place-items: center; padding: 40px 24px; }
.login { width: min(380px, 100%); display: grid; gap: 8px; }
.login h1 { margin: 0; }
.login .lead { margin: 0 0 14px; color: var(--muted); }
.login label { margin-top: 8px; }
.login .m-only { display: none; }
.pass { position: relative; }
.pass input { padding-right: 46px; }
.pass .iconbtn { position: absolute; right: 2px; top: 1px; }
.login .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink-2); margin: 6px 0 2px; }
.login .check input { width: 16px; height: 16px; accent-color: var(--navy); }
#loginBtn { height: 44px; justify-content: center; font-size: 15.5px; margin-top: 8px; }
#loginBtn:disabled { opacity: .7; cursor: progress; }
.hint { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.hint.warn { color: #8a5f00; }
.login .err { background: var(--bad-soft); border-radius: var(--r-sm); padding: 9px 12px; margin-top: 6px; }

/* ---------- pestañas y antigüedad de saldos ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); }
.aging { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.aging div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px 14px; position: relative; overflow: hidden; }
.aging span { display: block; font-size: 13px; color: var(--muted); }
.aging b { font: italic 700 21px var(--display); color: var(--navy); font-variant-numeric: tabular-nums; }
.aging i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--chart); }
.aging .hot b { color: var(--bad); } .aging .hot i { background: var(--bad); }
button.sm, .btn.sm { height: 30px; padding: 0 10px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 1180px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi:nth-child(2n) { border-right: 0; } .kpi:nth-last-child(-n+4) { border-bottom: 1px solid var(--line-2); } .kpi:nth-last-child(-n+2) { border-bottom: 0; } .mename { display: none; } }
@media (max-width: 860px) {
  #login { grid-template-columns: 1fr; } .brandside { display: none; } .login .m-only { display: block; width: 220px; color: var(--navy); margin-bottom: 18px; }
  .aging { grid-template-columns: repeat(2, 1fr); }
  #app { grid-template-columns: 1fr; }
  #nav { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  #nav.open { transform: none; }
  .appbar { background: var(--navy); border: 0; padding: 8px 12px 10px; gap: 10px; height: auto; flex-wrap: wrap; }
  #menuBtn { display: inline-flex; color: #fff; border-color: rgba(255, 255, 255, .25); }
  .appbar .m-only { display: block; width: 128px; color: #fff; }
  .gsearch { order: 3; flex-basis: 100%; max-width: none; }
  .gsearch kbd { display: none; }
  .mebtn:hover { background: var(--navy-2); }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 28px; }
  .card { padding: 18px 16px; }
  .kpis > .kpi:first-child b { font-size: 31px; }
  .totals { width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
}
@media print {
  #nav, .appbar, .bar, .noprint, button, .toast, .phead .actions { display: none !important; }
  #app { display: block; } main { padding: 0; max-width: none; } body { background: #fff; font-size: 13px; }
  .printhead { display: flex; justify-content: space-between; align-items: end; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 16px; color: var(--muted); }
  .printhead .logo { width: 240px; color: var(--navy); }
  .card, .tbl, .panel { border: 0; padding: 0; } form.card > h2 { border: 0; padding-top: 0; }
  input, select, textarea { border: 0; padding: 0; height: auto; appearance: none; background: none; }
  .tbl { max-height: none; overflow: visible; } th { position: static; }
  .checks label { border: 0; padding: 2px 0; }
}
