/* Kurbside Crew: mobile-first, Kurbside Sweets brand colors */
:root {
  --maroon: #8C1D2C;
  --maroon-dark: #6B1220;
  --teal: #1D7F91;
  --mint: #A9DCD5;
  --mint-soft: #E4F4F1;
  --cookie: #D49A55;
  --butter: #F6E08A;
  --cream: #FFF9F1;
  --white: #FFFFFF;
  --ink: #231B1D;
  --ink-soft: #6A5F61;
  --line: #EADFD3;
  --band: #F5EEE6;
  --danger: #B3261E;
  --ok: #2E7D32;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
.loading { text-align: center; padding: 40px; color: var(--ink-soft); }

/* ----- App shell ----- */
.top { position: sticky; top: 0; z-index: 10; }
.topbar {
  background: var(--maroon); color: var(--white);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .left { justify-self: start; }
.topbar .right { justify-self: end; }
.topbar button, .topbar a {
  background: none; border: 0; color: var(--white); font-size: 1rem; padding: 6px 4px; cursor: pointer; text-decoration: none;
}
.topbar .icon-btn { font-size: 1.6rem; line-height: 1; }

main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); max-width: 720px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--white); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-soft); text-decoration: none; font-size: .72rem;
}
.tabbar a svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--maroon); font-weight: 600; }

/* ----- Lists (grouped rows like a phone settings screen) ----- */
.band {
  background: var(--band); padding: 10px 16px; font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.list { background: var(--white); border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); background: var(--white);
  text-decoration: none; color: inherit; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
}
a.row, button.row { cursor: pointer; }
a.row:active, button.row:active { background: var(--mint-soft); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 1.05rem; }
.row .sub { color: var(--ink-soft); font-size: .88rem; margin-top: 2px; }
.row .chev { color: #b9aeb0; font-size: 1.4rem; }
.row.muted .title { color: var(--ink-soft); }
.row.action { color: var(--teal); font-size: 1.05rem; }
.row.danger { color: var(--danger); }
.empty { text-align: center; color: var(--ink-soft); padding: 22px 16px; background: var(--white); border-bottom: 1px solid var(--line); }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: .95rem;
}
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.pill {
  display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px;
  background: var(--mint-soft); color: var(--teal); font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.pill.owner { background: var(--butter); color: var(--ink); }
.pill.off { background: #eee; color: var(--ink-soft); }

/* ----- Forms ----- */
.form { padding: 16px; display: grid; gap: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input[type=text], .field input[type=tel], .field input[type=password], .field input[type=date],
.field input[type=number], .field select, .field textarea {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 1rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--teal); border-color: transparent; }
.field .hint { font-size: .8rem; color: var(--ink-soft); margin-top: 5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--white); cursor: pointer; font-size: .95rem;
}
.field .check { display: inline-flex; margin: 0; font-weight: 400; font-size: .95rem; color: var(--ink); }
.check input { margin: 0; accent-color: var(--maroon); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--white); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.seg button { flex: 1; padding: 10px; border: 0; background: none; cursor: pointer; }
.seg button.on { background: var(--maroon); color: var(--white); }

.btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--maroon); color: var(--white); font-size: 1.05rem; font-weight: 600; cursor: pointer;
}
.btn:active { background: var(--maroon-dark); }
.btn:disabled { opacity: .6; }
.btn.secondary { background: var(--white); color: var(--maroon); border: 1px solid var(--line); }
.error { background: #FDECEA; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: .95rem; }
.notice { background: var(--mint-soft); color: var(--teal); padding: 10px 12px; border-radius: 10px; font-size: .95rem; }

/* ----- Login ----- */
.login { max-width: 380px; margin: 0 auto; padding: 48px 20px; }
.login .brand { text-align: center; margin-bottom: 24px; }
.login .brand img { width: 96px; height: 96px; }
.login .brand h1 { margin: 10px 0 0; font-size: 1.5rem; }
.login .brand p { margin: 4px 0 0; color: var(--ink-soft); }

/* ----- Placeholder cards ----- */
.soon { margin: 16px; padding: 20px; background: var(--white); border: 1px dashed var(--line); border-radius: 14px; color: var(--ink-soft); text-align: center; }
.soon strong { display: block; color: var(--ink); margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%);
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 999px; font-size: .95rem; z-index: 20;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ----- Schedule ----- */
.subbar { background: var(--white); border-bottom: 1px solid var(--line); }
.seg-top { margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
.seg-top button { padding: 9px; font-size: .95rem; }
.weeklabel { display: flex; justify-content: center; gap: 12px; padding: 8px 16px 0; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.weeklabel a { color: var(--teal); text-decoration: none; }
.weekstrip { display: flex; align-items: center; padding: 4px 4px 8px; }
.weeknav { width: 36px; text-align: center; font-size: 1.7rem; color: var(--maroon); text-decoration: none; line-height: 1; padding: 6px 0; }
.weekstrip .days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.day { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0; cursor: pointer; }
.day .dow { font-size: .72rem; color: var(--ink-soft); }
.day .num { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.day.today .num { background: var(--maroon); color: var(--white); font-weight: 700; }
.day .mark { width: 5px; height: 5px; border-radius: 50%; }
.day.has .mark { background: var(--teal); }
.band.today { color: var(--maroon); }
.band-num { font-weight: 600; letter-spacing: 0; }
.shift-row { border-left: 6px solid #9A8F91; }
.shift-row .time { font-weight: 700; font-size: 1.15rem; }
.shift-row .event { color: var(--ink); }
.shift-row.open .sub:first-of-type { color: var(--maroon); }
.avatar.unassigned { background: #fff; border: 2px dashed #b9aeb0; color: #9A8F91; }
.add-row { color: var(--teal); justify-content: center; }
.add-row.small { padding: 8px 16px; font-size: .9rem; }
.list.spaced { margin-top: 18px; border-top: 1px solid var(--line); }
main.has-footer { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 72px); }
.totalbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 9;
  background: #5C5153; color: var(--white); display: flex; justify-content: space-between;
  padding: 12px 18px; font-size: 1.15rem;
}
.row.info { align-items: flex-start; }
.row.info .label { width: 84px; flex: none; color: var(--ink-soft); font-size: .9rem; padding-top: 2px; }
.row.info a { color: var(--teal); }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.inline .avatar { width: 28px; height: 28px; font-size: .7rem; }
.notes { white-space: pre-wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formband { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 14px; }
.field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 1rem; resize: vertical; }
.field input[type=time] { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 1rem; }
.copygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.copygrid .dow { text-align: center; font-size: .75rem; color: var(--ink-soft); }
.copygrid .cell { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: .85rem; cursor: pointer; padding: 0; }
.copygrid .cell.on { background: var(--maroon); color: var(--white); border-color: var(--maroon); }
.copygrid .cell.source { background: var(--mint-soft); color: var(--teal); font-weight: 700; cursor: default; }
[hidden] { display: none !important; }

/* ----- Drafts and publishing ----- */
.pill.draft { background: var(--butter); color: var(--ink); }
.shift-row.draft { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #FBF6EC 10px, #FBF6EC 20px); }
.shift-row.draft .avatar { opacity: .75; }
.publishbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #FFF6D6; border-bottom: 1px solid #EBD99A; font-size: .9rem;
}
.publishbar strong { display: block; font-size: 1rem; }
.btn.small { width: auto; padding: 9px 14px; font-size: .95rem; border-radius: 10px; white-space: nowrap; }
.row.action.strong { font-weight: 700; color: var(--maroon); }
.publish-field { border-top: 1px solid var(--line); padding-top: 14px; }

/* ----- Home: my shifts ----- */
.next-card { margin: 16px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; border-left: 6px solid var(--teal); text-decoration: none; color: inherit; display: block; }
.next-card .label { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.next-card .when { font-size: 1.25rem; font-weight: 700; margin-top: 6px; }
.next-card .sub { color: var(--ink-soft); margin-top: 4px; }
.next-card.none .when { font-weight: 400; color: var(--ink-soft); font-size: 1.05rem; }

/* ----- Time clock ----- */
.seg .segbtn { flex: 1; padding: 9px; text-align: center; text-decoration: none; color: inherit; font-size: .95rem; }
.seg .segbtn.on { background: var(--maroon); color: var(--white); }
.clock-card { margin: 16px; padding: 20px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; text-align: center; display: grid; gap: 12px; }
.clock-card.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint-soft); }
.clock-status { font-weight: 700; font-size: 1.1rem; }
.clock-elapsed { font-size: 2.4rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.clock-shift { color: var(--ink-soft); }
.clock-card input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.clock-btn { padding: 20px; font-size: 1.3rem; border-radius: 14px; }
.clock-btn.in { background: var(--teal); }
.clock-btn.in:active { background: #155f6c; }
main > .error { margin: 16px 16px 0; }
.hrs { font-weight: 600; font-variant-numeric: tabular-nums; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pills:empty { display: none; }
.pills .pill { margin-left: 0; }
.pill.warn { background: #FDECEA; color: var(--danger); }
.pill.ok { background: #E6F4EA; color: var(--ok); }
.navrow { align-items: center; padding-bottom: 8px; }
.navrow .weeknav { width: 32px; }
.entry-info { font-size: .9rem; }

/* ----- Pay periods ----- */
.hrs.none { color: var(--ink-soft); font-weight: 400; }
.hrs.right { text-align: right; }
.hrs.right .sub { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.sumcard { margin: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.sumcard .stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; }
.sumcard .num { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sumcard .lbl { font-size: .75rem; color: var(--ink-soft); margin-top: 2px; }
.sumcard .stat.ot .num { color: var(--danger); }
a.publishbar.link { text-decoration: none; color: inherit; }
.footnote { margin: 16px; font-size: .8rem; color: var(--ink-soft); }

/* ----- Dashboard ----- */
.hello { padding: 14px 16px 6px; font-size: 1.15rem; font-weight: 700; }
.count {
  width: 40px; height: 40px; border-radius: 50%; flex: none; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink);
}
.count.zero { color: var(--ink-soft); font-weight: 400; }
.count.warn { border-color: var(--maroon); background: var(--maroon); color: var(--white); }
.notice-row { padding-left: 28px; background: #FFFBF3; }
.notice-row .avatar { width: 32px; height: 32px; font-size: .75rem; }
.notice-row.noshow .title, .notice-row.forgot .title { color: var(--danger); }
.clockbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 9;
  background: var(--white); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 14px rgba(35, 27, 29, .08);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
}
.clockbar-main { font-weight: 600; }
.clockbar .sub { color: var(--ink-soft); font-size: .85rem; }
.clockbar .btn.in { background: var(--teal); }
.clockbar .btn { padding: 12px 18px; font-size: 1.05rem; }
.clockbar .grow { flex: 1; min-width: 0; }
/* Lift toasts above a bottom bar (clock bar, totals) when one is showing. */
body:has(.clockbar) .toast, body:has(.totalbar) .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }

/* ----- Requests ----- */
.row.request { align-items: flex-start; }
.row.request .title .pill { margin-left: 8px; }
.sub.pre { white-space: pre-line; }
.sub.quote { font-style: italic; }
.sub.link { display: inline-block; margin-top: 6px; color: var(--teal); text-decoration: none; }
.sub.muted { color: var(--ink-soft); font-size: .85rem; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
a.btn.small { display: inline-block; text-decoration: none; }
.grow.plain { text-decoration: none; color: inherit; }
.timeoff-row { background: repeating-linear-gradient(135deg, #F4F1EE, #F4F1EE 8px, #FBFAF8 8px, #FBFAF8 16px); }
.timeoff-row .avatar { opacity: .6; }
.timeoff-row .title { color: var(--ink-soft); }

/* ----- Notifications ----- */
.bell { position: relative; display: inline-flex; padding: 4px; }
.bell svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.bell .badge {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--butter); color: var(--ink); font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.notif .unread-dot { width: 9px; height: 9px; background: transparent; }
.notif.unread .unread-dot { background: var(--maroon); }
.notif.unread .title { font-weight: 700; }
.notif .when { font-size: .78rem; }
.row.toggle { cursor: pointer; }
.row.toggle input { width: 22px; height: 22px; accent-color: var(--maroon); flex: none; }
.row.inline-field { gap: 8px; }
.row.inline-field input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
