/* ── Tokens — T2 foundation migration ─────────────────────────
   foundation.css MUST be loaded before this file (base.html + the
   standalone login/invite/reset templates all link it first). Time's
   legacy token names are kept as ALIASES to foundation tokens so the
   ~500 references across app.css + page styles keep working, while
   every actual color now comes from the design system.

   Deliberately NOT aliased:
     --text-muted  #8aab94 — Time's green-muted is part of the dark-
                   header identity (company line, nav inactive). The
                   foundation --muted (#6b6557, warm brown) reads wrong
                   on the dark green header.
     --radius      12px — Time's cards are rounder than foundation's
                   --r-card (10px); kept for now, candidate for a later
                   tighten.
     --tap         48px Time-specific minimum tap target.
   --red / --amber / --font-mono are GONE from this block — foundation
   provides them (slightly deeper shades, consistent with HQ/Office). */
:root {
  --accent:       var(--green);
  --accent-dark:  var(--green-deep);
  --accent-light: var(--green-tint);
  --accent-border:var(--green-line);
  --header-bg:    var(--ink);     /* same #0f1f17 it always was */
  --text:         var(--ink);
  --text-muted:   #8aab94;
  --border:       var(--line);
  --bg:           var(--paper);
  --card:         #ffffff;
  --radius:       12px;
  --tap:          48px;   /* minimum tap target */
  --font-ui:      var(--font-sans);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  /* foundation sets body to 15px (desktop baseline); Time stays at
     16px for mobile readability. */
  font-size: 1rem;
  min-height: 100vh;
  padding-bottom: 80px; /* space for bottom nav */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button, input, select { font-family: inherit; font-size: 1rem; }

/* ── Foundation-compat guards ─────────────────────────────────
   foundation.css styles bare <label> as an uppercase muted form-field
   label and gives every input width:100%. Time uses <label> as a
   tappable row wrapper in the add-workers checklist — reset those so
   the rows read as body text. (Same fix Office needed for .emp-row.) */
label.checklist-row {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 400;
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* ── App header ───────────────────────────────────────────── */
.app-header {
  background: var(--header-bg);
  color: #fff;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  /* subtle brightness boost so the mark reads well on dark bg */
  filter: brightness(1.15);
}
.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.header-title span {
  font-weight: 400;
  color: #8aab94;
}
.app-header .header-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: #4a7a58;
  margin-top: 1px;
  line-height: 1;
}
.header-company {
  font-size: 0.7rem;
  font-weight: 600;
  color: #8aab94;
  margin-top: 2px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.header-right a { color: #8aab94; font-size: 0.82rem; font-weight: 600; }
.header-right a:hover { color: #d4ead9; }

/* ── Bottom nav ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  gap: 3px;
  min-height: var(--tap);
  text-decoration: none;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* ── Page content ─────────────────────────────────────────── */
.page { padding: 16px; max-width: 600px; margin: 0 auto; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: #f9fbfa;
}
.card-body { padding: 14px 16px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
  height: var(--tap);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:active { opacity: 0.85; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 2px 8px rgba(45,107,58,0.3); }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-outline   { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-full      { width: 100%; }
.btn-sm        { height: 36px; padding: 0 14px; font-size: 0.82rem; border-radius: 8px; }

/* ── Form controls ────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.form-control {
  width: 100%;
  height: var(--tap);
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,107,58,0.15);
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238aab94' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash-list { list-style: none; padding: 0 16px; margin-top: 12px; }
.flash-list li {
  padding: 11px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--accent-light);
  color: #1a5c2a;
  border: 1px solid var(--accent-border);
}

/* ── Week cards (dashboard / weeks page) ──────────────────── */
.week-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.week-card:active { background: var(--bg); }
.week-label { font-weight: 700; font-size: 1rem; }
.week-sub   { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-gray     { background: #f1f5f2; color: #3d5c47; }
.badge-amber    { background: #fef3c7; color: #92400e; }
.badge-green    { background: var(--accent-light); color: #1a5c2a; }
.badge-blue     { background: #dbeafe; color: #1e40af; }

/* ── Crew list ────────────────────────────────────────────── */
.crew-list { list-style: none; }
.crew-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.crew-item:last-child { border-bottom: none; }
.crew-item:active { background: var(--bg); }
.crew-name  { font-weight: 600; font-size: 0.95rem; }
.crew-meta  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.crew-arrow { color: var(--text-muted); font-size: 1.2rem; }

/* ── Entry page ───────────────────────────────────────────── */
.emp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.emp-nav a { color: var(--accent); font-weight: 600; padding: 8px 4px; }
.emp-nav .emp-counter { color: var(--text-muted); font-size: 0.8rem; }

.day-row {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.day-row:last-child { border-bottom: none; }
.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.day-label {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 90px;
}
.day-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.day-inputs {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.day-inputs .input-group { flex: 1; min-width: 100px; }
.day-inputs label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 4px;
}
.day-inputs input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-ui);
}
.day-inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,107,58,0.15);
}

.override-toggle {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 8px;
  display: inline-block;
  cursor: pointer;
  font-weight: 600;
}
.override-fields {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.override-fields select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

/* ── Save bar (sticky bottom) ─────────────────────────────── */
.save-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.save-bar .btn { flex: 1; }

/* ── Review page ──────────────────────────────────────────── */
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.review-row:last-child { border-bottom: none; }
.review-row.warning { background: #fffbeb; }
.review-hours { font-weight: 700; color: var(--accent); }
.review-warning { color: var(--amber); font-size: 0.78rem; }

/* ── Admin tables ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f9fbfa;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

/* ── Login ────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: #0f1f17;
  position: relative;
}
.login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(45,107,58,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #e8f5eb;
  letter-spacing: -0.04em;
}
.login-logo h1 span { color: #4cba62; }
.login-logo p {
  font-size: 0.82rem;
  color: #6b9a76;
  margin-top: 4px;
  font-weight: 500;
}
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.72rem;
  color: #4a7a58;
  position: relative;
  z-index: 1;
}
.login-logo-img {
  width: 48px; height: 48px; object-fit: contain;
  margin: 0 auto 12px;
}
.login-flash { padding: 0; margin-bottom: 14px; }
.login-alt { margin-top: 16px; text-align: center; }
.login-alt a {
  color: #a7d9b0; font-size: 0.85rem;
  text-decoration: none; font-weight: 600;
}

/* Input overrides inside the dark glass login card */
.login-card .form-group label { color: #6b9a76; }
.login-card .form-control {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #e8f5eb;
}
.login-card .form-control::placeholder { color: #4a7a58; }
.login-card .form-control:focus {
  background: rgba(255,255,255,0.12);
  border-color: #2d6b3a;
  box-shadow: 0 0 0 3px rgba(45,107,58,0.20);
}

/* ── Utilities ────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 16px 16px 6px;
}

/* ─────────────────────────────────────────────────────────────────────
   T1-A — Unified section-head pattern
   Replaces the three different `.section-label` treatments that used
   to coexist (small grey caps in dashboard.html + work_order.html, dark
   green bar in admin/manage.html). Same look + class names as Office /
   HQ foundation.css so T2's foundation migration can drop the
   duplication without re-editing markup.

   Markup pattern:
     <div class="section-head">
       <h2 class="section-title">Today's orders</h2>
       <span class="section-count">3</span>     ← optional
     </div>
   ───────────────────────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  /* Neutralize foundation's gradient-band .section-head — Time uses the
     flat label variant. (foundation loads first; these zero its band.) */
  padding: 0;
  background: transparent;
  border-bottom: none;
}
.section-head:first-child,
.page-pad > .section-head:first-of-type { margin-top: 4px; }
.section-head .section-title {
  /* Reset the legacy .section-title rule above so the head + title
     can stack into one flex row without odd padding. */
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.section-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 9px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   T1-B — App-header overflow menu
   Replaces the inline cluster (EN·ES toggle + Switch + Logout) on the
   header right with a single ⋮ trigger + popover. Reclaims ~150px of
   header width on phone; tap targets stay ≥ 44px.
   ───────────────────────────────────────────────────────────────────── */
.menu-wrap { position: relative; display: inline-block; }
.menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #d4ead9;
  cursor: pointer;
}
.menu-trigger:hover,
.menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}
.menu-trigger svg { width: 20px; height: 20px; }

.menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 200;
  display: none;
}
.menu-popover.open { display: block; }
.menu-popover a,
.menu-popover button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.menu-popover a:hover,
.menu-popover button:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.menu-popover .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 4px;
}
.menu-popover .menu-danger { color: var(--red); }
.menu-popover .menu-danger:hover { background: #fef2f2; color: var(--red); }
.menu-popover .menu-section-title {
  padding: 6px 12px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.menu-popover .menu-lang-row {
  display: flex;
  gap: 6px;
  padding: 4px 8px 8px;
}
.menu-popover .menu-lang-row button {
  flex: 1;
  justify-content: center;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.menu-popover .menu-lang-row button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────
   T1-C — Compact WO header + Scan to Weigh elevation
   Edit Details + Delete buttons move into a small ⋮ menu at the
   corner of the order-header card (admin/lead only, non-approved).
   Scan to Weigh comes OUT of the header card and renders as its own
   dedicated full-width primary action between the header card and the
   Crew section — so a piece-rate foreman's primary action is the most
   visible button on the page.
   ───────────────────────────────────────────────────────────────────── */
.order-header { position: relative; }
.order-header .order-header-menu {
  position: absolute;
  top: 8px;
  right: 8px;
}
.order-header .order-header-menu .menu-trigger {
  color: var(--text-muted);
  width: 36px;
  height: 36px;
}
.order-header .order-header-menu .menu-trigger:hover {
  background: var(--accent-light);
  color: var(--text);
}

.scan-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 18px 18px;
  margin-bottom: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(45, 107, 58, 0.22);
}
.scan-cta:active { background: var(--accent-dark); }
.scan-cta:hover { color: #fff; text-decoration: none; }
.scan-cta svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.95;
}
.scan-cta .scan-cta-sub {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

/* ─────────────────────────────────────────────────────────────────────
   T1-D — Sticky bottom action bar (Save + Submit)
   Replaces the two prior treatments: the in-form "Save hours" button
   buried at the bottom of a long crew, and the .submit-banner Submit
   sticky bar. Now ONE bar pinned just above the bottom nav holds both
   actions. The body's bottom padding bumps to clear both bars.
   ───────────────────────────────────────────────────────────────────── */
.tm-action-bar {
  position: fixed;
  bottom: 56px;             /* sits just above the .bottom-nav */
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  z-index: 90;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  /* Respect the iOS home-indicator safe area on phones with a gesture bar. */
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.tm-action-bar > .btn,
.tm-action-bar .btn-secondary,
.tm-action-bar .btn-submit { flex: 1; min-height: var(--tap); justify-content: center; }
.tm-action-bar .btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.tm-action-bar .btn-secondary:disabled {
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}
.tm-action-bar .btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.tm-action-bar .btn-submit:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
}
.tm-action-bar .btn-submit:active { background: var(--accent-dark); }

/* When the action bar is present the body needs more bottom padding so
   the crew form doesn't slip behind it. CSS :has() makes this automatic
   (no class on <body> needed) on Safari 15.4+ / Chrome 105+ / FF 121+.
   Older browsers fall back to the default 80px clearance which is still
   usable, just tighter against the action bar. */
body:has(.tm-action-bar) { padding-bottom: 148px; }

/* ─────────────────────────────────────────────────────────────────────
   T2 — Shared components (deduped out of per-template <style> blocks)
   These used to be copy-pasted into dashboard.html, work_order.html,
   admin/manage.html, admin/create_order.html, admin/manage_order.html —
   each with slight drift. One definition here; templates carry markup
   only.
   ───────────────────────────────────────────────────────────────────── */

/* Page container — every Time page body. */
.page-pad {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 90px;
}

/* Back link — top of detail/sub pages. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}

/* Status pills — foundation provides the .pill base (inline-flex, small
   caps, fully-rounded). Time adds nowrap + its status variants, colored
   from foundation tokens. */
.pill { white-space: nowrap; flex-shrink: 0; }
.pill-open       { background: #eef0ec;          color: #3d4a3d; }
.pill-submitted  { background: var(--amber-tint); color: var(--amber); }
.pill-approved   { background: var(--green-tint); color: var(--green); }
.pill-unassigned { background: var(--amber-tint); color: var(--amber); }
.pill-foreman    { background: #dbeafe;          color: #1e40af; }
.pill-sm         { font-size: 0.65rem; padding: 2px 8px; }

/* Order cards — dashboard + admin manage lists. */
.order-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.order-card:active { background: var(--bg); }
.order-card.unassigned { border-left: 3px solid var(--amber); }
.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.order-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.order-sub   { font-size: 0.78rem; color: #6b7280; margin-top: 2px; }
.order-meta  {
  font-size: 0.75rem; color: #9ca3af; margin-top: 8px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.order-date-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af; margin-top: 4px;
}

/* Empty state. */
.empty-state {
  background: var(--bg);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Primary page-level CTA (e.g. "+ New work order"). */
.fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 16px;
}
.fab:active { background: var(--accent-dark); }

/* ESTIMATED badge — blue, matches Office's estimated pill tones. */
.badge-est {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Picker kind-filter chips inside the add-to-crew panel. */
.picker-filter { display: flex; width: 100%; margin-bottom: 10px; }
.picker-filter button { flex: 1 1 auto; }

/* NEW worker badge (pending_employees rows in crew lists). */
.badge-temp {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--amber-tint);
  color: var(--amber);
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* App footer — copyright + legal links under page content. */
.app-footer {
  padding: 16px 20px 8px;
  font-size: 0.72rem;
  color: #4a7a58;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.app-footer a { color: inherit; text-decoration: none; }

/* Sandbox banner placement — markup uses foundation's
   .notice.notice-pending.notice-banner; this just floats it inside
   Time's edge-to-edge layout. */
.sandbox-notice { margin: 12px 14px 8px; }

/* Log-a-bug modal internals — the shell is foundation's .modal-overlay
   + .modal-card; these style only the bits foundation doesn't cover. */
.lt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.lt-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted-2);
  padding: 0;
  line-height: 1;
}
.lt-disclosure {
  margin: 10px 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
}
.lt-disclosure summary { cursor: pointer; }
.lt-disclosure ul { margin: 6px 0 0; padding-left: 18px; }
.lt-disclosure p  { margin: 6px 0 0; }
