/* layout: grouped side menu on the left, slim top bar */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: #00695c; color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .6rem 2rem; }
.side .brand-mark { color: #fff; text-decoration: none; padding: 0 .6rem; font-size: 1.15rem; }
.side-co { color: rgba(255,255,255,.75); font-size: .8rem; padding: .2rem .6rem 0; }
.side-group { margin-top: .9rem; }
.side-group + .side-group { border-top: 1px solid rgba(255,255,255,.25); padding-top: .9rem; }
.side-label { color: rgba(255,255,255,.7); font-size: .78rem; font-weight: 600; letter-spacing: .03em; padding: 0 .6rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .5rem; padding: .5em .7em; border-radius: 8px; color: rgba(255,255,255,.9); text-decoration: none; }
.side-nav a:hover { background: rgba(255,255,255,.1); }
.side-nav a.on { background: #fff; color: #00695c; font-weight: 600; }
.side-nav a .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 .45em; font-size: .75rem; }
.side-dim { display: none; }
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-in { padding: .55rem 20px; display: flex; align-items: center; gap: .9rem; }
.top-title { flex: 1; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .muted { color: rgba(255,255,255,.85); }
.top .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.menu-btn { display: none; border: 0; background: transparent; color: #fff; width: 40px; height: 40px; padding: 8px; border-radius: 50%; cursor: pointer; }
.menu-btn svg { width: 100%; height: 100%; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: 2px 0 12px rgba(0,0,0,.3); }
  .side-open .side { transform: none; }
  .side-open .side-dim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
  .menu-btn { display: inline-flex; margin-left: -8px; }
  .top-in { padding: .4rem 12px; }
  .top .who { display: none; }
}
main { max-width: 1200px; margin: 0; padding: 1.25rem 16px 4rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }
.qr-box { display: flex; justify-content: center; padding: 1rem; background: #fff; border-radius: var(--radius); }
.qr-box img, .qr-box canvas { width: 220px; height: 220px; }
.linkbox { word-break: break-all; font-size: .85rem; background: var(--surface-2); padding: .6rem; border-radius: 8px; }
.places-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem; }

@media print {
  .top, .side, .side-dim, .no-print, .report-head-buttons { display: none !important; }
  .chart-card, .stat { break-inside: avoid; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
}
.print-sheet { text-align: center; padding: 2rem 1rem; }
.print-sheet h1 { font-size: 2.2rem; }
.print-sheet .qr-box img, .print-sheet .qr-box canvas { width: 320px; height: 320px; }

/* payroll */
.day-chip { display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; padding: .15rem .45rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.day-chip input { margin: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: .3rem; }
.pay-table td, .pay-table th { white-space: nowrap; }
.pay-table td.num, .pay-table th { text-align: right; }
.pay-table th:first-child { text-align: left; }
.pay-detail td { background: var(--surface-2); }
.pay-items { max-width: 460px; display: grid; gap: .2rem; padding: .3rem 0; }
.rules-table td, .rules-table th { white-space: nowrap; vertical-align: middle; }
.rules-table input[type="time"] { padding: .35em .4em; }
.rules-table .days { display: flex; gap: .25rem; }
.rules-table .day-chip { padding: .1rem .35rem; }

/* report charts */
.stat.warn-tile b { color: var(--bad); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: .9rem; }
.chart-card { display: grid; gap: .3rem; align-content: start; }
.chart { width: 100%; height: auto; display: block; margin-top: .3rem; }
.chart .bar { fill: #009688; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(0, 150, 136, .08); }
.chart .grid { stroke: #e6eaf1; stroke-width: 1; }
.chart .axis { stroke: #b8c0cf; stroke-width: 1; }
.chart .tick { fill: #5d6880; font-size: 11px; }
.chart-tip { position: fixed; z-index: 100; display: none; pointer-events: none; background: #172033; color: #fff; padding: .45rem .6rem; border-radius: 8px; font-size: .82rem; line-height: 1.4; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.chart-tip span { color: #c9d1e0; }
.rank { display: grid; gap: .35rem; margin-top: .4rem; }
.rank-row { display: grid; grid-template-columns: 1.4rem minmax(0, 11rem) 1fr auto; gap: .5rem; align-items: center; font-size: .9rem; }
.rank-no { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 12px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: #009688; border-radius: 0 4px 4px 0; }
.rank-v { white-space: nowrap; color: var(--text); }
.rank-v small { color: var(--muted); }
/* report view switch: a framed bar with solid buttons */
.toolbar { margin: 1rem 0; padding: .55rem .65rem; background: #eef6f5; border: 1px solid #cfe5e2; border-radius: 12px; }
.seg { display: inline-flex; gap: .3rem; padding: .25rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.seg button { border: 0; border-radius: 8px; background: transparent; padding: .5em 1.05em; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.seg button:hover { background: #eef1f6; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 150, 136, .35); }
.quick-range { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.quick-range button { border: 0; background: var(--surface); padding: .35em .85em; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; }
.quick-range button + button { border-left: 1px solid var(--line); }
.quick-range button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* clear titles; what needs doing stands out */
main h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
main h2.section { font-size: 1.05rem; margin: 1.6rem 0 .6rem; padding-left: .6rem; border-left: 4px solid var(--brand); }
main > h2.section:first-of-type { margin-top: .6rem; }
.card h2 { font-size: 1.05rem; }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .8rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: #fff4e0; border: 1px solid #ffd79a; color: #7a4a00; }
.todo-item { display: inline-flex; gap: .3rem; align-items: baseline; padding: .3rem .8rem; border-radius: 999px; background: #fff; border: 1px solid #ffd79a; color: #7a4a00; text-decoration: none; font-weight: 500; }
.todo-item b { color: #c0262d; font-size: 1.1rem; }
.todo-item:hover { background: #fff9ef; }
.stat { border-left: 4px solid var(--brand); }
.stat.warn-tile { border-left-color: var(--bad); }

/* payroll: what we owe now, money in, the month in four steps */
.live-card { margin: .8rem 0 1rem; padding: 1.1rem 1.3rem; border-radius: 16px; background: linear-gradient(135deg, #00796b, #009688); color: #fff; box-shadow: 0 6px 18px rgba(0, 121, 107, .25); display: grid; gap: .5rem; }
.live-top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; font-weight: 600; }
.live-total { font-size: 2.6rem; font-weight: 700; line-height: 1.1; letter-spacing: .01em; }
.live-total small { font-size: 1rem; font-weight: 500; opacity: .85; }
.live-parts { display: flex; flex-wrap: wrap; gap: .6rem; }
.live-parts > div { background: rgba(255,255,255,.14); border-radius: 10px; padding: .45rem .8rem; display: grid; min-width: 170px; }
.live-parts > div span { font-size: .82rem; opacity: .9; }
.live-parts > div b { font-size: 1.15rem; }
.live-parts > div.bad { background: rgba(255, 82, 82, .35); }
.live-warn { background: #fff; color: #c0262d; border-radius: 10px; padding: .45rem .8rem; font-weight: 600; }
.live-card .muted { color: rgba(255,255,255,.8); }
.chip { display: inline-flex; align-items: center; gap: .2rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(255,255,255,.2); font-size: .85rem; font-weight: 500; }
.chip.warn { background: #ffb300; color: #3d2c00; } .chip.bad { background: #fff; color: #c0262d; } .chip.ok { background: rgba(255,255,255,.25); }
.cash-card .big-input { font-size: 1.3rem; font-weight: 600; max-width: 220px; }
.plan-table th { text-align: left; background: #eef6f5; color: #00695c; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; gap: .55rem; align-content: start; }
.step.done { border-color: #9fd8cf; background: #f3fbf9; }
.step-head { display: flex; align-items: center; gap: .55rem; }
.step-head h2 { margin: 0; font-size: 1.05rem; }
.step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.step.done .step-no { background: #2e7d32; }
.big-btn { font-size: 1.05rem; padding: .7em 1.2em; }
.pay-sum { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.pay-sum .bad b { color: var(--bad); }
.close-table td { padding: .35rem .5rem; } .close-table td.num { text-align: right; } .close-table tr.em td { font-weight: 700; color: var(--bad); }
.fold { margin-bottom: .7rem; } .fold > summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; list-style: revert; }
.pay-table tfoot th { border-top: 2px solid var(--line); color: var(--text); }
.pick { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; display: grid; gap: .5rem; background: #fafcfc; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem .8rem; }
.pick-item { display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.pick-item small { margin-left: auto; color: var(--bad); }
.plan-table input.amt { max-width: 140px; text-align: right; }
.plan-table tfoot th { text-align: left; border-top: 2px solid var(--line); }
.late-note { margin-top: .25rem; padding: .3rem .5rem; border-radius: 8px; background: #fff4e0; color: #7a4a00; font-size: .85rem; max-width: 280px; }
.chart-scope { font-weight: 600; color: var(--ink, #1f2a30); background: #eef6f6; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; align-self: flex-start; }
/* number tiles: solid mint boxes (owner, 24 Nov 2026) */
.stat, .stat.warn-tile { background: #c8f1e3; border: 0; border-left: 0; box-shadow: none; }
.stat b { color: #0b4a3f; }
.stat span, .stat .muted { color: #2d6b5e; }
.stat.warn-tile b { color: var(--bad); }
@media print { .stat, .stat.warn-tile { background: #c8f1e3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.edit-note { font-size: .85rem; color: #8a5a00; background: #fff6e0; border-radius: 8px; padding: .15rem .45rem; margin-top: .25rem; display: inline-block; }
.side-ver { margin-top: auto; padding: .8rem 1rem 1rem; font-size: .78rem; color: rgba(255,255,255,.6); }
