/* CHARM App — Rostering day view (pilot). Calm light enterprise theme. */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #eef2f8; --surface: #fff; --surface-alt: #f6f8fc; --border: #e2e8f0; --line-soft: #eef2f7;
  --text: #0b1c30; --muted: #51607a; --faint: #8a94a6;
  --navy: #131b2e; --indigo: #4b41e1; --indigo-50: #eef0ff;
  --ok: #10b981; --warn: #f59e0b; --bad: #ef4444; --bad-bg: #fde8e8; --ok-bg: #e7f8f1;
  --radius: 9px; --radius-lg: 14px; --shadow: 0 4px 6px -1px rgb(11 28 48 / .06), 0 2px 4px -2px rgb(11 28 48 / .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 1120px; }
body { font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; }
#app.loading { display: grid; place-items: center; min-height: 100vh; color: var(--faint); }

/* top bar */
.rbar { display: flex; align-items: center; gap: 16px; padding: 12px 22px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.rbrand { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--indigo); white-space: nowrap; }
.rbrand b { color: var(--navy); }
.rbar .site { font-weight: 700; font-size: 16px; }
.rbar .spacer { flex: 1; }
.wk { display: inline-flex; align-items: center; gap: 8px; }
.wk .rng { font-weight: 700; min-width: 150px; text-align: center; }
.b { font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: var(--radius); cursor: pointer; border: 1px solid transparent; background: var(--navy); color: #fff; }
.b:hover { filter: brightness(1.08); }
.b.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.b.ghost:hover { background: var(--surface-alt); filter: none; }
.b.indigo { background: var(--indigo); }
.b.sm { padding: 6px 10px; font-size: 12px; }
.b:disabled { opacity: .45; cursor: default; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill.sm { font-size: 11px; padding: 2px 8px; }
.pill.dirty { background: #fef3e2; color: #9a6400; } .pill.clean { background: var(--ok-bg); color: #0a7d57; }

/* board = three columns */
.board { display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px 60px; }
.col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.col.people { flex: 0 0 232px; }
.shift-stack { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* view toggle (Allocation | Rota) */
.viewtog { display: inline-flex; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.vt { font-family: inherit; font-size: 12px; font-weight: 700; padding: 6px 13px; border: 0; background: none; color: var(--muted); border-radius: 7px; cursor: pointer; }
.vt.on { background: var(--surface); color: var(--indigo); box-shadow: var(--shadow); }

/* rota (multi-week shift planning) */
.rota-wrap { padding: 18px 22px 60px; }
table.rota { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
table.rota th, table.rota td { text-align: center; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
table.rota thead th { background: var(--surface-alt); font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 4px; }
table.rota thead th span { display: block; font-size: 11px; color: var(--faint); font-weight: 600; text-transform: none; margin-top: 2px; }
table.rota th.today { background: var(--indigo-50); color: var(--indigo); }
.rname-h, .rname { text-align: left; padding: 9px 12px; font-weight: 700; font-size: 13px; position: sticky; left: 0; background: var(--surface); z-index: 1; width: 180px; }
.rname-h { background: var(--surface-alt); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.rname .bench { font-size: 9px; font-weight: 800; color: var(--indigo); background: var(--indigo-50); padding: 1px 6px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; }
.rcell { height: 44px; cursor: pointer; }
.rcell:hover { background: var(--surface-alt); }
.rcell.wo { background: repeating-linear-gradient(45deg, #f4f6fa, #f4f6fa 6px, #eef1f6 6px, #eef1f6 12px); }
.rc { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 9px; border-radius: 7px; color: #fff; font-weight: 800; font-size: 13px; position: relative; }
.rc .dd { position: absolute; bottom: -2px; right: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); border: 1.5px solid #fff; }
.rcoff { color: var(--faint); font-size: 11px; font-weight: 600; }
.rcov { font-weight: 800; font-size: 13px; color: var(--muted); padding: 7px 0; background: var(--surface-alt); font-variant-numeric: tabular-nums; }
.rota-hint { color: var(--faint); font-size: 12px; margin: 12px 2px 0; }
.colhd { display: flex; align-items: center; gap: 8px; padding: 13px 16px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.colhd .hint { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 11px; }
.colbody { padding: 12px; }
.av { width: 22px; height: 22px; border-radius: 50%; background: #dfe6f2; color: #4b5a75; font-size: 9px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }

/* people */
.pchip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; margin-bottom: 7px; font-weight: 600; cursor: grab; box-shadow: 0 1px 2px rgb(11 28 48 / .05); }
.pchip:active { cursor: grabbing; }
.pchip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.staffed { opacity: .5; }
.pchip.sel { opacity: 1; border-color: var(--indigo); background: var(--indigo-50); box-shadow: 0 0 0 3px rgb(75 65 225 / .12); }
.pchip .ptag { margin-left: auto; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; flex-shrink: 0; }
.pchip .ptag.free { background: #eef2f8; color: var(--faint); }
.pchip .ptag.bench { background: var(--indigo-50); color: var(--indigo); }

/* shift bands (each shift = a horizontal section: its people + its work) */
.band { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.band.over { outline: 2px dashed var(--indigo); outline-offset: -2px; }
.band-hd { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: 14px; background: var(--surface-alt); }
.band-hd .dot { width: 12px; height: 12px; border-radius: 3px; }
.band-hd .cov { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.band-hd .cov.met { background: var(--ok-bg); color: #0a7d57; } .band-hd .cov.under { background: var(--bad-bg); color: var(--bad); }
.band-hd .win { font-size: 11px; font-weight: 600; color: var(--faint); }
.band-hd .wcount { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--faint); }
.band-body { display: flex; align-items: stretch; }
.band-people { flex: 1; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 8px; align-content: flex-start; min-height: 66px; }
.band-work { flex: 0 0 300px; min-width: 0; padding: 12px; border-left: 1px solid var(--line-soft); background: #fbfcfe; }
.band-work .wlabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 8px; }
.lane-empty { grid-column: 1 / -1; border: 1.5px dashed #cdd6e4; border-radius: 8px; padding: 12px; text-align: center; font-size: 12px; color: var(--faint); }
.work-empty { font-size: 12px; color: #0a7d57; font-weight: 600; }

.pcard { background: var(--surface); border: 1px solid #e6ebf3; border-radius: 9px; padding: 8px; }
.pcard.over { outline: 2px dashed var(--indigo); outline-offset: -3px; }
.pcard.blocked { outline: 2px dashed var(--bad); outline-offset: -3px; }
.pcard.noshow { opacity: .55; } .pcard.noshow .nm { text-decoration: line-through; }
.pcard-top { display: flex; align-items: center; gap: 8px; }
.pcard-top .nm { font-weight: 700; font-size: 13px; cursor: grab; }
.pcard-top .mins { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.pcard-top .pmenu { margin-left: 6px; border: 0; background: none; color: var(--faint); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pcard-top .pmenu:hover { color: var(--text); }
.pcard-top .mins + .pmenu { margin-left: 6px; }
.works { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.wchip { display: inline-flex; align-items: center; gap: 5px; background: var(--indigo-50); border: 1px solid #dcdcfb; color: #2f2aa8; border-radius: 7px; padding: 3px 4px 3px 8px; font-size: 11.5px; font-weight: 600; }
.wchip .x { border: 0; background: none; color: #8f8ad6; font-size: 13px; line-height: 1; cursor: pointer; padding: 0 2px; }
.wchip .x:hover { color: var(--bad); }
.wdrop { border: 1.5px dashed #cdd6e4; border-radius: 7px; padding: 3px 9px; font-size: 10.5px; color: var(--faint); align-self: center; }

/* work items (inside each shift band) */
.witem { display: flex; align-items: flex-start; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; font-weight: 600; font-size: 12.5px; cursor: grab; box-shadow: 0 1px 2px rgb(11 28 48 / .05); }
.witem:active { cursor: grabbing; }
.witem.free { border-left: 3px solid #f6b0b0; }
.witem .grip { color: #c2ccda; font-weight: 800; letter-spacing: -1px; line-height: 1.5; }
.witem .wt { flex: 1; min-width: 0; line-height: 1.3; }
.witem .warea { font-size: 10px; color: var(--faint); font-weight: 700; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; padding-top: 2px; }

/* popover */
.pop-back { position: fixed; inset: 0; z-index: 100; }
.pop { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px -12px rgb(11 28 48 / .3); width: 236px; padding: 12px; }
.pop h4 { margin: 0 0 2px; font-size: 14px; } .pop .psub { color: var(--faint); font-size: 12px; margin: 0 0 10px; }
.pop .act { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.pop .act:hover { background: var(--surface-alt); }
.pop .act .k { margin-left: auto; color: var(--faint); font-size: 11px; }

/* day-off conflict flag */
.pcard.dayoff { outline: 1.5px solid #f6b0b0; outline-offset: -1px; }
.offflag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff; background: var(--bad); padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.offflag + .mins { margin-left: 6px; }
.otflag, .coverflag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.otflag { color: #fff; background: var(--warn); }
.coverflag { color: var(--indigo); background: var(--indigo-50); }
.otflag ~ .coverflag, .otflag ~ .offflag, .coverflag ~ .offflag, .otflag ~ .mins, .coverflag ~ .mins { margin-left: 6px; }

/* person flyout — a small card that pops out to the right of the People panel */
.personpop { position: absolute; width: 288px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 44px -14px rgb(11 28 48 / .32); padding: 15px 16px; opacity: 0; transform: translateX(-8px); transition: opacity .16s ease, transform .16s ease; }
.personpop.in { opacity: 1; transform: none; }
.drawer-hd { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.av.lg { width: 38px; height: 38px; font-size: 13px; }
.drawer-hd .dwho { flex: 1; } .drawer-hd .dnm { font-weight: 800; font-size: 15px; } .drawer-hd .drole { color: var(--faint); font-size: 12px; }
.drawer-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--faint); cursor: pointer; align-self: flex-start; }
.drawer-x:hover { color: var(--text); }
.dsec { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.dlabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 8px; }
.daybs { display: flex; gap: 4px; flex-wrap: wrap; }
.dayb { font-family: inherit; font-size: 11px; font-weight: 700; width: 30px; height: 30px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; cursor: pointer; color: var(--muted); }
.dayb[data-off="none"] { width: auto; padding: 0 10px; }
.dayb.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.dayb:hover:not(.on) { background: var(--surface-alt); }
.dtog { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dtoday { font-size: 13px; }

/* duplicate modal */
.modal-back { background: rgb(11 28 48 / .34); display: grid; place-items: center; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px -20px rgb(11 28 48 / .45); padding: 22px; width: 380px; max-width: 92vw; }
.modal h4 { margin: 0 0 4px; font-size: 17px; } .modal .psub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.duppresets { display: flex; gap: 7px; margin-bottom: 12px; }
.chipbtn { font-family: inherit; font-size: 12px; font-weight: 700; padding: 6px 11px; border: 1px solid var(--border); background: var(--surface-alt); border-radius: 999px; cursor: pointer; color: var(--indigo); }
.chipbtn:hover { background: var(--indigo-50); }
.dupdays { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.dayrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.dayrow:hover { background: var(--surface-alt); }
.modal .b.indigo { width: 100%; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; padding: 11px 18px; border-radius: 10px; box-shadow: 0 12px 30px -10px rgb(11 28 48 / .5); z-index: 200; opacity: 0; transition: opacity .25s, transform .25s; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* login */
.login-card { width: 320px; margin: 12vh auto 0; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 30px; }
.login-card .rbrand { font-size: 13px; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; } .login-card p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.login-card label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); margin: 12px 0 5px; display: block; }
.login-card input { width: 100%; font-family: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfe; }
.login-card input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgb(75 65 225 / .12); }
.login-card button { width: 100%; margin-top: 16px; font-family: inherit; font-size: 15px; font-weight: 700; padding: 11px; border: none; border-radius: 9px; background: var(--navy); color: #fff; cursor: pointer; }
.login-card .err { background: var(--bad-bg); color: #b42318; font-size: 13px; padding: 8px 12px; border-radius: 8px; margin-top: 14px; }
.muted { color: var(--faint); }
