/* pamgis: one stylesheet, no framework. */

/* Palette: the government dashboard mock (2026-10-15), colours sampled from it: navy chrome, pale blue-grey
   page, white cards, a brighter working blue. Light is the default; <html data-theme="dark"> switches, chosen per
   user (sidebar switch or account page). */
:root {
  --bg: #f2f5fa; --card: #ffffff; --surface: #f5f8fd; --fg: #1c2940; --muted: #5a6a82; --faint: #8995a8;
  --line: #dbe3ee; --line-soft: #e9eef6;
  --accent: #1a5bb8; --on-accent: #ffffff; --accent-hover: #154a96; --contrast: #cc943f; --tint: #e8f0fb;
  --title: #17306a;
  --ok: #1f8f52; --ok-bg: #e4f5eb; --warn: #c9770a; --warn-bg: #fdf3e1;
  --bad: #d7303f; --bad-bg: #fdecee; --off: #64758c; --off-bg: #edf1f5;
  --saved: #d7f5dd; --input-bg: #ffffff; --hatch: rgb(96 125 139 / .07);
  --lb-bg: #101318; --lb-bar: #1d222b; --lb-fg: #f2f4f7; --lb-line: #3a414d;
  --shadow: 0 12px 36px rgb(16 42 92 / .2);
  --shadow-card: 0 1px 2px rgb(16 42 92 / .05), 0 3px 10px rgb(16 42 92 / .04);
  --danger: #d7303f;
  /* chrome: header gradient, nav column */
  --navy: #0e3467; --navy-2: #1a4c8f; --nav-bg: #0c284f; --nav-fg: #c3d2ec; --nav-active: #1d5aa6; --nav-line: rgb(255 255 255 / .1);
  /* chart series (class colours on the overview) */
  --c1: #2274da; --c2: #f59c34; --c3: #2fa462; --c4: #8b6ad9;
  /* asset status colours; app.js reads these for the map markers */
  --st-active: #2fa462;
  --st-vacant: #8a98ad;
  --st-maintenance: #f0a030;
  --st-degraded: #e5404f;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --banner-h: 62px; --nav-w: 220px;
  font-family: var(--font);
  color: var(--fg);
}
:root[data-theme="dark"] {
  --bg: #0d131f; --card: #151d2c; --surface: #1a2335; --fg: #e3e8f0; --muted: #9ba7ba; --faint: #76839a;
  --line: #2a3448; --line-soft: #212a3b;
  --accent: #6ea4f5; --on-accent: #0b1424; --accent-hover: #93bbf8; --contrast: #e2ad5f; --tint: #1d2a44;
  --title: #b4cdf6;
  --ok: #5cc98a; --ok-bg: #16301f; --warn: #f5ae4a; --warn-bg: #35260f;
  --bad: #f2707b; --bad-bg: #3b1c22; --off: #93a3b8; --off-bg: #222b38;
  --saved: #1d4a2a; --input-bg: #1a2233; --hatch: rgb(147 167 178 / .07);
  --shadow: 0 12px 36px rgb(0 0 0 / .55);
  --shadow-card: 0 1px 2px rgb(0 0 0 / .3);
  --danger: #f2707b;
  --navy: #0a1d3c; --navy-2: #12305f; --nav-bg: #09162b; --nav-fg: #a9b9d6; --nav-active: #1d4f93;
  --c1: #4f94ec; --c2: #f7ac52; --c3: #4cc07f; --c4: #a68bea;
  --st-active: #4cc07f; --st-vacant: #93a3b8; --st-maintenance: #f5ae4a; --st-degraded: #f2707b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
h1 { font-size: 20px; margin: 0; color: var(--title); }
h2 { font-size: 17px; margin: 0 0 8px; color: var(--title); }
a { color: var(--accent); }
input, select, textarea, button { font: inherit; color: inherit; }
input:not(.inline), select:not(.status), textarea:not(.inline) {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--fg);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint, .muted { color: var(--muted); font-size: 13px; }
.hint { margin: 4px 0; }

/* buttons */
button, .btn {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--card); color: var(--fg); text-decoration: none; cursor: pointer; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--tint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: #e3b4b4; }
.btn.danger:hover { background: var(--bad-bg); }

/* generic table + dialog (shared with the folder/equipment sections) */
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); }
dialog { border: 0; border-radius: 8px; padding: 0; box-shadow: 0 10px 40px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(0 0 0 / .6); }

/* status chips: .st-* sets --c */
.st-active { --c: var(--st-active); }
.st-vacant { --c: var(--st-vacant); }
.st-maintenance { --c: var(--st-maintenance); }
.st-degraded { --c: var(--st-degraded); }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  color: #fff; background: var(--c, #777); white-space: nowrap;
}

/* error toast */
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000;
  max-width: min(560px, 92vw); padding: 10px 16px; border-radius: 6px;
  background: #b71c1c; color: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / .3);
}

/* "/" split view */
.split { display: grid; grid-template-columns: var(--pane-w, 440px) 6px 1fr; height: calc(100vh - var(--banner-h)); height: calc(100dvh - var(--banner-h)); }
.pane-resize { cursor: col-resize; background: var(--line); }
.pane-resize:hover { background: #b0b8c4; }
.pane { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-right: 1px solid var(--line); }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.filters input[type=search] { grid-column: 1 / -1; }
.filters select { min-width: 0; }
.asset-list { flex: 1; overflow-y: auto; }
.count { margin: 6px 16px; color: var(--muted); font-size: 13px; }
.empty { margin: 16px; color: var(--muted); }
.asset-row {
  display: flex; justify-content: space-between; gap: 8px; padding: 8px 16px;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.asset-row:hover, .asset-row.hl { background: var(--tint); }
.asset-row:focus-visible { outline: none; background: var(--tint); box-shadow: inset 4px 0 0 var(--accent); }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.map { height: 100%; min-height: 300px; }
body:has(#asset-form) #map.leaflet-grab { cursor: crosshair; }

/* add form (in #panel) */
.asset-form { margin: 10px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }
.asset-form label { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.asset-form label input, .asset-form label select { display: block; width: 100%; margin-top: 2px; }
.asset-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.asset-form .actions { display: flex; gap: 8px; margin-top: 12px; }

/* "/assets/{id}" detail */
.topbar { padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar a { text-decoration: none; }
.detail { max-width: 1200px; margin: 0 auto; padding: 16px 24px 48px; }
.detail > section { margin-top: 28px; }
/* the map runs the full height of the header card (client: no blank space beside/under it, meeting 00:31) */
.detail-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: stretch; }
.inset-wrap { display: flex; flex-direction: column; min-height: 0; }
.inset-wrap .hint { margin: 4px 0 0; }
.asset-header { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.title-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.field { display: flex; flex-direction: column; }
.field > span { font-size: 12px; color: var(--muted); padding-left: 7px; }
.field.wide { grid-column: 1 / -1; }
#f-coords { display: block; padding: 4px 7px; font-variant-numeric: tabular-nums; }
.asset-header .btn.danger { margin-top: 8px; }
.inset { flex: 1 1 auto; min-height: 300px; border: 1px solid var(--line); border-radius: 8px; }

/* inline edit: looks like text until hovered/focused; flashes green when a save lands */
.inline {
  width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; transition: background-color 1.2s;
}
textarea.inline { resize: vertical; field-sizing: content; min-height: 2.4em; }
.inline::placeholder { color: #a0a8b3; }
.inline:hover { border-color: var(--line); background: #fff; }
.inline:focus { border-color: var(--accent); background: #fff; outline: 2px solid rgb(21 101 192 / .2); outline-offset: 0; }
.inline.htmx-added { background: #d7f5dd; transition: none; }
.inline.invalid { border-color: var(--danger); background: #fdecea; }
.inline.title { flex: 1 1 280px; min-width: 0; font-size: 22px; font-weight: 600; }
select.status {
  padding: 5px 8px; border: 1px solid var(--c); border-radius: 999px; font-weight: 600;
  color: var(--c); background: #fff; transition: background-color 1.2s;
}
select.status.htmx-added { background: #d7f5dd; transition: none; }

@media (max-width: 860px) {
  .detail-top { grid-template-columns: minmax(0, 1fr); }
  .detail { padding: 12px; }
}
@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40vh 0 minmax(0, 1fr); }
  .pane-resize { display: none; }
  .map { order: -1; }
  .pane { border-right: 0; }
  .fields { grid-template-columns: 1fr; }
  .inline.title { font-size: 18px; }
}
@media print {
  .topbar, .userbar, .build, #toast { display: none; }
}

/* language toggle: bottom-right so it never covers the map controls or the page header */

/* auth: login/settings cards, user bar, read-only lock for viewers */
main.card { max-width: 560px; margin: 24px auto; padding: 20px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
main.card.login { max-width: 380px; margin-top: 12vh; }
main.card h1 { margin-bottom: 12px; }
main.card h2 { margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.stack button { align-self: flex-start; }
.error { color: var(--danger); margin: 0 0 8px; }
.notice { color: var(--st-active); margin: 0 0 8px; }
.settings .actions { white-space: nowrap; }
.settings tr.disabled td { color: var(--muted); }
.settings .actions .btn { margin-right: 4px; }
.userbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .userbar { border: 0; padding: 0; }
.userbar .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; text-transform: uppercase; }
.userbar .who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.userbar .who a { text-decoration: none; color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbar .who small { color: var(--muted); }
.userbar form { margin: 0; }
.btn.small { padding: 3px 8px; font-size: 13px; }
/* viewer role: the server already rejects writes; this just hides the controls that would be refused */
body.viewer .btn.primary, body.viewer .btn.danger, body.viewer [hx-delete], body.viewer [hx-post], body.viewer form[hx-post],
body.viewer .dropzone, body.viewer .item-add, body.viewer #inset-hint { display: none !important; }
body.viewer .landing-actions .btn, body.viewer .landing-actions [hx-patch] { display: inline-block !important; pointer-events: auto; }
body.viewer [hx-patch] { pointer-events: none; }
body.viewer input[hx-patch], body.viewer textarea[hx-patch], body.viewer select[hx-patch] { border-color: transparent; background: transparent; appearance: none; }

/* depreciation */
.depreciation { margin-top: 24px; }
.dep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dep-controls { display: flex; align-items: center; gap: 12px; }
.dep-controls .years { width: 64px; }
.depreciation td.num, .depreciation th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
main.card.wide { max-width: 1100px; }

/* campuses */
.pane-head { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 16px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap; }
.pane-head h1 { overflow: hidden; text-overflow: ellipsis; }
/* native dropdown: <details class="menu"><summary class="btn">...</summary><div>links</div></details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1200; min-width: 180px; padding: 4px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.menu > div a { display: block; padding: 6px 12px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.menu > div a:hover { background: var(--tint); }
.head-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.pane-head h1 { white-space: nowrap; }
.pane-head .btn { white-space: nowrap; }
.pane .userbar { margin-top: auto; }
.pane .build { padding: 0 16px 6px; font-size: 11px; text-align: right; }
.campus-label { background: rgb(255 255 255 / .85); border: 1px solid #b39ddb; box-shadow: none; color: #4a148c; font-weight: 600; font-size: 11px; padding: 0 6px; }
.campus-label::before { display: none; }
.campus-tip { font-size: 12px; }
.campus-popup .popup-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.campus-popup .btn { padding: 3px 8px; font-size: 12px; }
.leaflet-pm-toolbar { display: none; } /* draw/edit are driven from our own buttons */
.card.login .build { margin-top: 16px; font-size: 12px; text-align: right; }

/* roles + units + audit */
.roles { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.role-list a { display: block; padding: 6px 8px; border-radius: 4px; text-decoration: none; color: var(--fg); }
.role-list a.current { background: var(--tint); color: var(--accent); }
.role-list form { margin-top: 12px; }
.matrix th, .matrix td { text-align: center; font-size: 13px; }
.matrix tbody th { text-align: left; font-weight: 500; color: var(--fg); }
main.card.settings { max-width: 900px; }
.changes td.val { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.changes .nowrap { white-space: nowrap; font-size: 12px; }
.row { display: flex; gap: 8px; }
@media (max-width: 700px) { .roles { grid-template-columns: 1fr; } }

/* meeting 2026-10-09 */
.asset-list .group { margin: 8px 16px 2px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.filters .check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.st-disposed { --c: #455a64; }
.detail-wrap.with-side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; }
.side { padding: 16px; border-right: 1px solid var(--line); background: var(--card); min-height: calc(100vh - 44px - var(--banner-h)); }
.side h3 { margin: 0 0 2px; font-size: 15px; }
.side-list { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; }
.side-list a { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 4px; text-decoration: none; color: var(--fg); }
.side-list a:hover { background: var(--tint); }
.side-list a.current { background: var(--tint); color: var(--accent); }
.side-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.events .event-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.event-table td { font-size: 13px; }
.ev-damage { --c: var(--st-degraded); } .ev-repair_out { --c: var(--st-maintenance); } .ev-repair_in { --c: var(--st-active); }
.ev-moved { --c: var(--accent); } .ev-decommissioned { --c: #455a64; } .ev-note { --c: #777; }
.items-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.items-head label { font-size: 13px; }
select.small { padding: 3px 6px; font-size: 13px; }
body.viewer .events .event-form { display: none; }
@media (max-width: 900px) { .detail-wrap.with-side { grid-template-columns: 1fr; } .side { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); } }
.report .summary th, .report .summary td { font-size: 12px; }
.report-rows tr.disposed td { color: var(--muted); }
main.card.report { max-width: 1300px; }

.login-logo { display: block; margin: 0 auto 10px; border-radius: 50%; }
.card.login h1 { text-align: center; }
.platform-sub { text-align: center; font-size: 12px; margin: -6px 0 14px; }

/* sidebar density (2026-10-10): 13px base, tighter rows, filters in three rows */
.pane { font-size: 13px; }
.pane-head { padding: 8px 12px; gap: 4px; }
.pane-head h1 { font-size: 15px; }
.pane-head .btn { padding: 3px 8px; font-size: 12px; }
.filters { padding: 8px 12px; gap: 5px; }
.filters input, .filters select { padding: 4px 6px; font-size: 13px; }
.filters .unit-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.filters .unit-row select { flex: 1; min-width: 0; }
.filters .check { font-size: 12px; white-space: nowrap; }
.filters .check input { margin: 0; }
.count { margin: 4px 12px; font-size: 12px; }
.asset-row { padding: 6px 12px; gap: 8px; }
.asset-row strong { font-size: 13px; line-height: 1.3; }
.row-main small { font-size: 11.5px; line-height: 1.35; }
.row-side .chip { font-size: 11px; padding: 0 7px; line-height: 18px; }
.row-side small { font-size: 11px; }
.asset-list .group { margin: 6px 12px 2px; font-size: 11px; }
.pane .build { padding: 0 12px 4px; }

/* campus bar (replaces the map popup): shown above the list when a campus is selected */
.campus-bar { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--tint); display: flex; flex-direction: column; gap: 6px; }
.campus-bar b { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campus-bar .head-actions { flex-wrap: wrap; }
.campus-bar select.small { max-width: 160px; }
/* asset page: the campus column and the detail scroll on their own */
:root { --topbar-h: 42px; }
.topbar { height: var(--topbar-h); padding-top: 0; padding-bottom: 0; }
.detail-wrap.with-side { height: calc(100vh - var(--banner-h) - var(--topbar-h)); height: calc(100dvh - var(--banner-h) - var(--topbar-h)); }
.detail-wrap.with-side .side, .detail-wrap.with-side .detail { height: 100%; overflow-y: auto; min-height: 0; }
.side .head-row { margin-bottom: 6px; }
.side .side-actions { margin-bottom: 10px; }
.inventory { max-width: 600px; }
.unchecked summary { cursor: pointer; color: var(--accent); }
.unchecked ul { columns: 2; font-size: 13px; }
.landing .checked { margin: 10px 0; }
/* the guest's login button must survive the read-only (viewer) rules that hide primary buttons */
.userbar .btn.login { background: var(--accent); border-color: var(--accent); color: #fff; }
body.viewer .userbar .btn.login { display: inline-block !important; }
.inset-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.inset.repositioning { outline: 2px solid var(--contrast); outline-offset: 2px; cursor: crosshair; }

/* ===== design B2 "Workspace" (mock components, common.css) ===== */
/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--card); color: var(--fg); text-decoration: none; cursor: pointer; white-space: nowrap; font-size: 13.5px; line-height: 1.3; }
.btn:hover { background: var(--tint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.solid-danger { background: var(--bad); border-color: var(--bad); color: var(--card); font-weight: 600; }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--tint); }
.btn svg { width: 14px; height: 14px; flex: none; }

/* inline edit: reads as text until hovered or focused; flashes green when a save lands */
.inline { width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent;
  transition: background-color 1.2s; text-overflow: ellipsis; }
.inline:hover { border-color: var(--line); background: var(--input-bg); }
.inline:focus { border-color: var(--accent); background: var(--input-bg); outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 0; }
.inline::placeholder { color: var(--faint); }
.inline.saved, select.status.saved { background: var(--saved); transition: none; }
textarea.inline { resize: vertical; field-sizing: content; min-height: 2.4em; }
select.inline { cursor: pointer; }
output.inline { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--muted); padding-left: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field .inline { font-variant-numeric: tabular-nums; }
input.box, select.box { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); min-width: 0; }

/* status: chips and the status select */
.st-active, .st-ok { --c: var(--ok); --cb: var(--ok-bg); }
.st-maintenance, .st-in_repair { --c: var(--warn); --cb: var(--warn-bg); }
.st-degraded, .st-fault_reported { --c: var(--bad); --cb: var(--bad-bg); }
.st-vacant, .st-retired, .st-disposed { --c: var(--off); --cb: var(--off-bg); }
.ev-damage { --c: var(--bad); --cb: var(--bad-bg); } .ev-repair_out { --c: var(--warn); --cb: var(--warn-bg); }
.ev-repair_in { --c: var(--ok); --cb: var(--ok-bg); } .ev-moved { --c: var(--accent); --cb: var(--tint); }
.ev-decommissioned { --c: var(--off); --cb: var(--off-bg); } .ev-note { --c: var(--muted); --cb: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--c, var(--muted)); background: var(--cb, var(--surface)); white-space: nowrap; line-height: 1.5; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
select.status { padding: 3px 6px; border: 1px solid var(--c); border-radius: 999px; font-weight: 600; font-size: 12.5px;
  color: var(--c); background: var(--cb); cursor: pointer; transition: background-color 1.2s; max-width: 100%; }
select.status option { color: var(--fg); background: var(--card); }
.tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.tag.veh { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* segmented filter */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); flex: none; }
.seg button { border: 0; background: transparent; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--tint); }
.seg button[aria-pressed="true"] { background: var(--tint); color: var(--accent); font-weight: 700; }
.seg .n { font-variant-numeric: tabular-nums; margin-left: 4px; font-weight: 400; opacity: .85; }

/* native dropdown menu */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 170px; padding: 4px 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.menu > div > * { display: block; width: 100%; text-align: left; padding: 7px 12px; border: 0; background: none; color: var(--fg);
  text-decoration: none; cursor: pointer; font-size: 13px; white-space: nowrap; }
.menu > div > *:hover { background: var(--tint); }
.menu > div > .danger { color: var(--bad); }

/* photo thumbs and file-type tiles */
.thumb { position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ext { display: grid; place-items: center; width: 100%; height: 100%; font: 700 10px/1 var(--font); letter-spacing: .04em; color: var(--muted); background: var(--surface); }
.badge360 { position: absolute; top: 5px; left: 5px; font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 3px; background: rgb(0 0 0 / .62); color: #fff; }

/* campus plan (stands in for the Leaflet inset; no attribution) */

/* QR (always printed black on white) */
.qr { display: block; width: 100%; height: auto; border-radius: 4px; }

/* lightbox: a dark viewer in both themes */
  background: var(--lb-bg); color: var(--lb-fg); box-shadow: var(--shadow); }

/* toast */
  max-width: min(520px, 92vw); padding: 9px 16px; border-radius: 6px; background: var(--fg); color: var(--bg); font-size: 13px; box-shadow: var(--shadow); }



/* ===== Workspace B2/B3: campus (map + buildings), identity strip, tabs per concern, list beside record ===== */
:root { --scrim: rgb(16 22 36 / .45); }
.layout-side .side-head { flex-direction: column; align-items: stretch; }
.ident .inline.title { margin-left: -7px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; text-decoration: underline; }

/* ---------- campus block (shared) ---------- */
.side { display: flex; flex-direction: column; gap: 10px; background: var(--card); min-width: 0; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.side-head h3 { font-size: 15px; line-height: 1.3; }
.side-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.side-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.side-actions .menu > div { left: 0; right: auto; min-width: 200px; }
.side-actions .menu hr { margin: 4px 0; }
.side-map { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.side-map[hidden] { display: none !important; }
.tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.bl { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 2px 9px; width: 100%; padding: 6px 8px; border: 0; border-radius: 5px; background: none; color: var(--fg); text-align: left; cursor: pointer; font: inherit; }
.bl:hover { background: var(--tint); }
.bl .nm { font-size: 13px; line-height: 1.3; min-width: 0; }
.bl .nm small { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bl .att { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; color: var(--bad); background: var(--bad-bg); }
.tree li.cur > .bl { background: var(--tint); box-shadow: inset 3px 0 0 var(--accent); }
.tree li.cur .nm { color: var(--accent); font-weight: 700; }
.tree ul { list-style: none; margin: 2px 0 4px 26px; padding: 0 0 0 10px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.tree ul a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; font-size: 12.5px; color: var(--muted); text-decoration: none; border-radius: 4px; }
.tree ul a:hover { background: var(--tint); color: var(--accent); }
.tree ul b { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }

/* B2: left column */
.layout-side { display: grid; grid-template-columns: 284px minmax(0, 1fr); align-items: start; }
.layout-side .side { position: sticky; top: env(safe-area-inset-top, 0px); max-height: 100vh; overflow-y: auto; padding: 12px 14px 18px; border-right: 1px solid var(--line); min-height: calc(100vh - var(--banner-h) - 40px); }
.layout-side .tree { margin: 0 -6px; }


/* building pins: status-coloured circle markers like the map page; label only as a hover tooltip */
  box-shadow: 0 1px 3px rgb(0 0 0 / .4); white-space: nowrap; font-size: 12px; text-align: left; pointer-events: none; }

/* ---------- identity strip + tabs ---------- */
main.detail { min-width: 0; }
.ident { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 28px; padding: 14px 24px 12px; background: var(--card); }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 2px; }
.inline.title { font-size: 22px; font-weight: 700; color: var(--accent); flex: 0 1 auto; field-sizing: content; min-width: 8ch; max-width: 100%; }
.kpis { display: flex; margin: 0; }
.kpis > div { padding: 2px 16px; display: flex; flex-direction: column; min-width: 0; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis dt { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kpis dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpis dd small { font-size: 12px; font-weight: 600; color: var(--bad); }
.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; gap: 2px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px 9px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--accent); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-weight: 400; font-variant-numeric: tabular-nums; }
.tabs .alert { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; color: var(--bad); background: var(--bad-bg); }
.panel { padding: 16px 24px 48px; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.panel-head h2 { white-space: nowrap; }
.panel-head .ph-right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scope-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); transition: color .3s; }
.scope-note svg { width: 13px; height: 13px; }
.scope-note.just { color: var(--ok); }
.card { border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.card-h { flex-wrap: wrap; }
.card-h h3 { font-size: 13.5px; white-space: nowrap; }
.card-h a { font-size: 12.5px; text-decoration: none; }
.btag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--tint); color: var(--accent); white-space: nowrap; vertical-align: 1px; }

/* ---------- overview ---------- */
.ov { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ov-left, .ov-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
table.sheet { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet caption { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.sheet th { width: 21%; white-space: normal; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; background: var(--surface); border: 1px solid var(--line-soft); border-left: 0; line-height: 1.3; }
.sheet td { padding: 2px 4px; border: 1px solid var(--line-soft); border-right: 0; }
.sheet tr:last-child th, .sheet tr:last-child td { border-bottom: 0; }
.sheet .inline { font-variant-numeric: tabular-nums; }
.sheet output.inline small { color: var(--faint); }
.sheet .coords { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 6px; padding-right: 6px; }
.sheet .coords output { white-space: nowrap; font-size: 13px; }
.media-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; }
.media-tabs button { padding: 8px 10px 7px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.media-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.mp-main { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; overflow: hidden; }
.mp-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-main figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; color: #ffffff; font-size: 12.5px; text-align: left; background: linear-gradient(transparent, rgb(0 0 0 / .65)); }
.mp-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 8px 10px 10px; }
.mp-strip .thumb { aspect-ratio: 1; max-width: 100%; }
.mp-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }
.inset-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px 10px; font-size: 12.5px; }
.inset-tools output { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: auto; }
#pin-editing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
#pin-editing[hidden] { display: none !important; }
#pin-editing .muted { flex: 1 1 100%; font-size: 12px; }
.todo { list-style: none; margin: 0; padding: 4px 0; }
.todo a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 12px; text-decoration: none; color: var(--fg); font-size: 13px; }
.todo a:hover { background: var(--tint); }
.todo .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.recent { list-style: none; margin: 0; padding: 2px 0; }
.recent li { display: grid; grid-template-columns: 84px 170px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 12px; font-size: 13px; border-top: 1px solid var(--line-soft); }
.recent li:first-child { border-top: 0; }
.recent time { color: var(--muted); font-variant-numeric: tabular-nums; }
.s { color: var(--muted); font-size: 12px; margin-right: 6px; }
a.s { color: var(--accent); }
.doc { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; line-height: 20px; color: var(--accent); background: var(--card); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.doc svg { width: 12px; height: 12px; flex: none; }

/* ---------- equipment ---------- */
.md { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.md-list { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.md-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.md-tools .search { flex: 1 1 100%; font-size: 13px; }
.md-tools select { font-size: 12.5px; padding: 4px 6px; flex: 1 1 140px; }
.md-items { position: relative; max-height: 640px; overflow-y: auto; }
.grp { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 8px; padding: 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 1px 9px; align-items: center; width: 100%; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; cursor: pointer; color: var(--fg); }
.li:hover { background: var(--tint); }
.li[aria-selected="true"] { background: var(--tint); box-shadow: inset 3px 0 0 var(--accent); }
.li .dot { grid-row: 1 / 3; align-self: start; margin-top: 6px; }
.li .n { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li[aria-selected="true"] .n { color: var(--accent); }
.li .v { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.li small { grid-column: 2 / -1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.li small.f { color: var(--bad); } .li small.f.r { color: var(--warn); }
.li.retired { background-image: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px); }
.li.retired .n { color: var(--faint); text-decoration: line-through; font-weight: 500; }
.li.retired .v { color: var(--faint); }
.md-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.md-add input, .md-add select { font-size: 13px; padding: 4px 6px; }
.md-detail { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; min-width: 0; }
.d-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; }
.d-head .inline.title { font-size: 19px; width: 100%; field-sizing: fixed; }
.d-nav { display: flex; gap: 4px; }
.d-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.d-actions .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.callout { padding: 6px 8px; border-radius: 6px; background: var(--cb); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); font-size: 13px; }
.callout > span { color: var(--c); font-weight: 600; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 2px 12px; }
.d-grid .w2 { grid-column: span 2; }
.field .lnk { margin-left: 6px; font-size: 11.5px; }
.xfield { border-radius: 6px; background: var(--surface); padding-top: 2px; }
.xfield .tag { margin-left: 6px; }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border: 1px solid currentColor; border-radius: 50%; font: italic 700 10px/1 Georgia, serif; cursor: help; vertical-align: 0; }
.d-low { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; align-items: start; }
.qrbox { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); text-align: center; }
.d-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.d-figs div { padding: 6px 10px; display: flex; flex-direction: column; min-width: 0; }
.d-figs div + div { border-left: 1px solid var(--line); }
.d-figs span { font-size: 11.5px; color: var(--muted); }
.d-figs b { font-variant-numeric: tabular-nums; font-size: 14px; }
.d-ev { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.d-ev li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px; }
.d-ev li.fresh, .month li.fresh { animation: fresh 2.4s ease-out; border-radius: 4px; }
@keyframes fresh { from { background: var(--saved); } to { background: transparent; } }
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; font-size: 12.5px; }
.step { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.step i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font: 700 10px/1 var(--font); }
.step.done { color: var(--fg); } .step.done i { background: var(--c); border-color: var(--c); color: var(--card); }
.step.now { color: var(--c); font-weight: 700; } .step.now i { border-color: var(--c); box-shadow: 0 0 0 3px var(--cb); }
.step + .step::before { content: ""; width: 22px; height: 2px; background: var(--line); margin: 0 8px; }
.step small { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- documents ---------- */
.docs { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.facets { display: flex; flex-direction: column; gap: 1px; }
.facets button { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; color: var(--fg); font-size: 13.5px; }
.facets button:hover { background: var(--tint); }
.facets button[aria-pressed="true"] { background: var(--tint); color: var(--accent); font-weight: 700; }
.facets button:disabled { color: var(--faint); cursor: default; background: none; }
.facets .n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.facets p { font-size: 12px; color: var(--muted); padding: 8px 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 8px; background: var(--card); font-size: 13px; margin-bottom: 12px; }
.dropzone select { font-size: 12.5px; padding: 3px 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); min-width: 0; }
.tile.cover { border-color: var(--contrast); box-shadow: 0 0 0 1px var(--contrast); }
.tile .thumb { aspect-ratio: 4 / 3; max-width: 100%; border: 0; border-radius: 0; }
.tile .inline { font-size: 12.5px; font-weight: 600; padding: 3px 6px; }
.tile .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; padding: 0 8px 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.star { position: absolute; top: 5px; right: 5px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border: 0; border-radius: 12px; background: rgb(0 0 0 / .55); color: #ffffff; font-size: 12px; cursor: pointer; }
.star:hover { background: rgb(0 0 0 / .75); }
.star.on { background: var(--contrast); color: #1d2330; font-weight: 700; }
.tile:not(:hover):not(:focus-within) .star:not(.on) .lbl { display: none; }
.tbl-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 10px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
table.files { table-layout: fixed; font-size: 13px; min-width: 680px; }
.files .h-t { width: 48px; } .files .h-k { width: 124px; } .files .h-l { width: 230px; } .files .h-s { width: 70px; } .files .h-d { width: 88px; } .files .h-a { width: 98px; }
.files td { padding: 3px 8px; }
.files .thumb { width: 36px; height: 27px; border-radius: 4px; }
.files .ext { font-size: 7px; letter-spacing: 0; }
.files .meta { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.files .link-to { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .acts { text-align: right; white-space: nowrap; }
.files .acts .btn { padding: 2px 6px; }

/* ---------- events ---------- */
.evs { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.open-list { list-style: none; margin: 0; padding: 4px 0; }
.open-list li { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.open-list li:first-child { border-top: 0; }
.open-list .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.open-list .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-list small { color: var(--muted); font-size: 12px; }
.ev-filter { margin-bottom: 12px; }
.month { margin: 0 0 14px; }
.month h3 { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.month ol { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.month li { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 10px; font-size: 13px; padding: 2px 4px; }
.month li::before { content: ""; position: absolute; left: -25px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid var(--bg); }
.month time { color: var(--muted); font-variant-numeric: tabular-nums; }
.month .by { font-size: 12px; color: var(--muted); }
.month .extra { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.new-badge { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }

/* ---------- depreciation ---------- */
.dep-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.dep-ctl input { width: 64px; }
.dep-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.dep-sum > div { padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dep-sum > div + div { border-left: 1px solid var(--line); }
.dep-sum span { font-size: 12px; color: var(--muted); }
.dep-sum b { font-size: 18px; font-variant-numeric: tabular-nums; }
table.dep { font-size: 13.5px; min-width: 720px; }
.dep tfoot th { background: var(--surface); color: var(--fg); font-size: 13px; border-top: 1px solid var(--line); border-bottom: 0; }
.dep .bar { display: inline-block; width: 60px; vertical-align: middle; margin-left: 8px; }
.dep tr.bh td { background: var(--surface); font-weight: 700; color: var(--accent); border-top: 1px solid var(--line); }
.dep tr.sub td { font-weight: 700; border-bottom: 1px solid var(--line); }
.dep td.ind { padding-left: 24px; }

/* ---------- modals ---------- */
dialog.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
dialog.modal.wide { width: min(720px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: var(--scrim); }
dialog.modal[open] { display: flex; flex-direction: column; }
.modal form, .modal .mwrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.m-head h2 { font-size: 16px; }
.m-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.m-body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.m-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 10px 10px; }
.mf { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); border: 0; padding: 0; margin: 0; min-width: 0; }
.mf legend { padding: 0; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; width: 100%; }
.mf .box { color: var(--fg); font-size: 14px; }
textarea.box { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); resize: vertical; min-height: 3.2em; }
.m-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.m-two[hidden] { display: none !important; }
.kind-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-pills label { position: relative; }
.kind-pills input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pills span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--fg); cursor: pointer; background: var(--card); white-space: nowrap; }
.kind-pills span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.kind-pills input:checked + span { border-color: var(--c); background: var(--cb); color: var(--c); font-weight: 700; }
.kind-pills input:disabled + span { opacity: .4; cursor: not-allowed; }
.kind-pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.attach { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--fg); }
.m-hint { font-size: 12px; color: var(--muted); }
.effect { padding: 8px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 13px; color: var(--fg); display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.effect b { font-weight: 600; }
.ex-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.ex-list label, label.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg); padding: 3px 0; }
.ex-list small { color: var(--muted); }
table.tax { font-size: 13.5px; }
.tax tr.g td { background: var(--surface); font-weight: 700; color: var(--accent); }
.tax td.ty { padding-left: 26px; }
.tax .num { text-align: right; }

/* lightbox star + tooltip */
#lb-star.on { background: var(--contrast); color: #1d2330; border-color: var(--contrast); }
#tip { position: fixed; z-index: 200; max-width: min(300px, calc(100vw - 24px)); padding: 8px 10px; background: var(--fg); color: var(--bg); border-radius: 6px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); pointer-events: none; }

/* ---------- narrower ---------- */
@media (max-width: 1180px) {
  .ov { grid-template-columns: minmax(0, 1fr) 300px; }
  .kpis > div:nth-child(n+3) { display: none; }
}
@media (max-width: 900px) {
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .layout-side .side, .layout-strip .side { position: static; max-height: none; min-height: 0; display: flex; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-map { max-width: 100%; }
  .tree, .layout-strip .tree { display: flex; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; margin: 0; }
  .tree li { flex: 0 0 auto; }
  .tree .bl { border: 1px solid var(--line); width: auto; white-space: nowrap; grid-template-columns: 9px max-content auto; }
  .tree ul { display: none; }
  .ident { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .kpis { flex-wrap: wrap; }
  .kpis > div:first-child { padding-left: 0; }
  .tabs { padding: 0 8px; }
  .panel { padding: 14px 16px 40px; }
  .ov { grid-template-columns: minmax(0, 1fr); }
  .md, .layout-strip .md { grid-template-columns: minmax(0, 1fr); }
  .md-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .md-items { max-height: 340px; }
  .docs, .evs { grid-template-columns: minmax(0, 1fr); }
  .facets { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .facets p { display: none; }
  .facets button { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
  .panel-head .ph-right { margin-left: 0; }
}
@media (max-width: 640px) {
  .sheet, .sheet caption, .sheet tbody, .sheet tr, .sheet th, .sheet td { display: block; width: auto; }
  .d-head { grid-template-columns: minmax(0, 1fr); }
  .d-head .d-nav { order: -1; justify-content: flex-end; }
  .sheet th { border: 0; background: none; padding: 6px 6px 0; }
  .sheet td { border: 0; border-bottom: 1px solid var(--line-soft); }
  .recent li { grid-template-columns: 80px minmax(0, 1fr); }
  .recent li > span:last-child { grid-column: 1 / -1; }
  .d-grid .w2 { grid-column: auto; }
  .d-low { grid-template-columns: 84px minmax(0, 1fr); }
  .d-figs { grid-template-columns: minmax(0, 1fr); }
  .d-figs div + div { border-left: 0; border-top: 1px solid var(--line); }
  .dep-sum { grid-template-columns: minmax(0, 1fr); }
  .dep-sum > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .m-two, .ex-list { grid-template-columns: minmax(0, 1fr); }
  .steps .step + .step::before { width: 10px; margin: 0 5px; }
}
.menu > div > hr { padding: 0; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }

/* ---------- workspace: pieces the mock drew by hand, done with Leaflet here ---------- */
.side-map { aspect-ratio: 1.3; background: var(--surface); }
.side-map .leaflet-container { width: 100%; height: 100%; font: 12px/1.4 var(--font); }
.ws-pin { width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: var(--c, #555); box-shadow: 0 1px 4px rgb(0 0 0 / .45); cursor: pointer; }
.ws-pin.sel { width: 24px; height: 24px; border-width: 3px; box-shadow: 0 0 0 3px var(--accent), 0 2px 8px rgb(0 0 0 / .5); }
.ws-pin-tip small { display: block; color: #666; font-size: 11px; }
.leaflet-container .leaflet-control-layers, .leaflet-container .leaflet-bar { font-family: var(--font); }
.sheet-foot { display: flex; justify-content: flex-end; padding: 6px 10px; border-top: 1px solid var(--line-soft); }
.mp-note { font-size: 12px; padding: 8px 10px 10px; }
#inset.inset { aspect-ratio: 4 / 3; min-height: 0; border: 0; border-radius: 0; }
.inset.repositioning { outline: 3px solid var(--contrast); outline-offset: -3px; }
.coords .link { font-size: 12px; }
.todo .empty, .md-items .empty { display: block; padding: 8px 12px; font-size: 13px; }
.md-items .grp[hidden], .li[hidden] { display: none !important; }
.d-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.d-ev + h3, .d-low h3 { margin-top: 10px; font-size: 13.5px; }
.small-note { font-size: 13px; }
.qrbox .qr { width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px; background: #fff; }
.tile .link-to { padding: 0 8px 6px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .att-label { margin: 2px 2px 0; }
.files .thumb { display: grid; place-items: center; }
.files .thumb .ext { font-size: 8px; }
.open-list .row.start { justify-content: flex-start; }
.card-h .flow { font-size: 12px; }
.dep-note { font-size: 12.5px; margin: -4px 0 10px; }
.dep-stack { display: flex; flex-direction: column; }
.dep-stack .dep-sum { order: -1; }
.dep-ctl .box { width: 64px; }
.layout-side .side .menu > div > button { display: block; width: 100%; text-align: left; padding: 7px 12px; border: 0; background: none; color: var(--fg); font-size: 13px; cursor: pointer; }
.layout-side .side .menu > div > button:hover { background: var(--tint); }
.ex-n { margin-left: auto; }
label.check.end { align-self: end; }
.settings-tax .inline { min-width: 8em; }
.settings-tax td.actions form { display: inline-block; margin-right: 4px; }
.settings-tax tr.add td { background: var(--surface); }
.settings-tax tr.add form { gap: 6px; }
.row.wrap { flex-wrap: wrap; align-items: center; }
body.viewer .md-add, body.viewer .d-nav .danger, body.viewer [data-ev-open], body.viewer .star, body.viewer #pin-edit, body.viewer .sheet-foot { display: none !important; }
body.viewer .d-actions .sep { display: none; }
/* folder.js viewer: the star that sets the cover photo */
.viewer .v-star.on { background: var(--contrast); color: #1d2330; border-color: var(--contrast); }
@media (max-width: 1180px) { .ov { grid-template-columns: minmax(0, 1fr) 300px; } .kpis > div:nth-child(n+3) { display: none; } }
.layout-side .detail { max-width: none; margin: 0; padding: 0; }
.layout-side .detail > section { margin-top: 0; }
@media (min-width: 901px) { .layout-side .side { min-height: calc(100vh - var(--banner-h) - var(--topbar-h)); } }
.layout-side .side .side-actions { margin-bottom: 0; }
.ident .title-row { margin-bottom: 0; }
.ident .inline.title { flex: 0 1 auto; }
.panel h2 { margin: 0; }
.panel table { background: transparent; }
.panel th, .panel td { vertical-align: middle; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line-soft); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.count { font-size: 13px; font-weight: 400; color: var(--muted); }
.layout-side h3, .modal h2, .modal h3 { margin: 0; color: var(--accent); font-size: 14px; font-weight: 700; }
.layout-side .side-head h3 { font-size: 15px; }
.layout-side p { margin: 0; }
.tree a.bl { text-decoration: none; }
.tree li.cur > .bl .nm { color: var(--accent); }
.ident .status { font-size: 12.5px; padding: 3px 8px; }
.d-head .eyebrow { margin-bottom: 2px; }
.d-actions .btn.small { font-size: 12.5px; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
label.btn { position: relative; }
label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cpre { color: var(--faint); font-weight: 400; }
/* dropdown menus sit above Leaflet (its controls go up to z-index 1000) */
.menu > div { z-index: 1200; }
/* menus inside a scrolling box (the campus column) would be clipped by it: app.js pins them to the viewport
   under the button instead, so they overlap whatever is next to the box */
.menu.fixed > div { position: fixed; left: var(--mx); top: var(--my); right: auto; }
.bld-map { aspect-ratio: 16 / 9; max-height: 46vh; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bld-map .leaflet-container { width: 100%; height: 100%; cursor: crosshair; }
/* sticky = own stacking context: lift the column above the sticky tab bar while one of its menus is open */
.layout-side .side:has(details.menu[open]) { z-index: 30; }
/* building picker in the column */
.tree-all { display: flex; align-items: center; gap: 6px; padding: 4px 8px 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tree-all > span { white-space: nowrap; }
.tree-all input { margin: 0; flex: none; }
.tree-all b { color: var(--fg); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 2px; }
.tree li > ul { grid-column: 1 / -1; }
.tree .pick { margin: 0 0 0 6px; }
.tree li.cur > .bl { grid-column: auto; }
.scope-note b { color: var(--fg); font-weight: 600; }
@media (max-width: 900px) { .tree li { display: flex; align-items: center; } }
/* dialog fields fill their column (a content-sized <select> renders too narrow in some browsers) */
.mf > .box, .mf > select.box { width: 100%; }
/* year / "after X years" boxes: room for four digits plus Firefox's inline spinner */
input.years, .dep-controls .years, .dep-ctl .box { width: 6.2em; }
main.card.settings:has(.settings-tax) { max-width: 1180px; }
.settings-tax select.inline { width: auto; max-width: 11em; }
/* organization settings: section tabs across the top of the card */
.stabs { display: flex; flex-wrap: wrap; gap: 2px; margin: -8px -24px 16px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.stabs a { padding: 10px 12px 8px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.stabs a:hover { color: var(--accent); }
.stabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
/* depreciation preferences: a compact form group above the catalogue */
.dep-prefs { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 10px 16px; align-items: start; padding: 12px 14px; margin: 4px 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.dep-prefs label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); min-width: 0; }
.dep-prefs label small { font-size: 12px; }
.dep-prefs select.inline { width: 100%; border-color: var(--line); background: var(--input-bg); }
.dep-prefs .btn { align-self: start; margin-top: 21px; }
@media (max-width: 900px) { .dep-prefs { grid-template-columns: 1fr 1fr; } .dep-prefs .btn { margin-top: 0; } }
/* catalogue page: one save for everything */
.savebar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 12px; border: 1px solid var(--warn); border-radius: 8px; background: var(--warn-bg); font-size: 13px; }
.savebar span:first-child { flex: 1; }
.settings-tax .dirty, .dep-prefs .dirty { background: var(--warn-bg); border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.fields-tbl td, .fields-tbl th { padding: 4px 6px; }
.fields-tbl .box { width: 100%; }
.fields-tbl .key { font-family: ui-monospace, monospace; font-size: 12px; width: 9em; }
.xbool { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 14px; }
.xbool input { margin: 0; width: 16px; height: 16px; }
/* organization settings: the user table was wider than its card */
main.card.settings { max-width: 1100px; }
.settings table { font-size: 13px; table-layout: auto; }
.settings td { vertical-align: middle; }
.settings td:nth-child(2) { white-space: nowrap; }
.settings select { max-width: 100%; }
.settings .actions .btn { padding: 3px 8px; font-size: 12.5px; }
/* suggestion list under inputs with a datalist (app.js) */
.suggest { position: fixed; z-index: 1300; margin: 0; padding: 4px 0; list-style: none; max-height: 240px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); font-size: 13.5px; }
.suggest li { padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.suggest li:hover, .suggest li.on { background: var(--tint); color: var(--accent); }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }

/* the campus's vehicles node in the column: a diamond instead of a status dot, a rule above */
.tree li.veh { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
.tree .dot.veh { --c: var(--accent); border-radius: 1px; transform: rotate(45deg); width: 7px; height: 7px; }

/* campus record page (/campuses/{id}) */
main.site { max-width: 1400px; margin: 0 auto; padding: 12px 16px 40px; display: grid; gap: 14px; }
.site-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; }
.site-head .card { padding: 10px 12px; }
.site-head .eyebrow { margin: 0 0 2px; }
.site-head .inline.title { font-size: 20px; font-weight: 700; width: 100%; margin-bottom: 6px; }
.site-head .sheet { width: 100%; }
.site-map { height: 320px; border-radius: 6px; overflow: hidden; }
.site-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.doc-slot { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.doc-slot b { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.doc-slot ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 3px; }
.doc-slot li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.doc-slot li small { color: var(--muted); }
.site-table .card-h h2 { font-size: 15px; margin: 0; }
.site-table .tbl-wrap { overflow-x: auto; }
.site-table table { width: 100%; font-size: 12.5px; }
.site-table h3 { font-size: 13.5px; margin: 12px 12px 4px; }
.site-table .hint { margin: 4px 12px; }
.site-table .dep-controls { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { .site-head { grid-template-columns: 1fr; } .site-docs { grid-template-columns: 1fr; } }

/* item panel: the item's photos and documents (mock A) */
.d-docs { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 10px 0 2px; display: grid; gap: 8px; }
.d-docs-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-docs-h h3 { margin: 0; font-size: 13px; flex: 1; }
.d-docs-h form { display: flex; gap: 6px; align-items: center; }
.d-docs-h select { font-size: 12px; padding: 3px 6px; }
.d-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.d-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.d-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.d-files li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 3px 0; border-top: 1px solid var(--line-soft); }
.d-files li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-files .tag { font-size: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; color: var(--muted); white-space: nowrap; }
.li .clip { color: var(--accent); }

/* ===== shell (dashboard mock 2026-10-15): navy header, nav column, pale page ===== */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: var(--banner-h) auto; min-height: 100vh; }
html.nav-mini { --nav-w: 68px; }
.app-main { grid-column: 2; grid-row: 2; min-width: 0; }

/* header */
.banner { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 1100; height: var(--banner-h); display: flex; align-items: center; gap: 14px; padding: 0 18px 0 16px;
  color: #fff; background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy) 100%); box-shadow: 0 2px 8px rgb(8 24 52 / .25); }
.banner .brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.banner .brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 2px rgb(255 255 255 / .85), 0 0 0 4px rgb(255 214 102 / .35); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-size: 19px; font-weight: 700; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 12.5px; color: #c6d6ef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.banner-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.banner .bell { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; }
.banner .bell:hover { background: rgb(255 255 255 / .1); }
.banner .menu > summary { display: flex; align-items: center; gap: 8px; color: #fff; }
.banner .menu.lang > summary { height: 36px; padding: 0 10px; border: 1px solid rgb(255 255 255 / .28); border-radius: 6px; font-size: 13.5px; }
.banner .menu.lang > summary:hover, .banner .userbar > summary:hover { background: rgb(255 255 255 / .08); }
.banner .menu .ic { width: 16px; height: 16px; }
.banner .menu > summary > .ic:last-child { width: 14px; height: 14px; opacity: .8; }
.flag { width: 22px; height: 15px; border-radius: 2px; flex: none; }
.banner .menu > div { right: 0; top: calc(100% + 8px); min-width: 200px; color: var(--fg); }
.banner .menu > div form { margin: 0; padding: 0; }
.banner .menu > div a, .banner .menu > div button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; border: 0; background: none; color: var(--fg); font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.banner .menu > div a:hover, .banner .menu > div button:hover { background: var(--tint); }
.banner .menu > div .ic { width: 16px; height: 16px; color: var(--muted); }
.banner .userbar { display: block; padding: 0; border: 0; font-size: inherit; margin: 0; }
.banner .userbar > summary { padding: 4px 8px 4px 4px; border-radius: 30px; }
.banner div.userbar { display: flex; align-items: center; gap: 8px; }
.banner .userbar .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #dbe8f8; color: var(--navy); font-weight: 700; font-size: 15px; text-transform: uppercase; box-shadow: 0 0 0 2px rgb(255 255 255 / .35); }
.banner .userbar .avatar .ic { width: 22px; height: 22px; }
.banner .userbar .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.banner .userbar .who b { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
.banner .userbar .who small { font-size: 12px; color: #b8cbe8; white-space: nowrap; }
.banner .userbar hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.banner .btn.login { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }

/* nav column */
.sidenav { grid-column: 1; grid-row: 2; position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h)); height: calc(100dvh - var(--banner-h)); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; color: var(--nav-fg); background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg) 70%, color-mix(in srgb, var(--nav-bg) 82%, #2a5d9e) 100%); z-index: 1050; }
.nav-toggle { display: grid; place-items: center; width: 40px; height: 36px; padding: 0; margin: 0 0 4px 4px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }
.nav-toggle:hover { background: rgb(255 255 255 / .08); }
.nav-toggle.mobile { display: none; color: #fff; margin: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sidenav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 7px; color: var(--nav-fg); text-decoration: none; font-size: 14.5px; white-space: nowrap; }
.sidenav a:hover { background: rgb(255 255 255 / .07); color: #fff; }
.sidenav a[aria-current="page"] { background: linear-gradient(90deg, var(--nav-active), color-mix(in srgb, var(--nav-active) 80%, #3b82e0)); color: #fff; font-weight: 600; box-shadow: 0 2px 10px rgb(0 0 0 / .25), inset 0 0 0 1px rgb(255 255 255 / .08); }
.sidenav a .ic { width: 21px; height: 21px; }
.sidenav a span { overflow: hidden; text-overflow: ellipsis; }
.theme-seg { display: flex; margin: 18px 4px 0; padding: 3px; border: 1px solid var(--nav-line); border-radius: 8px; background: rgb(0 0 0 / .15); }
.theme-seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--nav-fg); font-size: 13px; cursor: pointer; }
.theme-seg button:hover { color: #fff; }
.theme-seg button[aria-pressed="true"] { background: var(--nav-active); color: #fff; font-weight: 600; cursor: default; }
.theme-seg .ic { width: 16px; height: 16px; }
.nav-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nav-art { width: 100%; max-width: 168px; fill: none; stroke: #8fb0e0; stroke-width: 1.4; stroke-linejoin: round; opacity: .35; }
.nav-foot small { font-size: 11px; color: #6f86ab; }
.nav-scrim { display: none; }
html.nav-mini .sidenav { padding-left: 8px; padding-right: 8px; }
html.nav-mini .sidenav a { justify-content: center; padding: 0; }
html.nav-mini .sidenav a span, html.nav-mini .theme-seg span, html.nav-mini .nav-foot { display: none; }
html.nav-mini .nav-toggle { margin-left: 6px; }
html.nav-mini .theme-seg { flex-direction: column; margin: 18px 0 0; }

/* the page under the shell */
.app-main > .topbar { height: auto; min-height: 44px; padding: 8px 24px; background: transparent; border-bottom: 0; font-size: 13.5px; }
.app-main > .topbar a { color: var(--muted); }
.app-main > .topbar a:first-child { color: var(--accent); font-weight: 600; }
.app-main > main.card { margin-top: 4px; border-color: var(--line); border-radius: 10px; box-shadow: var(--shadow-card); }
.card, .tbl-wrap, .md, .dep-sum { box-shadow: var(--shadow-card); }
.tabs, .layout-side .side, .savebar { top: var(--banner-h); }
.layout-side .side { max-height: calc(100vh - var(--banner-h)); }
.split { height: calc(100vh - var(--banner-h)); height: calc(100dvh - var(--banner-h)); }

@media (max-width: 1100px) { .brand-text b { font-size: 16px; } .banner .userbar .who { display: none; } }
@media (max-width: 900px) {
  body.shell { grid-template-columns: minmax(0, 1fr); }
  .app-main { grid-column: 1; }
  .nav-toggle.mobile { display: grid; }
  .sidenav .nav-toggle { display: none; }
  .sidenav { position: fixed; left: 0; top: var(--banner-h); bottom: 0; width: 248px; height: auto; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgb(0 0 0 / .3); }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: var(--banner-h) 0 0; z-index: 1040; background: var(--scrim); }
  html.nav-mini .sidenav a { justify-content: flex-start; padding: 0 12px; }
  html.nav-mini .sidenav a span, html.nav-mini .theme-seg span { display: inline; }
  .banner { gap: 8px; padding: 0 10px 0 6px; }
  .banner .brand img { width: 34px; height: 34px; }
  .brand-text small, .banner .menu.lang span { display: none; }
}
@media (max-width: 560px) { .brand-text b { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .banner .bell { display: none; } }
@media print {
  body.shell { display: block; }
  .banner, .sidenav, .nav-scrim { display: none; }
}

/* login: the card on the navy backdrop */
body:not(.shell):has(main.login) { background: radial-gradient(circle at 30% 20%, var(--navy-2), var(--navy) 55%, var(--nav-bg)); min-height: 100vh; }
main.card.login { border: 0; border-radius: 12px; box-shadow: 0 20px 60px rgb(0 0 0 / .35); padding: 28px 28px 22px; }
main.card.login h1 { color: var(--title); font-size: 19px; }

/* ===== overview (/overview): the dashboard ===== */
main.ov { padding: 16px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.ov .card { border-radius: 10px; }
.ov .card-h { padding: 12px 16px 8px; border-bottom: 0; }
.ov .card-h h3, .ov h2.sec { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; color: var(--title); white-space: normal; }
.ov .card-h h3 .count { font-weight: 600; color: var(--muted); text-transform: none; }
.ov .card-h a { font-size: 13px; white-space: nowrap; }
.h-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--accent); flex: none; }
.h-ic.bad { background: var(--st-degraded); }
.h-ic .ic { width: 16px; height: 16px; }

/* filter cards */
.ov-filters { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.fcard { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-card); }
.fcard > .ic { width: 30px; height: 30px; color: var(--accent); stroke-width: 1.5; }
.fcard > span { display: flex; flex-direction: column; gap: 3px; }
.fcard small { font-size: 12px; color: var(--muted); }
.fcard select { min-width: 210px; padding: 4px 8px; font-size: 13.5px; }
.ov-updated { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.btn.refresh { padding: 10px 18px; gap: 8px; font-weight: 600; font-size: 14px; color: var(--accent); border-color: var(--line); box-shadow: var(--shadow-card); }
.btn.refresh .ic { width: 18px; height: 18px; }

/* headline tiles */
.ov-tiles { padding: 14px 16px 16px; }
.ov-tiles .sec { margin-bottom: 12px; }
.tiles4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile4 { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--tc) 22%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 10%, var(--card)), color-mix(in srgb, var(--tc) 4%, var(--card))); }
.t-blue { --tc: #1f6fd1; } .t-sky { --tc: #1d8fd6; } .t-green { --tc: #23955a; } .t-purple { --tc: #8a63e0; }
.tic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--tc) 70%, #fff), var(--tc)); box-shadow: 0 4px 12px color-mix(in srgb, var(--tc) 35%, transparent); }
.tic .ic { width: 26px; height: 26px; }
.tile4 h3 { margin: 4px 0 6px; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.tile4 .big { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 700; color: var(--title); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile4 .big small { font-size: 18px; font-weight: 600; }
.tile4 .sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.delta { display: flex; align-items: center; gap: 4px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.delta .ic { width: 16px; height: 16px; color: var(--ok); stroke-width: 2.4; }
.delta b { color: var(--ok); font-size: 15px; margin-right: 4px; }
.delta.down .ic, .delta.down b { color: var(--bad); }
.usage-body { display: flex; align-items: center; gap: 14px; }
.gauge { width: 104px; height: 104px; flex: none; transform: rotate(0deg); }
.gauge circle, .donut circle { fill: none; }
.gauge circle { stroke-width: 5.2; }
.gauge .ring, .donut .ring { stroke: var(--line-soft); }
.gauge text { font-size: 7px; font-weight: 700; fill: var(--ok); text-anchor: middle; }
.usage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; flex: 1; min-width: 0; font-size: 12.5px; }
.usage li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.usage li b { font-variant-numeric: tabular-nums; }
.dot { --c: var(--c, currentColor); }
.st-active .dot { --c: var(--st-active); } .st-maintenance .dot { --c: var(--st-maintenance); } .st-degraded .dot { --c: var(--st-degraded); } .st-vacant .dot { --c: var(--st-vacant); }
li > .dot { width: 10px; height: 10px; }

/* value mix / trend / map */
.ov-row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1.2fr); gap: 16px; }
.ov-row2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-row2 > :only-child { grid-column: 1 / -1; }
.mix-body { display: flex; align-items: center; gap: 18px; padding: 8px 16px 18px; }
.donut { width: 200px; height: 200px; flex: none; }
.donut circle { stroke-width: 7.5; }
.donut text { text-anchor: middle; font-family: var(--font); }
.donut .seg { font-size: 2.7px; font-weight: 700; fill: #fff; }
.donut .c1 { font-size: 5.2px; font-weight: 700; fill: var(--title); }
.donut .c2 { font-size: 2.9px; fill: var(--muted); }
.mix-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.mix-legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; }
.mix-legend .dot { width: 14px; height: 14px; margin-top: 2px; }
.mix-legend b { display: block; font-size: 13.5px; font-weight: 600; }
.mix-legend small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend em { font-style: normal; color: var(--line); margin: 0 4px; }
.trend-body { padding: 0 14px 14px; }
.axis-unit { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.chart { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .yl { font-size: 11.5px; fill: var(--muted); text-anchor: end; }
.chart .xl { font-size: 12.5px; fill: var(--fg); text-anchor: middle; }
.chart .bar { fill: var(--c1); opacity: .9; }
.chart .bar:hover { opacity: 1; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .acc { stroke: var(--c2); } .chart .rem { stroke: var(--c3); }
.chart .pt { fill: var(--card); stroke-width: 2.2; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 8px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; background: var(--c1); }
.sw.acc { background: var(--c2); } .sw.rem { background: var(--c3); }
.ov-map-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; padding: 0 12px 12px; }
.ov-map { height: 300px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.ov-legend { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; align-self: start; }
.ov-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ov-legend .dot { width: 12px; height: 12px; }
.ov-pop { display: flex; flex-direction: column; gap: 3px; min-width: 170px; font: 13px/1.35 var(--font); }
.ov-pop small { color: #5a6a82; }
.ov-pop a { margin-top: 4px; font-weight: 600; }

/* alerts + activity tables */
.ov-scroll { max-height: 380px; overflow: auto; margin: 0 12px 12px; border: 1px solid var(--line-soft); border-radius: 8px; }
.ov-table { font-size: 13px; }
.ov-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); color: #455364; font-size: 12.5px; padding: 9px 10px; }
:root[data-theme="dark"] .ov-table thead th { color: var(--muted); }
.ov-table td { padding: 9px 10px; vertical-align: middle; }
.ov-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ov-table .stt { width: 44px; text-align: center; color: var(--muted); }
.ov-table .due { color: var(--warn); font-weight: 600; white-space: nowrap; }
.ov-table .due.late { color: var(--bad); }
.lvl { display: inline-block; padding: 2px 10px; border-radius: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lvl.urgent { background: #e8384a; color: #fff; }
.lvl.watch { background: #f4cb64; color: #5c4510; }
.ov-table td:last-child a { font-weight: 600; text-decoration: none; }
.ov-table .when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.res { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; color: #fff; background: var(--c); vertical-align: middle; }
.res .ic { width: 15px; height: 15px; }

@media (max-width: 1400px) {
  .ov-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ov-row3 .ov-map-card { grid-column: 1 / -1; }
  .tiles4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) { .ov-row2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  main.ov { padding: 12px; }
  .ov-row3, .tiles4 { grid-template-columns: minmax(0, 1fr); }
  .mix-body { flex-direction: column; }
  .ov-map-body { grid-template-columns: minmax(0, 1fr); }
  .fcard { flex: 1 1 100%; }
  .fcard select { min-width: 0; width: 100%; }
  .fcard > span { flex: 1; }
}
/* tile layout: the condition tile's gauge spans under its icon; the nav column stays navy on long pages */
.tile4 > h3 { align-self: center; margin: 0; }
.tile4 .usage { grid-column: 1 / -1; }
.usage-body { gap: 16px; }
.gauge { width: 96px; height: 96px; }
.delta.flat b { color: var(--muted); }
.mix-legend small span { white-space: nowrap; }
.donut { width: 172px; height: 172px; }
body.shell { background: linear-gradient(90deg, var(--nav-bg) var(--nav-w), var(--bg) var(--nav-w)); }
@media (max-width: 900px) { body.shell { background: var(--bg); } }
@media (max-width: 1250px) { .tiles4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ov-table { min-width: 540px; }
@media (max-width: 760px) { .tiles4 { grid-template-columns: minmax(0, 1fr); } }

/* ===== existing pages in the dashboard's dress ===== */
/* section titles: uppercase navy, like the mock's card headers */
.card-h h3, .card-h h2, .panel-head h2, .pane-head h1 { text-transform: uppercase; color: var(--title); font-weight: 700; letter-spacing: .01em; }
.card-h h3, .card-h h2, .panel-head h2 { font-size: 14px; }
.pane-head h1 { font-size: 15px; }
.app-main main.card h2 { text-transform: uppercase; font-size: 15px; letter-spacing: .01em; margin-top: 22px; }
.app-main main.card h1 { font-size: 21px; }
/* asset page: title on its own line, the four figures as tinted tiles under it */
.ident { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpis > div, .kpis > div:nth-child(n+3), .kpis > div:first-child { display: flex; padding: 9px 14px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--tc) 22%, var(--line)); background: color-mix(in srgb, var(--tc) 7%, var(--card)); }
.kpis > div + div { border-left: 1px solid color-mix(in srgb, var(--tc) 22%, var(--line)); }
.kpis > div:nth-child(1) { --tc: #1f6fd1; } .kpis > div:nth-child(2) { --tc: #8a63e0; } .kpis > div:nth-child(3) { --tc: #23955a; } .kpis > div:nth-child(4) { --tc: #1d8fd6; }
.kpis dd { font-size: 19px; color: var(--title); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* campus page: names wrapped one word per line in the narrow column */
.site-table td:nth-child(2) { min-width: 180px; }
/* login: the sign-in button survives the read-only rule (the page has no user yet, so body is .viewer) */
body.viewer main.login .btn.primary { display: inline-flex !important; }
main.login .stack button { align-self: stretch; padding: 9px; font-size: 15px; }
