/* Employee PWA — mobile-first, big touch targets.
   Palette matches the ops / FOH / BOH apps. */
:root {
  --accent: #d1432a;
  --accent2: #c8a86b;
  --green: #3ecf8e;
  --yellow: #f7c948;
  --bg: #14110f;
  --surface: #1a1a2e;
  --surface2: #232340;
  --text: #f0f0f0;
  --muted: #8888a8;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* An explicit `display` beats the UA stylesheet's `[hidden] { display: none }`.
   Make the attribute win so a styled element can't be stuck visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Installed to the home screen, the viewport is `viewport-fit=cover` with a
     translucent status bar, so the page runs UNDERNEATH the clock and battery.
     Without this inset the back arrow sits below the status bar, where the OS
     takes the taps and the button appears dead. The bottom inset was here; the
     top one was missed because it costs nothing in a browser tab. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.view { display: none; }
.view.active { display: block; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ------------------------------------------------------------- login */
.login-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 24px 24px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.logo { width: 88px; margin: 0 auto 16px; display: block; }

.login-wrap h1 {
  text-align: center;
  font-size: 26px;
  margin: 0 0 32px;
  font-weight: 600;
}

.field-label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type=text], input:not([type]), .code-input {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  color: var(--text);
}

input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.code-input {
  font-size: 32px;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hint { color: var(--muted); font-size: 14px; margin: 8px 0 20px; }

.btn {
  width: 100%;
  min-height: 56px;           /* thumb-sized, people use this one-handed */
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  background: var(--surface2);
  color: var(--text);
}

.btn.primary { background: var(--accent); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.clock {
  background: var(--green);
  color: #06231a;
  min-height: 64px;
  font-size: 19px;
}
.btn.clock.out { background: var(--accent); color: #fff; }
/* Stop the browser treating a quick second tap as double-tap-to-zoom, which
   on some phones fires a second click from one press. */
.btn.clock { touch-action: manipulation; -webkit-user-select: none; user-select: none; }

.clock-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 15px;
  color: var(--green);
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 15px;
  color: var(--muted);
}
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.link {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 15px;
  cursor: pointer;
  padding: 12px 4px;
}

.row-links { display: flex; justify-content: space-between; margin-top: 8px; }

.error {
  color: #ff8a7a;
  background: rgba(209, 67, 42, 0.12);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 18px;
  font-size: 15px;
}

.lang-switch { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }
.lang-switch.small { margin: 0; }
.lang-switch button {
  background: var(--surface);
  border: 1px solid var(--surface2);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lang-switch button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* -------------------------------------------------------------- home */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 12px;
}

.greeting { font-size: 22px; font-weight: 600; }

main { padding: 0 20px 32px; max-width: 640px; margin: 0 auto; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}

.card-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  min-height: 88px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  text-decoration: none;
}

.tile:disabled { opacity: 0.5; cursor: default; }

.pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
}

.pill.soon { background: var(--surface2); color: var(--muted); }
.card .pill.soon { position: absolute; top: 16px; right: 16px; }

.signout { display: block; margin: 28px auto 0; }

.pill.ok { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.pill.warn { background: rgba(247, 201, 72, 0.16); color: var(--yellow); }

/* ------------------------------------------------------ availability */
.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  /* 44px is the smallest thing a thumb reliably hits. The glyph alone was
     about half that. */
  min-width: 44px;
  min-height: 44px;
  margin: -10px 0 -10px -10px;
  padding: 0 14px 0 10px;
  text-align: left;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}

.page-title { font-size: 20px; margin: 4px 0 6px; }

.avail-days { margin: 22px 0; }

.avail-day {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid transparent;
}
.avail-day.on { border-color: rgba(62, 207, 142, 0.28); }

.avail-head { display: flex; align-items: center; justify-content: space-between; }
.avail-name { font-size: 17px; font-weight: 600; }

/* Big thumb-friendly switch — this screen is used one-handed on a phone. */
.switch { position: relative; display: inline-block; width: 54px; height: 32px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: 999px;
  transition: background 0.15s;
}
.slider::before {
  content: '';
  position: absolute;
  height: 26px;
  width: 26px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(22px); }

.avail-body { margin-top: 14px; }

.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1;
  min-height: 46px;
  background: var(--surface2);
  border: none;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.active { background: var(--accent); color: #fff; }

.times { display: flex; gap: 12px; margin-top: 12px; }
.times label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.times input {
  padding: 12px;
  font-size: 16px;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
}

/* ---------------------------------------------------- my schedule */
.empty-state { text-align: center; padding: 40px 20px; line-height: 1.6; }

.sched-toggle { margin-bottom: 18px; }

/* Small arrows hugging a legible, centred date — not two big buttons with
   the date squished between them. */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.week-nav span {
  font-weight: 600;
  font-size: 17px;
  min-width: 130px;
  text-align: center;
}
.week-nav .btn {
  min-height: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-loc {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px;
  font-size: 15px;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
}

.team-day { margin-bottom: 22px; }
.team-shift {
  background: var(--surface);
  border-left: 3px solid var(--surface2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
/* Temporal state owns the left border + overall tint. */
.team-shift.state-past { border-left-color: var(--surface2); opacity: 0.5; }
.team-shift.state-active {
  border-left-color: var(--green);
  background: rgba(62, 207, 142, 0.12);
  box-shadow: 0 0 0 1px rgba(62, 207, 142, 0.3);
}
.team-shift.state-future { border-left-color: var(--accent2); }
/* "Mine" and "open" read from the inline tags, not the border, so they don't
   fight the temporal colour. */
.team-shift.open { border-left-style: dashed; }

.now-tag {
  background: var(--green);
  color: #06231a;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}
.done-tag {
  background: var(--surface2);
  color: var(--muted);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
}

.team-shift-time { font-weight: 600; font-size: 16px; }
.team-shift-dur { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.team-shift-who { font-size: 14px; margin-top: 2px; }
.you-tag {
  background: var(--green);
  color: #06231a;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.team-shift-note { color: var(--accent2); font-size: 13px; margin-top: 5px; }

.open-tag, .cover-tag {
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}
.open-tag { background: var(--yellow); color: #231a00; }
.cover-tag { background: var(--accent); color: #fff; }
.my-shift.truly-open { border-left-style: dashed; }

.shift-day { margin-bottom: 24px; }
.shift-date {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.my-shift {
  background: var(--surface);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.my-shift-time { font-size: 19px; font-weight: 600; }
.my-shift-meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.my-shift-note {
  margin-top: 9px;
  font-size: 14px;
  color: var(--accent2);
  border-top: 1px solid var(--surface2);
  padding-top: 9px;
}

/* ------------------------------------------------------- coverage */
.my-shift.open-shift { border-left-color: var(--accent2); }
.cover-btn { min-height: 46px; margin-top: 12px; font-size: 15px; }
.shift-actions { display: flex; gap: 8px; }
.shift-actions .cover-btn { flex: 1; }

.swap-line { font-size: 15px; margin-top: 4px; }
.swap-lbl {
  display: inline-block;
  min-width: 74px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cover-state {
  margin-top: 10px;
  font-size: 14px;
  color: var(--yellow);
  border-top: 1px solid var(--surface2);
  padding-top: 9px;
}

/* ------------------------------------------------------- time off */
.section-head {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 28px 0 10px;
}

.req-card {
  background: var(--surface);
  border-left: 3px solid var(--surface2);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 10px;
}
.req-card.approved { border-left-color: var(--green); }
.req-card.pending { border-left-color: var(--yellow); }
.req-card.denied { border-left-color: var(--accent); }
.req-card.canceled { opacity: 0.55; }

.req-dates { font-size: 17px; font-weight: 600; }
.req-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.card input[type=date], .card input[type=text], .card input:not([type]) {
  width: 100%;
}

.save-msg { text-align: center; margin-top: 14px; font-size: 15px; }
.save-msg.ok { color: var(--green); }
.save-msg.err { color: #ff8a7a; }

/* ----------------------------------------------------------- hours */
/* Deliberately no money on this screen: OnPay is the system of record and
   a dollar figure here would only start arguments with the real one. */
.hours-total { text-align: center; }
.big-hours {
  font-size: 34px;
  font-weight: 700;
  color: var(--accent2);
  margin: 4px 0 2px;
}
.my-shift.problem { border-left: 3px solid var(--yellow); }
.warn-line { color: var(--yellow); font-size: 13px; margin-top: 4px; }
.my-shift .link { margin-top: 6px; }

/* Named shifts in the "you're still scheduled" block — a bare refusal
   without saying which days is a dead end. */
.blocked-shifts { margin: 8px 0 4px; padding-left: 20px; }
.blocked-shifts li { margin: 3px 0; }

/* Location + job side by side above the team week. */
/* A manager's note on a shift. Tinted so it reads as an instruction, not as
   part of the time or place. */
.shift-note {
  margin-top: 6px;
  padding: 6px 10px;
  border-left: 3px solid var(--accent2);
  background: rgba(200, 168, 107, 0.10);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}

/* Day picker for the Everyone view. Seven pills have to fit the narrowest
   phone, so they share the row equally and shrink rather than wrap —
   a wrapped strip reads as two rows of days and loses the week at a glance. */
.day-strip {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.day-pill {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.day-pill-dow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.day-pill-num { font-size: 17px; font-weight: 600; }
/* Nothing on: still tappable, just visibly quiet. */
.day-pill.empty { opacity: .45; }
/* Today gets a marker even when you're looking at another day. */
.day-pill.today .day-pill-num { color: var(--accent2); }
.day-pill.active {
  background: var(--accent);
  opacity: 1;
}
.day-pill.active .day-pill-dow,
.day-pill.active .day-pill-num { color: #fff; }

/* Who could take a shift you've put up. Collapsed by default -- it's a
   reference you open when a broadcast text hasn't landed, not something
   that should push the shift itself off the screen. */
.free-who { margin-top: 8px; }
.free-who > summary {
  cursor: pointer;
  color: var(--accent2);
  font-size: 14px;
  padding: 4px 0;
}
.free-group { margin: 8px 0 4px; }
.free-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.free-name {
  display: block;
  padding: 3px 0;
  font-size: 15px;
}

.team-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.team-filters .team-loc { flex: 1; margin-bottom: 0; }
