:root {
  --blue: #4f8fcc; --blue-dark: #2f6fad; --blue-soft: #eaf3fb;
  --ink: #1c2733; --muted: #5b6b7b; --line: #e3e9f0; --bg: #f5f7fa; --panel: #fff;
  --good: #1f9d55; --good-bg: #e7f6ee; --warn: #c98a00; --warn-bg: #fdf3dd; --bad: #d23b3b; --bad-bg: #fbe2e2;
  --shadow: 0 1px 3px rgba(20,40,70,.07), 0 6px 20px rgba(20,40,70,.05); --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1,h2,h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .hidden { display: none !important; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--blue); color: #fff; padding: 12px 16px; box-shadow: var(--shadow); }
.bar .logo { height: 26px; }
.bar .title { font-weight: 800; font-size: 16px; }
.bar .spacer { flex: 1; }
.bar .who { font-weight: 700; font-size: 13px; opacity: .95; }
.bar .barbtn { background: rgba(255,255,255,.18); border: none; color: #fff; font-weight: 700; padding: 7px 12px; border-radius: 9px; font-size: 13px; }
.bar .barbtn:hover { background: rgba(255,255,255,.28); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 90px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 20px 2px 10px; }
.sec-h h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sec-h .count { background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; font-size: 12px; padding: 1px 9px; border-radius: 100px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; text-align: center; padding: 28px 24px; }
.login .logo { height: 40px; margin-bottom: 12px; }
.login h1 { font-size: 21px; } .login .sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 18px; }
label { display: block; text-align: left; font-weight: 800; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 12px 2px 5px; }
select, input[type=text], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password] {
  width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 11px; font: inherit; color: inherit; background: #fff; outline: none;
}
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
input.pin { text-align: center; letter-spacing: 6px; font-size: 22px; font-weight: 800; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 11px 16px; border-radius: 12px; font-weight: 800; font-size: 15px; }
.btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.full { width: 100%; margin-top: 14px; padding: 13px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--bad); font-weight: 700; font-size: 13px; min-height: 17px; margin-top: 10px; }
.linkish { background: none; border: none; color: var(--blue-dark); font-weight: 700; font-size: 13px; margin-top: 16px; text-decoration: underline; }

/* shift card */
.shift { margin-bottom: 12px; padding: 0; overflow: hidden; }
.shift .top { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.shift .date { text-align: center; background: var(--blue-soft); color: var(--blue-dark); border-radius: 11px; padding: 8px 10px; min-width: 60px; }
.shift .date .dow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.shift .date .dnum { font-size: 22px; font-weight: 900; line-height: 1; }
.shift .date .mon { font-size: 11px; font-weight: 700; }
.shift .info { flex: 1; min-width: 0; }
.shift .time { font-weight: 800; font-size: 16px; }
.shift .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.shift .notes { font-size: 13px; margin-top: 6px; color: var(--ink); background: var(--bg); border-radius: 8px; padding: 6px 9px; }
.shift .fillbar { height: 7px; background: var(--line); border-radius: 100px; overflow: hidden; margin-top: 10px; }
.shift .fillbar > span { display: block; height: 100%; background: var(--good); }
.shift .fillbar.full > span { background: var(--warn); }
.shift .foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fbfcfe; }
.shift .cnt { font-weight: 800; font-size: 14px; } .shift .cnt .l { color: var(--muted); font-weight: 700; }
.shift .foot .spacer { flex: 1; }
.pill { font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: 100px; }
.pill.booked { background: var(--good-bg); color: var(--good); }
.pill.waitlist { background: var(--warn-bg); color: var(--warn); }
.pill.full { background: var(--warn-bg); color: var(--warn); }
.pill.closed { background: var(--line); color: var(--muted); }
.pill.cancelled { background: var(--bad-bg); color: var(--bad); }

.empty { text-align: center; color: var(--muted); padding: 26px 16px; }
.names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 100px; }
.chip.wait { background: var(--warn-bg); color: var(--warn); }
.chip.slotfree { background: var(--bg); color: var(--muted); border: 1px dashed var(--line); }

/* manager tabs */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 4px; }
.tabs button { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px; font-weight: 800; color: var(--muted); font-size: 14px; }
.tabs button.active { background: var(--blue); color: #fff; }
.cov { display: flex; gap: 10px; margin-bottom: 14px; }
.cov .box { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.cov .box .n { font-size: 24px; font-weight: 900; } .cov .box .l { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.cov .box.gap .n { color: var(--bad); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.rolebtns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.rolebtn { border: 2px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; padding: 7px 12px; border-radius: 100px; font-size: 13px; }
.rolebtn.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); background: var(--ink); color: #fff; font-weight: 700; padding: 12px 20px; border-radius: 100px; box-shadow: var(--shadow); opacity: 0; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: var(--good); } .toast.bad { background: var(--bad); }

/* onboarding + settings */
textarea { width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 11px; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; outline: none; background: #fff; color: inherit; }
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.ob-body { text-align: left; max-height: 44vh; overflow: auto; margin: 6px 0 16px; -webkit-overflow-scrolling: touch; }
.ob-body h4 { font-size: 14px; margin: 14px 0 3px; color: var(--blue-dark); }
.ob-body p { margin: 0 0 9px; font-size: 14px; }
.contract { text-align: left; white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 42vh; overflow: auto; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.chk { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); font-weight: 600; margin: 6px 2px; }
.chk input { width: auto; }
.ob-cta { margin-top: 12px; font-size: 13px; color: var(--muted); }
.linkish2 { background: none; border: none; color: var(--blue-dark); font-weight: 800; font-size: 13px; text-decoration: underline; }
.newtag { background: var(--good-bg); color: var(--good); font-weight: 800; font-size: 10px; padding: 1px 7px; border-radius: 100px; text-transform: uppercase; letter-spacing: .03em; margin-left: 6px; }

/* start-scanning hand-off */
.scanbtn { display: block; text-decoration: none; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 15px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.scanbtn.on { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); }
.scanbtn:active { transform: translateY(1px); }
.scanbtn .scantop { display: block; font-size: 12.5px; font-weight: 800; opacity: .92; margin-bottom: 4px; }
.scanbtn .scanmain { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; }
.scanbtn .scanic { font-size: 22px; }
.scanbtn .scanarrow { margin-left: auto; }
.scanbtn .scanhint { display: block; font-size: 12px; opacity: .78; margin-top: 6px; font-weight: 600; }

/* map link + help/tutorial modal */
.maplink { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.meta .maplink { color: var(--muted); }
.hb { position: fixed; inset: 0; z-index: 200; background: rgba(20,35,55,.5); display: grid; place-items: center; padding: 16px; }
.hcard { background: #fff; border-radius: var(--radius); width: 100%; max-width: 440px; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.hhead { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.hhead h3 { flex: 1; font-size: 17px; }
.hx { border: none; background: none; font-size: 24px; line-height: 1; color: var(--muted); padding: 0 4px; }
.hbody { padding: 16px 18px; }
.hbody p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.hbody .hr { height: 1px; background: var(--line); border: 0; margin: 14px 0; }

/* set-up prompt card (new starters) */
.setupcard { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.setupcard .sc-txt { flex: 1; line-height: 1.3; }
.setupcard .sc-txt b { display: block; font-size: 15px; }
.setupcard .sc-txt span { font-size: 12.5px; opacity: .9; }
.setupcard .sc-go { background: #fff; color: var(--blue-dark); border: none; font-weight: 800; padding: 8px 14px; border-radius: 100px; font-size: 13px; white-space: nowrap; }
.setupcard .sc-x { background: rgba(255,255,255,.22); border: none; color: #fff; font-size: 17px; line-height: 1; width: 26px; height: 26px; border-radius: 50%; flex: none; }

/* detailed onboarding sections (mirrors the tablet's sign-up) */
.ob-sec { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.ob-sec:first-of-type { border-top: 0; margin-top: 8px; padding-top: 0; }
.ob-sec h4 { margin: 0; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--blue-dark); }
.ob-sec .ob-opt { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.ob-req { color: #e0483a; font-weight: 800; }
.ob-prog { margin-bottom: 16px; }
.ob-dots { display: flex; gap: 6px; justify-content: center; }
.ob-dot { width: 30px; height: 5px; border-radius: 100px; background: var(--line); }
.ob-dot.on { background: var(--blue); }
.ob-dot.done { background: var(--blue-dark); }
.ob-steplabel { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.ob-optnote { font-size: 12.5px; color: var(--muted); text-align: center; margin: 16px 0 2px; font-weight: 700; padding-top: 12px; border-top: 1px dashed var(--line); }

/* visual staff login picker (photos, not a dropdown) */
.sub2 { font-weight: 800; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 2px 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin-bottom: 12px; max-height: 42vh; overflow-y: auto; }
.pk-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 12px 6px 10px; cursor: pointer; }
.pk-tile.sel { border-color: var(--blue); background: var(--blue-soft); }
.pk-av { position: relative; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.pk-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pk-ini { font-weight: 800; font-size: 17px; color: var(--blue-dark); }
.pk-name { font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.2; word-break: break-word; }
.barav { background: none; border: 0; padding: 0; cursor: pointer; }
.barav .pk-av { width: 32px; height: 32px; background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.6); }
.barav .pk-ini { font-size: 12px; color: #fff; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ob-grid > div { min-width: 0; }
.ob-hint { font-size: 12px; color: var(--muted); margin: 8px 2px 2px; line-height: 1.35; }
.avrow { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.avBig { width: 62px; height: 62px; border-radius: 50%; background: var(--blue-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none; }
@media (max-width: 420px) { .ob-grid { grid-template-columns: 1fr; } }

/* phone clock-in panel (bidirectional presence with the packing tablet) */
.clockcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; margin-bottom: 14px; }
.clockcard.on { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-color: #37c26b; background: #f2fbf5; }
.clockcard .ct-row { display: flex; align-items: center; gap: 11px; }
.clockcard .ct-dot { width: 11px; height: 11px; border-radius: 50%; background: #37c26b; flex: none; box-shadow: 0 0 0 4px rgba(55,194,107,.18); }
.clockcard b { display: block; font-size: 15px; color: var(--ink); }
.clockcard .ct-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.clockcard .ct-in { display: flex; gap: 8px; margin-top: 11px; }
.clockcard .ct-in select { flex: 1; padding: 11px; border: 2px solid var(--line); border-radius: 11px; font: inherit; background: #fff; color: var(--ink); }
.clockcard .btn.sm { white-space: nowrap; }
