/* Vridam Office Inventory — one stylesheet, served locally (no CDN, no web font), so the
   app works on an office LAN with the internet unplugged.

   Light corporate look: warm white surfaces, charcoal ink, Vridam orange used
   sparingly — for the one primary action on a screen, the active menu item,
   and chart marks. Status colours are reserved for status. Numbers are
   tabular so columns of rupees line up. */

:root {
  --bg:        #f6f5f3;
  --surface:   #ffffff;
  --surface-2: #faf9f7;
  --line:      #e7e4e0;
  --line-2:    #efedea;
  --ink:       #1f1b18;
  --ink-2:     #57514b;
  --ink-3:     #8b847d;
  --brand:     #d9650f;      /* chart marks, accents (validated ≥3:1 on white) */
  --brand-ink: #b8520a;      /* orange text and buttons: white-on-this passes 4.5:1 */
  --brand-soft:#fdf2e9;
  --brand-line:#f6d3b6;
  --green: #157a3b;  --green-bg: #eaf7ef;
  --amber: #9a5b00;  --amber-bg: #fdf5e1;
  --red:   #b42318;  --red-bg:   #fdeeec;
  --blue:  #1d4fc4;  --blue-bg:  #edf2fe;
  --grey:  #57514b;  --grey-bg:  #f1efec;
  --r: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(31,27,24,.05);
  --shadow-lg: 0 10px 30px rgba(31,27,24,.12), 0 2px 6px rgba(31,27,24,.06);
  --side-w: 244px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.pad { padding: 14px 18px; margin: 0; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ic { flex: 0 0 auto; vertical-align: middle; }
.req { color: var(--red); font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 18px; }
.hidden, [hidden] { display: none !important; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; color: var(--ink); text-decoration: none !important; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 17px;
}
.brand-text { font-weight: 700; letter-spacing: .06em; font-size: 14px; line-height: 1.15; }
.brand-mark .ic { stroke-width: 2; }
.brand-text small { display: block; font-weight: 500; letter-spacing: 0; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.nav { flex: 1; padding: 4px 10px 16px; }
.nav-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 6px; }
.nav-a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; text-decoration: none !important; position: relative;
}
.nav-a .ic { color: var(--ink-3); }
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
.nav-a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav-a.on .ic { color: var(--brand); }
.nav-a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-n { margin-left: auto; background: var(--brand-ink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.side-foot { padding: 12px 20px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 60px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.gsearch { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.gsearch .ic { position: absolute; left: 12px; color: var(--ink-3); }
.gsearch input, .gsearch input[type=search] {
  width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 9px; padding: 0 12px 0 36px; font: inherit; color: var(--ink);
}
.gsearch input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.dot-n { position: absolute; top: 3px; right: 2px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; border: 2px solid #fff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 600; cursor: pointer; list-style: none; user-select: none;
}
.avatar::-webkit-details-marker, .menu summary::-webkit-details-marker { display: none; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.menu-list.right, .top-r .menu-list { left: auto; right: 0; }
.menu-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.menu-list a:hover { background: var(--surface-2); }
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-who span { display: block; color: var(--ink-3); font-size: 12px; }

.page { padding: 24px 28px 64px; width: 100%; max-width: 1360px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 22px; }
.sub { margin: 4px 0 0; color: var(--ink-3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  font: 500 14px/1 inherit; font-family: inherit; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  text-decoration: none !important; list-style: none; transition: background .12s, border-color .12s;
}
.btn-primary { background: var(--brand-ink); color: #fff; }
.btn-primary:hover { background: #a2470a; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: #d9d4ce; }
.btn-danger { background: #fff; border-color: #f2c4bf; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-ok { background: var(--green); color: #fff; }
.btn-ok:hover { background: #10652f; }
.btn-link { background: none; color: var(--brand-ink); padding: 0 6px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
form.inline { display: inline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ cards, tiles */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2 { font-size: 15px; }
.card-h .muted { font-size: 12.5px; }
.card-b { padding: 16px 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.cols > .card { margin-bottom: 0; }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none !important; display: block; position: relative;
}
a.kpi:hover { border-color: #d9d4ce; }
.kpi-l { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.kpi-v { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi-bad { border-left: 3px solid var(--red); }
.kpi-warn { border-left: 3px solid #e0a106; }
.kpi-good { border-left: 3px solid var(--green); }
.kpi-brand { border-left: 3px solid var(--brand); }

.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.quick a {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
}
.quick a .ic { color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 6px; width: 32px; height: 32px; }
.quick a:hover { border-color: var(--brand-line); background: #fffaf6; }

.insights { list-style: none; margin: 0; padding: 6px 0; }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 18px; }
.insights li .ic { color: var(--ink-3); margin-top: 2px; }
.insights li.warn .ic { color: #c98200; }
.insights li.bad .ic { color: var(--red); }
.insights li.good .ic { color: var(--green); }

.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.timeline .w { color: var(--ink-3); font-size: 12.5px; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.alerts li:last-child { border-bottom: 0; }
.alerts li a { color: var(--ink); font-weight: 500; }
.alerts .n { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }

.meter { height: 8px; background: var(--grey-bg); border-radius: 8px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }

/* ------------------------------------------------------------------ badges, flashes */

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; line-height: 18px; }
.b-green { color: var(--green); background: var(--green-bg); }
.b-amber { color: var(--amber); background: var(--amber-bg); }
.b-red   { color: var(--red);   background: var(--red-bg); }
.b-blue  { color: var(--blue);  background: var(--blue-bg); }
.b-grey  { color: var(--grey);  background: var(--grey-bg); }
.b-orange{ color: var(--brand-ink); background: var(--brand-soft); }

.flash { display: flex; gap: 8px; align-items: center; padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash.ok   { background: var(--green-bg); border-color: #bfe5cc; color: #0f5c2c; }
.flash.warn { background: var(--amber-bg); border-color: #f1dca5; color: #7a4800; }
.flash.bad  { background: var(--red-bg);   border-color: #f3c7c1; color: #8f1c13; }
.note { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 9px; padding: 10px 14px; color: var(--ink-2); font-size: 13px; }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 600; }
.tab-n { background: var(--grey-bg); color: var(--ink-2); border-radius: 10px; font-size: 11.5px; padding: 0 7px; margin-left: 4px; font-weight: 600; }
.tabs a.on .tab-n { background: var(--brand-soft); color: var(--brand-ink); }

/* ------------------------------------------------------------------ forms */

.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.span2 { grid-column: span 2; } .fld.span3 { grid-column: span 3; } .fld.span4 { grid-column: 1 / -1; }
.fld > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.help { color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], input[type=tel], input:not([type]),
select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #dcd7d1; border-radius: var(--r-sm);
  padding: 0 11px; height: 38px; width: 100%; min-width: 0;
}
textarea { padding: 9px 11px; height: auto; resize: vertical; }
select { padding-right: 28px; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b847d' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: #e38b83; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=file] { font: inherit; font-size: 13px; padding: 7px 0; }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.fld-check { justify-content: flex-end; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand-ink); }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }
.form-foot .muted { margin-right: auto; }
.section-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); grid-column: 1 / -1; margin-top: 6px; }

/* line editor (purchase / issue / request lines) */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lines input, .lines select { height: 36px; }
.lines td.num { padding-top: 14px; }
.lines .rm { width: 32px; height: 36px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 7px; }
.lines .rm:hover { background: var(--red-bg); color: var(--red); }
.lines .w-qty { width: 96px; } .lines .w-rate { width: 110px; } .lines .w-gst { width: 84px; } .lines .w-type { width: 150px; }
.lines .sub-info { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.lines .sub-info.bad { color: var(--red); font-weight: 600; }
.totals { margin-left: auto; width: 100%; max-width: 360px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 700; }
.add-line { margin: 10px 6px; }

/* autocomplete */
.ac { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); background: #fff; border: 1px solid var(--line);
  border-radius: 9px; box-shadow: var(--shadow-lg); z-index: 60; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; min-width: 280px;
}
.ac-list li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-list li.on, .ac-list li:hover { background: var(--brand-soft); }
.ac-list small { color: var(--ink-3); white-space: nowrap; }

/* ------------------------------------------------------------------ tables */

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.toolbar select, .toolbar input[type=date] { height: 36px; width: auto; min-width: 130px; }
.tb-search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 320px; }
.tb-search .ic { position: absolute; left: 10px; color: var(--ink-3); }
.tb-search input, .tb-search input[type=search] { padding-left: 32px; height: 36px; }
.tb-spacer { flex: 1; }
.colpick { position: relative; }
.colpick > summary { list-style: none; }
.colpick-menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 8px 12px; z-index: 50; min-width: 200px; max-height: 320px; overflow-y: auto; }
.colpick-menu label { display: flex; gap: 8px; padding: 4px 0; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl th a { color: inherit; text-decoration: none; }
.tbl th a.sorted { color: var(--ink); }
.tbl th a.sorted.asc::after { content: " ▲"; font-size: 9px; }
.tbl th a.sorted.desc::after { content: " ▼"; font-size: 9px; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fcfbfa; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); padding: 10px 14px; }
.tbl tr.void td { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.tbl tr.void td .badge { text-decoration: none; }
.tbl .strong { font-weight: 600; color: var(--ink); }
.tbl .mono, .tbl td.nowrap { white-space: nowrap; }
.kpi-v.long { font-size: 17px; line-height: 1.3; }
.tbl .sm { font-size: 12.5px; color: var(--ink-3); }
.plain td, .plain th { padding: 9px 18px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager-btns { display: flex; gap: 10px; align-items: center; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--grey-bg); color: var(--ink-3); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.empty p { margin: 0 0 14px; color: var(--ink-3); }

/* detail lists */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; margin: 0; padding: 16px 18px; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.big-num { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.docs { list-style: none; margin: 0; padding: 6px 0; }
.docs li { display: flex; align-items: center; gap: 8px; padding: 7px 18px; flex-wrap: wrap; }
.docs li .muted { font-size: 12px; margin-left: auto; }
.doc-up { display: flex; gap: 8px; align-items: center; padding: 10px 18px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

.hist { list-style: none; margin: 0; padding: 8px 18px 14px; }
.hist li { position: relative; padding: 6px 0 10px 20px; border-left: 2px solid var(--line); }
.hist li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-3); }
.hist li.now::before { border-color: var(--brand); background: var(--brand); }
.hist .when { font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ charts */

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { stroke: #d6d1cb; stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--brand); }
.chart .hit:hover .bar { fill: #b8520a; }
.hbars { padding: 12px 18px 16px; display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; }
.hb-l { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { display: flex; align-items: center; gap: 8px; }
.hb-b { height: 14px; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 3px; }
.hb-v { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip { position: fixed; z-index: 90; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 7px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ dialog */

.dlg { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(31,27,24,.35); }
.dlg form { padding: 22px 22px 18px; }
.dlg h3 { font-size: 17px; margin-bottom: 8px; }
.dlg p { color: var(--ink-2); margin: 0 0 14px; white-space: pre-line; }
.dlg label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------------ login */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: #1f1b18; color: #f1ece6; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(217,101,15,.18); }
.auth-art h2 { font-size: 30px; line-height: 1.2; max-width: 420px; letter-spacing: -.02em; }
.auth-art p { color: #bdb4aa; max-width: 420px; }
.auth-art ul { list-style: none; padding: 0; margin: 20px 0 0; color: #d9d1c8; display: grid; gap: 8px; }
.auth-art li::before { content: "—"; color: var(--brand); margin-right: 10px; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-box { width: 100%; max-width: 360px; }
.auth-box h1 { font-size: 22px; margin: 18px 0 4px; }
.auth-box .fld { margin-bottom: 14px; }
.auth-logo { display: block; width: 190px; max-width: 70%; height: auto; margin: 0 0 6px; }
.auth-box .btn { width: 100%; justify-content: center; height: 42px; }

/* ------------------------------------------------------------------ responsive */

.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 1100px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fld.span3 { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .only-mobile { display: grid; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(31,27,24,.3); z-index: 35; }
  .cols, .cols-3, .cols-21, .cols-12 { grid-template-columns: minmax(0, 1fr); }
  .top { padding: 0 16px; }
  .page { padding: 18px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .form-grid, .form-grid.g3, .form-grid.g2 { grid-template-columns: minmax(0, 1fr); }
  .fld.span2, .fld.span3 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-v { font-size: 19px; }
  .page-h h1 { font-size: 19px; }
  .gsearch input, .gsearch input[type=search] { font-size: 16px; }         /* stops iOS zooming on focus */
  input, select, textarea { font-size: 16px !important; }
  /* Registers become stacked cards: each cell shows its column name. */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .tbl td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; text-align: left; }
  .tbl tfoot { display: block; }
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100% !important; }
  .lines tr { border: 1px solid var(--line); border-radius: 9px; padding: 8px; margin-bottom: 10px; }
  .lines td { border: 0; padding: 4px 0; }
  .lines td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 3px; }
  .lines td.num { text-align: left; padding-top: 4px; }
  .hb { grid-template-columns: 96px 1fr; }
  .toolbar select, .toolbar input[type=date] { min-width: 0; flex: 1 1 130px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}
@media print {
  .side, .top, .toolbar, .pager, .page-actions, .tabs, .btn, .scrim { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
