:root {
  --ink: #1d1b26; --muted: #5f5a6b; --line: #e6e1ec; --bg: #f6f4f8; --card: #fff;
  --brand: #662D91; --green: #1a7f37; --red: #b42318; --amber: #b54708; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
.bar { background: var(--brand); padding: 12px 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 140px; }
.grow { flex: 3 1 240px !important; }
label { display: block; font-size: 13px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #cfd5df; border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d9c6ea; border-color: var(--brand); }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cfd5df; font-weight: 500; }
.btn.green { background: var(--green); } .btn.red { background: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; white-space: nowrap; }
tr.day td { background: #fafbfc; font-weight: 600; font-size: 13px; color: var(--muted); }
tfoot td { font-weight: 700; border-bottom: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.big { font-size: 22px; margin: 6px 0 14px; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f4; color: var(--muted); }
.chip.pending { background: #fff4e5; color: var(--amber); }
.chip.approved { background: #e8f5ec; color: var(--green); }
.chip.queried { background: #fdecea; color: var(--red); }
.chip.superseded { text-decoration: line-through; }
.chip.lock { background: #eef0f4; }
.timer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.clock { font: 600 30px/1 ui-monospace, Menlo, monospace; }
.running { border-color: #b996d6; background: #faf6fd; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { flex: 1 1 160px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.periodnav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.periodnav strong { min-width: 230px; text-align: center; }
.inline input { margin: 0; padding: 5px 7px; }
.tasks { margin: 6px 0 0; padding: 0; list-style: none; display: flex; gap: 6px; flex-wrap: wrap; }
.tasks li { background: #f1f3f7; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.tasks li.off { opacity: .5; text-decoration: line-through; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 10; max-width: 90vw; }
.toast.err { background: var(--red); }
.notice { padding: 10px 14px; border-radius: 8px; margin: 10px 0; }
.notice.ok { background: #e8f5ec; color: var(--green); } .notice.err { background: #fdecea; color: var(--red); }
.stack { display: grid; gap: 12px; max-width: 560px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 15px; }
.check input { width: auto; margin-top: 4px; }
.login { max-width: 420px; margin: 10vh auto; }
.recon-page main.card { max-width: 860px; margin: 32px auto; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 520px; width: 92vw; }
dialog::backdrop { background: rgba(20, 25, 40, .35); }
@media (max-width: 640px) { .hide-sm { display: none; } main { margin-top: 12px; } .top { gap: 10px; padding: 10px 12px; } }
.stack hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
[hidden] { display: none !important; }

/* layout: purple sidebar + content */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 240px; min-width: 200px; background: var(--brand); color: #fff; padding: 24px 16px; box-sizing: border-box; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; font-weight: 600; }
.brand img, .bar img { height: 40px; display: block; }
.bar { background: var(--brand); padding: 12px 24px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: #efe6f6; font: inherit; font-size: 14px; cursor: pointer; }
nav button:hover { background: rgba(255,255,255,.1); }
nav button.on { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
nav svg { flex: none; }
.who { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.2); font-size: 13px; color: #efe6f6; display: flex; flex-direction: column; gap: 2px; }
.who .link { color: #fff; text-decoration: underline; font-size: 12px; text-align: left; }
.shell > main { flex: 999 1 560px; min-width: 0; max-width: 1240px; padding: 32px 40px; box-sizing: border-box; }
@media (max-width: 760px) {
  .side { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav button { width: auto; padding: 8px 10px; }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; }
  .shell > main { padding: 16px; }
}

/* Enter time: week grid */
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pagehead h1 { margin: 0; font-size: 26px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.weeknav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iconbtn { width: 44px; height: 44px; border: 1px solid #d9d2e2; background: #fff; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.weeklabel { padding: 0 14px; height: 44px; display: flex; align-items: center; background: #fff; border: 1px solid #d9d2e2; border-radius: 10px; font-weight: 600; font-size: 14px; }
.timerbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: #fff; border: 2px solid var(--brand); border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; }
.timerbar.idle { border: 1px solid var(--line); }
.timerbar .clock { font: 600 28px/1 ui-monospace, Menlo, monospace; }
.livedot { width: 10px; height: 10px; border-radius: 50%; background: #c2410c; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.colmain { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.colside { flex: 1 1 280px; display: flex; flex-direction: column; gap: 16px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { min-height: 68px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; font: inherit; }
.day .dn { font-size: 12px; font-weight: 600; }
.day .dh { font-size: 16px; font-weight: 700; }
.day .dt { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); font-weight: 700; }
.day.weekend { background: #f7f6f8; }
.day.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.day.on .dt { color: #fff; }
.gridcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.grid { min-width: 700px; font-size: 14px; }
.grid thead tr, .grid tfoot tr { background: #faf8fc; }
.grid th, .grid td { padding: 8px 4px; text-align: center; }
.grid th:first-child, .grid td:first-child { text-align: left; padding-left: 16px; }
.grid th:last-child, .grid td:last-child { text-align: right; padding-right: 16px; }
.grid .dayhead { display: inline-block; padding: 4px 10px; border-radius: 99px; }
.grid .dayhead.on { background: var(--brand); color: #fff; }
.grid tbody th { font-weight: 600; }
.grid .rowname { display: flex; align-items: center; gap: 10px; }
.grid .rowname small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cell { width: 56px; height: 40px; box-sizing: border-box; margin: 0 auto; text-align: center; border: 1px solid #ddd6e5; border-radius: 8px; padding: 0; font-size: 14px; }
.cell.today { border-color: #b996d6; background: #faf6fd; }
.cell.weekend { background: #f7f6f8; }
.cell:disabled { background: #f1eff4; color: var(--muted); border-style: dashed; }
.gridfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.addrow { height: 44px; padding: 0 16px; border: 1px dashed #b9a6cc; background: #fff; color: var(--brand); border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 15px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.bar8 { height: 8px; background: #f0ecf4; border-radius: 99px; overflow: hidden; }
.bar8 > div { height: 8px; border-radius: 99px; }
.callout { background: #fff4e5; color: #8a3b00; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.callout.ok { background: #e8f5ec; color: #14632b; }
.callout.err { background: #fdecea; color: #a01f14; }
.entrycard { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.entrycard .stripe { width: 4px; align-self: stretch; min-height: 36px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grid tbody th, .grid tfoot th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.grid tfoot th { font-weight: 700; }
