/* Admin Desk — same tokens as the app, with a slate header accent to set it apart */
body.admin .bar { background: #1d293d; border-bottom-color: #141c2b; color: #fff; }
body.admin .brand { color: #fff; }
body.admin .brand svg { stroke: #ff9a4d; }
body.admin .brand-logo { background: #fff; border-radius: 8px; padding: 2px; height: 34px; width: 34px; }
body.admin .brand abbr { color: #ff9a4d; }
body.admin .desk-label { font-weight: 500; font-size: 13px; color: #fdba74; padding-left: 10px; border-left: 1px solid #3d4b63; }
body.admin .who { color: #d6dbe4; }
body.admin .bar .btn.ghost { background: transparent; color: #fff; border-color: #3d4b63; }
body.admin .bar .btn.ghost:hover { background: #2b3a55; }

.desk { display: flex; min-height: calc(100vh - 86px); }
.desk-nav { width: 200px; flex: none; padding: 18px 10px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 2px; }
.desk-nav a { padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.desk-nav a:hover { background: var(--panel); }
.desk-nav a[aria-current="page"] { background: var(--teal-tint); color: var(--teal-dark); font-weight: 500; }
.desk-main { flex: 1; min-width: 0; max-width: 1180px; padding: 26px 28px 60px; }
.desk-main h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.desk-main .lede { margin: 0 0 20px; color: var(--muted); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile .num { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tile.attention { border-color: #f0d49a; background: #fffaf0; }
.tile.attention .num { color: #8a5a00; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-top: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.panel h2 { margin: 0 0 2px; font-size: 15px; }
.panel .note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.chart-panel { margin-top: 16px; }

/* bar chart */
.bars { position: relative; height: 180px; display: grid; grid-template-columns: 34px 1fr; }
.bars .yaxis { position: relative; font-size: 11px; color: var(--muted); }
.bars .yaxis span { position: absolute; right: 8px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.bars .plot { position: relative; border-bottom: 1px solid #ead5bf; display: flex; align-items: flex-end; gap: 2px; }
.bars .gridline { position: absolute; left: 0; right: 0; border-top: 1px solid #fdf0e3; }
.bars .col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bars .col:hover { background: rgb(194 65 12 / .06); }
.bars .bar-fill { width: min(26px, 70%); background: var(--teal); border-radius: 4px 4px 0 0; }
.bars .col.zero .bar-fill { height: 0; }
.xaxis { display: flex; gap: 2px; margin-left: 34px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.xaxis span { flex: 1; text-align: center; white-space: nowrap; }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12.5px;
  box-shadow: 0 6px 16px rgb(30 42 50 / .12); white-space: nowrap;
}
.chart-tip strong { font-variant-numeric: tabular-nums; }
details.table-view { margin-top: 10px; font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--teal-dark); }
details.table-view table { margin-top: 8px; border-collapse: collapse; }
details.table-view td, details.table-view th { padding: 3px 12px 3px 0; text-align: left; font-variant-numeric: tabular-nums; }

/* activity + health */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #fdf0e3; font-size: 13.5px; align-items: start; }
.activity li:last-child { border-bottom: 0; }
.activity .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.activity svg, .health svg { width: 16px; height: 16px; margin-top: 2px; }
.health { list-style: none; margin: 0; padding: 0; }
.health li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #fdf0e3; font-size: 13.5px; }
.health li:last-child { border-bottom: 0; }
.health .detail { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.health .ok svg { color: var(--ok); }
.health .bad svg { color: #c98a00; }

/* tables and toolbars */
.toolbar-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar-row input[type="search"] { flex: 1; min-width: 200px; max-width: 360px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
.toolbar-row .count { color: var(--muted); font-size: 13px; margin-left: auto; }
table.list td .badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 9px; background: #fdf0e3; color: var(--muted); margin-left: 6px; }
table.list td .badge.off { background: #fbe9e7; color: var(--stop); }
table.list td .badge.shared { background: var(--teal-tint); color: var(--teal-dark); }
table.list td.num { font-variant-numeric: tabular-nums; }
table.list tr.disabled td:first-child { color: var(--muted); }
table.list select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; max-width: 180px; }
.danger-link { color: var(--stop) !important; }

/* settings */
.settings { max-width: 640px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #fdf0e3; }
.switch-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.switch-row .t { font-weight: 500; }
.switch-row .d { color: var(--muted); font-size: 13px; }

.site-notice { background: #fff3e6; border-bottom: 1px solid #fed7aa; color: #7c2d12; }

@media (max-width: 900px) {
  .desk { flex-direction: column; }
  .desk-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .desk-nav a { white-space: nowrap; }
  .desk-main { padding: 18px 16px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  table.list { display: block; overflow-x: auto; }
}
.form label.switch-row { display: flex; margin: 0; color: var(--ink); font-size: 14px; cursor: pointer; }
.form label.switch-row:first-child { padding-top: 0; }
@media (max-width: 640px) {
  body.admin .who, body.admin .bar .btn.ghost[href] { display: none; }
  body.admin .desk-label { display: none; }
}

/* security page */
.desk-nav a.nav-sep { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 12px; }
.sec-tips { margin-top: 14px; display: grid; gap: 8px; }
.desk-main .panel, .desk-main .settings { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel-head .spacer { flex: 1; }
.panel-head .count { color: var(--muted); font-size: 13px; }
.panel .sub { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 0 0 12px; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; margin-bottom: 8px; }
.num-field .unit { display: flex; align-items: center; gap: 8px; }
.num-field .unit input { width: 96px; }
.num-field .unit span { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 4px 11px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: #fff; }
.chip:hover { background: var(--panel); }
.chip[aria-pressed="true"] { background: var(--teal-tint); border-color: #fed7aa; color: var(--teal-dark); font-weight: 500; }
.table-scroll { overflow-x: auto; }
table.list.audit td { font-size: 13px; vertical-align: top; }
table.list.audit td .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
table.list td.nowrap { white-space: nowrap; }
table.list td.mono, .mono { font-family: var(--mono); font-size: 12px; }
tr.bad-row td:first-child { box-shadow: inset 3px 0 0 var(--stop); }
.fail-text { color: var(--stop); font-weight: 500; }
table.list td .badge.on { background: #e2f4ea; color: #17733f; }
table.list td .badge.muted-badge { background: #fff4dc; color: #8a5a00; }
/* home page editor (2026-11-11) */
.panel + .panel, .panel + form.panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head .spacer, .row .spacer { flex: 1; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 9px; margin-right: 6px; }
.ok-pill { background: #e2f4ea; color: #17733f; }
.warn-pill { background: #fff0c7; color: #7a5200; }
.off-pill { background: #fdf0e3; color: #5b6b76; }
.ach-rows { display: grid; gap: 8px; }
.ach-row { display: grid; grid-template-columns: 150px 1fr 1.6fr auto; gap: 8px; align-items: center; }
.ach-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.check-row, .dialog .check-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13.5px; }
.check-row input, .dialog .check-row input { width: auto !important; }
.grid-2.tight { gap: 12px; }
@media (max-width: 760px) { .ach-row { grid-template-columns: 1fr; } }

/* new logo has a light version for the dark bar: no white box */
body.admin .brand-logo { background: none; padding: 0; height: 36px; width: 36px; border-radius: 0; }
body.admin .brand-name { color: #fff; }
body.admin .brand-name small { color: #a9b8c8; }
/* mobile menu on the dark admin bar */
body.admin .navtoggle { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
body.admin header.bar.nav-open > nav { border-top-color: rgba(255,255,255,.2); }
body.admin header.bar.nav-open > nav > a { color: #fff; }
body.admin header.bar.nav-open > nav > a:hover, body.admin header.bar.nav-open > nav > a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
body.admin header.bar.nav-open > .bar-actions { border-top-color: rgba(255,255,255,.2); }
@media (min-width: 861px) {
  body.admin header.bar.has-drawer.nav-open > .drawer-only { background: #1d293d; border-color: rgba(255,255,255,.18); }
}
@media (min-width: 861px) {
  body.admin header.bar.has-drawer.nav-open > .drawer-only > a { color: #fff; }
  body.admin header.bar.has-drawer.nav-open > .drawer-only > a:hover { background: rgba(255,255,255,.12); color: #fff; }
}
