/* ============================================================
   Hotshots Australia Driver Portal — App Styles
   Mobile-first, max-width 420px
   Primary: #1F3864  Success: #2E7D32  Danger: #C0392B
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1F3864;
  --primary-dark:  #152843;
  --primary-light: #2a4a80;
  --success:       #2E7D32;
  --success-light: #E8F5E9;
  --danger:        #C0392B;
  --danger-light:  #FDECEA;
  --warning:       #E65100;
  --warning-light: #FFF3E0;
  --info:          #0277BD;
  --info-light:    #E1F5FE;
  --text:          #1A1A1A;
  --text-secondary:#555;
  --text-muted:    #888;
  --border:        #DDE3EC;
  --bg:            #F4F6FA;
  --bg-card:       #FFFFFF;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(31,56,100,0.10);
  --shadow-sm:     0 1px 4px rgba(31,56,100,0.08);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --header-h:      56px;
  --nav-h:         64px;
  --offline-h:     0px;
}

html {
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Screen ─────────────────────────────────────────── */
.login-body {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

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

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

.login-form-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer a { color: var(--primary); }

.input-with-toggle {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
}

/* ── App Shell ────────────────────────────────────────────── */
.app-body {
  background: var(--bg);
  min-height: 100dvh;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--primary);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(31,56,100,0.3);
}

.app-header-inner {
  max-width: 420px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.app-header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-back-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

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

.header-icon-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}

.app-main {
  max-width: 420px;
  margin: 0 auto;
  padding-top: calc(var(--header-h) + var(--offline-h) + 16px);
  padding-bottom: calc(var(--nav-h) + 16px);
  padding-left: 16px;
  padding-right: 16px;
  min-height: 100dvh;
}

/* When offline banner is showing */
body.is-offline .app-main {
  --offline-h: 40px;
}

/* ── Bottom Navigation ────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(31,56,100,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color 0.15s;
  min-height: 44px;
}

.bottom-nav-btn.active { color: var(--primary); }
.bottom-nav-btn.active svg { stroke: var(--primary); }

/* ── Offline Banner ───────────────────────────────────────── */
.offline-banner {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 40px;
  background: var(--warning);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 99;
}

/* Login offline banner: static */
.login-body .offline-banner {
  position: static;
  border-radius: 8px;
  margin-top: 12px;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toast-in 0.25s ease;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }

.toast-offline {
  background: var(--warning);
  color: #fff;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Screen Loading ───────────────────────────────────────── */
.screen-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Job Cards ────────────────────────────────────────────── */
.job-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  border-left: 4px solid var(--primary);
  -webkit-tap-highlight-color: transparent;
}

.job-card:active { transform: scale(0.99); }
.job-card.completed { border-left-color: var(--success); opacity: 0.8; }

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.job-hs-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.job-qb-number {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.job-customer {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.job-route {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-awaiting  { background: var(--warning-light); color: var(--warning); }
.badge-transit   { background: var(--info-light);    color: var(--info); }
.badge-delivered { background: var(--success-light); color: var(--success); }
.badge-draft     { background: var(--bg);            color: var(--text-muted); border: 1px solid var(--border); }
.badge-flat-fee  { background: #F3E5F5;              color: #6A1B9A; }

/* ── Section Headers ──────────────────────────────────────── */
.section-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,56,100,0.12);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--bg);
  color: var(--text-secondary);
  cursor: default;
}

.form-control.is-invalid { border-color: var(--danger); }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.form-control.is-invalid + .form-error,
.form-control.is-invalid ~ .form-error { display: block; }

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='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-control-lg {
  padding: 16px 18px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
}

/* ── Toggle / Con Note Type ───────────────────────────────── */
.toggle-group {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
}

.toggle-option {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  border: none;
  background: none;
  transition: background 0.15s, color 0.15s;
}

.toggle-option.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── Reason Buttons (Delay) ───────────────────────────────── */
.reason-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reason-btn {
  padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  text-align: center;
}

.reason-btn:active { transform: scale(0.97); }

.reason-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

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

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #245F27; }

.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #9b2e20; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  font-weight: 500;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-lg { padding: 15px 24px; font-size: 16px; min-height: 54px; }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; }
.btn-block { width: 100%; }

.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Add Item Button ──────────────────────────────────────── */
.btn-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-sm);
  background: rgba(31,56,100,0.04);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
}

/* ── Stop Block ───────────────────────────────────────────── */
.stop-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  position: relative;
}

.stop-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stop-block-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stop-remove-btn {
  background: var(--danger-light);
  border: none;
  color: var(--danger);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
}

/* ── Photos Section ───────────────────────────────────────── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
}

.photo-add-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px dashed var(--primary);
  background: rgba(31,56,100,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  position: relative;
}

.photo-add-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ── Signature Pad ────────────────────────────────────────── */
.signature-container {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  position: relative;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 120px;
  cursor: crosshair;
  touch-action: none;
}

.signature-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.signature-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.signature-clear-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.signature-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding: 8px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 0 0 20px 0;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 14px;
}

.timeline-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.timeline-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(31,56,100,0.15);
}

.timeline-dot.pending {
  background: #fff;
  border-color: var(--border);
  color: var(--text-muted);
}

.timeline-content { flex: 1; padding-top: 6px; }

.timeline-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.timeline-label.muted { color: var(--text-muted); font-weight: 400; }

.timeline-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Calculation Box ──────────────────────────────────────── */
.calc-box {
  background: var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: #fff;
  margin-bottom: 20px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}

.calc-row.total {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
}

.calc-label { opacity: 0.85; }

/* ── Invoice Table ────────────────────────────────────────── */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}

.invoice-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invoice-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.invoice-table tr:last-child td { border-bottom: none; }
.invoice-table tr:nth-child(even) td { background: var(--bg); }

.invoice-totals {
  margin-top: 8px;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.invoice-total-row:last-child {
  border-bottom: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  padding-top: 12px;
}

/* ── Job Header ───────────────────────────────────────────── */
.job-header-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.job-header-hs {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}

.job-header-qb {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.job-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-danger   { background: var(--danger-light);  color: var(--danger); }
.alert-success  { background: var(--success-light); color: var(--success); }
.alert-warning  { background: var(--warning-light); color: var(--warning); }
.alert-info     { background: var(--info-light);    color: var(--info); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Pull to Refresh ──────────────────────────────────────── */
.pull-to-refresh {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

/* ── Floating Action Button ───────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31,56,100,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 50;
  transition: transform 0.15s;
}

.fab:active { transform: scale(0.93); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Depot screen ─────────────────────────────────────────── */
.depot-hero {
  text-align: center;
  padding: 24px 0 16px;
}

.depot-hero-icon { font-size: 56px; margin-bottom: 12px; }

.depot-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.depot-hero p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Invoice Preview ──────────────────────────────────────── */
.invoice-preview {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.invoice-preview-header {
  background: var(--primary);
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.invoice-preview-from { font-size: 13px; }
.invoice-preview-from strong { display: block; font-size: 16px; margin-bottom: 4px; }

.invoice-no-block { text-align: right; }
.invoice-no-block .inv-label { font-size: 11px; text-transform: uppercase; opacity: 0.7; }
.invoice-no-block .inv-number { font-size: 20px; font-weight: 700; }

.invoice-bill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.invoice-bill-cell {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
}

.invoice-bill-cell:first-child {
  border-right: 1px solid var(--border);
}

.invoice-bill-cell strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 700;
}

.invoice-preview-body { padding: 16px; }

.invoice-date-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Sync indicator ───────────────────────────────────────── */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--warning-light);
  color: var(--warning);
}

.sync-badge.synced {
  background: var(--success-light);
  color: var(--success);
}

/* ── Profile toggles ──────────────────────────────────────── */
.toggle-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-switch-row:last-child { border-bottom: none; }

.toggle-switch-label { flex: 1; }
.toggle-switch-label strong { display: block; font-size: 15px; }
.toggle-switch-label span { font-size: 13px; color: var(--text-muted); }

.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch input:checked + .toggle-track { background: var(--success); }

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(22px);
}

/* ── Inline number prefix grid ────────────────────────────── */
.inline-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Sticky action bar ────────────────────────────────────── */
.sticky-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin: 0 -16px;
  display: flex;
  gap: 10px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 480px) {
  .app-header,
  .bottom-nav { max-width: 420px; left: 50%; transform: translateX(-50%); }

  .app-main { left: 50%; }

  .offline-banner { max-width: 420px; left: 50%; transform: translateX(-50%); }

  .toast-container { max-width: 420px; }
}

/* ── Utility ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fade-in 0.2s ease; }
