/* Adjuster Toolbox – Graphite theme. No external fonts or CDNs. */
:root, [data-theme="dark"] {
  --bg: #15171c; --bg2: #1b1e24; --panel: #20242b; --panel2: #262b33;
  --line: #313742; --line2: #3b4250;
  --text: #e7eaf0; --muted: #9aa3b2; --faint: #6b7483;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.18);
  --input: #181b21;
  --good: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5f8; --bg2: #eceff4; --panel: #ffffff; --panel2: #f7f8fa;
  --line: #e1e5eb; --line2: #cfd5de;
  --text: #1c2330; --muted: #5b6575; --faint: #8b94a3;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.06);
  --input: #ffffff;
  color-scheme: light;
}
:root, [data-accent="blue"] { --accent: #3b82f6; --accent-2: #2563eb; }
[data-accent="teal"] { --accent: #14b8a6; --accent-2: #0d9488; }
[data-accent="green"] { --accent: #22c55e; --accent-2: #16a34a; }
[data-accent="purple"] { --accent: #8b5cf6; --accent-2: #7c3aed; }
[data-accent="orange"] { --accent: #f97316; --accent-2: #ea580c; }
[data-accent="rose"] { --accent: #f43f5e; --accent-2: #e11d48; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code, pre, .mono { font-family: Consolas, "SF Mono", Menlo, monospace; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.ic { flex: none; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--muted); }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; align-items: center; gap: 6px; }
.me { flex: 1; display: flex; gap: 10px; align-items: center; color: var(--text); padding: 6px; border-radius: 8px; min-width: 0; }
.me:hover, .me.active { background: var(--panel); text-decoration: none; }
.me strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.logout { color: var(--muted); padding: 8px; border-radius: 8px; }
.logout:hover { background: var(--panel); color: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; }
.quick-search { flex: 1; max-width: 460px; margin-left: auto; position: relative; display: flex; align-items: center; }
.quick-search .ic { position: absolute; left: 10px; color: var(--faint); }
.quick-search input[type=search] { padding-left: 34px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.content { padding: 20px 22px 60px; }
.demo-bar { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--text); padding: 6px 22px; font-size: 13px; border-bottom: 1px solid var(--line); }
.only-mobile, .icon-btn.only-mobile { display: none; }
.scrim { display: none; }

/* ---------- building blocks ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.empty { text-align: center; padding: 40px 20px; }
.empty p { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: inherit; cursor: pointer;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.sm { padding: 5px 9px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--faint); text-decoration: none; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--input);
  color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.field { margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.fields .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.hint { font-size: 12px; color: var(--faint); margin-top: 3px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 600; color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.tag.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid var(--line2); background: var(--panel); display: flex; align-items: center; gap: 10px; }
.flash.success { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }
.flash.error { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.flash.info { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.flash .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel2); }
.tbl .clickable { cursor: pointer; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl .claimno { font-weight: 600; white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.tbl .sub { display: block; color: var(--muted); font-size: 12px; }
.date-bad { color: var(--bad); font-weight: 600; }
.date-warn { color: var(--warn); font-weight: 600; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); display: block; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--line2); text-decoration: none; }
.kpi.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kpi .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi.bad .n { color: var(--bad); }
.kpi.warn .n { color: var(--warn); }

/* filter bar */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { max-width: 260px; }
.filters select { width: auto; }
.status-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pills a { opacity: .75; }
.status-pills a:hover, .status-pills a.on { opacity: 1; text-decoration: none; }
.status-pills a.on .chip { box-shadow: 0 0 0 2px var(--c); }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 12px; }

/* due list */
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.due-list li:last-child { border-bottom: 0; }
.due-list .when { width: 74px; flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.due-list .what { flex: 1; min-width: 0; }
.due-list .what a { font-weight: 600; }
.due-list .what small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 10px 0 2px; font-weight: 600; }

/* activity */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--faint); font-size: 12px; display: block; }

/* calendar */
.cal-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.cal-head strong { margin-left: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; color: var(--faint); text-transform: uppercase; text-align: center; padding: 2px 0; }
.cal-day {
  min-height: 92px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); padding: 5px 6px;
  color: var(--text); display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal.compact .cal-day { min-height: 54px; }
.cal-day:hover { border-color: var(--accent); text-decoration: none; }
.cal-day.load1 { background: color-mix(in srgb, var(--accent) 7%, var(--panel2)); }
.cal-day.load2 { background: color-mix(in srgb, var(--accent) 13%, var(--panel2)); }
.cal-day.load3 { background: color-mix(in srgb, var(--accent) 20%, var(--panel2)); }
.cal-day.load4 { background: color-mix(in srgb, var(--accent) 28%, var(--panel2)); }
.cal-day.past { opacity: .55; }
.cal-day.weekend { background-image: linear-gradient(transparent, transparent); }
.cal-day.thisweek { border-color: var(--line2); }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); opacity: 1; }
.cal-day.pto { border-style: dashed; border-color: var(--warn); }
.dnum { font-size: 12px; font-weight: 600; color: var(--muted); }
.today .dnum { color: var(--accent); }
.dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cnt { font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 5px; color: #fff; background: var(--c, var(--faint)); line-height: 16px; }
.cnt.ins { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.cnt.ev { background: transparent; color: var(--muted); padding: 0 2px; }
.cal-item { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c); padding-left: 4px; color: var(--text); }
.cal-item b { color: var(--c); }
.more { font-size: 11px; color: var(--muted); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--faint); margin-top: 8px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.sw.dash { background: transparent; border: 1px dashed var(--warn); }

/* claim page */
.claim-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.claim-head h2 { font-size: 1.35rem; margin: 0; }
.claim-head .who { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.note { padding: 10px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .meta { font-size: 12px; color: var(--faint); margin-bottom: 3px; display: flex; gap: 8px; }
.note .body { white-space: pre-wrap; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); display: flex; flex-direction: column; }
.doc .thumb { height: 100px; display: grid; place-items: center; background: var(--bg2); color: var(--faint); font-weight: 700; font-size: 18px; }
.doc .thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc .info { padding: 7px 8px; font-size: 12px; }
.doc .info a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.doc .info .row { gap: 4px; margin-top: 4px; }
.ai-box { white-space: pre-wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13.5px; }
.ai-badge { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* comms */
.comms { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.tpl-list li a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.tpl-list li a:hover { background: var(--panel2); text-decoration: none; }
.tpl-list li a.on { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.tpl-list small { color: var(--muted); display: block; }
.tpl-cat { font-size: 11px; text-transform: uppercase; color: var(--faint); margin: 10px 10px 4px; font-weight: 600; letter-spacing: .05em; }
textarea.letter { min-height: 340px; font-family: inherit; line-height: 1.5; }
.warn-box { border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* settings */
.mod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mod { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel2); display: flex; gap: 10px; }
.mod h4 { margin: 0 0 2px; font-size: 14px; }
.mod p { margin: 0; color: var(--muted); font-size: 12.5px; }
.mod.addon { opacity: .7; border-style: dashed; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--line2); transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.side-tabs { display: flex; flex-direction: column; gap: 2px; }
.side-tabs a { padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.side-tabs a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.side-tabs a.on { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { display: flex; gap: 6px; align-items: center; color: var(--text); font-weight: 400; font-size: 13px; border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; cursor: pointer; margin: 0; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* auth */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent),
  var(--bg); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 18px; font-size: 18px; }
.auth-card h2 { margin-bottom: 4px; }
.auth-card .btn.primary { width: 100%; justify-content: center; padding: 10px; }
.auth-foot { text-align: center; margin-top: 14px; color: var(--muted); font-size: 13px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .quick-search { order: 5; max-width: none; flex-basis: 100%; }
  .content { padding: 14px 12px 60px; }
  .cols-2, .cols-3, .comms, .settings, .dash { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .tbl th, .tbl td { padding: 8px 6px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 14px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-day { min-height: 64px; }
  .cal-item { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .side-tabs { flex-direction: row; overflow-x: auto; }
}
@media print {
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  :root { --bg: #fff; --panel: #fff; --text: #000; --line: #ccc; }
  .card { box-shadow: none; }
}

/* ======================================================================
   Theme presets (v1.2). Each sets colors and, where it helps, layout:
   slate     Slate & Carrier Blue     desk-first light command center
   midnight  Midnight Adjuster        dark navy triage workspace
   field     Tactical Field           olive & brass, big touch targets for tablets
   nordic    Nordic Paper & Graphite  warm light reading mode
   obsidian  Executive Obsidian       black & gold, admin control center
   daylight  High-Contrast Daylight   outdoor / sunlight, large text, bold borders
   Theme accents win over the accent picker (the picker applies to Dark and Light).
   ====================================================================== */
[data-theme="slate"] {
  --bg: #f1f4f8; --bg2: #ffffff; --panel: #ffffff; --panel2: #f5f7fa;
  --line: #dde3ea; --line2: #c9d1dc; --text: #16202e; --muted: #556275; --faint: #8693a5;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.05); --input: #ffffff;
  --good: #15803d; --warn: #b45309; --bad: #dc2626;
  --accent: #1d4ed8; --accent-2: #1e40af; color-scheme: light;
}
[data-theme="slate"] body { font-size: 13.5px; }
[data-theme="slate"] .sidebar { box-shadow: 1px 0 0 var(--line); }
[data-theme="slate"] .nav a.active { background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
[data-theme="slate"] .tbl td, [data-theme="slate"] .tbl th { padding-top: 7px; padding-bottom: 7px; }
[data-theme="slate"] .topbar { background: #fff; }

[data-theme="midnight"] {
  --bg: #0a1120; --bg2: #0d1628; --panel: #111c31; --panel2: #16233c;
  --line: #1e2d48; --line2: #29395a; --text: #e3ecf8; --muted: #8fa3c0; --faint: #5d7091;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.25); --input: #0b1426;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --accent: #22d3ee; --accent-2: #06b6d4; color-scheme: dark;
}
[data-theme="midnight"] .btn.primary { color: #04202a; }
[data-theme="midnight"] .nav a.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
[data-theme="midnight"] .kpi .n { color: var(--accent); }

[data-theme="field"] {
  --bg: #23271c; --bg2: #2a2f21; --panel: #313726; --panel2: #3a412d;
  --line: #4a5239; --line2: #5a6445; --text: #eef0e2; --muted: #b9bea0; --faint: #8b9170;
  --shadow: 0 2px 4px rgba(0,0,0,.35); --input: #262b1e;
  --good: #8bc34a; --warn: #e0a83a; --bad: #e5604b;
  --accent: #c9a14a; --accent-2: #b38a33; color-scheme: dark;
}
[data-theme="field"] body { font-size: 15.5px; }
[data-theme="field"] .btn { padding: 11px 16px; border-radius: 10px; }
[data-theme="field"] .btn.sm { padding: 8px 12px; font-size: 14px; }
[data-theme="field"] .btn.primary { color: #1f1a0c; font-weight: 600; }
[data-theme="field"] input, [data-theme="field"] select, [data-theme="field"] textarea { padding: 11px 12px !important; font-size: 15.5px; }
[data-theme="field"] .nav a { padding: 12px 12px; }
[data-theme="field"] .card { border-radius: 14px; }
[data-theme="field"] input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 1180px) {
  [data-theme="field"] .grid.dash, [data-theme="field"] .cols-2, [data-theme="field"] .cols-3 { grid-template-columns: minmax(0, 1fr); }
}

[data-theme="nordic"] {
  --bg: #f3efe7; --bg2: #ebe6dc; --panel: #fbf9f4; --panel2: #f2eee6;
  --line: #e0d9cc; --line2: #cfc6b5; --text: #2b2a27; --muted: #6c675d; --faint: #9a9385;
  --shadow: 0 1px 2px rgba(60,50,30,.06), 0 6px 18px rgba(60,50,30,.05); --input: #fffdf8;
  --good: #3f7d4e; --warn: #b07a1e; --bad: #b4412f;
  --accent: #2f4a41; --accent-2: #233830; color-scheme: light;
}
[data-theme="nordic"] h1, [data-theme="nordic"] h2, [data-theme="nordic"] h3 { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-weight: 600; letter-spacing: .1px; }
[data-theme="nordic"] .nav a.active { background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }

[data-theme="obsidian"] {
  --bg: #0c0c0e; --bg2: #121215; --panel: #17171b; --panel2: #1e1e23;
  --line: #2a2a31; --line2: #36363f; --text: #ece9e2; --muted: #a39e92; --faint: #6f6a60;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.35); --input: #101013;
  --good: #4ade80; --warn: #e8b24a; --bad: #f05252;
  --accent: #d4a64a; --accent-2: #b98d35; color-scheme: dark;
}
[data-theme="obsidian"] .btn.primary { color: #1a1406; font-weight: 600; }
[data-theme="obsidian"] .logo { background: linear-gradient(135deg, #e6c06c, #a87d2c); color: #1a1406; }
[data-theme="obsidian"] .kpi .n { color: var(--accent); }
[data-theme="obsidian"] .nav a.active { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

[data-theme="daylight"] {
  --bg: #ffffff; --bg2: #f4f6f9; --panel: #ffffff; --panel2: #eef1f5;
  --line: #6b7686; --line2: #4a5363; --text: #000000; --muted: #2a3240; --faint: #4a5363;
  --shadow: none; --input: #ffffff;
  --good: #0a6b2b; --warn: #8a4b00; --bad: #b00020;
  --accent: #0047bb; --accent-2: #00358c; color-scheme: light;
}
[data-theme="daylight"] body { font-size: 16px; }
[data-theme="daylight"] .card { border-width: 2px; }
[data-theme="daylight"] .btn { border-width: 2px; font-weight: 600; padding: 10px 15px; }
[data-theme="daylight"] .tag, [data-theme="daylight"] .chip { font-weight: 700; border-width: 2px; }
[data-theme="daylight"] a { text-decoration: underline; text-underline-offset: 2px; }
[data-theme="daylight"] .nav a, [data-theme="daylight"] .btn, [data-theme="daylight"] .brand, [data-theme="daylight"] .kpi, [data-theme="daylight"] .me, [data-theme="daylight"] .clickable a, [data-theme="daylight"] .claimno { text-decoration: none; }
[data-theme="daylight"] .nav a.active { background: var(--accent); color: #fff; box-shadow: none; }
[data-theme="daylight"] :focus-visible { outline: 3px solid #ffb000; outline-offset: 2px; }
[data-theme="daylight"] input, [data-theme="daylight"] select, [data-theme="daylight"] textarea { border-width: 2px !important; }

/* theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.theme-opt { display: block; border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; background: var(--panel2); color: var(--text); font-weight: 400; font-size: 13px; margin: 0; }
.theme-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt strong { display: block; font-size: 13.5px; }
.theme-opt small { color: var(--muted); display: block; margin-top: 2px; }
.theme-prev { display: flex; height: 54px; border-radius: 8px; overflow: hidden; margin-bottom: 8px; border: 1px solid rgba(128,128,128,.35); }
.theme-prev i { display: block; }
.theme-prev .s { width: 26%; } .theme-prev .m { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.theme-prev .b { height: 7px; border-radius: 3px; } .theme-prev .a { width: 40%; height: 9px; border-radius: 3px; }

/* add-on modules */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.result { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.result .big { font-size: 26px; font-weight: 700; color: var(--accent); }
.progress { height: 8px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }
.check-items .ci { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-items .ci.done span { color: var(--muted); text-decoration: line-through; }
.check-items .ci input { margin-top: 3px; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; display: flex; }
.bar-row .bar i { display: block; height: 100%; background: var(--accent); }

/* print: always black on white, whatever the theme */
@media print {
  html[data-theme] { --bg: #fff; --bg2: #fff; --panel: #fff; --panel2: #f5f5f5; --text: #000; --muted: #444; --faint: #666; --line: #ccc; --line2: #bbb; --input: #fff; --shadow: none; }
  .demo-bar, .top-actions, .btn, .scrim { display: none !important; }
  .main { display: block; } .content { padding: 0; }
}
/* forms used by Inspection, Reinspection and Coverage */
.form-sec { margin-top: 18px; } .form-sec:first-child { margin-top: 0; }
.form-sec > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.checks label { font-weight: 400; color: var(--text); font-size: 13.5px; display: flex; gap: 8px; align-items: center; margin: 0; }
.grid-rows td input, .grid-rows td select { min-width: 70px; }
.diff-up { color: var(--bad); font-weight: 600; } .diff-down { color: var(--good); font-weight: 600; }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-pick label { margin: 0; position: relative; cursor: pointer; }
.photo-pick img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); display: block; }
.photo-pick input:checked + img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.photo-pick input { position: absolute; top: 6px; left: 6px; }

/* v1.3 */
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; align-items: start; }
.grid.two > .card { margin: 0; }
.card > .grid.two { margin: 0 0 8px; }
.kpis.ec-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.due-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); }
.due-list li:last-child { border-bottom: 0; }
.due-list { list-style: none; margin: 0; padding: 0; }
@media (max-width: 760px) { .grid.two, .kpis.ec-kpis { grid-template-columns: 1fr; } }
.trade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0; }
.trade-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; }
.trade-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.trade-opt input { margin-top: 3px; }
.trade-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--panel2, var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; }
.board-col h3 { font-size: 13px; margin: 0 0 8px; display: flex; justify-content: space-between; }
.board-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; color: var(--text); font-size: 13px; }
.board-card:hover { border-color: var(--accent); text-decoration: none; }
.board-card .sub { display: block; color: var(--muted); font-size: 12px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 110px; font-size: 12px; }
.week-day.today { border-color: var(--accent); }
.week-day .d { color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.week-job { display: block; border-left: 3px solid var(--accent); background: var(--bg); padding: 4px 6px; border-radius: 4px; margin-bottom: 4px; color: var(--text); }
.week-job.delivery { border-left-color: var(--warn); }
@media (max-width: 760px) { .trade-grid { grid-template-columns: 1fr; } .week { grid-template-columns: 1fr; } .week-day { min-height: 0; } }
