/* =============================================
   SMOKESIGNAL STYLES v1.3.5
   Mobile-first. Two equal panels. Always.
   ============================================= */

/* ---------------------------------------------
   RESET + FONTS
   --------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------
   CSS VARIABLES
   --------------------------------------------- */
:root {
  --bg:         #0f0e0c;
  --surface:    #1a1916;
  --border:     #2a2826;
  --orange:     #e85000;
  --orange-lt:  #ff6a1a;
  --text:       #d4d0ca;
  --muted:      #5a5855;
  --dim:        #3a3835;
  --green:      #2d7a3a;
  --amber:      #c8860a;
  --red:        #c0392b;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  --nav-height: 56px;
  --panel-header-height: 48px;
}

/* ---------------------------------------------
   APP SHELL
   --------------------------------------------- */
#app {
  height: 100%;
  width: 100%;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------------------------------------
   TOP NAV
   --------------------------------------------- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--nav-height);
  min-height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-logo span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--orange);
  letter-spacing: 0.08em;
  line-height: 1;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Desktop-only inline nav buttons are now superseded by the always-on hamburger.
   Kept in DOM for backward compat / quick rollback if needed. */
.top-nav-actions .btn { display: none; }

/* Hamburger — always visible across all breakpoints */
.nav-hamburger {
  display: flex;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 10px;
  color: var(--muted);
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
}

.nav-hamburger:hover {
  border-color: var(--orange);
  background: rgba(232, 80, 0, 0.08);
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--muted);
  border-radius: 1px;
}

/* Nav menu dropdown — right-aligned, compact, works on all breakpoints */
.nav-menu {
  display: none;
  position: absolute;
  top: calc(var(--nav-height) - 2px);
  right: 12px;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 110;
  flex-direction: column;
  overflow: hidden;
}

.nav-menu.open {
  display: flex;
}

.nav-menu-item {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  touch-action: manipulation;
}

.nav-menu-item:last-child { border-bottom: none; }
.nav-menu-item:hover { background: rgba(255,255,255,0.04); }
.nav-menu-item.orange { color: var(--orange); }

/* ---------------------------------------------
   GLOBAL ACTION BAR
   Desktop (>=768px): sticky row below top nav, full width
   Mobile (<768px):   fixed at viewport bottom, safe-area aware
   --------------------------------------------- */
.global-action-bar {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.global-action-btn {
  flex: 1;
  min-height: 48px;
  padding: 12px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 500;
  background: var(--orange);
  color: var(--bg);
  border: none;
  border-radius: 0;
  text-transform: uppercase;
  touch-action: manipulation;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.global-action-btn:hover {
  opacity: 0.85;
}

.global-action-btn:active {
  opacity: 0.7;
}

.global-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------------------------------------
   MAIN CONTENT — TWO EQUAL PANELS
   --------------------------------------------- */
.app-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Panel headers */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--panel-header-height);
  min-height: var(--panel-header-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
}

/* ---------------------------------------------
   MANPOWER PANEL — LEFT 50%
   --------------------------------------------- */
.manpower-panel {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.manpower-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Crew member row — tappable */
.crew-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

.crew-row:hover,
.crew-row:active {
  background: rgba(255,255,255,0.03);
}

.crew-row.dragging {
  opacity: 0.4;
  background: rgba(232,80,0,0.05);
}

/* Feature: greyed-out when assigned AND dispatched */
.crew-row.crew-row-dispatched {
  opacity: 0.38;
}
.crew-row.crew-row-dispatched .crew-row-name {
  color: var(--muted);
}

/* "WHERE TO?" separator within trade sections */
.trade-where-to {
  font-size: 9px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--orange);
  letter-spacing: 0.1em;
  padding: 6px 16px 2px;
  opacity: 0.7;
}

.crew-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.crew-row-name {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.crew-row-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-row-sub.pending { color: var(--amber); }
.crew-row-sub.notified { color: var(--muted); }
.crew-row-sub.unassigned { color: var(--green); }

/* Trade section headers in manpower */
.trade-section-header {
  padding: 8px 16px 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ---------------------------------------------
   STATUS DOTS
   --------------------------------------------- */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 8px;
}

.status-dot.available { background: var(--green); }
.status-dot.assigned  { background: var(--orange); }
.status-dot.pending   { background: var(--amber); }

/* ---------------------------------------------
   JOBS PANEL — RIGHT 50%
   --------------------------------------------- */
.jobs-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.jobs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: var(--panel-header-height);
  min-height: var(--panel-header-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.jobs-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------------------------------------------
   JOB CARDS
   --------------------------------------------- */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

.job-card:active {
  background: rgba(255,255,255,0.02);
}

.job-card.selected {
  border-color: var(--orange);
}

.job-card.drop-target {
  border-color: var(--orange);
  background: rgba(232,80,0,0.08);
}

.job-card.pending-border {
  border-color: var(--amber);
}

.job-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-card-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ---------------------------------------------
   TABS
   --------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab:hover { color: var(--text); border-color: var(--muted); }
.tab.active {
  background: var(--orange);
  color: var(--bg);
  border-color: var(--orange);
}

/* ---------------------------------------------
   BADGES
   --------------------------------------------- */
.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
  background: var(--bg);
  white-space: nowrap;
}

.badge.draft     { color: var(--dim);    border-color: var(--dim); }
.badge.scheduled { color: var(--green);  border-color: var(--green); }
.badge.active    { color: var(--orange); border-color: var(--orange); }
.badge.completed { color: var(--muted);  border-color: var(--muted); }
.badge.pending   { color: var(--amber);  border-color: var(--amber); }

/* ---------------------------------------------
   JOB FULLSCREEN (mobile tap)
   --------------------------------------------- */
.job-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.job-fullscreen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.job-fullscreen-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--orange);
  padding: 4px;
  display: flex;
  align-items: center;
}

.job-fullscreen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.job-fullscreen-footer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 8px;
  /* Safari's expanding bottom toolbar isn't reflected in safe-area-inset.
     Add small buffer past the home-indicator inset so toolbar can't
     cover the bottom row of buttons. */
  padding-bottom: max(10px, calc(env(safe-area-inset-bottom) + 4px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------------------------------------------
   EXPANDED PANEL (tablet/desktop in-place)
   --------------------------------------------- */
.job-expanded {
  background: var(--surface);
  border: 1px solid var(--orange);
  border-top: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expanded-trade-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

.expanded-crew-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 6px;
}

.expanded-crew-row.unassigned {
  background: transparent;
  border-style: dashed;
}

.expanded-crew-row.needs-dispatch {
  background: #1a0e00;
  border-color: var(--amber);
}

.expanded-crew-name {
  font-size: 14px;
  color: var(--text);
}

.expanded-crew-name.unassigned {
  color: var(--muted);
}

/* ---------------------------------------------
   ASSIGNMENT PICKER (bottom sheet)
   --------------------------------------------- */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  z-index: 91;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.bottom-sheet-header {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-sheet-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0.05em;
}

.bottom-sheet-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-family: 'IBM Plex Mono', monospace;
}

.bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.1s;
}

.picker-option:hover,
.picker-option:active {
  background: rgba(255,255,255,0.03);
}

.picker-option.selected {
  background: rgba(232,80,0,0.08);
}

.picker-option-label {
  font-size: 15px;
  color: var(--text);
}

.picker-option-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 2px;
}

.picker-option-check {
  color: var(--orange);
  font-size: 18px;
  flex-shrink: 0;
}

.bottom-sheet-footer {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------------------------------------------
   DRAWER
   --------------------------------------------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 55;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(480px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--orange);
  letter-spacing: 0.05em;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-footer {
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------------------------------------------
   FORMS
   --------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field { flex: 1; }

input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text);
  font-size: 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--orange);
}

input::placeholder, textarea::placeholder {
  color: var(--dim);
}

textarea { resize: none; }

select option {
  background: var(--surface);
  color: var(--text);
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
  color: var(--text);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

input[type="file"] {
  padding: 12px;
  cursor: pointer;
}

.label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.error-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--orange);
  min-height: 16px;
}

/* ---------------------------------------------
   BUTTONS
   --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  min-height: 44px;
  touch-action: manipulation;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--orange);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) { background: var(--orange-lt); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: white; }

.btn-amber {
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
}

.btn-lg {
  width: 100%;
  padding: 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  border-radius: var(--radius-lg);
}

/* Tight modifier — for buttons that sit inside cramped panel headers
   alongside tabs/labels. Smaller than default .btn but still tappable. */
.btn-tight {
  padding: 7px 12px;
  font-size: 11px;
  min-height: 36px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-icon:hover { color: var(--text); }

/* ---------------------------------------------
   EMPTY STATES
   --------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  gap: 12px;
  color: var(--dim);
  padding: 24px;
  text-align: center;
}

.empty-state p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------------------------------------
   DIVIDER
   --------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  width: 100%;
  flex-shrink: 0;
}

/* ---------------------------------------------
   AUTH PAGE
   --------------------------------------------- */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.auth-logo h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  color: var(--orange);
  line-height: 1;
  letter-spacing: 0.08em;
}

.auth-logo p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-footer {
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--dim);
}

/* ---------------------------------------------
   CREW LIST PAGE
   --------------------------------------------- */
.crew-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.crew-list-row:hover { border-color: var(--muted); }

/* ---------------------------------------------
   CREW METHOD TABS
   --------------------------------------------- */
.crew-method-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.crew-method-tab {
  flex: 1;
  padding: 12px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

.crew-method-tab.active {
  border-bottom-color: var(--orange);
  color: var(--text);
}

/* ---------------------------------------------
   SCROLLBAR
   --------------------------------------------- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------------------------------------------
   TYPOGRAPHY HELPERS
   --------------------------------------------- */
.font-brand {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
}

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

/* ---------------------------------------------
   TABLET — 768px and up
   Widen panels, show more info
   --------------------------------------------- */
@media (min-width: 768px) {
  :root {
    --nav-height: 60px;
    --panel-header-height: 52px;
  }

  .top-nav-logo span { font-size: 28px; }

  .manpower-panel { width: 280px; }

  .job-card-title { font-size: 20px; }
  .crew-row-name { font-size: 15px; }

  .tab { font-size: 11px; padding: 8px 14px; }
  .btn { font-size: 13px; padding: 9px 16px; }
  .drawer-title { font-size: 32px; }
}

/* ---------------------------------------------
   MOBILE — under 768px
   50/50 split, hamburger nav, full-screen actions
   --------------------------------------------- */
@media (max-width: 767px) {
  /* 50/50 split — both panels equal */
  .manpower-panel {
    width: 50%;
    min-width: 0;
  }

  /* Smaller text to fit 50% */
  .crew-row { padding: 10px 10px; }
  .crew-row-name { font-size: 13px; }
  .crew-row-sub { font-size: 10px; }
  .trade-section-header { font-size: 9px; padding: 6px 10px 3px; }

  /* Simplified job cards */
  .job-card { padding: 12px; }
  .job-card-title { font-size: 15px; }
  .job-card-meta { font-size: 11px; }
  .jobs-list { padding: 8px; gap: 8px; }

  /* Tabs smaller */
  .tab { font-size: 9px; padding: 5px 8px; letter-spacing: 0.05em; }

  /* Drawers full screen on mobile */
  .drawer {
    width: 100vw;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  /* Panel header — slightly taller on mobile so btn-tight buttons
     have proper top/bottom padding rather than sitting flush. */
  .panel-header {
    padding: 0 12px;
    height: 50px;
    min-height: 50px;
  }
  .panel-header-title { font-size: 10px; }
  .jobs-panel-header { padding: 0 12px; height: 50px; min-height: 50px; }

  /* Global action bar: fixed to viewport bottom on mobile.
     Uses dvh-aware positioning so Safari's expanding/collapsing
     bottom toolbar doesn't cover the buttons. */
  .global-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* 3px on top/sides matches desktop. Bottom adds safe-area inset
       (home indicator) + 3px so visual padding still reads as 3px above
       the home indicator strip. iOS does NOT include Safari's expanding
       toolbar in this inset, so app-shell's 100dvh handles that case. */
    padding: 3px 3px calc(env(safe-area-inset-bottom) + 3px) 3px;
    border-top: 1px solid var(--border);
    border-bottom: none;
    background: var(--border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    z-index: 50;
  }

  /* Reserve space at end of panel content so list bottom doesn't hide
     under the fixed action bar OR Safari's bottom toolbar.
     Worst-case stack: action bar (60px w/ 3px padding) + Safari toolbar
     (44px collapsed) + tap-zone buffer = 146px + safe-area inset. */
  .manpower-list,
  .jobs-list {
    padding-bottom: calc(146px + env(safe-area-inset-bottom));
  }
}
/* =============================================
   LEGAL — consent text, links, modal
   ============================================= */

/* Clickwrap consent line on login form */
.auth-consent {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--dim);
  text-align: center;
  line-height: 1.6;
  margin-top: -8px;
}

/* Inline text button for legal links — looks like a link, acts like a button */
.legal-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--orange);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.legal-link:hover {
  text-decoration-color: var(--orange);
}

/* Loading spinner — used on email-verified landing */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Settings page legal footer */
.settings-legal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.settings-legal-links {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.settings-legal-links .legal-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

/* Legal modal overlay */
.legal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 900;
  backdrop-filter: blur(2px);
}

/* Legal modal panel */
.legal-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 901;
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 700px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.legal-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.legal-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text);
}

.legal-modal-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

/* Scrollable body */
.legal-modal-body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-section-heading {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legal-section-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.legal-modal-footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--dim);
  text-align: center;
}

/* Mobile: modal goes nearly full screen */
@media (max-width: 480px) {
  .legal-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 85vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

/* =============================================
   CREW PAGE HEADER
   Matches the dashboard panel header pattern
   ============================================= */
.crew-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.crew-page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--text);
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Force orange — matches + JOB button in dashboard panel header */
.crew-add-btn {
  background: var(--orange) !important;
  color: var(--bg) !important;
  border: none !important;
  font-size: 12px;
  padding: 8px 16px;
}
.crew-add-btn:hover:not(:disabled) {
  background: var(--orange-lt) !important;
}

/* Mobile crew add dropdown */
.fs-add-select option {
  background: var(--surface);
  color: var(--text);
}
.fs-add-select:focus {
  outline: none;
  border-color: var(--orange);
  border-style: solid;
}

/* ---------------------------------------------
   TRUCKER NOTE SHEET — full screen on mobile
   Uses dvh so iOS keyboard shrinks the viewport
   and the textarea stays visible above it.
   --------------------------------------------- */
.note-sheet-full {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  background: var(--bg);
  z-index: 71;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.note-sheet-full .bottom-sheet-handle { display: none; }

.note-sheet-full .bottom-sheet-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.note-sheet-full .bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.note-sheet-full .bottom-sheet-footer {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

#trucker-note-text {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  resize: none;
  min-height: 120px;
  -webkit-text-size-adjust: 100%;
}

#trucker-note-text:focus {
  outline: none;
  border-color: var(--orange);
}