/* The look from docs/DASHBOARD_SPEC.md (section 0) and the mock-up screens (docs/dashboard_mockup/). */
:root {
  --menu: #0F1217; --menu-raised: #1A2130; --menu-current: #232B3A; --menu-border: #2A3345;
  --menu-text: #AEB6C2; --menu-dim: #8B94A3; --menu-label: #7E8796; --highlight: #4C7DFF;
  --ground: #F4F6F9; --card: #FFFFFF; --line: #E3E7EE; --line-soft: #EDF0F5; --input: #CDD4DF;
  --text: #121722; --muted: #5B6472; --accent: #2F5BEA; --accent-dark: #1E40AF;
  --green-bg: #DDF4E6; --green: #14532D; --amber-bg: #FCE9CF; --amber: #7A3E0C;
  --info-bg: #E7EDFD; --info: #1E3A8A; --head: #F1F4F8;
  --shadow: 0 1px 2px rgba(15,23,42,0.05), 0 10px 30px rgba(15,23,42,0.06);
  --sans: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
  --display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--ground); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.shell { display: flex; min-height: 100vh; }
.menu { width: 236px; flex-shrink: 0; background: var(--menu); color: #E6E9EE; display: flex; flex-direction: column;
        padding: 20px 14px; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--display); font-size: 22px; font-weight: 600; padding: 0 10px 10px; }
.firm-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 0 6px 10px; }
.firm-picker label { width: 100%; padding: 0 4px; font-size: 12px; color: var(--menu-label); }
.firm-picker select { flex: 1; min-width: 0; height: 36px; border-radius: 10px; border: 1px solid var(--menu-border);
                      background: var(--menu-raised); color: #FFF; font: inherit; font-size: 14px; padding: 0 8px; }
.firm-go { height: 36px; border-radius: 10px; border: 1px solid var(--menu-border); background: var(--menu-raised);
           color: #FFF; font: inherit; font-size: 13px; padding: 0 10px; cursor: pointer; }
.js .firm-go { display: none; }
.firm-name { padding: 0 10px 10px; font-size: 14px; color: #FFF; font-weight: 600; }
.group { padding: 10px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--menu-label); }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; min-height: 32px;
        border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--menu-text); }
.item:hover { background: var(--menu-raised); color: #FFF; }
.item.current { background: var(--menu-current); color: #FFF; font-weight: 600; box-shadow: inset 3px 0 0 var(--highlight); }
.item.locked { color: var(--menu-dim); }
.lock { font-size: 11px; }
.item .label { display: inline-flex; align-items: center; gap: 10px; }
.item { font-size: 14px; min-height: 36px; }
.sr { position: absolute; left: -9999px; }
.goto { padding: 0 6px 10px; }
.goto input { width: 100%; box-sizing: border-box; height: 36px; border-radius: 10px; border: 1px solid var(--menu-border);
              background: var(--menu-raised); color: #FFF; font: inherit; font-size: 13px; padding: 0 10px; }
.goto input::placeholder { color: var(--menu-label); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 2px; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; text-decoration: none;
       color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--text); }
.tab.current { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.tab.locked { color: var(--muted); font-style: italic; }
.reach { display: block; margin-top: 4px; font-size: 13px; color: var(--amber); }
.reach.now { color: var(--green); }
.goto-results { margin: 0; padding-left: 18px; line-height: 2; }
.menu-fold { display: flex; flex-direction: column; gap: 2px; }
.menu-fold > summary { display: none; }
.grow { flex-grow: 1; min-height: 16px; }
.me { font-size: 12px; color: var(--menu-label); padding: 0 10px 6px; }
.signout { margin: 0 6px; height: 32px; width: calc(100% - 12px); border-radius: 8px; border: 1px solid var(--menu-border);
           background: transparent; color: var(--menu-text); font: inherit; font-size: 13px; cursor: pointer; }
.signout:hover { color: #FFF; background: var(--menu-raised); }

.main { flex-grow: 1; min-width: 0; padding: 28px 36px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 16px;
             border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; }
h2 { margin: 0 0 6px; font-size: 17px; }
.sub { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
        background: var(--info-bg); color: var(--info); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.banner { padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.card p { margin: 6px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .num { font-size: 30px; font-weight: 700; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }

.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent);
       color: #FFF; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.link-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.link-btn:hover { color: #FFF; background: var(--accent-dark); }
.btn.ghost { border-color: var(--input); background: var(--card); color: var(--text); font-weight: 400; }
.btn.wide { width: 100%; text-align: left; padding: 8px 18px; }
.btn:disabled { cursor: not-allowed; opacity: 0.6; }

body.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.signin { width: 420px; max-width: 100%; padding: 44px; display: flex; flex-direction: column; gap: 14px; }
.brand-big { font-size: 32px; }
.signin .sub { margin: 0 0 6px; }
.alert { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 14px; }
.test-signin { border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.test-signin h2 { font-size: 14px; color: var(--muted); }

/* Settings pages */
.section { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.source { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.section > .muted { margin: 0; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.fact { display: grid; grid-template-columns: minmax(120px, 0.8fr) 1.2fr; gap: 12px; padding: 8px 0;
        border-top: 1px solid var(--line-soft); }
.fact dt { font-weight: 600; }
.fact.wide { grid-column: 1 / -1; grid-template-columns: minmax(120px, 0.27fr) 1fr; }
.fact dd { margin: 0; color: var(--text); overflow-wrap: break-word; min-width: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--head); text-align: left; padding: 10px 14px; font-weight: 700; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: break-word; }
td:first-child { min-width: 120px; }
td:first-child { font-weight: 600; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--head); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.fold { border-top: 1px solid var(--line-soft); }
.fold summary { cursor: pointer; padding: 10px 0; font-weight: 600; min-height: 24px; }
.fold summary:hover { color: var(--accent); }
.long { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; padding: 4px 0 14px; overflow-wrap: anywhere; }
.long dl, .long ol, .long ul { white-space: normal; }
mark { background: var(--amber-bg); color: var(--amber); border-radius: 4px; padding: 0 3px; }
.tree, .tree dd { margin: 0; }
.tree dt { font-weight: 600; margin-top: 8px; }
.tree dd { padding-left: 16px; border-left: 2px solid var(--line-soft); }
ol.tree { padding-left: 22px; margin: 4px 0; }
ol.tree > li { margin: 6px 0; }
.letterhead { display: flex; flex-direction: column; gap: 10px; }
.letterhead img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #FFF; }
.systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.system { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.system-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.system-name { font-weight: 700; font-size: 15px; }
.keys { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }

/* Live records */
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
        border: 1px solid var(--input); background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #FFF; font-weight: 600; }
.pill.off { color: var(--muted); border-style: dashed; }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.transcript li { padding: 8px 12px; border-radius: 10px; background: var(--head); max-width: 80%; }
.transcript li.emma { background: var(--info-bg); align-self: flex-end; }
.transcript .who { font-weight: 700; margin-right: 6px; }

/* Personal */
.notice { padding: 10px 14px; border-radius: 12px; background: var(--head); color: var(--text); font-size: 14px; margin: 0; }
.cellbox { min-height: 44px; font: inherit; padding: 8px 12px; border: 1px solid var(--input); border-radius: 10px; width: 220px; }
.mins { width: 72px; min-height: 36px; font: inherit; padding: 4px 8px; border: 1px solid var(--input); border-radius: 8px; }
/* Activity marks */
.tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--head); color: var(--muted); }
.tag.ok { background: var(--green-bg); color: var(--green); } .tag.warn { background: var(--amber-bg); color: var(--amber); }
.mark-actions { display: flex; flex-direction: column; gap: 4px; }
.mark-actions input[type=text] { min-height: 40px; font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--input); border-radius: 8px; width: 320px; max-width: 100%; }
.note { border-top: 1px solid var(--line-soft); padding: 8px 0; font-size: 14px; }
/* Editing */
.field textarea.doc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.fold-edit { margin: 0 0 8px; } .fold-edit .btn { min-height: 36px; font-size: 13px; }
.diff { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.45; background: var(--head); border-radius: 10px;
        padding: 10px 12px; margin: 0; overflow-wrap: anywhere; }
.diff .add { background: var(--green-bg); color: var(--green); display: block; }
.diff .del { background: #FDE2E4; color: #9F1239; display: block; text-decoration: line-through; }
.diff .ctx { color: var(--muted); display: block; }
.diff span { min-height: 1.45em; }
.diff-title { font-size: 14px; margin: 10px 0 4px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--head); padding: 0 4px; border-radius: 4px; }
.chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chain select, .field select, .records select { font: inherit; font-size: 15px; min-height: 44px; padding: 0 10px;
  border: 1px solid var(--input); border-radius: 10px; background: #FFF; color: var(--text); }
.records input { width: 100%; min-width: 110px; min-height: 40px; font: inherit; font-size: 14px; padding: 6px 10px;
  border: 1px solid var(--input); border-radius: 8px; }
.records td { padding: 6px 8px; }
.check.danger { border-color: #BE123C; color: #9F1239; }
.testcopy { padding: 8px 14px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 13.5px; }
.banner.ok { background: var(--green-bg); color: var(--green); }
.edits .edit-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.edits .btn { min-height: 40px; font-size: 14px; }
.editform { gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field > label, .section > label { font-weight: 600; }
.field input[type=time], .field input[type=number], .field input[type=email], .field input[type=tel],
.field input[type=text], .field textarea, .section input[type=text], .inline-form select {
  font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--input); border-radius: 10px; background: #FFF;
  color: var(--text); min-height: 44px; max-width: 100%; }
.field input[type=time] { width: 150px; } .field input[type=number] { width: 120px; }
.field input[type=email], .field input[type=tel] { width: 360px; }
.field textarea { width: 100%; resize: vertical; line-height: 1.45; }
.section input[type=text] { width: 100%; }
.readonly { color: var(--muted); }
.field input.short { width: 160px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.error { margin: 0; font-size: 14px; color: #9F1239; font-weight: 600; }
.has-error input, .has-error textarea { border-color: #BE123C; }
.days { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
         border: 1px solid var(--input); border-radius: 10px; }
.pairs { display: flex; flex-direction: column; gap: 8px; }
.pair { display: grid; grid-template-columns: 200px 1fr; gap: 8px; }
.pair input { min-height: 44px; font: inherit; padding: 9px 12px; border: 1px solid var(--input); border-radius: 10px; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.actions-card { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.pin { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.plain { margin: 0; padding-left: 18px; }
.prop { padding: 8px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .menu { width: 100%; height: auto; position: static; padding: 14px 16px; }
  .menu-fold > summary { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
                         border: 1px solid var(--menu-border); background: var(--menu-raised); color: #FFF;
                         font-weight: 600; cursor: pointer; margin-bottom: 6px; }
  .main { padding: 20px 16px; }
  .stats, .two { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .fact { grid-template-columns: 1fr; gap: 2px; }
  .pair, .edits .edit-list { grid-template-columns: 1fr; }
  .field input[type=email], .field input[type=tel] { width: 100%; }
}
@media (max-width: 520px) { .stats, .two { grid-template-columns: 1fr; } }

.mini { border-collapse: collapse; margin: 6px 0; font-size: 14px; }
.mini th, .mini td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.chart-box { overflow-x: auto; }
.chart { width: 100%; min-width: 520px; height: auto; display: block; }
