:root {
  --bg: #f4f5fb; --card: #fff; --ink: #1b1f3b; --muted: #667085; --line: #e6e8f2;
  --brand: #4f46e5; --brand-d: #4338ca; --brand-l: #eef0ff;
  --ok: #107c41; --okbg: #e6f6ee; --warn: #b45309; --warnbg: #fff3e0;
  --bad: #c0262d; --badbg: #fdeaea; --weekend: #f8f9fd; --radius: 16px;
  --shadow: 0 1px 2px rgba(27,31,59,.05), 0 6px 20px rgba(27,31,59,.05);
  --ring: 0 0 0 3px rgba(79,70,229,.2);
  --brand-ink: #4f46e5; --ok-solid: #107c41; --bad-solid: #c0262d; --input-bg: #fff; --ink2: #3b4166; --faint: #b5bbc6;
  --surface2: #f8f9fd; --hover: #f6f7ff; --hover2: #f1f2fb; --tint2: #f5f6ff; --field-line: #d5d9ea; --field-line-h: #b9bfdc;
  --chipbg: #eceef6; --stripe: #f3f3f8; --off1: #f3f4f6; --off2: #eceef1; --hl1: #fff8d9; --hl2: #fff9e6;
  --warn-soft: #fffaf0; --warn-line: #f3c98b; --draft-bg: #f7f3ff; --draft-line: #b9a6f0; --draft-ink: #6d4fd6; --bad-line: #f1b8bb;
  --hrs-bg: #eaf2ff; --hrs-bg2: #f4f8ff; --hrs-line: #7aa7f0; --hrs-line2: #c3d6f5; --hrs-tagbg: #dbe7ff; --hrs-ink: #1d4ed8;
  --top-grad: linear-gradient(115deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%); --toast-bg: #1e1b4b;
  color-scheme: light;
}
/* dark mode: switched by the toggle in the header (theme.js sets data-theme on <html>) */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1124; --card: #181b35; --ink: #e8eaf6; --muted: #9ba2c6; --line: #2b2f52;
    --brand: #6366f1; --brand-d: #4f46e5; --brand-l: #262a5a; --brand-ink: #a5b4fc;
    --ok: #4ade80; --okbg: #11301f; --ok-solid: #15803d; --warn: #fbbf24; --warnbg: #38290b; --bad: #f87171; --badbg: #3b161a; --bad-solid: #dc2626;
    --weekend: #141731; --shadow: 0 1px 2px rgba(0,0,0,.45), 0 6px 22px rgba(0,0,0,.35); --ring: 0 0 0 3px rgba(129,140,248,.35);
    --input-bg: #11142b; --ink2: #c9cdea; --faint: #4d5380;
    --surface2: #1f2340; --hover: #222648; --hover2: #292d55; --tint2: #1f2347; --field-line: #3a3f68; --field-line-h: #525a94;
    --chipbg: #2a2e50; --stripe: #23274a; --off1: #1c1f3a; --off2: #232745; --hl1: #3a3411; --hl2: #2d2910;
    --warn-soft: #2d2410; --warn-line: #7c5c1d; --draft-bg: #271f52; --draft-line: #5b4bab; --draft-ink: #c4b5fd; --bad-line: #7b2b31;
    --hrs-bg: #132a52; --hrs-bg2: #101f3e; --hrs-line: #3d68b8; --hrs-line2: #28446f; --hrs-tagbg: #1c3768; --hrs-ink: #9dbcff;
    --top-grad: linear-gradient(115deg, #0a0c20 0%, #181a4a 55%, #2a2f78 100%); --toast-bg: #2b2f63;
  }
  html[data-theme="dark"] .overlay { background: rgba(4,5,18,.7); }
  html[data-theme="dark"] .modal { box-shadow: 0 24px 70px rgba(0,0,0,.6); border: 1px solid var(--line); }
  html[data-theme="dark"] .toast { border: 1px solid #3c4190; }
  html[data-theme="dark"] .chip.pending { color: var(--ink); }
  html[data-theme="dark"] .note.ok { background: var(--okbg); }
  html[data-theme="dark"] .day.other { opacity: .5; }
  html[data-theme="dark"] .tabs button.active { background: var(--brand-l); }
  html[data-theme="dark"] .sched td.cell.hasoff { background: #3b1a1e; }
  html[data-theme="dark"] .sched td.cell.haspend { background: #38290b; }
  html[data-theme="dark"] .wk.todo span { color: var(--warn); }
  html[data-theme="dark"] .startcard { border-color: #5b63c9; }
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { letter-spacing: -.01em; }
.hidden { display: none !important; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--field-line); background: var(--card); border-radius: 10px; padding: 8px 14px; font-weight: 500; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
button:hover { background: var(--hover); border-color: var(--field-line-h); }
button:active { transform: translateY(1px); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(79,70,229,.35), 0 4px 12px rgba(79,70,229,.22); }
button.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
button.good { background: var(--ok-solid); border-color: var(--ok-solid); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(16,124,65,.35), 0 4px 12px rgba(16,124,65,.18); }
button.good:hover { background: #0c6a38; border-color: #0c6a38; }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--badbg); border-color: var(--bad-line); }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
input, select, textarea { border: 1px solid var(--field-line); border-radius: 10px; padding: 8px 11px; background: var(--input-bg); max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--field-line-h); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; background: var(--top-grad); color: #fff; flex-wrap: wrap; box-shadow: 0 2px 14px rgba(30,27,75,.28); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.brand b { color: #a5b4fc; font-weight: 700; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%); box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.brand .logo svg { width: 22px; height: 22px; }
.who { display: flex; gap: 10px; align-items: center; }
.who label { font-size: 13px; color: #c7d2fe; display: flex; align-items: center; gap: 8px; }
.who select { min-width: 190px; color: var(--ink); border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.who select:focus { box-shadow: 0 0 0 3px rgba(165,180,252,.6); }
.who button { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.who button:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }
.who button.on { background: #15803d; border-color: #16a34a; }
.who button.on:hover { background: #166534; }

.tabs { display: flex; gap: 6px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--card); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; border-radius: 10px; background: none; padding: 8px 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button:hover { background: var(--hover2); color: var(--ink); }
.tabs button.active { color: var(--brand-ink); background: var(--brand-l); }
.badge { background: var(--bad-solid); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 12px; margin-left: 4px; font-weight: 700; }

main { padding: 20px 24px 48px; max-width: 1400px; margin: 0 auto; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { border-radius: 99px; padding: 6px 14px; font-weight: 600; background: var(--card); box-shadow: 0 1px 2px rgba(27,31,59,.04); }
.pill:hover { box-shadow: 0 2px 8px rgba(27,31,59,.1); }
.pill.active { color: #fff; border-color: transparent; background: var(--pc, var(--brand)); box-shadow: 0 3px 10px rgba(27,31,59,.2); }
.pill .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pc); margin-right: 6px; }
.pill.active .dot { background: #fff; }
.spacer { flex: 1; }
.monthnav { display: flex; align-items: center; gap: 6px; }
.monthnav h2 { margin: 0 8px; font-size: 21px; min-width: 170px; text-align: center; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 16px; }

/* calendar */
.cal { padding: 0; overflow: hidden; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow div { padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--line); }
.day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 6px; cursor: pointer; position: relative; overflow: hidden; transition: background .12s; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--hover); }
.day.weekend { background: var(--weekend); }
.day.other { opacity: .42; }
.day.sel { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--brand-l); }
.day .num { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.day.today .num span:first-child { background: var(--brand); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(79,70,229,.4); }
.flag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--badbg); color: var(--bad); }
.chip { display: block; font-size: 12px; line-height: 1.25; margin-top: 3px; padding: 3px 7px; border-radius: 7px; background: var(--cc); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.chip.pending { background: repeating-linear-gradient(135deg, var(--card), var(--card) 4px, var(--stripe) 4px, var(--stripe) 8px); color: var(--ink); border: 1.5px dashed var(--cc); }
.more { font-size: 11px; color: var(--muted); margin-top: 3px; }
@media (max-width: 640px) {
  main { padding: 12px 10px 40px; }
  .top { padding: 12px 14px; }
  .brand { font-size: 18px; } .brand .logo { width: 32px; height: 32px; }
  .day { min-height: 70px; padding: 2px; }
  .chip { font-size: 10px; padding: 1px 3px; border-radius: 5px; }
  .flag { font-size: 9px; padding: 0 3px; white-space: nowrap; }
  .who { width: 100%; flex-wrap: wrap; gap: 8px; } .who label { white-space: nowrap; flex: 1 1 220px; } .who label select { flex: 1; min-width: 0; }
  .who button { white-space: nowrap; padding: 7px 12px; }
  .tabs { padding: 8px 10px; } .tabs button { padding: 8px 12px; }
  .monthnav h2 { min-width: 120px; font-size: 17px; }
}

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; background: #555; }
.legend i.p { background: var(--card); border: 1.5px dashed #555; }

/* side panel */
.side h3 { display: flex; justify-content: space-between; align-items: center; }
.stat { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.stat.ok { background: var(--okbg); color: var(--ok); } .stat.bad { background: var(--badbg); color: var(--bad); } .stat.na { background: var(--chipbg); color: var(--muted); }
.timeline { position: relative; height: 22px; background: var(--badbg); border-radius: 8px; overflow: hidden; margin: 6px 0 2px; }
.timeline .seg { position: absolute; top: 0; bottom: 0; background: #7dd3a0; }
.tl-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.person { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.person:first-of-type { border-top: 0; }
.person .nm { font-weight: 600; } .person .sub { color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; align-self: start; }
.tag.off { background: var(--badbg); color: var(--bad); } .tag.pend { background: var(--warnbg); color: var(--warn); } .tag.on { background: var(--okbg); color: var(--ok); } .tag.free { background: var(--chipbg); color: var(--muted); }

.reqlist .req { padding: 10px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.reqlist .req:first-of-type { border-top: 0; }
.req .nm { font-weight: 600; } .req .sub { font-size: 12px; color: var(--muted); }

/* notices */
.note { border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: 14px; border-left: 4px solid transparent; }
.note.ok { background: var(--okbg); color: var(--ok); border-left-color: var(--ok); } .note.warn { background: var(--warnbg); color: var(--warn); border-left-color: #e08a00; } .note.bad { background: var(--badbg); color: var(--bad); border-left-color: var(--bad); }
.note ul { margin: 4px 0 0 18px; padding: 0; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(17,19,50,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 5vh 12px; overflow: auto; z-index: 10; animation: fadein .15s ease; }
.modal { background: var(--card); border-radius: 20px; width: min(520px, 100%); padding: 24px; box-shadow: 0 24px 70px rgba(17,19,50,.35); animation: pop .18s ease; }
.modal h2 { margin: 0 0 14px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.field { margin-bottom: 12px; display: block; } .field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--ink2); }
.field input, .field select, .field textarea { width: 100%; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; } .check input { width: auto; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--toast-bg); color: #fff; padding: 12px 22px; border-radius: 12px; z-index: 20; box-shadow: 0 10px 34px rgba(17,19,50,.4); max-width: calc(100vw - 24px); }

/* approvals */
.approval { margin-bottom: 12px; }
.approval .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.approval .who2 { font-size: 17px; font-weight: 700; }

/* team editor */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl input[type=time] { width: 100px; padding: 4px 6px; }
.tbl input[type=number] { width: 60px; padding: 4px 6px; }
.tbl input[type=text] { width: 150px; padding: 4px 6px; }
.scroll { overflow-x: auto; }
.sched-cell { display: flex; flex-direction: column; gap: 3px; }
.sched-cell input { width: 94px !important; }
h2.sec { margin: 22px 0 10px; font-size: 18px; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* weekly schedule grid */
.sched { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.sched th, .sched td { border: 1px solid var(--line); padding: 0; }
.sched thead th { background: var(--surface2); padding: 8px 4px; font-size: 13px; text-align: center; }
.sched thead th span { font-weight: 400; color: var(--muted); }
.sched thead th.today { background: var(--brand-l); color: var(--brand-ink); }
.sched .namecol { width: 112px; text-align: left; padding: 6px 8px; font-size: 14px; background: var(--card); position: sticky; left: 0; }
.sched .deptrow td { background: var(--dc); color: #fff; font-weight: 700; padding: 5px 10px; letter-spacing: .3px; }
.sched .emprow.me .namecol { background: var(--hl1); }
.sched td.cell { height: 40px; text-align: center; font-size: 14px; position: relative; vertical-align: middle; }
.sched td.cell input { width: 100%; height: 100%; min-height: 38px; border: 0; border-radius: 0; background: transparent; text-align: center; padding: 4px 2px; font-size: 14px; }
.sched td.cell input:focus { background: var(--brand-l); outline: 2px solid var(--brand); outline-offset: -2px; }
.sched td.cell input.bad { background: var(--badbg); }
.sched td.cell.off { background: repeating-linear-gradient(135deg, var(--off1), var(--off1) 6px, var(--off2) 6px, var(--off2) 12px); color: var(--muted); }
.sched td.cell.off input { color: var(--muted); }
.sched td.cell.onphone:not(.off) { background: var(--hl2); }
.sched td.cell .txt { display: block; padding: 8px 2px 4px; }
.sched .covrow th, .sched .covrow td { background: var(--surface2); font-size: 12px; text-align: center; padding: 3px 2px; }
.sched .covrow th { color: var(--muted); font-weight: 600; }
.sched .okc { color: var(--ok); font-weight: 700; } .sched .badc { color: var(--bad); font-weight: 700; } .sched .muted { color: var(--faint); }
.oc { font-size: 11px; color: var(--muted); }

@media print {
  body { background: #fff; }
  .top, .tabs, .toolbar button, .legend, .note, #toast, #modalRoot { display: none !important; }
  .toolbar { margin-bottom: 6px; } .toolbar .spacer { display: none; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .sched { min-width: 0; font-size: 11px; }
  .sched td.cell { height: 26px; font-size: 12px; }
  .sched td.cell input { font-size: 12px; min-height: 24px; }
  .sched .namecol { position: static; }
  .deptrow td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: landscape; margin: 10mm; }
}
@media (max-width: 640px) { .sched .namecol { width: 78px; font-size: 12px; padding: 4px; } }

.nn { font-size: 10px; font-weight: 400; color: var(--muted); line-height: 1.2; }
.warnc { color: var(--warn); font-weight: 600; }
.sched .phonerow td { font-size: 13px; padding: 8px 2px; }

/* building a schedule */
.weekstrip { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.ws-label { align-self: center; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.wk { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; text-align: left; border-radius: 10px; }
.wk b { font-size: 13px; } .wk span { font-size: 11px; color: var(--muted); font-weight: 400; }
.wk.todo { border-color: var(--warn-line); background: var(--warn-soft); } .wk.todo span { color: var(--warn); }
.wk.active { background: var(--brand); border-color: var(--brand); color: #fff; } .wk.active span { color: #dbe6ff; }
.startcard { border: 2px dashed #a5b4fc; background: var(--brand-l); margin-bottom: 14px; } .startcard h3 { margin-top: 0; }
.buildbanner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
@media print { .weekstrip, .startcard, .buildbanner { display: none !important; } }

.wk.draft { border-color: var(--draft-line); background: var(--draft-bg); } .wk.draft span { color: var(--draft-ink); }
.publishbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
@media print { .publishbar { display: none !important; } }

/* time off in the weekly grid */
.sched td.cell.hasoff { background: var(--badbg); box-shadow: inset 0 0 0 2px #e57373; }
.sched td.cell.haspend { background: var(--warnbg); box-shadow: inset 0 0 0 2px #f0b35a; }
.sched td.cell.hasoff, .sched td.cell.haspend { height: 54px; }
.sched td.cell.hasoff input, .sched td.cell.haspend input, .sched td.cell.hasoff .txt, .sched td.cell.haspend .txt { padding-top: 16px; }
.sched td.cell.clash input, .sched td.cell.clash .txt { text-decoration: line-through; color: var(--bad); }
.sched td.cell .tag { position: absolute; top: 0; left: 0; right: 0; margin: 0; width: auto; border-radius: 0; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .4px; padding: 1px 0; z-index: 1; pointer-events: none; }
.sched td.cell .tag.off { background: #c62828; color: #fff; }
.sched td.cell .tag.pend { background: #e08a00; color: #fff; }
.timeoff { margin-bottom: 12px; padding: 10px 14px; }
.timeoff .to-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeoff ul { margin: 6px 0 0 18px; padding: 0; } .timeoff li { margin: 4px 0; }
@media print { .timeoff { display: none !important; } .sched td.cell .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* auto-created pick-ups */
.sched td.cell.pick::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #2563eb; z-index: 2; }
.pickbar { display: inline-block; width: 4px; height: 14px; background: #2563eb; vertical-align: -2px; margin-right: 6px; }
/* the selected week tab always wins over its draft / not-started tint */
.wk.active, .wk.active.draft, .wk.active.todo { background: var(--brand); border-color: var(--brand); color: #fff; }
.wk.active span, .wk.active.draft span, .wk.active.todo span { color: #e0e7ff; }

/* department header in Team & Rules */
.dept-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dept-head .dname { font-size: 17px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 2px 6px; width: 260px; }
.dept-head .dname:hover, .dept-head .dname:focus { border-color: var(--line); background: var(--input-bg); }
.dept-head input[type=color] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }

/* calendar chips: let longer wording such as "Maintenance request closed" wrap instead of being cut off */
.day .chip { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }

/* notifications */
.notif { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif.new { background: var(--tint2); }
.notif .ni { font-size: 22px; line-height: 1.2; }
.notif .nt { font-weight: 700; }
.notif .nd { font-size: 15px; margin-top: 1px; }
.notif .nr { margin: 6px 0 2px; padding: 6px 10px; background: var(--warnbg); border-radius: 8px; font-size: 14px; }
.newpill { background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: 1px; }

/* schedule requests ("I can only work these hours") */
.tag.hrs { background: var(--hrs-tagbg); color: var(--hrs-ink); }
.sched td.cell.hashrs { background: var(--hrs-bg); box-shadow: inset 0 0 0 2px var(--hrs-line); }
.sched td.cell.hashrspend { background: var(--hrs-bg2); box-shadow: inset 0 0 0 2px var(--hrs-line2); }
.sched td.cell.hashrs, .sched td.cell.hashrspend { height: 54px; }
.sched td.cell.hashrs input, .sched td.cell.hashrspend input, .sched td.cell.hashrs .txt, .sched td.cell.hashrspend .txt { padding-top: 16px; }
.sched td.cell .tag.hrs { background: #1d4ed8; color: #fff; }
.sched td.cell .tag.hrspend { background: #6b8fd6; color: #fff; }
.sched td.cell.hclash input, .sched td.cell.hclash .txt { color: var(--bad); font-weight: 700; }

/* request log */
.rlbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.rlbar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rlbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rlsum { color: var(--muted); font-size: 13px; margin: 8px 0; }
.rlwrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rltbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.rltbl th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.rltbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rltbl .sub { font-size: 11px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-ink); font-weight: 600; text-align: left; text-decoration: underline; }
.printonly { display: none; }
@media print {
  .noprint { display: none !important; }
  .printonly { display: block; font-size: 14px; margin-bottom: 6px; }
  .rlwrap { border: 0; overflow: visible; } .rltbl { min-width: 0; font-size: 11px; }
  .rltbl tr { break-inside: avoid; } .rltbl thead { display: table-header-group; }
  .linkbtn { color: inherit; text-decoration: none; font-weight: 400; }
}

/* theme toggle */
.who button#themeBtn { padding: 6px 10px; font-size: 16px; line-height: 1.2; }
.theme-switching, .theme-switching * { transition: none !important; }

/* plane that takes off when a time-off request is sent */
.flyplane { position: fixed; z-index: 60; width: 32px; height: 32px; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(27,31,59,.35)); }
.flyplane svg { width: 100%; height: 100%; display: block; fill: var(--brand); stroke: #fff; stroke-width: .9; stroke-linejoin: round; }
@media print { .flyplane { display: none !important; } }
.toast button { margin-left: 12px; background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.toast button:hover { background: rgba(255,255,255,.26); border-color: #fff; }
.note button.small { margin-left: 8px; }

/* company holidays */
.day .hol { font-size: 11px; line-height: 1.2; color: var(--ink2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .hol.closed { font-weight: 700; color: var(--brand-ink); }
.day.closedday { background: var(--brand-l); }
.sched thead th span.hol { display: block; font-size: 10px; font-weight: 600; color: var(--brand-ink); line-height: 1.2; }
@media (max-width: 640px) { .day .hol { font-size: 9px; } }

/* request form quick picks */
.quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; }
.quick .quicklabel { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 2px; }

/* who is out */
.wo-week { margin-bottom: 18px; break-inside: avoid; }
.wo-week h3 { margin: 0 0 6px; font-size: 16px; }
.wo-week .sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.rltbl.wotbl { min-width: 0; }
@media print { .wo-week h3 { font-size: 14px; } .rltbl.wotbl { font-size: 11px; } }
.rlbar label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--ink); padding-bottom: 8px; }

/* my week */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button.active { background: var(--brand-l); color: var(--brand-ink); font-weight: 600; }
.myweek { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.mw-day { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.mw-day.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-l); }
.mw-date { min-width: 54px; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.mw-date b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mw-date span { font-size: 18px; font-weight: 700; }
.mw-body { flex: 1; min-width: 0; }
.mw-main { font-size: 18px; font-weight: 700; }
.mw-none, .mw-off { color: var(--muted); font-weight: 400; font-size: 15px; }
.mw-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.mw-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.mw-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* needs-attention box (managers), hours column, "changed" marks, welcome list */
.attn { margin-bottom: 14px; padding-bottom: 6px; }
.attn h3 { margin: 0 0 4px; }
.attn-item { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.attn-ic { font-size: 18px; width: 26px; text-align: center; }
.attn-tx { flex: 1 1 260px; min-width: 0; }
.attn-tx ul { margin: 4px 0 0; padding-left: 18px; }
.attn-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.attn-ok { margin-bottom: 12px; }
.safebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sched th.hrscol, .sched td.hrscol { text-align: center; white-space: nowrap; min-width: 56px; padding: 0 8px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.sched td.hrscol.over { color: var(--bad); font-weight: 700; }
.sched td.cell.changed { box-shadow: inset 0 0 0 2px var(--brand); }
.tag.changed { background: var(--brand-l); color: var(--brand-ink); }
ul.welcome { margin: 0 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }

/* time clock */
.clockcard { text-align: center; padding: 22px 16px; }
.clockstat { font-size: 20px; font-weight: 700; margin-bottom: 14px; color: var(--muted); }
.clockstat.live { color: var(--ok); }
.clockbtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.clockbtn { font-size: 20px; font-weight: 700; padding: 18px 28px; min-width: 170px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; background: var(--brand); }
.clockbtn.in { background: var(--ok-solid); }
.clockbtn.out { background: var(--bad-solid); }
.clockbtn.lunch { background: var(--brand); }
.clockbtn.call { background: var(--brand); font-size: 17px; padding: 14px 20px; }
.phonebox { border-left: 4px solid var(--brand); }
.clocktot { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 4px 2px; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } .clockbtn { width: 100%; } }
.tsdept { margin: 14px 0 6px; padding: 6px 12px; font-weight: 700; color: var(--ink); background: var(--surface2); border-left: 6px solid var(--dc); border-radius: 8px; }
details.tsperson { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
details.tsperson > summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: revert; }
.tsname { font-weight: 700; min-width: 90px; }
.tsnums { display: flex; gap: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tsnums b { color: var(--ink); }
.tsflags { margin-left: auto; }
.tsbody { padding: 0 14px 12px; }
.tag.bad { background: var(--badbg); color: var(--bad); }
@media print { .noprint { display: none !important; } details.tsperson:not([open]) > .tsbody { display: block; } }

/* a signed-in person's own shift inside each calendar day */
.myshift { margin: 2px 0 3px; font-size: 12px; font-weight: 700; color: var(--brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myshift.off { color: var(--muted); font-weight: 500; }
@media (max-width: 640px) { .myshift { font-size: 10px; } }

/* the group-access-code front page: only the product name and the code box */
body.gate .who, body.gate .tabs { display: none; }
