
:root {
  --bg: #0f1720;
  --bg-2: #101822;
  --panel: #18222d;
  --panel-2: #1d2a36;
  --panel-3: #223241;
  --text: #e8eef5;
  --muted: #9fb0c2;
  --line: #2d3b49;
  --accent: #5aa9ff;
  --danger: #ff6b6b;
  --warn: #ffbe55;
  --ok: #6ed39b;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.22);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Segoe UI", Arial, sans-serif; }
body { line-height: 1.35; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: #cfe3ff; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--accent); color: #08111a; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
button:hover { filter: brightness(1.05); }
button.ghost { background: transparent; color: var(--text); }
button.danger { border-color: #5b2b31; color: #ffd4d8; }
button.small-btn { padding: 6px 10px; font-size: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow); }
.topbar h1 { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.version { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; background: rgba(255,255,255,0.03); }
.subtitle { margin-top: 6px; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.top-actions .file-btn { position: relative; overflow: hidden; }
.top-actions .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.app-grid { display: grid; grid-template-columns: 420px 1fr; gap: 16px; padding: 16px; min-height: calc(100vh - 86px); }
.left-col,.right-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stack-gap { display: flex; flex-direction: column; gap: 12px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span, .field label { font-size: 12px; color: var(--muted); }
.full-span { grid-column: 1 / -1; }
input[type="text"], input[type="file"], input[type="number"], input[type="date"], input[type="time"], select, textarea { width: 100%; background: #0d141c; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,169,255,.15); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-grid, .editor-grid, .quick-grid, .dict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 14px; }
.checkboxes label { display: flex; align-items: center; gap: 8px; }
.column-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.column-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 8px; min-height: 92px; justify-content: center; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.value { font-size: 28px; font-weight: 700; }
.main-list-panel { min-height: 0; display: flex; flex-direction: column; }
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 72vh; background: #0d141c; }
table { width: 100%; border-collapse: collapse; min-width: 1600px; }
thead th { position: sticky; top: 0; z-index: 3; background: var(--panel-2); color: #c9d9ea; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { background: var(--panel-3); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
.asset-row.expanded { background: rgba(90,169,255,.08); }
.asset-detail-row td { background: #101922; }
.asset-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.nowrap { white-space: nowrap; }
.coords { font-family: Consolas, monospace; font-size: 12px; }
.inline-maintainer { min-width: 180px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.badge.ok { background: #183425; color: var(--ok); }
.badge.due { background: #3d2f12; color: #ffd26e; }
.badge.late { background: #3c1f21; color: #ff9aa1; }
.badge.type { background: #233445; color: #cfe3ff; }
.badge.todo { background: #243446; color: #d3e5ff; }
.badge.planned { background: #21403b; color: #aaf0d0; }
.badge.done { background: #183425; color: var(--ok); }
.badge.deferred { background: #4d3721; color: #ffd2a6; }
.log-box { width: 100%; min-height: 180px; background: #0d141c; color: #dce8f5; border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; font-family: Consolas, monospace; font-size: 12px; }
.due-list, .mini-list, .planner-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.due-item, .mini-item, .planner-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 12px; background: #0d141c; border: 1px solid var(--line); border-radius: 10px; }
.due-item-main, .planner-item-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.empty-box { padding: 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: #0d141c; }
.task-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #0d141c; display: flex; flex-direction: column; gap: 10px; }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; background: #13202c; }
.small-list { display: flex; flex-wrap: wrap; gap: 6px; }
.yaml-box { min-height: 220px; font-family: Consolas, monospace; font-size: 12px; }
.status-line { min-height: 18px; }
.hidden { display: none !important; }
.planner-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; padding: 16px; }
.planner-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.planner-column { min-height: 280px; }
@media (max-width: 1320px) { .app-grid, .planner-grid { grid-template-columns: 1fr; } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 880px) { .filter-grid, .checkboxes, .column-toggle-grid, .editor-grid, .asset-detail-grid, .quick-grid, .dict-grid, .planner-columns { grid-template-columns: 1fr; } .topbar { flex-direction: column; } .stats-grid { grid-template-columns: 1fr 1fr; } .table-wrap { max-height: 78vh; } }
/* 0022 — the phone case. `max-height:none` let .table-wrap grow past the viewport, so it
   never scrolled internally and the page scrolled instead; a sticky header inside an
   overflow:auto box sticks to THAT box's scrollport, which was not the one moving. Giving
   it a viewport-relative height restores the internal scroll the header sticks within. */


/* v2026.06.10-r5 readability */
.tiny{padding:4px 8px;font-size:12px}.compact{gap:6px;margin-top:6px}.coords-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.coords-text{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap}.coords-review{color:var(--danger);font-weight:700}.inline-maintainer{min-width:145px}.task-editor-card,.planner-task-card{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--panel-2);margin-bottom:10px}.task-title-input,.planner-task-title input{width:100%;font-weight:700;font-size:15px}.task-head,.planner-task-title{display:flex;align-items:center;gap:8px}.task-edit-grid,.planner-edit-grid{display:grid;grid-template-columns:repeat(4,minmax(90px,1fr));gap:8px;margin:10px 0}.task-edit-grid label,.planner-edit-grid label{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:4px}.task-details-input,.planner-task-card textarea{width:100%;min-height:70px;resize:vertical}.planner-list{display:flex;flex-direction:column;gap:10px}.planner-asset-line{color:var(--muted);font-size:12px;margin-top:4px}.is-done{opacity:.75}.done-column{grid-column:1/-1}.planner-task-card input,.planner-task-card select,.planner-task-card textarea,.task-editor-card input,.task-editor-card select,.task-editor-card textarea{background:var(--panel-3);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:6px}@media(max-width:1200px){.task-edit-grid,.planner-edit-grid{grid-template-columns:repeat(2,minmax(120px,1fr));}}@media(max-width:700px){.task-edit-grid,.planner-edit-grid{grid-template-columns:1fr;}}


/* r7 compact workflow sections */
.compact-list { display:flex; flex-direction:column; gap:6px; }
.compact-item { display:flex; align-items:center; gap:6px; padding:6px; border:1px solid var(--line); border-radius:8px; background:#0d141c; color:var(--text); }
.compact-item .grow { flex:1; min-width:0; }
.immediate-item select { width:58px; }
.small-btn { padding:3px 6px; font-size:12px; }
.is-done { opacity:.65; text-decoration:line-through; }

/* 0018 — movable + resizable columns, two-line inspection cell */
/* `sticky`, not `relative` (0022): this selector is more specific than the `thead th`
   rule above and comes later, so `position:relative` here silently killed the sticky
   header the moment 0018 shipped. Sticky is still a positioned ancestor, so .col-resize's
   absolute anchoring — and therefore drag-to-resize — is unaffected. */
thead th.col-head { position:sticky; top:0; padding-right:14px; user-select:none; }
.col-head-label { pointer-events:none; }
/* The grip sits inside the header's right edge. 8px is the smallest comfortable target;
   pointer capture in app.js keeps the drag alive once the cursor leaves it. */
.col-resize { position:absolute; top:0; right:0; width:8px; height:100%; cursor:col-resize; touch-action:none; }
.col-resize:hover, body.col-resizing .col-resize { background:linear-gradient(to right, transparent, var(--accent)); opacity:.55; }
thead th.col-head[draggable="true"] { cursor:grab; }
thead th.col-dragging { opacity:.45; cursor:grabbing; }
thead th.col-drop { box-shadow:inset 3px 0 0 var(--accent); }
body.col-resizing { cursor:col-resize; user-select:none; }
/* A resized column holds its width via the inline width/min/max renderTableHead sets;
   overflow:hidden stops long content from pushing past it. (`text-overflow:ellipsis` was
   dropped — it is inert without white-space:nowrap, and cells here wrap on purpose.) */
.table-wrap th, .table-wrap td { overflow:hidden; }

.insp-cell { display:flex; flex-direction:column; gap:2px; }
.insp-line { display:flex; align-items:center; gap:6px; }
.insp-type { font-size:11px; color:var(--muted); line-height:1.2; }
/* The bundle flag: another inspection is due within 5 weeks of the date shown. */
.insp-bang { color:var(--warn); font-weight:800; font-size:15px; line-height:1; cursor:help; }

/* 0037 — expected AND final due date per inspection, inside the expanded row. The column
   shows one filtered date by design; this is where the unfiltered truth lives. */
.insp-schedule { margin:10px 0; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.02); }
.insp-schedule-row { font-size:12px; line-height:1.5; }
.insp-schedule-row.is-hidden-class { opacity:.55; }

.insp-filter-group { margin-bottom:8px; }
.insp-filter-title { text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }

/* Server sync (0021) — the banner offering to pull a newer server copy. It sits between
   the header and the grid so it is unmissable on a phone without covering the table. */
.sync-banner {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin:0 16px 12px; padding:10px 14px; border-radius:10px;
  background:#2a2413; border:1px solid var(--warn); color:var(--warn); font-size:14px;
}
.sync-banner[hidden] { display:none; }
.sync-banner span { flex:1 1 240px; }
.sync-banner button { padding:6px 10px; font-size:13px; }
#serverSyncPanel .button-row { flex-wrap:wrap; }

/* 0022 — the per-row Edit panel inside an expanded row. Boxed and offset so it reads as a
   mode you entered, not as more of the detail list above it. */
.row-edit-panel { margin:10px 0; padding:10px 12px; border:1px solid var(--accent); border-radius:10px; background:var(--panel-2); display:flex; flex-direction:column; gap:10px; }
.row-edit-panel .field { display:flex; flex-direction:column; gap:4px; }
.row-edit-panel .field > span { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
/* .coords-tools / .coords-text / .coords-review are defined once, higher up — do not
   redeclare them here; the earlier rule carries the monospace + nowrap the cells need. */

/* 0030 — the inspection cell when everything is hidden or nothing was ever tracked. A plain
   dash, not the old `filtered` badge: with five types hidden that badge landed on 128 of 242
   rows and named neither the filter nor the fix. The tooltip carries the detail. */
.insp-none { cursor:help; }

/* 0030 — the filter panel says what it is hiding. The checkbox positions alone are state you
   stop reading; a sentence with a count is state you notice. */
.insp-filter-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:10px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:#0d141c; font-size:12px; }
.insp-filter-summary strong { color:var(--warn); }

/* 0030 — due-date buckets on asset rows, Immediate items and (via v2.css) v2 cards.
   Backgrounds stay near the row's own colour per the founder's note; the 3px left edge does
   the signalling, so a table of 242 rows does not become a colour chart. These selectors are
   more specific than `tbody tr:hover` and `.asset-row.expanded` above, and come later — the
   expanded rule is restated below at equal specificity so an open row still reads as open. */
tr.asset-row.due-today   { background:rgba(255,255,255,.085); box-shadow:inset 3px 0 0 var(--warn); }
tr.asset-row.due-past    { background:rgba(160,110,220,.16);  box-shadow:inset 3px 0 0 #a06ee0; }
tr.asset-row.due-tomorrow{ background:rgba(110,211,155,.13);  box-shadow:inset 3px 0 0 var(--ok); }
tr.asset-row.due-today:hover    { background:rgba(255,255,255,.12); }
tr.asset-row.due-past:hover     { background:rgba(160,110,220,.24); }
tr.asset-row.due-tomorrow:hover { background:rgba(110,211,155,.20); }
tr.asset-row.expanded { background:rgba(90,169,255,.14); }

.compact-item.due-today   { background:#141d27; box-shadow:inset 3px 0 0 var(--warn); }
.compact-item.due-past    { background:#1d1630; box-shadow:inset 3px 0 0 #a06ee0; }
.compact-item.due-tomorrow{ background:#0f2119; box-shadow:inset 3px 0 0 var(--ok); }

/* 0031 — the week ahead. Blue to the coming Sunday, a paler blue for the Monday after: the
   two are deliberately close, because they answer "this week" vs "just after", not two
   different urgencies. They rank below past/today/tomorrow, so a nearer bucket always wins. */
tr.asset-row.due-week        { background:rgba(90,169,255,.13); box-shadow:inset 3px 0 0 var(--accent); }
tr.asset-row.due-next-monday { background:rgba(90,169,255,.07); box-shadow:inset 3px 0 0 #7fbcff80; }
tr.asset-row.due-week:hover        { background:rgba(90,169,255,.20); }
tr.asset-row.due-next-monday:hover { background:rgba(90,169,255,.13); }
.compact-item.due-week        { background:#101d2b; box-shadow:inset 3px 0 0 var(--accent); }
.compact-item.due-next-monday { background:#0e1721; box-shadow:inset 3px 0 0 #7fbcff80; }

/* 0031 — the bosses' inspection marker, next to the `!`. */
.insp-boss { cursor:help; font-size:14px; line-height:1; }
/* 0031 — the bundled inspection, written out under the soonest one. Indented and dimmed so
   the row still reads as one date with a footnote, not as two competing dates. */
.insp-bundle { font-size:11px; color:#9ec5f0; line-height:1.25; padding-left:2px; }

/* 0031 — the four stat cards, folded into the Assets panel head. */
.stat-inline { margin-right:14px; white-space:nowrap; }
.stat-inline strong { color:var(--text); font-weight:700; }

/* 0034 — the search box at the table head, and the work-list export row beneath it. */
.asset-search-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.asset-search-row input {
  flex:1; min-width:0; padding:7px 10px; border-radius:6px;
  border:1px solid var(--line); background:var(--panel-2); color:var(--text);
  font-size:13px;
}
.asset-search-row input:focus { outline:none; border-color:var(--accent); }
.asset-search-row .muted { white-space:nowrap; }
.export-row { align-items:center; margin-bottom:10px; }

/* 0043 — companion inspection marker. Muted, not alarming: an inherited date is normal
   operating reality at the diamond, not a fault. Sits inline with the badge and the `!`. */
.insp-companion { cursor:help; font-size:12px; opacity:.85; margin-left:2px; }
.insp-companion:hover { opacity:1; }
