/* Theme: calm, flat, data-first. Loaded after styles.css. Every colour comes from a variable, so the dark and light themes share one set of rules.
   Dark is the default; html[data-theme=light] swaps the variables at the bottom of this file. */
:root{
  --input:#101116;--track:#2a2c35;--link:#7aa2ff;--navtext:#c3c5ce;--navon:#2a2b33;--navon-ink:#fff;--subtext:#9a9dab;--tree:#2c2e38;
  --viewbar:#3a2f12;--viewbar-ink:#f3d58a;--viewbar-line:#5a4818;--placeholder:#5c5f6b;--th:#1b1c22;--scroll:#2c2e38;--toast:#2a2c35;--btnhover:#363842;--logochip:#fff;
  color-scheme:dark;
}
html,body{background:var(--bg)}
body{font:14px/1.5 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;letter-spacing:0;color:var(--ink)}
h1{font-size:18px;font-weight:600;letter-spacing:-.1px}
h2{font-size:15px;font-weight:600;letter-spacing:0}
h3{font-size:14px;font-weight:600}
a{color:var(--link)}
::selection{background:rgba(79,124,255,.35)}
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--scroll);border-radius:8px;border:2px solid var(--bg)}::-webkit-scrollbar-track{background:transparent}
.small{font-size:12.5px}

/* ---------- sign in */
.auth{background:var(--bg)}
.auth-card{background:var(--card);border-radius:12px;box-shadow:none;border:1px solid var(--line)}
.auth-card .logo{background:var(--logochip);border-radius:8px;padding:8px 12px;width:auto;height:40px;max-width:none;box-sizing:content-box}

/* ---------- forms and buttons */
.field>label,.lbl{font-size:12.5px;font-weight:500;color:var(--mute)}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=number],input[type=url],input[type=search],select,textarea{background:var(--input);border:1px solid var(--line);border-radius:8px;color:var(--ink);padding:8px 11px;font-size:14px}
input[type=search]{padding-left:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8e9a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:11px center;background-size:16px}
input::placeholder,textarea::placeholder{color:var(--placeholder)}
input:focus,select:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-l)}
select option{background:var(--card);color:var(--ink)}
input[type=file]{color:var(--mute);font-size:13px}
input[type=file]::file-selector-button{background:var(--soft);color:var(--ink);border:1px solid var(--line);border-radius:7px;padding:6px 11px;margin-right:10px;cursor:pointer}
.check input,.sck input,.ck input[type=checkbox]{accent-color:var(--brand)}
.btn{background:transparent;border:1px solid var(--line);border-radius:8px;padding:7px 14px;font-size:13.5px;font-weight:500;color:var(--ink);transition:background .12s,border-color .12s}
.btn:hover{background:var(--hover);border-color:var(--btnhover);color:var(--ink)}
.btn.primary{background:var(--brand);border-color:var(--brand);box-shadow:none;color:#fff}
.btn.primary:hover{background:var(--brand-d);border-color:var(--brand-d);color:#fff;filter:none}
.btn.danger{color:var(--bad)}.btn.danger:hover{background:var(--badbg);border-color:var(--bad);color:var(--bad)}
.btn.ok{background:var(--ok);color:#fff}
.btn.sm{padding:4px 10px;font-size:12.5px;border-radius:7px}
.msg{border-radius:8px;font-size:13.5px}

/* status pills: quiet and neutral, with a small coloured dot */
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:6px;font-weight:500;font-size:12px;padding:2px 8px;background:var(--chip);color:var(--ink);border:1px solid var(--line)}
.chip::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--brand);flex:none}
.chip.ok::before{background:var(--ok)}.chip.bad::before{background:var(--bad)}.chip.warn::before{background:var(--warn)}.chip.info::before{background:var(--info)}.chip.grey::before{background:var(--mute)}
.chip.ok,.chip.bad,.chip.warn,.chip.info,.chip.grey{background:var(--chip);color:var(--ink)}
.chip[style]{border-color:transparent}.chip[style]::before{display:none}
.dot-k{box-shadow:none}

/* ---------- the shell: sidebar and main area */
.top{display:none}
.shell{grid-template-columns:240px minmax(0,1fr);max-width:none;margin:0;align-items:start}
.shell main{padding:26px 36px 70px;max-width:1560px}
.side{position:sticky;top:var(--vb,0px);height:calc(100vh - var(--vb,0px));max-height:none;padding:14px 12px;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;overflow:auto}
.brandrow{display:flex;align-items:center;gap:10px;padding:4px 6px 16px}
.brandrow .logo-pill{background:var(--logochip);border-radius:7px;padding:5px 9px}
.brandrow .logo-pill img{height:20px}
.brandrow .appname{font-weight:600;font-size:14px;color:var(--ink)}
.side nav{display:grid;gap:2px;align-content:start}
.navgroup{display:grid}
.navrow{display:flex;align-items:center;border-radius:8px;position:relative}
.navlink{flex:1;display:flex;align-items:center;gap:11px;padding:8px 10px;border-radius:8px;text-decoration:none;color:var(--navtext);font-weight:500;font-size:14px;min-width:0}
.navlink:hover{background:var(--hover);color:var(--ink)}
.navlink.on{background:var(--navon);color:var(--navon-ink)}
.navlink .ico{width:18px;height:18px;flex:none;opacity:.9}
.navlink span:not(.nbadge){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nbadge{margin-left:auto;background:var(--chip);color:var(--ink);font-size:11px;font-weight:600;border-radius:6px;min-width:19px;height:19px;display:inline-grid;place-items:center;padding:0 5px}
.chev{position:absolute;right:4px;top:50%;transform:translateY(-50%);background:none;border:0;color:var(--mute);width:28px;height:28px;border-radius:6px;display:grid;place-items:center;cursor:pointer}
.chev:hover{background:var(--hover);color:var(--ink)}
.chev .ico{width:15px;height:15px;transition:transform .15s}
.navgroup.open .chev .ico{transform:rotate(180deg)}
.navrow:has(.chev) .nbadge{margin-right:26px}
.subnav{display:none;margin:2px 0 6px 18px;padding-left:14px;border-left:1px solid var(--tree);gap:1px}
.navgroup.open .subnav{display:grid}
.subnav a{position:relative;padding:6px 10px;border-radius:8px;text-decoration:none;color:var(--subtext);font-size:13.5px;font-weight:500}
.subnav a:hover{background:var(--hover);color:var(--ink)}
.subnav a.on{background:var(--navon);color:var(--navon-ink)}
.subnav a::before{content:"";position:absolute;left:-15px;top:50%;width:5px;height:5px;border-radius:50%;background:var(--tree);transform:translateY(-50%)}
.subnav a.on::before{background:var(--brand)}
.sidecard{margin-top:16px;background:transparent;border:1px solid var(--line);border-radius:10px;padding:12px;box-shadow:none}
.sidehead{font-size:12.5px;color:var(--mute)}
.sidehead b{font-weight:600;color:var(--ink)}
.sidehead span{color:var(--ink);font-weight:600}
.sck{font-size:13px;color:var(--navtext)}
.sck em{color:var(--bad)}
.sdoc{color:var(--link);font-size:13px}
.sidefoot{margin-top:auto;padding-top:14px;display:flex;gap:8px;align-items:center}
.usercard{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:10px;background:transparent;border:1px solid var(--line);color:var(--ink);cursor:pointer;text-align:left}
.usercard:hover{background:var(--hover)}
.usercard span{display:grid;line-height:1.25;min-width:0}
.usercard .ico{margin-left:auto;width:16px;height:16px;flex:none;color:var(--mute)}
.usercard b{font-weight:600;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.usercard small{color:var(--mute);font-size:12px}
.themebtn{flex:none;width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:transparent;color:var(--mute);display:grid;place-items:center;cursor:pointer}
.themebtn:hover{background:var(--hover);color:var(--ink)}
.themebtn .ico{width:17px;height:17px}
@media(max-width:900px){
  .top{display:block;position:sticky;top:0;z-index:30;background:var(--panel);border-bottom:1px solid var(--line);box-shadow:none}
  .top-in{padding:8px 14px}
  .brand-sub{display:block;color:var(--ink)}
  .who .nm{display:none}
  .who .btn{background:transparent;border-color:var(--line);color:var(--ink)}
  .shell{grid-template-columns:1fr}
  .side{position:static;height:auto;padding:8px 12px;border-right:0;border-bottom:1px solid var(--line);flex-direction:row;overflow-x:auto}
  .brandrow,.sidefoot,.sidecard,.subnav,.chev{display:none!important}
  .side nav{display:flex;gap:4px}
  .navgroup{display:block}
  .navlink{white-space:nowrap;padding:8px 11px}
  .shell main{padding:18px 16px 60px}
  .pagehead{margin:-18px -16px 16px!important;padding:14px 16px!important}
}

/* ---------- page header (a quiet bar with a rule under it) and tabs */
.pagehead{margin:-26px -36px 20px;padding:18px 36px;border-bottom:1px solid var(--line);align-items:center;gap:16px}
.pagehead p{color:var(--mute);margin-top:1px;font-size:13px}
.tabs{gap:4px;margin:0 0 16px;border-bottom:1px solid var(--line)}
.tabs a,.tabs button{padding:9px 12px;font-weight:500;font-size:14px;border-bottom:2px solid transparent;color:var(--mute)}
.tabs a:hover,.tabs button:hover{color:var(--ink)}
.tabs a.on,.tabs button.on{color:var(--link);border-bottom-color:var(--brand)}
.tabs .dot{background:var(--chip);color:var(--mute);border-radius:6px;font-weight:600;font-size:11px;min-width:20px;height:19px;margin-left:7px;padding:0 5px}
.tabs a.on .dot,.tabs button.on .dot{background:var(--brand);color:#fff}
.seg{border-radius:8px;background:transparent;border-color:var(--line)}
.seg button{font-weight:500;font-size:13px;padding:6px 14px}
.seg button.on{background:var(--navon);color:var(--navon-ink)}

/* ---------- cards, lists, tables */
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:none;padding:16px}
.card h2{margin-bottom:10px}
.card.attn{border-left:3px solid var(--warn)}
.cats .cat,.mcard{background:var(--card);border-radius:10px;box-shadow:none}
.cat:hover,.mcard:hover,a.card.stat:hover,a.kpi:hover{border-color:var(--btnhover)}
.cat .i{width:34px;height:34px;border-radius:8px;background:var(--soft);color:var(--mute);display:grid;place-items:center}
.cat .i .ico{width:18px;height:18px}
.item{background:var(--card);border-radius:8px;padding:11px 14px}
table{font-size:13.5px}
th{text-transform:none;letter-spacing:0;font-weight:500;font-size:12.5px;color:var(--mute);background:var(--th);border-bottom:1px solid var(--line);padding:11px 14px;white-space:nowrap}
td{border-bottom:1px solid var(--line2);padding:13px 14px}
.thi{display:inline-flex;align-items:center;gap:7px}
.thi .ico{width:14px;height:14px;opacity:.85}
tbody tr:hover>td,table>tr:hover>td{background:var(--hover)}
.tablewrap{background:var(--card);border:1px solid var(--line);border-radius:10px}
.av{margin-right:9px}
.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-top:1px solid var(--line);background:var(--card);position:sticky;left:0}
.pager .pgs{display:flex;gap:4px;align-items:center}
.pager button{min-width:32px;height:30px;border:1px solid transparent;background:transparent;color:var(--mute);border-radius:7px;font-size:13px;cursor:pointer;padding:0 8px}
.pager button:hover{background:var(--hover);color:var(--ink)}
.pager button.on{background:var(--navon);color:var(--navon-ink)}
.pager button.nav{border-color:var(--line);color:var(--ink)}
.pager button:disabled{opacity:.4;cursor:default}
.stat .k{text-transform:none;letter-spacing:0;font-weight:500;font-size:13px}
.stat .v{font-weight:600;font-size:24px;letter-spacing:-.4px}
.empty{color:var(--mute)}
.bar,.hbar,.mbar{background:var(--track)}
.legend span::before{border-radius:50%}

/* ---------- dashboard pieces: plain numbers, no icon boxes */
.kpi{background:var(--card);border:1px solid var(--line);border-left:1px solid var(--line);border-radius:10px;box-shadow:none;padding:14px 16px;gap:12px}
.kico,.dico{display:none}
.kl{text-transform:none;letter-spacing:0;font-weight:500;font-size:12.5px}
.kv{font-size:22px;font-weight:600;letter-spacing:-.3px}
.ks{font-size:12.5px}
.dh h2{font-size:14.5px}
.dper{border-bottom-color:var(--line2)}
.mini{background:var(--soft);border-radius:8px}
.setup:hover{background:var(--soft)}
.setup .tick{border-color:var(--btnhover)}
.pp{background:var(--soft);border-color:var(--line)}
.pp.away{background:var(--brand-l);border-color:var(--brand)}
.lg{background:var(--card);font-weight:500}
.col .cv{color:var(--ink)}
.cover .col.today .cl{color:var(--link)}
.trip{background:var(--soft);border-color:var(--line)}
.donut{max-width:100%}

/* ---------- avatars */
.av{width:var(--s,28px);height:var(--s,28px);border-radius:50%;display:inline-grid;place-items:center;flex:none;font-size:calc(var(--s,28px)*.4);font-weight:600;color:hsl(var(--h) 75% 86%);background:hsl(var(--h) 38% 27%);letter-spacing:0;vertical-align:middle}
.who2{display:flex;align-items:center;gap:10px;min-width:0}

/* ---------- modals, toasts, misc */
.modalbg{background:rgba(5,6,9,.62)}
.modal{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 30px 80px rgba(0,0,0,.4)}
.toast{background:var(--toast);color:var(--ink);border:1px solid var(--line);box-shadow:0 10px 30px rgba(0,0,0,.3);border-radius:10px;font-weight:500}
.toast.bad{background:var(--bad);color:#fff;border-color:var(--bad)}
.secret{background:var(--soft)}
.viewbar{background:var(--viewbar);color:var(--viewbar-ink);border-bottom:1px solid var(--viewbar-line)}
.docframe,.mframe,.nlframe{border-color:var(--line);border-radius:10px}
.paper{background:#fff;color:#111}
.paper *{color:inherit}
.linkbtn{color:var(--link)}
input.warnfield{background:var(--warnbg);border-color:var(--warn)}

/* ---------- calendar */
.cal th,.cal td{border-color:var(--line2)}
.cal th.name,.cal td.name{background:var(--card);border-right-color:var(--line)}
.cal.tc td.tot,.cal.tc th.tot{background:var(--soft)}
.cal tr.grp td{color:var(--mute);font-weight:600}
.cal.tc tbody tr:hover td.name{background:var(--hover)}
.cal.tc td.mon,.cal.tc th.mon{border-left-color:var(--btnhover)}
.cal.tc td.bh,.cal.tc th.bh{background:var(--brand-l)}
.cal.tc td.cl,.cal.tc th.cl{background:var(--warnbg)}
.cal.tc td.today,.cal.tc th.today{box-shadow:inset 1px 0 0 var(--brand),inset -1px 0 0 var(--brand)}
.cal.tc thead tr:first-child th.today{background:var(--brand-l);color:var(--link)}
.cal.tc i.h.pend{color:var(--ink);text-shadow:none}

@media print{
  :root,html[data-theme=light]{--bg:#fff;--card:#fff;--panel:#fff;--soft:#f4f4f6;--hover:#eee;--ink:#111;--mute:#555;--line:#ccc;--line2:#ddd;--chip:#eee;--th:#f4f4f6}
  body{background:#fff;color:#111}
  .side{display:none}
  .shell{display:block}
  .shell main{padding:0}
  .pagehead{margin:0 0 12px;padding:0 0 8px}
  .pager{display:none}
}

/* ================= calendars: fit the page, one scroll, easy to read ================= */
.cal,.cal.tc{table-layout:fixed;width:100%}
.cal th,.cal td{min-width:0}
.cal th.name,.cal td.name{width:172px;overflow:hidden;text-overflow:ellipsis;font-weight:500;font-size:13px}
.cal.tc td.tot,.cal.tc th.tot{width:56px;min-width:0}
.cal.tc thead th{height:40px;font-size:12px;line-height:1.15}
.cal.tc thead tr+tr th{top:40px;height:28px;font-size:12px}
.cal.tc td.d{height:36px}
.cal.tc th.we{color:var(--mute)}
.cal.tc i.h{top:5px;bottom:5px;font-size:11px;font-weight:600}
.cal.tc i.full{left:2px;right:2px;border-radius:7px}
.cal.tc i.am{border-radius:7px 0 0 7px}.cal.tc i.pm{border-radius:0 7px 7px 0}
/* bank holidays and closure days: hatched, so they never look like leave */
.cal.tc td.bh,.cal.tc th.bh{background:repeating-linear-gradient(135deg,transparent 0 4px,var(--line) 4px 5px),var(--soft)}
.cal.tc td.cl,.cal.tc th.cl{background:repeating-linear-gradient(135deg,transparent 0 4px,rgba(251,191,36,.4) 4px 5px),var(--warnbg)}
.cal.tc thead th{background-color:var(--th)}
.sw.bh{background:repeating-linear-gradient(135deg,transparent 0 3px,var(--mute) 3px 4px),var(--soft);border:1px solid var(--line)}
.sw.cl{background:repeating-linear-gradient(135deg,transparent 0 3px,var(--warn) 3px 4px),var(--warnbg);border:1px solid var(--line)}
.calstats{display:flex;flex-wrap:wrap;gap:4px 22px;margin:0 0 8px}
.calstats .st{background:none;border:0;border-radius:0;padding:0;display:flex;align-items:baseline;gap:6px}
.calstats .st b{display:inline;font-size:15px;font-weight:600;line-height:1.2}
.calstats .st span{display:inline;font-size:13px;color:var(--mute)}
.lgd{margin-bottom:10px;gap:6px}
.lg{padding:3px 10px 3px 7px;font-size:12px}
.calbar{margin-bottom:10px}
/* wide screens: the table is as wide as the page, so the whole page scrolls (no scroll-in-a-scroll) and the header stays put */
@media(min-width:1000px){
  .tablewrap.cw{overflow:visible;max-height:none}
  .cal.tc thead th{position:sticky;top:0}
  .cal.tc thead tr+tr th{top:40px}
}
@media(max-width:1300px){.cal th.name,.cal td.name{width:140px}}
@media(max-width:999px){
  .cal,.cal.tc{table-layout:auto;width:auto}
  .cal th,.cal td{min-width:26px}
  .cal th.name,.cal td.name{min-width:130px}
}

/* ================= light theme ================= */
html[data-theme=light]{
  color-scheme:light;
  --bg:#f5f6f8;--panel:#ffffff;--card:#ffffff;--soft:#f4f5f7;--hover:#eff1f4;--line:#e2e5ea;--line2:#eceef2;--chip:#eef0f3;
  --ink:#15171c;--mute:#667084;
  --brand:#3b6cf5;--brand-d:#2f58d4;--brand-l:rgba(59,108,245,.10);--accent:#667084;
  --ok:#15803d;--okbg:rgba(22,163,74,.12);--bad:#dc2626;--badbg:rgba(220,38,38,.09);--warn:#b45309;--warnbg:rgba(217,119,6,.12);--info:#2563eb;--infobg:rgba(37,99,235,.10);
  --input:#ffffff;--track:#e6e9ef;--link:#2b59d9;--navtext:#3d4354;--navon:#eaedf3;--navon-ink:#111418;--subtext:#667084;--tree:#dcdfe6;
  --viewbar:#fff4d6;--viewbar-ink:#6b4600;--viewbar-line:#f0d58a;--placeholder:#9aa1b1;--th:#f6f7f9;--scroll:#d3d7df;--toast:#ffffff;--btnhover:#c9ced8;--logochip:transparent;
}
html[data-theme=light] ::selection{background:rgba(59,108,245,.25)}
html[data-theme=light] .brandrow .logo-pill{padding:0}
html[data-theme=light] .auth-card .logo{padding:0;height:34px}
html[data-theme=light] .modal{box-shadow:0 24px 60px rgba(20,24,40,.18)}
html[data-theme=light] .modalbg{background:rgba(20,24,40,.35)}
html[data-theme=light] .toast{box-shadow:0 10px 30px rgba(20,24,40,.15)}
html[data-theme=light] .cal.tc i.h.pend{color:#111}
html[data-theme=light] .av{color:hsl(var(--h) 55% 28%);background:hsl(var(--h) 60% 88%)}
html[data-theme=light] .card.attn{background:var(--card)}

.calbar input[type=search],.pagehead input[type=search]{padding-left:34px}


/* ---------- drag and drop (Teams) */
.pchips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.pchip{display:inline-flex;align-items:center;gap:7px;padding:3px 11px 3px 4px;border:1px solid var(--line);border-radius:99px;background:var(--soft);cursor:grab;font-size:13px;user-select:none;color:var(--ink)}
.pchip .av{margin-right:0}
.pchip:hover{border-color:var(--btnhover)}
.pchip.sel{border-color:var(--brand);background:var(--brand-l)}
.pchip.dragging{opacity:.35}
.pchip:active{cursor:grabbing}
.dropzone{transition:background .12s,outline-color .12s}
.dropzone.over{outline:2px dashed var(--brand);outline-offset:-2px;background:var(--brand-l)}
.emptydrop{color:var(--mute);border:1px dashed var(--line);border-radius:8px;padding:8px 12px;font-size:13px}

/* ---------- stacked column charts (sickness statistics) */
.stk{display:flex;align-items:flex-end;gap:10px;height:250px;padding-top:6px}
.stkcol{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;gap:4px;min-width:0}
.stkbar{width:100%;max-width:56px;display:flex;flex-direction:column-reverse;border-radius:6px 6px 2px 2px;overflow:hidden}
.stkbar i{display:block;min-height:2px}
.stkv{font-size:11.5px;font-weight:600;min-height:15px;color:var(--ink)}
.stkl{font-size:11.5px;color:var(--mute)}
@media(max-width:700px){.stk{gap:4px}.stkv{font-size:10px}}

/* ================= phones and tablets ================= */
/* the page column may shrink below its widest content, so wide tables scroll inside their own box instead of pushing the page sideways */
.shell>*{min-width:0}
.grid>*{min-width:0}          /* same for every grid of cards */
.item .main{min-width:0}
.item .acts{flex-wrap:wrap;justify-content:flex-end}
.mobonly{display:none}
.secnav .tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.secnav .tabs::-webkit-scrollbar{display:none}
.secnav .tabs a{white-space:nowrap;flex:none}
@media(max-width:900px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .mobnav{display:block}
  .mobnav .tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .mobnav .tabs::-webkit-scrollbar{display:none}
  .mobonly{display:flex}
  .btn.wide.mobonly{display:flex;justify-content:center}
  .pagehead{align-items:flex-start}
  .pagehead>div:first-child{flex:1 1 240px;min-width:0}
  .pagehead>div:last-child:not(:first-child){flex-wrap:wrap}
  .side nav::-webkit-scrollbar{display:none}
  .docframe{height:70vh}
  .modal{padding:18px}
}
@media(max-width:640px){
  .shell main{padding:14px 12px 56px}
  .pagehead{margin:-14px -12px 14px!important;padding:12px!important}
  .pagehead h1{font-size:19px}
  .pagehead>div:last-child:not(:first-child){width:100%}
  .pagehead>div:last-child:not(:first-child)>.btn:not(.sm),.pagehead>div:last-child:not(:first-child)>a.btn:not(.sm){flex:1 1 auto;justify-content:center}
  .tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tabs a,.tabs button{white-space:nowrap;flex:none}
  .card{padding:14px}
  /* 16px stops iPhones zooming in when a box is tapped */
  input,select,textarea{font-size:16px}
  .modalbg{padding:8px;align-items:end}
  .modal{padding:16px;max-height:94vh;border-radius:14px 14px 10px 10px}
  .modal .foot .btn{flex:1 1 auto;justify-content:center}
  .btn.sm{min-height:34px}
  /* dashboard figures two to a row rather than one long column */
  .grid.c4:has(>.kpi),.grid.c5:has(>.kpi){grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpi{min-width:0}
  table th,table td{padding-left:10px;padding-right:10px}
  .docframe{height:62vh}
}

/* ================= preview as someone else ================= */
.pvpanel{display:flex;gap:14px 24px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:16px 18px;margin:0 0 18px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(120deg,rgba(79,124,255,.12),rgba(46,158,98,.07) 55%,rgba(224,138,43,.08))}
.pvtext{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:5px}
.pvtext>b{display:flex;gap:8px;align-items:center;font-size:15.5px}
.pvtext>b .ico{width:19px;height:19px;color:var(--link)}
.pvtext>span{color:var(--mute);font-size:13px;line-height:1.5}
.pvtext>span b{color:var(--ink);font-weight:600}
.pvbtns{display:flex;gap:10px;flex-wrap:wrap}
.pvbtn{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:10px;border:1px solid color-mix(in srgb,var(--c) 60%,transparent);background:color-mix(in srgb,var(--c) 15%,var(--card));color:var(--ink);cursor:pointer;font:inherit;text-align:left;transition:background .15s,transform .15s,box-shadow .15s}
.pvbtn:hover{background:color-mix(in srgb,var(--c) 28%,var(--card));transform:translateY(-1px);box-shadow:0 6px 18px color-mix(in srgb,var(--c) 25%,transparent)}
.pvbtn .ico{width:20px;height:20px;color:var(--c);flex:none}
.pvbtn span{display:flex;flex-direction:column;line-height:1.25;font-weight:700;font-size:14px}
.pvbtn small{font-weight:500;color:var(--mute);font-size:11.5px}
.pvbtn i{font-style:normal;color:var(--c);font-weight:800;margin-left:2px}
.viewbar{position:sticky;top:0;z-index:40;font-size:14px;padding:9px 16px}
.viewbar>.ico{width:18px;height:18px;flex:none}
.viewbar .vrole{color:var(--c);background:color-mix(in srgb,var(--c) 18%,transparent);padding:1px 8px;border-radius:6px}
@media(max-width:640px){.pvbtn{flex:1 1 calc(50% - 10px)}.pvpanel{padding:14px}}

/* ================= who sees what: one choice per cell ================= */
.acctable td{vertical-align:middle}
.acc{min-width:112px;padding:5px 8px;font-size:13px;border-radius:8px;cursor:pointer}
.acc-hide{color:var(--mute)}
.acc-see{border-color:color-mix(in srgb,#4f7cff 55%,transparent);background:color-mix(in srgb,#4f7cff 12%,var(--input))}
.acc-must{border-color:color-mix(in srgb,#e08a2b 65%,transparent);background:color-mix(in srgb,#e08a2b 16%,var(--input));font-weight:650}

/* ================= newsletters ================= */
.mseries{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:hsl(var(--h,220) 70% 62%)}
.mseries::before{content:'';width:8px;height:8px;border-radius:50%;background:hsl(var(--h,220) 70% 58%)}
html[data-theme=light] .mseries{color:hsl(var(--h,220) 60% 38%)}
.mtop{display:flex;justify-content:space-between;align-items:center;gap:8px}
.mfeat{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:22px;align-items:stretch;padding:22px;margin-bottom:22px;border:1px solid var(--line);border-radius:14px;
  background:linear-gradient(135deg,hsl(var(--h,220) 70% 55% / .14),transparent 60%),var(--card);border-top:3px solid hsl(var(--h,220) 70% 55%)}
.mfeat-text{display:flex;flex-direction:column;min-width:0}
.mfeat-title{font-size:24px;line-height:1.25;margin:8px 0 6px}
.mfeat-sub{font-weight:600;margin:0 0 8px}
.mfeat-btns{display:flex;gap:10px;flex-wrap:wrap;margin-top:auto;padding-top:14px}
.mfeat-prev{position:relative;display:block;min-height:320px;border-radius:10px;overflow:hidden;border:1px solid var(--line);background:#fff}
.mfeat-prev iframe{position:absolute;inset:0;width:100%;height:100%;border:0;pointer-events:none}
.mfeat-prev::after{content:'';position:absolute;inset:0}
.msub{margin:6px 0 4px;font-size:17px}
.mmonth{margin:14px 0 8px;color:var(--mute);font-size:13px;font-weight:600}
.mcard{border-top:3px solid hsl(var(--h,220) 70% 55%)!important;transition:transform .15s,box-shadow .15s}
.mcard:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(0,0,0,.18)}
.mempty{text-align:center;padding:46px 20px}
.mempty-ico{display:inline-grid;place-items:center;width:58px;height:58px;border-radius:16px;background:var(--brand-l);color:var(--brand);margin-bottom:12px}
.mempty-ico .ico{width:28px;height:28px}
.mempty p{max-width:420px;margin:6px auto 16px}
@media(max-width:900px){.mfeat{grid-template-columns:minmax(0,1fr)}.mfeat-prev{min-height:260px}}
.nlmanage{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 12px;padding:10px 12px;border:1px dashed var(--line);border-radius:10px}
.nlmanage .small{flex-basis:100%}

/* ================= sickness on the calendar ================= */
.cal.tc i.h.st{color:#fff;font-weight:800}
.cal.tc i.h.st::after{content:'';position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:50%;background:#ff3b30;border:2px solid var(--card)}
.lgsick .dotk{display:inline-block;width:8px;height:8px;border-radius:50%;background:#ff3b30;margin:0 4px 0 2px;vertical-align:middle}
.cal.tc .skb{display:inline-block;margin-left:5px;padding:1px 6px;border-radius:6px;background:#d6453d;color:#fff;font-size:10.5px;font-weight:700;line-height:1.45;white-space:nowrap;vertical-align:middle}
.cal.yr td.d .skb{display:block;width:max-content;margin:3px auto 0}
.cal.yr td.d:not([style*="background:hsl"]) .skb:only-child{margin-top:0}
.cal th.sickrow{color:#e5675f;font-weight:700}
.lgsick{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;flex-basis:100%;margin-top:4px}
.lgt{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--mute)}
.lgt i{display:inline-grid;place-items:center;width:17px;height:17px;border-radius:4px;color:#fff;font-size:10px;font-weight:800;font-style:normal}

/* the key: each kind of leave shows the same letter as on the calendar */
.lgd .sw.mk{width:19px;height:19px;border-radius:5px;display:inline-grid;place-items:center;color:#fff;font-size:11px;font-weight:800;font-style:normal;line-height:1;text-shadow:0 1px 1px rgba(0,0,0,.25)}
.lgd .sw.pend.mk{color:#fff}
html[data-theme=light] .lgd .sw.pend.mk{color:#111;text-shadow:none}

/* the admin dashboard's "who's off" block */
.offhead{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:6px 0 10px}
.offhead h2{margin:0;font-size:18px}
.offhead select{width:auto;min-width:200px;max-width:100%}
.allclear{display:flex;align-items:center;gap:10px;margin-top:16px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--mute);font-size:14px}
.allclear .ico{width:18px;height:18px;color:var(--ok)}

/* a person's year */
.phead{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,2fr) auto;gap:18px;align-items:center}
.pwho{display:flex;gap:14px;align-items:center;min-width:0}
.pwho h1{font-size:22px}
.pfacts{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px 18px}
.pfacts>div{display:flex;flex-direction:column;min-width:0}
.pfacts b{font-weight:600;font-size:13.5px;overflow-wrap:anywhere}
.pbtns{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.prow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px}
.prow:last-child{border-bottom:0}
.prow b{font-weight:600;display:flex;gap:8px;align-items:center}
.pchart{display:flex;align-items:flex-end;gap:6px;height:190px;padding-top:18px}
.pc{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0}
.pst{width:70%;max-width:34px;flex:1;display:flex;flex-direction:column;justify-content:flex-end;border-radius:5px 5px 0 0;overflow:hidden}
.pst i{display:block;width:100%}
.pv{font-size:11px;font-weight:700;min-height:15px}
.pl{font-size:11px;color:var(--mute);margin-top:4px}
#main a[href^="#/hr/people/"]{color:inherit;text-decoration:none}
#main a[href^="#/hr/people/"]:hover b{text-decoration:underline}
@media(max-width:1000px){.phead{grid-template-columns:minmax(0,1fr)}.pbtns{flex-direction:row;flex-wrap:wrap;align-items:center}}

/* bank holidays and closure days */
.bhh{margin:14px 0 6px;font-size:14px}.bhh:first-of-type{margin-top:4px}
.bhlist{display:grid;gap:2px}
.bhpick{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;cursor:pointer;font-size:14px}
.bhpick:hover{background:var(--hover)}
.bhpick input{margin:0 2px 0 0;width:16px;height:16px;flex:none}
.bhpick .bhd{width:96px;flex:none;font-weight:600;white-space:nowrap}
.bhpick .bhn{flex:1;min-width:0}
.bhpick.done{cursor:default;color:var(--mute)}.bhpick.done:hover{background:none}
.bhpick.done .chip{margin-left:auto}
@media(max-width:640px){.bhpick .bhd{width:84px}.bhtype{display:none}}

/* manager dashboard: the year so far */
.ysum{padding:16px 18px}
.ysh{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:12px}.ysh h2{margin:0}
.ysg{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.ys{display:flex;flex-direction:column;gap:3px;padding:11px 12px 12px;border-radius:12px;background:var(--soft);border:1px solid var(--line);border-top:3px solid var(--a);color:inherit;text-decoration:none;min-width:0}
.ys:hover{border-color:var(--a)}
.ysl{font-size:12px;font-weight:650;color:var(--mute);text-transform:uppercase;letter-spacing:.03em}
.ysv{font-size:23px;font-weight:750;line-height:1.15;color:var(--ink)}.ysv small{font-size:13px;font-weight:600;color:var(--mute)}
.yss{font-size:12.5px;color:var(--mute);line-height:1.3}
.ysbar{display:block;height:5px;border-radius:3px;background:var(--track,var(--line));margin-top:6px;overflow:hidden}.ysbar i{display:block;height:100%;background:var(--a)}
@media(max-width:640px){.ysg{grid-template-columns:repeat(2,minmax(0,1fr))}.ysv{font-size:20px}}

/* My calendar (staff and new starters) */
.mcal{min-width:0}
.mhd,.mgrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.mhd span{font-size:12px;font-weight:650;color:var(--mute);padding:4px 6px}
.mgrid{gap:4px}
.mcd{min-height:92px;border:1px solid var(--line);border-radius:10px;padding:5px 6px;display:flex;flex-direction:column;gap:3px;min-width:0;background:var(--card)}
.mcd.out{opacity:.4}
.mcd.we{background:var(--soft)}
.mcd.today{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.mcd.today .mdn{background:var(--brand);color:#fff;border-radius:99px;padding:0 6px}
.mdn{font-size:12.5px;font-weight:700;align-self:flex-start}
.mcd.bh{background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(111,139,224,.16) 6px 8px),var(--card)}
.mcd.cl{background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(224,169,59,.2) 6px 8px),var(--card)}
.mbh{font-size:11.5px;font-weight:650;line-height:1.25}
.mcd.bh .mbh{color:#6f8be0}.mcd.cl .mbh{color:#d39a2c}
.mpill{display:block;font-size:11.5px;font-weight:650;border-radius:6px;padding:2px 6px;background:var(--c);color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mpill small{font-weight:600;opacity:.85}
.mpill.pend{background:repeating-linear-gradient(135deg,var(--c) 0 5px,transparent 5px 9px);color:var(--ink);border:1px solid var(--c)}
.mkey{display:inline-block;width:14px;height:14px;border-radius:4px;background:var(--c);flex:none}
.mkey.pend{background:repeating-linear-gradient(135deg,var(--c) 0 3px,transparent 3px 6px);border:1px solid var(--c)}
.mkey.bh{background:repeating-linear-gradient(135deg,transparent 0 3px,#6f8be0 3px 4px),rgba(111,139,224,.15);border:1px solid #6f8be0}
.mkey.cl{background:repeating-linear-gradient(135deg,transparent 0 3px,#e0a93b 3px 4px),rgba(224,169,59,.15);border:1px solid #e0a93b}
.mrow{display:flex;gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid var(--line);font-size:13.5px}.mrow:last-child{border-bottom:0}
.mrd{width:58px;flex:none;font-weight:650;font-size:12.5px;color:var(--mute)}
.ycal{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px}
.ymon a{font-weight:700;font-size:13.5px;text-decoration:none;color:var(--ink)}
.yhd,.ygrid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-top:4px}
.yhd span{font-size:10.5px;color:var(--mute);text-align:center;font-weight:650}
.yd,.ye{font-style:normal;font-size:11px;text-align:center;border-radius:5px;padding:3px 0;line-height:1.3}
.yd.we{color:var(--mute)}
.yd.today{outline:2px solid var(--brand);outline-offset:-1px;font-weight:800}
.yd[class*="k-"]{background:var(--c);color:#fff;font-weight:700}
.yd[class*="k-"].pend{background:repeating-linear-gradient(135deg,var(--c) 0 3px,transparent 3px 6px);color:var(--ink)}
.yd[class*="k-"].halfd{background:linear-gradient(135deg,var(--c) 50%,transparent 50%);color:var(--ink)}
.yd.bh{background:rgba(111,139,224,.28);color:var(--ink);font-weight:700}
.yd.cl{background:rgba(224,169,59,.32);color:var(--ink);font-weight:700}
.mpill .ms{display:none}
@media(max-width:640px){.mpill .ml{display:none}.mpill .ms{display:inline}.mgrid{gap:2px}.mcd{min-height:62px;padding:3px;border-radius:7px}.mpill{font-size:10px;padding:1px 3px}.mpill small{display:none}.mbh{font-size:9.5px}.mhd span{padding:4px 2px;font-size:11px}.mdn{font-size:11px}}

/* absence score key */
.abskey{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.abskey>.small{margin-right:2px}

/* Admin > Roles: roles across the top, abilities down the side */
.rg-wrap{overflow:auto;max-height:calc(100vh - 230px)}
.rgrid{border-collapse:separate;border-spacing:0;width:100%;min-width:720px}
.rgrid th,.rgrid td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:center;vertical-align:middle}
.rgrid tbody th,.rgrid .rg-corner{text-align:left;position:sticky;left:0;background:var(--card);z-index:1;min-width:250px;max-width:340px;font-weight:500;font-size:13.5px}
.rgrid thead th{position:sticky;top:0;background:var(--th);z-index:2;vertical-align:top;min-width:150px}
.rgrid thead .rg-corner{z-index:3;background:var(--th);vertical-align:bottom;font-weight:700}
.rg-role b{display:block;font-size:14px}.rg-role>span{display:block}.rg-role.locked{opacity:.75}
.rg-btns{display:flex!important;flex-wrap:wrap;gap:5px;justify-content:center;margin-top:7px}
.rg-scope th b{display:block}.rg-scope select{width:100%;min-width:130px}
.rgrid .rg-group th{font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--brand);background:var(--card);padding-top:16px;position:static;text-align:left}
.rgrid .rg-see th{font-weight:700}
.rg-tick{display:inline-grid;place-items:center;width:34px;height:28px;cursor:pointer}
.rg-tick input{width:19px;height:19px;accent-color:var(--brand);cursor:pointer;margin:0}
.rg-tick input:disabled{cursor:default}
.rg-na{color:var(--mute);opacity:.6}
.rg-save{position:sticky;bottom:12px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px;padding:12px 16px;border-radius:10px;background:var(--card);border:1px solid var(--brand);box-shadow:0 10px 30px rgba(0,0,0,.35);z-index:5}
@media (max-width:700px){.rgrid tbody th,.rgrid .rg-corner{min-width:170px;max-width:200px}.rg-wrap{max-height:none}}
