/* Technician PWA: mobile first, light, IBM Plex Sans + Mono.
   The colour tokens live in regie.css;
   this file only holds the phone layout and components. */
body.pwa {
  --body: "IBM Plex Sans", system-ui, sans-serif;
  min-height: 100vh; min-height: 100dvh; font-size: 16px;
}

.pwa-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 6px;
}
.pwa-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.pwa-mark { width: 28px; height: 28px; border-radius: 7px; display: block; }
.pwa-bar .top-actions { margin-left: 0; }

.pwa-main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 8px 18px calc(32px + env(safe-area-inset-bottom));
}
.pwa h1 { font-size: 24px; font-weight: 600; letter-spacing: 0; margin: 6px 0 14px; }

/* Times and amounts */
.pwa .time, .pwa .amount { font-family: var(--mono); color: var(--ink); }

.pwa input[type="tel"], .pwa input[type="password"] {
  font-size: 1.15rem;
  padding: 12px 14px;
  min-height: 48px;
}
.pwa input[inputmode="numeric"] { letter-spacing: .5em; text-align: center; font-family: var(--mono); }
.pwa .btn { min-height: 46px; border-radius: 9px; }
.pwa .btn.mini { min-height: 36px; }
.pwa .form-actions { flex-direction: column; align-items: stretch; }

/* Date cards: mono date header, title, post, times, amount */
.pwa-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.pwa-card.is-request { border-color: var(--info-line); }
.pwa-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pwa-card-date { font: 400 13px/1 var(--mono); color: var(--accent-text); text-transform: uppercase; }
.pwa-card-head .pill { margin-left: auto; }
.pwa-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.pwa-card-title { font-size: 16px; font-weight: 600; }
.pwa-card-sub { font-size: 13px; color: var(--muted); }
.pwa-card-times { display: flex; gap: 16px; align-items: baseline; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pwa-card-times .amount { margin-left: auto; }
.pwa-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.pwa-card-actions .btn { flex: 1; }

/* Banner for pending requests */
.pwa-banner { display: flex; align-items: center; gap: 10px; padding: 13px 14px; margin-bottom: 14px; border: 1px solid var(--warn-line); background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: 10px; text-decoration: none; }
.pwa-banner::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); flex: none; }

/* Bottom tab bar with stroke icons (screens use it from brick 3 task 4) */
.tabbar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Notifications onboarding: only the block matching the card's data-state is shown */
.push-state { display: none; }
#push-card[data-state="ios-browser"] .push-state[data-for="ios-browser"],
#push-card[data-state="ios-old"] .push-state[data-for="ios-old"],
#push-card[data-state="unsupported"] .push-state[data-for="unsupported"],
#push-card[data-state="disabled"] .push-state[data-for="disabled"],
#push-card[data-state="blocked"] .push-state[data-for="blocked"],
#push-card[data-state="ready"] .push-state[data-for="ready"],
#push-card[data-state="on"] .push-state[data-for="on"] { display: block; }
.push-state p { margin: 0 0 8px; }
.push-state ol { margin: 0 0 8px; padding-left: 20px; }
.push-error { color: var(--bad); margin: 0; }
.push-error[hidden], #push-toggle[hidden] { display: none; }

@media (min-width: 640px) {
  .pwa-main { padding-top: 24px; }
}
.pwa-card.is-unread { border-color: var(--accent-text); }

/* Tab bar spacing, unread badge */
body.has-tabbar .pwa-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tabbar a { min-height: 64px; }
.tabbar a:focus-visible { outline-offset: -4px; }
.tab-icon { position: relative; display: inline-flex; }
.tab-badge { position: absolute; top: -6px; right: -12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--bg); font: 600 10px/16px var(--mono); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Outlined pills on the phone (direction B) */
.pwa .pill { background: transparent; font-size: 12px; padding: 2px 7px; border-radius: 5px; }

/* Cards: whole-card link, muted (cancelled), empty state */
.pwa-card-link { display: block; color: inherit; text-decoration: none; }
.pwa-card-link:focus-visible { outline-offset: -3px; border-radius: 12px; }
.pwa-card.is-muted { opacity: .75; }
.pwa-card-body h1 { margin: 0; }
.pwa-empty { color: var(--muted); padding: 24px 4px; }
.pwa-back { display: inline-flex; align-items: center; min-height: 48px; color: var(--muted); text-decoration: none; font-size: 14px; }
.pwa h2.section-title { margin: 18px 2px 8px; }

/* Facts list (date detail) and rows (team, pay) */
.pwa-facts { margin: 0; padding: 4px 14px; }
.pwa-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pwa-facts > div:last-child { border-bottom: 0; }
.pwa-facts dt { color: var(--muted); font-size: 13px; }
.pwa-facts dd { margin: 0; text-align: right; }
.pwa-list { list-style: none; margin: 0; padding: 0 14px; }
.pwa-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pwa-list li:last-child { border-bottom: 0; }
.pwa-list a { text-underline-offset: 3px; }
.pwa-pay-what .muted { font-size: 13px; }
.pwa-pay-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pwa-total { font-weight: 600; }
.pwa-total .amount { font-size: 18px; }
.pwa .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Month navigation */
.pwa-monthnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-weight: 600; text-transform: capitalize; }
.pwa-monthnav a { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); text-decoration: none; font-size: 22px; }
.pwa-monthnav a:focus-visible { outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pwa * { transition: none !important; scroll-behavior: auto !important; } }

/* Bell link to the notification settings (header) */
.bellbtn { text-decoration: none; }
.bellbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.pwa-card-sub a { display: inline-block; padding: 12px 4px; }

/* Message page and the message list of a date */
.pwa-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; }
.pwa-note { margin: 4px 2px 16px; }
.pwa-list li.msg-line { display: block; min-height: 0; }
.pwa-list li.msg-line a { display: block; color: var(--ink); text-decoration: none; }
.pwa-list li.msg-line .pwa-card-sub { display: block; }

/* Unread messages: a badge on the date card, "Nouveau" on the date page (Marius 2026-12-04: no Messages tab) */
.msg-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--bg); font: 600 11px/18px var(--mono); text-align: center; }
.pwa-list li.msg-line.is-new a { font-weight: 600; }
.msg-new { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 6px; background: var(--accent); color: var(--bg); font: 600 10px/16px var(--mono); text-transform: uppercase; vertical-align: 1px; }
