/* Смени — shared styles */
:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --ink: #14212B; --ink2: #3D4A57; --muted: #5F6B78; --line: #E3E8ED; --line2: #CBD3DB;
  --accent: #0E7C7B; --accent-d: #0A5C5B; --accent-t: #DFF1EF;
  --yes: #17804A; --yes-bg: #DDF3E5; --yes-s: #23A35A;
  --no: #C0392B; --no-bg: #FCE3DE; --no-s: #D9533F;
  --vac: #2458C6; --vac-bg: #DCE7FB;
  --leave: #6D43B8; --leave-bg: #EAE1F9;
  --warn: #8A5200; --warn-bg: #FEF1D6; --bad: #B42318; --bad-bg: #FDE4E1;
  --day: #C98A06; --day-bg: #FFF3D6; --night: #4E54C8; --night-d: #1F2357;
  --sel: #14212B; --hl: #FFF6DA;
  --radius: 16px; --shadow: 0 1px 2px rgba(20,33,43,.06), 0 8px 24px rgba(20,33,43,.05);
  --font: 'Sofia Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.ic.sm { width: 14px; height: 14px; } .ic.xs { width: 12px; height: 12px; } .ic.lg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #7FB8F0; outline-offset: 2px; }

/* buttons & controls */
.btn { height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 1.5px solid var(--line2); background: var(--surface); text-decoration: none; color: var(--ink); }
.btn:hover { background: #F6F8FA; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #EEF1F4; }
.btn.danger { color: var(--bad); border-color: #F0B8B0; }
.btn.small { height: 34px; padding: 0 11px; border-radius: 10px; font-size: 14.5px; }
.btn.big { height: 56px; padding: 0 22px; border-radius: 16px; font-size: 18px; }
.seg { display: inline-flex; background: #E8ECF0; border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { height: 36px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,33,43,.15); }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--yes-bg); color: var(--yes); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: #E6ECF6; color: #2A4A80; } .chip.grey { background: #EEF1F4; color: var(--ink2); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 700; color: var(--ink2); }
.input, select.input { height: 42px; border-radius: 11px; border: 1.5px solid var(--line2); padding: 0 12px; background: #fff; font-size: 16px; font-weight: 500; color: var(--ink); min-width: 0; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(14,124,123,.15); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #CBD3DB; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { left: 21px; }
.av { width: 30px; height: 30px; border-radius: 50%; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.av.N { background: #CDEBE6; color: #0A5C5B; } .av.DA { background: #DCE5F7; color: #27468F; } .av.P { background: #F8E0CF; color: #8F3A0A; } .av.HA { background: #EADFF5; color: #5B3592; }
.role { font-size: 12.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: #EEF1F4; color: var(--ink2); white-space: nowrap; }
.tbadge { font-size: 11.5px; font-weight: 900; width: 19px; height: 19px; border-radius: 6px; background: #FFE3A1; color: #6A4400; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tag2 { font-size: 11.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #E6ECF6; color: #2A4A80; }

/* toast */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: 13px 18px; font-size: 16px; font-weight: 600; box-shadow: 0 12px 30px rgba(20,33,43,.3); animation: tin .18s ease-out; line-height: 1.35; }
.toast.warn { background: #6A3A00; } .toast.bad { background: #8A1C12; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ============ manager shell ============ */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 20px; font-weight: 900; }
.brand .unit { font-size: 14px; font-weight: 700; color: var(--muted); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { height: 40px; padding: 0 13px; border-radius: 10px; font-size: 16px; font-weight: 700; color: var(--ink2); display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.tabs a:hover { background: #EEF1F4; }
.tabs a.on { background: var(--accent-t); color: var(--accent-d); }
.tabs .count { background: var(--bad); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 7px; }
.spacer { flex: 1; }
.month-switch { display: flex; align-items: center; gap: 4px; }
.month-switch span { font-size: 17px; font-weight: 800; min-width: 132px; text-align: center; }
.month-switch button { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line2); background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.page { padding: 18px 20px 40px; max-width: 2400px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.page-head h1 { font-size: 28px; font-weight: 900; letter-spacing: -.3px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.toolbar .lbl { font-size: 14px; font-weight: 800; color: var(--muted); }

/* ============ overview matrix ============ */
.ov { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ov .matrix-card { flex: 999 1 640px; min-width: 0; overflow: hidden; }
.ov .side { flex: 1 1 300px; min-width: 280px; max-width: 420px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.mx-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 360px; }
table.mx { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mx th, .mx td { padding: 0; }
.mx thead th { position: sticky; background: #fff; z-index: 3; }
.mx thead tr.r1 th { top: 0; height: 30px; }
.mx thead tr.r2 th { top: 30px; height: 46px; }
.mx thead tr.r3 th { top: 76px; height: 22px; border-bottom: 1px solid var(--line2); }
.mx th.corner { left: 0; z-index: 6; min-width: 268px; width: 268px; text-align: left; padding: 6px 12px; vertical-align: bottom; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); font-size: 13px; color: var(--muted); font-weight: 700; }
.mx .wk-h { border-right: 2px solid var(--line2); border-bottom: 1px solid var(--line); }
.mx .wk-h button { width: 100%; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-weight: 800; font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; }
.mx .wk-h button:hover { background: #F2F4F7; }
.mx .wk-h .wr { margin-left: auto; font-weight: 800; color: var(--yes); }
.mx .wk-h.col { width: 46px; min-width: 46px; vertical-align: top; }
.mx .wk-h.col button { height: auto; min-height: 98px; flex-direction: column; justify-content: flex-start; padding: 8px 2px; gap: 6px; }
.mx .wk-h.col .vt { writing-mode: vertical-rl; transform: rotate(180deg); }
.mx .day-h { border-right: 1px solid var(--line); }
.mx .day-h button { width: 100%; height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; gap: 1px; position: relative; }
.mx .day-h button:hover { background: #F2F4F7; }
.mx .day-h .wd { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.mx .day-h .dn { font-size: 16px; font-weight: 900; }
.mx .day-h.we .wd { color: #A3392B; }
.mx .day-h.we { background: #FBFAF7; }
.mx .day-h .rd { position: absolute; top: 3px; right: 4px; width: 13px; height: 13px; border-radius: 50%; font-size: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.mx .day-h.ready { background: #E7F6EC; }
.mx .day-h.ready .rd { background: var(--yes-s); color: #fff; }
.mx .day-h.prob .rd { background: #F2B233; width: 8px; height: 8px; top: 5px; right: 6px; }
.mx .day-h.sel { box-shadow: inset 2px 2px 0 var(--sel), inset -2px 0 0 var(--sel); background: var(--ink) !important; }
.mx .day-h.sel .wd, .mx .day-h.sel .dn { color: #fff; }
.mx .sh-h { width: 27px; min-width: 27px; text-align: center; color: var(--day); }
.mx .sh-h.n { color: var(--night); border-right: 1px solid var(--line); }
.mx .sh-h.we { background: #FBFAF7; }
.mx tbody th.name { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; border-right: 1px solid var(--line2); border-bottom: 1px solid #F0F2F4; height: 34px; padding: 0; }
.mx tbody th.name button { width: 100%; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 12px; text-align: left; }
.mx tbody th.name button:hover { background: #F4F6F8; }
.mx .nm { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 128px; }
.mx .ncnt { margin-left: auto; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.mx .ncnt.full { color: var(--yes); } .mx .ncnt.over { color: var(--bad); }
.mx .nosub { width: 7px; height: 7px; border-radius: 50%; background: #F2B233; flex: none; }
.mx tr.grp th { position: sticky; left: 0; z-index: 2; background: #F7F9FA; text-align: left; padding: 6px 12px; font-size: 12px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.mx tr.grp td { background: #F7F9FA; border-bottom: 1px solid var(--line); }
.mx td.c { width: 27px; min-width: 27px; height: 34px; border-bottom: 1px solid #F0F2F4; text-align: center; cursor: pointer; position: relative; }
.mx td.c.n { border-right: 1px solid var(--line); }
.mx td.c.d { border-right: 1px dotted #E9EDF1; }
.mx td.c.we { background-color: #FCFBF8; }
.mx td.c:hover { box-shadow: inset 0 0 0 2px #7FB8F0; }
.mx td.av-yes { background: var(--yes-bg); }
.mx td.av-no { background: var(--no-bg); }
.mx td.av-vac { background: var(--vac-bg); color: var(--vac); }
.mx td.av-leave { background: var(--leave-bg); color: var(--leave); }
.mx td.blk { background: repeating-linear-gradient(135deg, #EEF1F4 0 4px, #E2E6EA 4px 8px); }
.mx.noav td.av-yes, .mx.noav td.av-no { background: transparent; }
.mx.noav td.c.we { background-color: #FCFBF8; }
.mx td.c .on { display: inline-flex; width: 21px; height: 21px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; align-items: center; justify-content: center; }
.mx td.c .on.tl { background: #B7791F; }
.mx td.c .on.conf { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--no-s); }
.mx td.c .ic { width: 12px; height: 12px; }
.mx td.wkc { width: 46px; min-width: 46px; text-align: center; font-weight: 800; color: var(--ink2); background: #F7F9FA; border-right: 2px solid var(--line2); border-bottom: 1px solid #F0F2F4; }
.mx .wkend { border-right: 2px solid var(--line2) !important; }
.mx tr.pr.sel th.name, .mx tr.pr.sel td.c { background-color: var(--hl); }
.mx tr.pr.sel > th, .mx tr.pr.sel > td { border-top: 2px solid #E0A21B; border-bottom: 2px solid #E0A21B; }
.mx tr.pr.sel th.name { box-shadow: inset 4px 0 0 #E0A21B; }
.mx tr.pr.sel td.av-yes { background: #D3EDC9; } .mx tr.pr.sel td.av-no { background: #F8DACB; }
.mx .sl { box-shadow: inset 2px 0 0 var(--sel); }
.mx .sr { box-shadow: inset -2px 0 0 var(--sel); }
.mx td.sl:hover { box-shadow: inset 2px 0 0 var(--sel), inset 0 0 0 2px #7FB8F0; }
.mx td.sr:hover { box-shadow: inset -2px 0 0 var(--sel), inset 0 0 0 2px #7FB8F0; }
.mx td.c.sl:not(.av-yes):not(.av-no):not(.av-vac):not(.av-leave):not(.blk), .mx td.c.sr:not(.av-yes):not(.av-no):not(.av-vac):not(.av-leave):not(.blk) { background-color: #F3F6F9; }
.mx tfoot td, .mx tfoot th { position: sticky; bottom: 0; background: #FBFCFD; z-index: 3; }
.mx tfoot tr.f1 td, .mx tfoot tr.f1 th { bottom: 30px; border-top: 2px solid var(--line2); }
.mx tfoot th { left: 0; z-index: 5; text-align: left; padding: 0 12px; font-size: 13px; font-weight: 800; height: 30px; border-right: 1px solid var(--line2); }
.mx tfoot td { height: 30px; text-align: center; font-weight: 900; font-size: 12px; }
.mx tfoot td.n { border-right: 1px solid var(--line); }
.mx tfoot td.fk.ok { color: var(--yes); } .mx tfoot td.fk.short { color: var(--warn); background: #FFF7E6; } .mx tfoot td.fk.bad { color: var(--bad); background: #FFF0EE; } .mx tfoot td.fk.zero { color: #9AA4AE; }
.mx tfoot td.sb { box-shadow: inset 2px -2px 0 var(--sel); } .mx tfoot td.sbr { box-shadow: inset -2px -2px 0 var(--sel); }
.mx tfoot tr.f1 td.sl { box-shadow: inset 2px 0 0 var(--sel); } .mx tfoot tr.f1 td.sr { box-shadow: inset -2px 0 0 var(--sel); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.modebar button[data-mode] .sw { width: 12px; height: 12px; }
.modebar button.on[data-mode="assign"] { background: var(--accent); color: #fff; }
.modebar button.on[data-mode="yes"] { background: var(--yes-s); color: #fff; }
.modebar button.on[data-mode="no"] { background: var(--no-s); color: #fff; }
.modebar button.on[data-mode="vac"] { background: var(--vac); color: #fff; }
.modebar button.on[data-mode="leave"] { background: var(--leave); color: #fff; }
.modebar button.on[data-mode="clear"] { background: var(--ink2); color: #fff; }

/* side cards */
.scard { padding: 16px 18px; }
.scard h3 { font-size: 21px; font-weight: 900; }
.scard .kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.shiftbox { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.shiftbox .hd { display: flex; align-items: center; gap: 10px; }
.shiftbox .ttl { font-size: 16.5px; font-weight: 900; display: flex; flex-direction: column; line-height: 1.15; }
.shiftbox .ttl small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sicon { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sicon.D { background: var(--day-bg); color: #B07A00; } .sicon.N { background: var(--night-d); color: #FFE7A3; }
.plist { display: flex; flex-direction: column; margin-top: 6px; }
.prow { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 15px; }
.prow .nm { font-weight: 800; flex: 1; min-width: 0; }
.xbtn { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #8A95A1; }
.xbtn:hover { background: var(--no-bg); color: var(--bad); }

/* ============ planner ============ */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; }
.dchip { width: 54px; height: 72px; flex: none; border-radius: 14px; background: #fff; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 1px 2px rgba(20,33,43,.05); position: relative; }
.dchip:hover { border-color: var(--line2); }
.dchip .w { font-size: 12px; font-weight: 700; color: var(--muted); } .dchip.we .w { color: #A3392B; }
.dchip .n { font-size: 19px; font-weight: 900; line-height: 1; }
.dchip .bars { display: flex; gap: 3px; margin-top: 3px; }
.dchip .bar { width: 14px; height: 6px; border-radius: 4px; }
.bar.ok { background: var(--yes-s); } .bar.short { background: #E8A21A; } .bar.bad { background: #D9433A; } .bar.zero { background: #D5DBE1; }
.dchip.sel { background: var(--ink); color: #fff; } .dchip.sel .w { color: #C9D2DA; }
.dchip .rd { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--yes-s); color: #fff; font-size: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.pl { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.pl .cands { flex: 1 1 340px; min-width: 290px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pl .shifts { flex: 2 1 620px; min-width: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.shift { flex: 1 1 300px; min-width: 0; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 9px; border: 3px solid transparent; }
.shift.D { background: #FFF8EA; } .shift.N { background: var(--night-d); color: #fff; }
.shift.act.D { border-color: var(--accent); } .shift.act.N { border-color: #9FA4F0; }
.shift .sh-hd { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.shift .sh-hd .big { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.shift.D .big { background: #F2B233; color: #fff; } .shift.N .big { background: #3A3FA0; color: #FFE7A3; }
.shift .lbl2 { font-size: 13px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; opacity: .7; margin-top: 4px; }
.slot { min-height: 56px; border-radius: 14px; display: flex; align-items: center; gap: 11px; padding: 8px 10px; }
.slot.filled { background: #fff; box-shadow: 0 1px 3px rgba(20,33,43,.08); }
.shift.N .slot.filled { background: #2B2F6B; box-shadow: none; }
.slot.empty { border: 2px dashed #C9D0D7; color: var(--muted); font-weight: 700; justify-content: center; width: 100%; }
.slot.empty:hover { border-color: var(--accent); color: var(--accent-d); }
.shift.N .slot.empty { border-color: #4A4F92; color: #C6C9F2; }
.slot.empty.tlneed { border-color: #E0806F; color: var(--bad); }
.shift.N .slot.empty.tlneed { border-color: #E8786C; color: #FFB4AA; }
.shift .xbtn { margin-left: auto; } .shift.N .xbtn { color: #9FA4F0; }
.cand { display: flex; align-items: center; gap: 11px; padding: 8px 2px; border-bottom: 1px solid #F0F2F4; }
.cand .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cand .nm { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.cand .sub { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.qbar { width: 52px; height: 6px; border-radius: 9px; background: #EEF1F4; overflow: hidden; display: inline-flex; }
.qbar span { display: block; height: 100%; border-radius: 9px; background: var(--yes-s); }
.addbtn { height: 40px; padding: 0 13px; border-radius: 11px; background: var(--accent-t); color: var(--accent-d); font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.addbtn:hover { background: var(--accent); color: #fff; }
.reason { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #F1F3F5; color: var(--muted); white-space: nowrap; margin-left: auto; }

/* ============ fixes ============ */
.fx { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.fx .col1 { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fx .col2 { flex: 2 1 360px; min-width: 300px; display: flex; flex-direction: column; gap: 14px; }
.issue { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.issue .ih { display: flex; align-items: center; gap: 10px; }
.issue .it { font-size: 16.5px; font-weight: 900; flex: 1; min-width: 0; line-height: 1.25; }
.issue .it small { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.issue .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 40px; padding: 7px 13px; border-radius: 11px; background: #F1F4F7; font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 7px; text-align: left; }
.opt:hover { background: var(--accent-t); }
.opt.best { background: var(--accent); color: #fff; } .opt.best:hover { background: var(--accent-d); }
.opt small { font-weight: 600; opacity: .8; }
.ai-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(#FFFFFF, #FFFFFF); border: 2px solid #D9E7F7; }
.ai-sug { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-sug.done { background: #F2FAF5; border-color: #BFE6CD; }
.ai-sug .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #CFE0F3; border-top-color: #2458C6; animation: sp 1s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.fair { display: grid; grid-template-columns: minmax(0, 150px) 1fr 48px; gap: 6px 10px; align-items: center; font-size: 13.5px; font-weight: 700; }
.fair .track { height: 10px; border-radius: 9px; background: #EEF1F4; position: relative; }
.fair .fill { height: 10px; border-radius: 9px; }
.fair .tick { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink); border-radius: 2px; }

/* ============ settings ============ */
.set-tabs { margin-bottom: 14px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; }
.ptable th { text-align: left; font-size: 12.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable td { padding: 8px; border-bottom: 1px solid #F0F2F4; vertical-align: middle; }
.ptable .input { height: 38px; font-size: 15px; }
.ptable input.num { width: 72px; }
.tbl-wrap { overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; align-items: end; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; background: #F1F4F7; border-radius: 9px; padding: 9px 12px; word-break: break-all; }

/* ============ help ============ */
.help { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.help nav { flex: 1 1 220px; max-width: 260px; position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.help nav a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink2); font-weight: 700; }
.help nav a:hover { background: #EEF1F4; }
.help .content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.help section { padding: 22px 24px; scroll-margin-top: 80px; }
.help section h2 { font-size: 23px; font-weight: 900; margin-bottom: 10px; }
.help section p, .help section li { font-size: 17px; line-height: 1.5; color: var(--ink2); }
.help section ol, .help section ul { padding-left: 22px; margin: 8px 0; }
.help .lg { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.help .lg div { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.help .demo { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 900; }
.help .faq h3 { font-size: 17px; margin: 14px 0 4px; }

/* ============ login ============ */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: min(420px, 100%); padding: 30px 28px; display: flex; flex-direction: column; gap: 16px; }

/* ============ staff page ============ */
.staff { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: #F2F3F8; }
.staff .sh { padding: 16px 16px 6px; display: flex; flex-direction: column; gap: 8px; }
.staff .who { font-size: 16px; color: var(--ink2); font-weight: 600; }
.staff .title { font-size: 27px; font-weight: 900; letter-spacing: -.3px; }
.staff .count { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 11px 14px; }
.staff .count .track { flex: 1; height: 10px; border-radius: 99px; background: #E1E3EC; overflow: hidden; display: flex; }
.staff .count .track span { display: block; height: 100%; border-radius: 99px; transition: width .2s; }
.staff .count b { font-size: 16px; white-space: nowrap; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 6px; }
.quick button { height: 40px; padding: 0 13px; border-radius: 999px; background: #fff; border: 1.5px solid #DCDFEA; font-size: 14.5px; font-weight: 700; white-space: nowrap; flex: none; }
.pgrid { display: grid; grid-template-columns: 28px repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pgrid .wd { text-align: center; font-size: 12.5px; font-weight: 800; color: #5F6478; }
.pgrid .wd.we, .pgrid .dl.we { color: #A3392B; }
.pgrid .dl { font-size: 12.5px; font-weight: 800; color: #3D4257; height: 15px; line-height: 15px; padding-left: 3px; }
.pgrid .lane { height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.pgrid .lane.sun { color: var(--day); } .pgrid .lane.moon { color: var(--night); }
.pc { height: 40px; border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center; font-weight: 900; transition: background .12s; }
.pc.yes { background: #CDEFD9; color: var(--yes); } .pc.yes::after { content: '✓'; font-size: 15px; }
.pc.no { background: #FBD9D2; color: #B03221; } .pc.no::after { content: '✕'; font-size: 13px; }
.pc.vac { background: #D3E2FC; color: var(--vac); } .pc.leave { background: #E5DBF8; color: var(--leave); }
.pc.empty { background: #fff; box-shadow: inset 0 0 0 1.5px #CDD2DE; }
.pc.rest { background: repeating-linear-gradient(135deg, #ECEEF3 0 5px, #DEE1E9 5px 10px); color: #6B7088; }
.pc.out { visibility: hidden; }
.pc.mine { box-shadow: inset 0 0 0 3px var(--accent); }
.brushes { position: sticky; bottom: 0; background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 24px rgba(20,33,43,.08); padding: 10px 14px 18px; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.brushes .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.brush { height: 74px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 14px; font-weight: 800; color: #3D4257; border: 2.5px solid transparent; transition: transform .12s; }
.brush.on { border-color: var(--ink); transform: translateY(-4px); background: #F4F5FA; color: var(--ink); }
.brush .swb { width: 40px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }

/* ============ public / print ============ */
.pub { max-width: 1500px; margin: 0 auto; padding: 18px 16px 40px; }
.pub-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pub-head h1 { font-size: 30px; font-weight: 900; }
table.pt { border-collapse: collapse; font-size: 13px; background: #fff; width: 100%; }
.pt th, .pt td { border: 1px solid #D7DDE3; padding: 0; text-align: center; }
.pt thead th { background: #F4F6F8; font-weight: 800; height: 34px; min-width: 26px; line-height: 1.05; font-size: 12px; }
.pt thead th small { display: block; font-weight: 700; color: var(--muted); font-size: 10px; }
.pt thead th.we, .pt td.we { background: #F8F4EC; }
.pt th.nm { text-align: left; padding: 3px 8px; white-space: nowrap; font-weight: 700; min-width: 170px; position: sticky; left: 0; background: #fff; z-index: 1; }
.pt th.nm .role { margin-left: 6px; }
.pt td { height: 26px; font-weight: 900; }
.pt td.D { color: #8A5800; } .pt td.N { color: #2E338F; }
.pt td.tl { text-decoration: underline; text-decoration-thickness: 2px; }
.pt tr.me th, .pt tr.me td { background: #FFF2C2 !important; }
.pt tr.grp th { background: #EEF1F4; text-align: left; padding: 4px 8px; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }
.pt tfoot td, .pt tfoot th { background: #F4F6F8; font-size: 11px; }
.pt-wrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.dayc { background: #fff; border-radius: 12px; padding: 10px 12px; border: 1px solid #DDE2E7; break-inside: avoid; }
.dayc h4 { margin: 0 0 6px; font-size: 15px; }
.dayc .sl { font-size: 13px; line-height: 1.4; margin: 3px 0; }
.dayc .sl b { display: inline-block; min-width: 46px; }
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { background: #fff; font-size: 11px; }
  .no-print, .top, #toasts { display: none !important; }
  .print-only { display: block; }
  .pub, .page { padding: 0; max-width: none; }
  .pt-wrap { box-shadow: none; overflow: visible; border-radius: 0; }
  table.pt { font-size: 9.5px; width: 100%; }
  .pt th.nm { min-width: 0; position: static; padding: 1px 4px; }
  .pt thead th { height: 24px; min-width: 0; font-size: 9px; }
  .pt td { height: 17px; }
  .pt tr { break-inside: avoid; }
  .pt thead th.we, .pt td.we { background: #F3F3F3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pt tr.grp th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .days { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .dayc { padding: 4px 6px; border-radius: 4px; }
  .dayc h4 { font-size: 10.5px; margin-bottom: 2px; } .dayc .sl { font-size: 9px; margin: 1px 0; }
  .pub-head h1 { font-size: 16px; }
}
@media (max-width: 720px) {
  .top { padding: 8px 12px; }
  .page { padding: 14px 12px 40px; }
  .page-head h1 { font-size: 23px; }
  .ov .side { position: static; max-width: none; }
  .mx-scroll { max-height: 70vh; }
  .mx th.corner { min-width: 150px; width: 150px; }
  .mx .nm { max-width: 74px; }
  .help nav { position: static; max-width: none; }
}
