:root {
  --brand: #1F4D3A; --accent: #C8892B; --bg: #F5F6F4; --card: #FFFFFF; --text: #1C2321; --muted: #6B7470;
  --line: #E1E4E0; --ok: #1E7B45; --warn: #B4531A; --danger: #B3261E; --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; margin: 0 0 .6rem; }
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--brand); color: #fff; padding: .6rem 1rem; position: sticky; top: 0; z-index: 20; }
.topbar a, .topbar .link { color: #fff; text-decoration: none; }
.topbar .logo { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.topbar .search { flex: 1; max-width: 520px; } .topbar .search input { width: 100%; border: 0; border-radius: 6px; padding: .45rem .7rem; }
.top-actions { display: flex; gap: 1rem; align-items: center; margin-left: auto; } .top-actions select { max-width: 180px; }
.badge { background: var(--accent); border-radius: 10px; padding: 0 .45rem; font-size: .8rem; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.3rem; }
.shell { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 1rem 0; flex-shrink: 0; }
.sidebar a { display: block; padding: .55rem 1.2rem; color: var(--text); text-decoration: none; }
.sidebar a.active, .sidebar a:hover { background: #EEF3EF; color: var(--brand); font-weight: 600; border-left: 3px solid var(--brand); padding-left: calc(1.2rem - 3px); }
.sidebar .sep { border-top: 1px solid var(--line); margin: .6rem 0; }
.content { flex: 1; padding: 1.25rem 1.5rem 3rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head.small { margin-bottom: .5rem; } .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 440px; margin: 2rem auto; } .card.highlight { border-color: var(--accent); background: #FFF9F0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem 1.2rem; }
.form-grid .field-textarea, .form-grid .field-json, .span-all, .form-actions { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
label.check { font-weight: 400; display: flex; gap: .4rem; align-items: center; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid #C9CEC9; border-radius: 6px; width: 100%; background: #fff; margin-top: .2rem; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; } input[type=color] { padding: 2px; height: 36px; }
.inline { display: inline-flex; gap: .4rem; align-items: center; } .inline input, .inline select { width: auto; margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .inline-form h3 { width: 100%; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; margin: 0; } .inline-form.compact input, .inline-form.compact select { flex: 0 1 130px; }
.btn { display: inline-block; padding: .45rem .9rem; border: 1px solid #C9CEC9; border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; font: inherit; font-weight: 600; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; } .btn.full { width: 100%; margin-top: .5rem; } .btn:hover { filter: brightness(.96); }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; text-decoration: underline; }
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; } .flash.error { background: #FCE8E6; color: var(--danger); } .flash.success { background: #E6F4EA; color: var(--ok); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.card .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; } .table th, .table td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #FAFBFA; font-size: .85rem; color: var(--muted); white-space: nowrap; } .table th a { color: inherit; text-decoration: none; }
.table tr[data-href] { cursor: pointer; } .table tr[data-href]:hover { background: #F7FAF8; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; } .table tfoot td { font-weight: 700; background: #FAFBFA; }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: .35rem 1rem; margin: 0; } .dl dt { color: var(--muted); font-size: .9rem; } .dl dd { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; } .center { text-align: center; }
.warn { color: var(--warn); } .ok { color: var(--ok); } .nowrap { white-space: nowrap; } .req { color: var(--danger); } .unit { color: var(--muted); font-weight: 400; }
.help { font-size: .8rem; color: var(--muted); } .has-error input, .has-error select, .has-error textarea { border-color: var(--danger); } .error-text { color: var(--danger); font-size: .85rem; }
.pre { white-space: pre-wrap; } .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.kpi-n { font-size: 1.6rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; } .kpi-l { color: var(--muted); font-size: .85rem; }
.kpi.bad .kpi-n { color: var(--danger); } .kpi.good .kpi-n { color: var(--ok); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .3rem; }
.tile:hover { border-color: var(--brand); } .tile span { color: var(--muted); font-size: .88rem; }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 10px; background: #EEE; font-size: .78rem; font-weight: 600; color: var(--muted); }
.pill.ok { background: #E6F4EA; color: var(--ok); } .pill.warn { background: #FDEFE3; color: var(--warn); } .pill.bad { background: #FCE8E6; color: var(--danger); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; } .tag { background: var(--tag, #667); color: #fff; border-radius: 12px; padding: .1rem .55rem; font-size: .82rem; }
.tag button { color: #fff; text-decoration: none; }
.alerts, .tasks, .files, .history { list-style: none; padding: 0; margin: 0; } .alerts li, .tasks li, .files li, .history li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.alerts li.lvl-alert { border-left: 3px solid var(--danger); padding-left: .5rem; } .alerts li.lvl-warning { border-left: 3px solid var(--warn); padding-left: .5rem; } .alerts li.read { opacity: .6; }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; } .pager a { padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; background: #fff; } .pager a.active { background: var(--brand); color: #fff; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .3rem 1rem; margin-bottom: .8rem; } .perm-grid code { color: var(--muted); font-size: .75rem; }
.codes { columns: 2; } .qr { display: flex; justify-content: center; margin: 1rem 0; } .qr img, .qr canvas { width: 200px; height: 200px; image-rendering: pixelated; }
.bare .bare-main { padding: 1rem; } .brand-mark { text-align: center; font-weight: 800; font-size: 1.4rem; color: var(--brand); margin-top: 2rem; }
.intro { color: var(--muted); max-width: 820px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .7rem; overflow-x: auto; padding-bottom: .5rem; }
.board-col { background: #EEF1EE; border-radius: var(--radius); padding: .5rem; min-height: 200px; } .board-col h4 { margin: .2rem .3rem .5rem; font-size: .9rem; }
.board-col.drop { outline: 2px dashed var(--brand); }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .6rem; margin-bottom: .45rem; cursor: grab; font-size: .88rem; }
.board-card .small { display: block; } .board-card.weather { border-left: 3px solid #3B7DD8; } .board-card.blocked { border-left: 3px solid var(--danger); }
.map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); }
.sig-pad { border: 2px dashed #B9C0BA; border-radius: 6px; width: 100%; height: 160px; touch-action: none; background: #fff; }
.letterhead { background: #fff; max-width: 860px; margin: 0 auto; padding: 0 0 2rem; border: 1px solid var(--line); }
.letterhead .lh-banner { background: var(--brand); color: #fff; padding: 1.2rem 2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.letterhead .lh-banner img { max-height: 70px; max-width: 260px; } .letterhead .lh-body { padding: 1.5rem 2rem; }
.letterhead .lh-footer { border-top: 3px solid var(--accent); margin: 1rem 2rem 0; padding-top: .6rem; font-size: .82rem; color: var(--muted); }
.option-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; } .option-card.recommended { border: 2px solid var(--brand); }
.ai-panel textarea { min-height: 90px; } .ai-answer { white-space: pre-wrap; background: #F7F8F6; border-radius: 6px; padding: .8rem; margin-top: .6rem; }
.lint-hit { background: #FFF3CD; border-radius: 3px; padding: 0 2px; }
@media (max-width: 900px) {
  .sidebar { display: none; position: fixed; top: 52px; left: 0; bottom: 0; z-index: 30; box-shadow: 2px 0 12px rgba(0,0,0,.1); }
  .sidebar.open { display: block; } .nav-toggle { display: block; } .topbar .search { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; } .content { padding: 1rem; } .dl { grid-template-columns: 1fr; } .top-actions { gap: .6rem; font-size: .9rem; }
}
@media print {
  .topbar, .sidebar, .actions, .no-print, .flash { display: none !important; } .content { padding: 0; } .card { border: 0; } body { background: #fff; }
  .letterhead { border: 0; } .letterhead .lh-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
