:root {
  --bg: #f6f6f9; --card: #fff; --ink: #1b1b24; --muted: #6b6b7b; --line: #e3e3ea; --accent: #4b32d6; --accent-ink: #fff; --accent-soft: #ecebfd;
  --ok: #17794a; --ok-soft: #e3f5ea; --warn: #8a5a00; --warn-soft: #fff1d6; --bad: #b3261e; --bad-soft: #fde8e6;
  --open: #fff; --limited: #c4c7cf; --blocked: #1b1b24; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-weight: 500; margin-left: 6px; }
nav.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
nav.tabs button { background: none; border: 0; padding: 18px 12px 15px; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs button:hover { color: var(--ink); }
nav.tabs button.on { color: var(--accent); border-color: var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 5px; }
.who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; flex: none; }
@media (max-width: 1040px) { .bar { gap: 4px 16px; } .who { margin-left: auto; } nav.tabs { order: 3; flex-basis: 100%; } nav.tabs button { padding: 10px 12px 9px; } }
main { padding: 24px 0 60px; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }
label:first-child { margin-top: 0; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 12px 0 0; }
input[type=text], input[type=date], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: inherit;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; min-width: 0; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.bad { background: var(--bad); } .btn.ok { background: var(--ok); } .btn.sm { padding: 5px 10px; font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.chip { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.gray { background: #ececf0; color: #555; }
.msgs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.msgs li { border-radius: 8px; padding: 9px 12px; font-size: 14px; border: 1px solid transparent; }
.msgs li.e { background: var(--bad-soft); color: var(--bad); border-color: #f5c6c2; } .msgs li.w { background: var(--warn-soft); color: var(--warn); border-color: #f1dca8; } .msgs li.i { background: var(--accent-soft); color: #3a2aa8; }
.verdict { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tablewrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { font-size: 22px; } .meter { height: 6px; background: #ececf0; border-radius: 9px; margin-top: 8px; overflow: hidden; } .meter i { display: block; height: 100%; background: var(--accent); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 9px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }

/* calendars */
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid #b9bcc6; vertical-align: -3px; margin-right: 5px; }
.sw.open { background: var(--open); } .sw.limited { background: var(--limited); border-color: var(--limited); } .sw.blocked { background: var(--blocked); border-color: var(--blocked); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 8px; }
.month h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.month h3 button { font-size: 11px; }
.dows, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dows span { font-size: 10px; color: var(--muted); text-align: center; }
.d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 5px; border: 1px solid #d9dbe2; background: var(--open); position: relative; user-select: none; }
.d.pad { border: 0; background: none; }
.d.limited { background: var(--limited); border-color: var(--limited); } .d.blocked { background: var(--blocked); border-color: var(--blocked); color: #fff; }
.d.we { color: #9a9aa8; } .d.blocked.we { color: #bbb; }
.d.sel { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.d.edit { cursor: pointer; } .d.edit:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.d.dirty { outline: 2px dashed #e08700; outline-offset: 1px; }
.d.today { font-weight: 800; text-decoration: underline; }
.d.note::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: #e08700; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 14px 0; padding: 14px; background: var(--accent-soft); border-radius: var(--radius); }
.toolbar > div { min-width: 120px; } .toolbar label { margin-top: 0; }
.paint { display: flex; gap: 6px; } .paint button { border: 2px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 11px; cursor: pointer; font: inherit; font-weight: 600; }
.paint button.on { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-head select { width: auto; }
.whos { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.whos .cell { min-height: 92px; border: 1px solid #d9dbe2; border-radius: 6px; padding: 3px 4px; background: var(--open); font-size: 11px; overflow: hidden; }
.whos .cell.limited { background: var(--limited); } .whos .cell.blocked { background: var(--blocked); color: #fff; } .whos .cell.pad { border: 0; background: none; }
.whos .cell .n { font-weight: 700; font-size: 12px; margin-bottom: 2px; } .whos .hd { font-size: 11px; color: var(--muted); text-align: center; }
.pill { display: block; border-radius: 4px; padding: 0 4px; margin-top: 2px; background: var(--accent); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.pending { background: #fff; color: var(--accent); border: 1px dashed var(--accent); } .pill.sick { background: #b3261e; } .pill.mental_health { background: #0b7285; }
dialog { border: 0; border-radius: 12px; padding: 20px; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.3); } dialog::backdrop { background: rgba(0,0,0,.4); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; } .login .card { max-width: 400px; width: 100%; text-align: center; padding: 30px; }
.sr { position: absolute; left: -9999px; }

/* roster, team and access rules */
.idcard { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0 2px; }
.idcard div { display: grid; min-width: 0; } .idcard b { font-size: 13px; overflow-wrap: anywhere; }
.pstats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 10px 0 6px; } .pstats b { font-size: 17px; }
.person details { margin-top: 8px; } .person summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.rulebox { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.rolechecks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; margin-top: 6px; }
.rolechecks label.inline { margin: 4px 0 0; font-size: 13px; }
