:root {
  /* Material 3 (Google) light scheme */
  --bg: #f8fafd;
  --panel: #ffffff;
  --panel-2: #f0f4f9;
  --line: #e0e3e8;
  --line-2: #c9cdd3;
  --ink: #1f1f1f;
  --ink-2: #444746;
  --ink-3: #747775;
  --accent: #0b57d0;
  --accent-ink: #ffffff;
  --accent-soft: #d3e3fd;
  --side: #f2f6fb;
  --side-ink: #444746;
  --side-ink-2: #5f6368;
  --side-active: #c2e7ff;
  --side-active-ink: #001d35;
  --side-hover: rgba(68, 71, 70, .08);
  --red: #b3261e; --red-soft: #f9dedc;
  --amber: #7a4f01; --amber-soft: #fef0cd;
  --green: #146c2e; --green-soft: #e6f4ea;
  --blue: #0b57d0; --blue-soft: #e8f0fe;
  --grey-soft: #e9edf2;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --radius: 16px;
  --mono: 'Roboto Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;
  --sans: 'Roboto', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/roboto/roboto-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url('/vendor/roboto/roboto-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/roboto/roboto-latin-700-normal.woff2') format('woff2'); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131314; --panel: #1e1f20; --panel-2: #28292a; --line: #3c4043; --line-2: #4b4f54;
    --ink: #e3e3e3; --ink-2: #c4c7c5; --ink-3: #9aa0a6; --accent: #a8c7fa; --accent-ink: #062e6f; --accent-soft: #0e3b76;
    --side: #1b1c1d; --side-active: #004a77; --side-active-ink: #c2e7ff; --side-ink: #e3e3e3; --side-ink-2: #9aa0a6; --side-hover: rgba(232,234,237,.08);
    --red: #f2b8b5; --red-soft: #5c1a16; --amber: #ffd38a; --amber-soft: #4d3a10; --green: #6dd58c; --green-soft: #0f3c22;
    --blue: #a8c7fa; --blue-soft: #1b2b41; --grey-soft: #2d2f31; --shadow: 0 1px 3px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131314; --panel: #1e1f20; --panel-2: #28292a; --line: #3c4043; --line-2: #4b4f54;
  --ink: #e3e3e3; --ink-2: #c4c7c5; --ink-3: #9aa0a6; --accent: #a8c7fa; --accent-ink: #062e6f; --accent-soft: #0e3b76;
  --side: #1b1c1d; --side-active: #004a77; --side-active-ink: #c2e7ff; --side-ink: #e3e3e3; --side-ink-2: #9aa0a6; --side-hover: rgba(232,234,237,.08);
  --red: #f2b8b5; --red-soft: #5c1a16; --amber: #ffd38a; --amber-soft: #4d3a10; --green: #6dd58c; --green-soft: #0f3c22;
  --blue: #a8c7fa; --blue-soft: #1b2b41; --grey-soft: #2d2f31; --shadow: 0 1px 3px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { padding: 40px; color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.shell { background: var(--side); }
.main { background: var(--bg); border-radius: 16px 0 0 16px; box-shadow: inset 0 0 0 1px var(--line); }
.brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 600; font-family: var(--mono); font-size: 13px; }
.brand b { display: block; font-size: 14px; color: var(--ink); font-weight: 500; letter-spacing: .01em; }
.brand span { font-size: 11.5px; color: var(--side-ink-2); }
.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-ink-2); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 999px; color: var(--side-ink); text-decoration: none; font-size: 13.5px; position: relative; overflow: hidden; }
.nav a:hover { background: var(--side-hover); }
.nav a.active { background: var(--side-active); color: var(--side-active-ink); font-weight: 500; }
.nav a .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: inherit; opacity: .75; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.side-foot .who { color: var(--ink); font-weight: 500; }
.side-foot .role { color: var(--side-ink-2); font-size: 11.5px; }
.side-foot .links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.side-foot button { white-space: nowrap; background: none; border: 0; color: var(--side-ink-2); cursor: pointer; padding: 0; font-size: 12px; }
.side-foot button:hover { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 26px 30px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--accent); cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; position: relative; overflow: hidden; transition: background .12s, box-shadow .12s; }
.btn:hover { background: var(--blue-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { box-shadow: var(--shadow); filter: none; }
.btn.danger { color: var(--red); } .btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
label.field > small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.req { color: var(--accent); }

/* ---------- cards / dashboard ---------- */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.card-h h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-h .muted { font-size: 12px; }
.card-b { padding: 14px 16px; }
.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--ink-3); }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.kpi.alert .value { color: var(--red); }
.kpi.warn .value { color: var(--amber); }
.dash-cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }

.renewal-list { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.renewal-list li { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.renewal-list li:first-child { border-top: 0; }
.renewal-list li:hover { background: var(--panel-2); }
.renewal-list .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renewal-list .d { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renewal-list .dt { font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: right; }
.tabs { display: flex; gap: 2px; }
.tab { background: none; border: 0; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.tab.on { background: var(--accent-soft); color: var(--side-active-ink, var(--ink)); font-weight: 500; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-child { border-top: 0; }
.check:hover { background: var(--panel-2); }
.check .n { font-family: var(--mono); font-weight: 500; min-width: 30px; text-align: right; font-size: 15px; }
.check .n.zero { color: var(--green); }
.check .n.some { color: var(--amber); }
.check .l { font-size: 13px; }
.check .h { font-size: 12px; color: var(--ink-3); }

.bars .row { display: grid; grid-template-columns: 140px 1fr 96px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bars .track { height: 8px; background: var(--grey-soft); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bars .amt { text-align: right; font-family: var(--mono); font-size: 12px; }

.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12.5px; display: flex; gap: 8px; }
.feed li:first-child { border-top: 0; }
.feed .when { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; min-width: 92px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.days { font-family: var(--mono); font-size: 11.5px; justify-content: center; min-width: 64px; }

/* ---------- table ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search svg { position: absolute; left: 9px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.toolbar .search input { padding-left: 32px; }
.toolbar select.input { width: auto; min-width: 140px; }
.toolbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border-radius: 8px; background: var(--accent-soft); color: var(--side-active-ink, var(--accent)); font-size: 12.5px; font-weight: 500; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.table-wrap { overflow-x: auto; }
table.grid-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-t th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; cursor: pointer; user-select: none; }
.grid-t th:hover { color: var(--ink); }
.grid-t th .arrow { font-size: 10px; margin-left: 4px; color: var(--accent); }
.grid-t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-t tbody tr { cursor: pointer; }
.grid-t tbody tr:hover td { background: var(--panel-2); }
.grid-t td.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.grid-t td.first { font-weight: 500; }
.grid-t td .note-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: middle; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }
.foot { padding: 9px 12px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,20,18,.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 41; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.18); border-radius: 16px 0 0 16px; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-h { padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.drawer-h .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-h h2 { margin: 0; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-h .meta { font-size: 12px; color: var(--ink-3); margin: 3px 0 10px; }
.drawer-h .tabs { margin-bottom: -1px; }
.drawer-h .tab { border-radius: 0; padding: 9px 14px; border-bottom: 3px solid transparent; background: none; }
.drawer-h .tab.on { background: none; border-bottom-color: var(--accent); color: var(--accent); }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.hist li:first-child { border-top: 0; }
.hist .who { color: var(--ink-2); }
.hist table { margin-top: 6px; border-collapse: collapse; width: 100%; }
.hist td { padding: 3px 6px 3px 0; vertical-align: top; font-size: 12px; }
.hist td:first-child { color: var(--ink-3); width: 34%; }
.hist del { color: var(--red); text-decoration-color: var(--red); }
.hist ins { color: var(--green); text-decoration: none; }
.callout { padding: 10px 12px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-size: 12.5px; margin-bottom: 14px; }
.callout.info { background: var(--blue-soft); color: var(--blue); }

/* ---------- modal / login ---------- */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: rgba(20,20,18,.4); padding: 16px; }
.modal .box { background: var(--panel); border-radius: 20px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal .box-h { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal .box-b { padding: 18px 20px; }
.modal .box-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(1200px 500px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.auth .box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.auth h1 { font-size: 19px; margin: 14px 0 4px; }
.auth p { margin: 0 0 18px; color: var(--ink-3); font-size: 13px; }
.auth .stack { display: grid; gap: 12px; }
.err { color: var(--red); font-size: 12.5px; min-height: 18px; }
.map-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.map-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.map-table select { height: 28px; font-size: 12.5px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast .t { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 3px 10px rgba(0,0,0,.3); margin-top: 6px; }
#toast .t.bad { background: var(--red); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; left: 0; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); color: var(--ink); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
  .topbar button { background: none; border: 0; color: inherit; padding: 4px; cursor: pointer; }
  .topbar svg { width: 22px; height: 22px; }
  .page { padding: 18px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .bars .row { grid-template-columns: 100px 1fr 80px; }
  .renewal-list li { grid-template-columns: 66px 1fr; }
  .renewal-list .dt { display: none; }
}
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 21px; } }

/* ---------- desktop additions ---------- */
.auth .box.wide { width: min(560px, 100%); }
.auth .path { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 16px; }
.btn.big { height: 40px; justify-content: center; }
.choice { display: grid; gap: 10px; }
.choice-btn { text-align: left; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 14px 16px; cursor: pointer; display: grid; gap: 3px; }
.choice-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice-btn b { font-size: 14px; font-weight: 600; }
.choice-btn span { font-size: 12.5px; color: var(--ink-3); }
.row-input { display: flex; gap: 8px; }
.row-input .input { font-family: var(--mono); font-size: 12px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.ro-banner { background: var(--amber-soft); color: var(--amber); padding: 9px 30px; font-size: 13px; border-bottom: 1px solid var(--line); }
.ro-banner button { margin-left: 10px; border: 1px solid currentColor; background: none; color: inherit; border-radius: 5px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; }
.modal .box.xwide { width: min(1080px, 100%); }
.ck-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin-bottom: 12px; color: var(--ink-2); }
.grid-t.ck td { white-space: normal; vertical-align: top; cursor: default; }
.grid-t.ck tbody tr { cursor: default; }
.sm { font-size: 11.5px; }

/* ---------- asset tag printing ---------- */
.modal .box.tagbox { width: min(1180px, 100%); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.tag-grid { display: grid; grid-template-columns: 380px 1fr; min-height: 0; flex: 1; }
.tag-opts { padding: 16px 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; border-right: 1px solid var(--line); max-height: calc(94vh - 120px); }
.tag-prev { display: flex; flex-direction: column; background: #e9e7e3; min-height: 420px; }
.tag-prev iframe { flex: 1; width: 100%; border: 0; min-height: 420px; }
.tg-pinfo { padding: 8px 14px; font-size: 12.5px; color: #57534b; background: #f4f3f0; border-bottom: 1px solid var(--line); }
.tg-h { font-size: 12px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tg-links { margin-left: auto; display: flex; gap: 10px; }
.tg-links button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.tg-devs { max-height: 170px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.tg-devs label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.tg-devs label:first-child { border-top: 0; }
.tg-devs .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sm-b { height: 18px; font-size: 10.5px; }
.tg-lbl { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.tg-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; font-size: 13px; }
.tg-checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.field > small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.tg-adv summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.tg-set-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding-top: 4px; }
iframe.hidden-print { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
@media (max-width: 900px) { .tag-grid { grid-template-columns: 1fr; } .tag-opts { border-right: 0; max-height: none; } }

/* ---------- service visits ---------- */
.svc-sum { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.svc-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.svc-list li { padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; display: grid; gap: 3px; }
.svc-list li:first-child { border-top: 0; }
.svc-list li:hover { background: var(--panel-2); }
.svc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); }
.svc-issue { font-weight: 500; }
.imp-fill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }

/* ---------- purchasing ---------- */
.drawer.wide { width: min(1000px, 100vw); }
.lt-wrap { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
table.lt { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.lt th { background: var(--panel-2); font-weight: 500; color: var(--ink-2); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.lt th.n, .lt td.n { text-align: right; }
.lt th.c, .lt td.c { text-align: center; }
.lt td { border-bottom: 1px solid var(--line); padding: 2px 3px; vertical-align: top; }
.lt td.n.lt-amt { padding: 8px 8px; font-family: var(--mono); font-size: 12px; }
.lt-in { width: 100%; border: 1px solid transparent; background: transparent; padding: 5px 5px; border-radius: 4px; font: inherit; color: inherit; resize: none; outline: none; }
.lt-in:hover { border-color: var(--line); }
.lt-in:focus { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 2px var(--accent-soft); }
.lt-in.num { text-align: right; font-family: var(--mono); font-size: 12px; }
.lt-in:disabled { color: var(--ink); }
.lt-del { border: 0; background: none; color: var(--ink-3); font-size: 17px; cursor: pointer; padding: 4px 6px; line-height: 1; }
.lt-del:hover { color: var(--red); }
.lt-bar { display: flex; align-items: center; gap: 12px; padding: 7px 8px; background: var(--panel-2); flex-wrap: wrap; }
.lt-foot { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.lt-foot b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.lt-total { font-weight: 600; color: var(--ink); }
.img-field { display: flex; gap: 12px; align-items: center; }
.img-prev { width: 140px; height: 60px; border: 1px dashed var(--line-2); border-radius: 6px; display: grid; place-items: center; background: #fff; overflow: hidden; font-size: 12px; }
.img-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal .box.docbox { width: min(1000px, 100%); height: 94vh; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.doc-prev { flex: 1; display: flex; flex-direction: column; background: #e9e7e3; min-height: 0; }
.doc-prev iframe { flex: 1; border: 0; width: 100%; }
.drawer-f { flex-wrap: wrap; }

/* ---------- v1.5 ---------- */
.side-search { margin: 4px 12px 2px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 0; background: var(--grey-soft); color: var(--side-ink); cursor: pointer; font-size: 13.5px; }
.side-search:hover { box-shadow: var(--shadow); }
.side-search svg { width: 15px; height: 15px; }
.side-search span { flex: 1; text-align: left; white-space: nowrap; }
.side-search kbd { white-space: nowrap; }
kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .7; }
.side-foot .ver { display: block; margin-top: 8px; font-size: 11px; color: var(--side-ink-2); text-decoration: none; }
.side-foot .ver:hover { color: var(--accent); }
.tab-n { margin-left: 5px; font-size: 10.5px; background: var(--grey-soft); border-radius: 8px; padding: 0 6px; }
.tab-n:empty { display: none; }
.drop { display: grid; justify-items: center; gap: 4px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 18px; cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.drop svg { width: 22px; height: 22px; color: var(--ink-3); }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop span { color: var(--ink-3); max-width: 420px; }
.files { list-style: none; margin: 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.files .fi svg { width: 18px; height: 18px; color: var(--ink-3); }
.files .fn { flex: 1; min-width: 0; display: grid; }
.files .fn b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fn span { font-size: 11.5px; }
.modal.top { align-items: start; padding-top: 12vh; }
.srbox { width: min(640px, 100%); }
.sr-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sr-in svg { width: 18px; height: 18px; color: var(--ink-3); }
.sr-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; }
.sr-list { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow-y: auto; }
.sr-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.sr-list li svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.sr-list li div { display: grid; min-width: 0; }
.sr-list li span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-list li.on { background: var(--accent-soft); }
.sr-list li.sr-hint { cursor: default; font-size: 13px; padding: 14px 10px; }
.set-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1080px; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 16px; }
.set-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; position: relative; overflow: hidden; }
.set-nav a svg { width: 16px; height: 16px; }
.set-nav a:hover { background: var(--panel); color: var(--ink); }
.set-nav a.on { background: var(--side-active); color: var(--side-active-ink); font-weight: 500; box-shadow: none; }
.set-h { grid-column: 1 / -1; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.set-h:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.set-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.set-preview { padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; }
.kvs { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 13px; }
.kvs > div:nth-child(odd) { color: var(--ink-3); }
.kvs .mono { word-break: break-all; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-t.mini { font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; }
.grid-t.mini tbody tr { cursor: default; }
.about { display: flex; gap: 16px; align-items: center; }
.brand-mark.big { width: 56px; height: 56px; font-size: 20px; border-radius: 12px; }
.about-t { font-size: 20px; font-weight: 600; }
.about .code { color: var(--accent); font-weight: 500; }
.modal .box.docbox.wide { width: min(1300px, 100%); }
@media (max-width: 900px) { .set-wrap { grid-template-columns: 1fr; } .set-nav { position: static; grid-template-columns: repeat(3, 1fr); } }

/* quotes received: one card per vendor */
.q-wrap { display: grid; gap: 10px; }
.q-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.q-card.acc { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.q-top { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qf { display: grid; gap: 1px; min-width: 110px; flex: 1; }
.qf.wide { flex: 2.2; min-width: 180px; }
.qf.num { flex: 0 1 150px; }
.qf > span { font-size: 11px; color: var(--ink-3); padding-left: 6px; }
.qf .lt-in { border-color: var(--line); background: var(--panel); }
.q-rank { font-family: var(--mono); font-weight: 600; font-size: 12px; min-width: 26px; height: 24px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-2); align-self: center; }
.q-rank:empty { display: none; }
.q-rank.l1 { background: var(--green-soft); color: var(--green); }
.q-acc { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; padding: 0 4px 6px; white-space: nowrap; }
.q-card.acc .q-acc { color: var(--green); }
.q-top .lt-del { align-self: center; }
table.q-items { border-bottom: 0; }
.q-items td.q-it { padding: 7px 6px; }
.q-items td.q-n { padding: 7px 6px; color: var(--ink-2); font-size: 12px; }
.lt-in.q-best { background: var(--green-soft); color: var(--green); font-weight: 600; }
.q-lump, .q-more { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px 0; flex-wrap: wrap; }
.q-lump > .muted { font-size: 12px; align-self: center; }
.q-tot { padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); text-align: right; }
.q-tot b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.q-part { color: var(--amber); }
.q-noitems, .q-empty { padding: 10px; font-size: 12.5px; }


/* ---------- v1.7: Material extras ---------- */
.form-sec { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 4px; }
.form-grid > .form-sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.col-pop { position: fixed; z-index: 55; width: 290px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,.2); overflow: hidden; }
.col-pop-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
.col-pop-h .btn:first-of-type { margin-left: auto; }
.col-pop-b { max-height: min(430px, 60vh); overflow-y: auto; padding: 6px 8px 10px; }
.col-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; }
.col-row:hover { background: var(--panel-2); }
.col-row label { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; min-width: 0; }
.col-mv { display: flex; gap: 2px; }
.col-mv button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 6px; }
.col-mv button:hover { background: var(--grey-soft); color: var(--ink); }
.col-mv button:disabled { opacity: .25; cursor: default; }
.col-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 10px 8px 4px; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .14; transform: scale(0); animation: ripple .5s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.8); opacity: 0; } }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
::selection { background: var(--accent-soft); }
.q-rank.l1 { border-radius: 999px; }

/* ---------- helpdesk ---------- */
.hd-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 16px 6px; }
.hd-n { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); color: var(--ink); text-decoration: none; }
.hd-n b { font-size: 24px; font-weight: 500; line-height: 1.1; }
.hd-n span { font-size: 12px; color: var(--ink-3); }
.hd-n.bad { background: var(--red-soft); } .hd-n.bad b { color: var(--red); }
.hd-n.warn { background: var(--amber-soft); } .hd-n.warn b { color: var(--amber); }
.hd-sub { padding: 6px 16px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sla-d { margin-left: 6px; font-size: 11px; }

.q-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px 10px; border-top: 1px dashed var(--line); }
.q-file { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); max-width: 100%; }
.q-file b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.q-attach { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tagchip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--amber-soft); font-size: 11px; }

.q-card.over { outline: 2px dashed var(--primary, #1a73e8); outline-offset: -2px; background: var(--panel-2); }
.q-hint { font-size: 12px; }
input.q-read { background: var(--amber-soft); }

.q-vd { display: block; margin-top: 4px; font-size: 12px; width: 100%; }

.q-extras { padding: 8px 10px 0; }
.q-xh { font-size: 12px; color: var(--muted, #5f6368); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.q-xt { width: 100%; }
.q-vq { display: block; margin: 4px 0 0 auto; width: 56px; font-size: 12px; }

textarea.q-vd { resize: vertical; font-family: inherit; line-height: 1.3; }
.q-file svg { width: 16px; height: 16px; flex: none; }
.q-attach svg { width: 16px; height: 16px; }

.cln-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cln-row.empty { opacity: .55; }
.cln-main { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13px; }
.cln-main input[type=checkbox] { margin-top: 3px; }
.cln-size { text-align: right; font-size: 13px; white-space: nowrap; }
.cln-names { grid-column: 1 / -1; font-size: 12px; margin-left: 26px; }
.cln-names summary { cursor: pointer; color: var(--ink-3); }
.cln-names .mono { max-height: 140px; overflow: auto; padding-top: 4px; word-break: break-all; }
.cln-keep { font-weight: 400; margin-left: 8px; font-size: 12px; }
.cln-bar { margin-top: 14px; align-items: center; }

.cln-main { text-align: left; }

.q-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; flex: none; }
.ms-t td { vertical-align: top; }
.ms-t td .input { width: 100%; }
.ms-opts { font-size: 12.5px; line-height: 1.4; resize: vertical; }
