/* Staff Tracker — Staff mobile UI. Custom, not Bootstrap. */

:root {
  --ground:#FAF8FB; --surface:#FFFFFF; --surface-2:#F1ECF3;
  --ink:#251A2C; --ink-soft:#7A7086; --line:#E4DAE6;
  --brand-amber:#F0A22E; --brand-red:#E23A4E; --brand-blue:#2A93B4; --brand-pink:#D879BE; --brand-purple:#93318A;
  --accent:#2A93B4; --accent-2:#93318A; --accent-ink:#FCFEFF;
  --good:#2E9E63; --good-bg:#E1F3E8;
  --warn:#D9931C; --warn-bg:#FAEDD2;
  --bad:#D6394A; --bad-bg:#FBE1E4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:#1C1520; --surface:#241B29; --surface-2:#2D2233;
    --ink:#F3EEF6; --ink-soft:#A79DB0; --line:#3A2E42;
    --accent:#4FB2CC; --accent-2:#C265BA; --accent-ink:#1C1520;
    --good-bg:#173425; --warn-bg:#3A2C0E; --bad-bg:#3A1720;
  }
}
:root[data-theme="dark"] {
  --ground:#1C1520; --surface:#241B29; --surface-2:#2D2233;
  --ink:#F3EEF6; --ink-soft:#A79DB0; --line:#3A2E42;
  --accent:#4FB2CC; --accent-2:#C265BA; --accent-ink:#1C1520;
  --good-bg:#173425; --warn-bg:#3A2C0E; --bad-bg:#3A1720;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Karla', -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: 84px; /* space for fixed bottom nav */
  min-height: 100vh;
}

h1, h2, h3, .display, .wordmark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--accent-2); text-decoration: none; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden;
}
.topbar::before {
  content: "";
  position: absolute;
  top: -70px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-pink) 0%, var(--brand-blue) 45%, transparent 72%);
  opacity: .22;
  pointer-events: none;
  z-index: -1;
}
.topbar .brand-strip {
  height: 5px;
  background: linear-gradient(90deg, var(--brand-amber), var(--brand-red), var(--brand-blue), var(--brand-pink), var(--brand-purple));
}
.topbar-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-user {
  font-size: .85rem;
  color: var(--ink-soft);
}
.topbar a.logout {
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
}

/* ── Layout container ───────────────────────────────────── */
.staff-container {
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Flash alerts ────────────────────────────────────────── */
.flash {
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: .92rem;
}
.flash-success { background: var(--good-bg); color: var(--good); }
.flash-error   { background: var(--bad-bg);  color: var(--bad); }
.flash-warning { background: var(--warn-bg); color: var(--warn); }
.flash-info    { background: var(--surface-2); color: var(--ink-soft); }

/* ── Cards ───────────────────────────────────────────────── */
.job-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 18px 18px 22px;
  margin-bottom: 14px;
  color: var(--ink);
  overflow: hidden;
}
.job-card::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-purple));
}
.job-card:nth-of-type(3n+2)::before { background: linear-gradient(180deg, var(--brand-amber), var(--brand-red)); }
.job-card:nth-of-type(3n+3)::before { background: linear-gradient(180deg, var(--brand-pink), var(--brand-purple)); }
.job-card:active { transform: scale(.99); }
.job-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 6px;
}
.job-card-meta {
  color: var(--ink-soft);
  font-size: .86rem;
  margin-bottom: 10px;
}
.job-card-foot {
  display: flex; align-items: center; justify-content: space-between;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px 16px;
  font-size: .95rem;
}

/* ── Pills ───────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: .35em .85em;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
}
.pill-good   { background: var(--good-bg);  color: var(--good); }
.pill-warn   { background: var(--warn-bg);  color: var(--warn); }
.pill-bad    { background: var(--bad-bg);   color: var(--bad); }
.pill-accent { background: rgba(42,147,180,.14); color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none;
  border-radius: 16px;
  padding: 14px 22px;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  min-height: 48px;
  text-align: center;
}
.btn-block { display: flex; width: 100%; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px rgba(147,49,138,.55);
}
.btn-accent:active { filter: brightness(.94); }

.btn-good { background: var(--good); color: #fff; }
.btn-bad  { background: var(--bad);  color: #fff; }
.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn:disabled { opacity: .55; cursor: default; }

/* ── Clock button (hero) ─────────────────────────────────── */
.clock-hero {
  text-align: center;
  padding: 28px 16px 8px;
}
.clock-status-label {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.clock-elapsed {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  margin-bottom: 22px;
}
.clock-btn {
  width: 100%;
  padding: 22px 24px;
  border-radius: 28px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 16px 34px -14px rgba(147,49,138,.55);
  min-height: 64px;
}
.clock-btn:active { filter: brightness(.95); }
.clock-btn.is-out {
  background: linear-gradient(135deg, var(--bad), var(--brand-red));
  box-shadow: 0 16px 34px -14px rgba(214,57,74,.5);
}
.clock-hint {
  color: var(--ink-soft);
  font-size: .82rem;
  margin-top: 12px;
}

/* ── Recent events list ──────────────────────────────────── */
.event-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.event-row:last-child { border-bottom: none; }
.event-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.event-dot.in  { background: var(--good); }
.event-dot.out { background: var(--bad); }
.event-time { font-family: 'IBM Plex Mono', monospace; font-size: .85rem; }
.event-label { font-weight: 600; font-size: .9rem; }
.event-sub { color: var(--ink-soft); font-size: .78rem; }

/* ── Map thumbnail placeholder ───────────────────────────── */
.map-thumb {
  width: 100%;
  height: 96px;
  border-radius: 16px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 14px 14px;
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
}
.map-thumb::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(147,49,138,.18);
}

/* ── Photo gallery / upload ──────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.photo-upload-input {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 2px dashed var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
}

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
textarea, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-family: 'Karla', sans-serif;
  min-height: 48px;
}
.field input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,147,180,.15);
}

/* ── Bottom nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: .74rem;
  font-weight: 700;
  min-height: 48px;
  justify-content: center;
  border-radius: 14px;
}
.bottom-nav a.active { color: var(--accent-2); background: rgba(147,49,138,.08); }
.bottom-nav .nav-icon { font-size: 1.3rem; line-height: 1; }
