/* 24 Sep 2026 redesign: the shell (rail, Admin side list, page titles) in the paper + teal look. Tokens from app.css. */
.rail { background: var(--panel); padding: 20px 12px 12px; }
.brand { font-family: var(--serif); font-weight: 400; font-size: 22px; padding: 0 10px 18px; }
.brand small { font-family: "Instrument Sans", system-ui, sans-serif; }
.nav { color: var(--ink-2); font-weight: 500; border-radius: 10px; }
.nav.on { background: var(--fill); color: var(--ink); box-shadow: none; }
.nav.quiet { color: var(--muted); font-weight: 400; font-size: 14px; height: 34px; }
.nav .cnt { color: var(--muted); }
.badge { background: var(--red); }
.badge.acc { background: var(--acc); color: var(--acc-ink); }
.me { font-size: 13px; color: var(--ink-2); }
.me button { color: var(--acc-text); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.quiet { color: var(--ink-2); }
.btn.quiet:hover { background: var(--fill); }
.page h1, .dk-top h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.01em; line-height: 1.1; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.toast { background: var(--ink); }

/* Live / Not live, top of the rail (every page) */
.live-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 4px 12px; padding: 7px 10px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink-2); text-align: left; font-size: 13px; }
.live-badge .live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.live-badge.ok { background: var(--green-soft); color: var(--green); } .live-badge.ok .live-dot { background: var(--green); }
.live-badge.bad { background: var(--red-soft); color: var(--red); } .live-badge.bad .live-dot { background: var(--red); }
.live-why { flex-basis: 100%; font-size: 12px; line-height: 1.35; color: var(--ink-2); }

@media (max-width: 1100px) and (min-width: 761px) { .live-badge { justify-content: center; } .live-badge b, .live-badge .live-why { display: none; } }

/* Admin: one side list, the section on the right */
.admin-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; min-height: 0; }
.subnav { border-right: 1px solid var(--line); padding: 22px 12px; overflow-y: auto; background: var(--ground); }
.subnav-h { font-family: var(--serif); font-size: 26px; padding: 0 10px 12px; }
.subnav-i { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.subnav-i:hover { background: var(--fill); }
.subnav-i.on { background: var(--fill); color: var(--ink); }
.subnav-note { margin: 16px 10px 0; font-size: 12px; color: var(--amber); }
.admin-body { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.admin-body > * { flex: 1; min-height: 0; }

/* plain one-line lists (Customers) */
.plain-list { border-top: 1px solid var(--line); max-width: 980px; }
.plain-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(0, 2fr) 110px 140px; gap: 12px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); font-size: 14px; }

@media (max-width: 760px) {
  /* phone: the rail becomes a bottom bar with the four CRM items */
  .shell, .shell.wide { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; width: 100vw; }
  .shell > * { min-width: 0; }
  .rail { order: 2; border-bottom: 0; border-top: 1px solid var(--line); justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .nav { flex-direction: column; height: auto; gap: 2px; padding: 4px 8px; font-size: 11px; background: none !important; }
  .nav.on { color: var(--acc-text); }
  .nav.quiet { display: none; }
  .live-badge { position: fixed; top: 6px; right: 8px; z-index: 40; margin: 0; padding: 4px 9px; max-width: 70vw; box-shadow: var(--shadow); }
  .live-badge.ok .live-why { display: none; }
  .nav .cnt { position: absolute; margin: -4px 0 0 18px; }
  .nav { position: relative; }
  .admin-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .subnav { display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .subnav-h, .subnav-note { display: none; }
  .subnav-i { white-space: nowrap; width: auto; }
  .plain-row { grid-template-columns: 1fr auto; }
  .plain-row > :nth-child(2), .plain-row > :nth-child(4) { display: none; }
  .page h1, .dk-top h1 { font-size: 26px; }
}

/* Switches (Admin): one big card per switch; the toggle is the loudest thing on the page */
.sw-page { max-width: 860px; }
.sw-list { display: grid; gap: 12px; margin-top: 18px; }
.sw-card { display: flex; align-items: center; gap: 20px; padding: 18px 22px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.sw-card.on { box-shadow: inset 0 0 0 2px var(--acc); }
.sw-card.danger { background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--amber); }
.sw-text { flex: 1; min-width: 0; }
.sw-title { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sw-state { font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--muted); }
.sw-card.on .sw-state { background: var(--acc); color: var(--acc-ink); }
.sw-card.danger .sw-state { background: var(--amber); color: var(--card); }
.sw-now { margin-top: 6px; font-size: 15px; color: var(--ink); }
.sw-other { margin-top: 4px; }
.sw-by { margin-top: 6px; font-size: 12px; }
.sw-toggle { flex: none; width: 76px; height: 42px; border-radius: 999px; border: 0; background: var(--line); position: relative; padding: 0; transition: background .15s; }
.sw-toggle span { position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.sw-toggle.on { background: var(--acc); }
.sw-card.danger .sw-toggle.on { background: var(--amber); }
.sw-toggle.on span { left: 38px; }
.sw-toggle:disabled { opacity: .6; }
.sw-hours { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; padding: 12px 4px; border-top: 1px solid var(--line); }

/* Routing (Admin) */
.rt-list { margin: 6px 0 0; padding-left: 22px; }
.rt-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.rt-to { color: var(--acc-text); font-weight: 600; margin-left: 8px; }
.rt-on { color: var(--green); } .rt-off { color: var(--red); }
.rt-unclear { margin-top: 8px; color: var(--red); font-size: 13.5px; }
.rt-try { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-try .rec-notes { min-width: 180px; }
.rt-result { margin-top: 10px; font-size: 14.5px; }

/* Reports: AI cost row under the KPI cards */
.rep-ai { padding: 0 28px 40px; max-width: 1100px; }
.rep-ai-row { display: flex; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-top: 6px; }
@media (max-width: 760px) {
  .sw-card { padding: 14px; gap: 12px; }
  .sw-title { font-size: 17px; }
  .rep-ai { padding: 12px 16px 0; }
}

/* House rules summary */
.rs { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.rs .eyebrow { justify-content: flex-start; }
.rs-sum { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.rs-list { margin: 0; padding-left: 22px; }
.rs-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rs-list li:last-child { border-bottom: 0; }
.rs-line { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.rs-point { font-size: 14.5px; }
.rs-pill { flex: none; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.rs-pill.ok { background: var(--green-soft); color: var(--green); }
.rs-pill.wait { background: var(--amber-soft); color: var(--amber); }
.sw-amt { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.sw-amt input { width: 70px; height: 32px; border: 0; border-radius: 8px; padding: 0 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
