/* ═══════════════════════════════════════════════
   MOBI — Mobile-first CSS
   Dark theme, 4-tab bottom nav, touch-optimized
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #0a1929;
  color: #e8f0fe;
  font-family: 'DM Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ──────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 100vw;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────── */
.mobi-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 25, 41, 0.97);
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
}

.android-dl-link {
  font-size: 1rem;
  opacity: 0.5;
  color: #6b8aad;
  text-decoration: none;
  padding: 4px 6px;
  flex-shrink: 0;
}
.android-dl-link:hover { opacity: 0.9; }
.desktop-link {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.45;
  color: #6b8aad;
  text-decoration: none;
  padding: 4px 6px;
  flex-shrink: 0;
}

.header-back {
  color: #00d9ff;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 8px;
  margin: -8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #00d9ff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  font-size: 0.75rem;
  color: #6b8aad;
}

/* ── Main scrollable content ────────────────────── */
.mobi-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ── Bottom navigation ──────────────────────────── */
.mobi-nav {
  flex-shrink: 0;
  display: flex;
  background: rgba(8, 20, 35, 0.98);
  border-top: 1px solid rgba(0, 217, 255, 0.15);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0 6px;
  min-height: 56px;
  color: #4a6080;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-item i {
  font-size: 1.25rem;
  line-height: 1;
}

.nav-item.active {
  color: #00d9ff;
}

.nav-item.active i {
  filter: drop-shadow(0 0 5px rgba(0, 217, 255, 0.6));
}

/* Alarm badge on nav tab */
.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  background: #ff4d6d;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  display: none;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: rgba(19, 47, 76, 0.65);
  border: 1px solid rgba(0, 217, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.card:active {
  background: rgba(0, 217, 255, 0.06);
}

.card.alarm {
  border-color: rgba(255, 77, 109, 0.6);
  animation: alarmPulse 2s ease-in-out infinite;
}

@keyframes alarmPulse {
  0%, 100% { border-color: rgba(255, 77, 109, 0.6); }
  50%       { border-color: rgba(255, 77, 109, 1); box-shadow: 0 0 12px rgba(255, 77, 109, 0.4); }
}

/* ── Status dots ────────────────────────────────── */
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green  { background: #00ff88; box-shadow: 0 0 5px rgba(0,255,136,0.7); }
.dot-grey   { background: #3a4a5a; }
.dot-amber  { background: #ffb800; box-shadow: 0 0 5px rgba(255,184,0,0.6); }
.dot-red    { background: #ff4d6d; box-shadow: 0 0 5px rgba(255,77,109,0.7); animation: alarmPulse2 1.2s ease-in-out infinite; }

@keyframes alarmPulse2 {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.badge-active  { background: rgba(0,255,136,0.12); color: #00ff88; border: 1px solid rgba(0,255,136,0.4); }
.badge-rented  { background: rgba(0,217,255,0.12); color: #00d9ff; border: 1px solid rgba(0,217,255,0.4); }
.badge-mtc     { background: rgba(255,184,0,0.12); color: #ffb800; border: 1px solid rgba(255,184,0,0.4); }
.badge-alarm   { background: rgba(255,77,109,0.15); color: #ff4d6d; border: 1px solid rgba(255,77,109,0.5); }
.badge-ended   { background: rgba(74,96,128,0.2); color: #6b8aad; border: 1px solid rgba(74,96,128,0.3); }

/* ── Section labels ─────────────────────────────── */
.section-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a6080;
  padding: 0.75rem 1rem 0.4rem;
}

.alarm-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 77, 109, 0.08);
  border-bottom: 1px solid rgba(255, 77, 109, 0.2);
  color: #ff4d6d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sort toggle ────────────────────────────────── */
.sort-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(8, 20, 35, 0.8);
  border-bottom: 1px solid rgba(0, 217, 255, 0.1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}

.sort-bar::-webkit-scrollbar { display: none; }

.sort-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 217, 255, 0.2);
  background: rgba(19, 47, 76, 0.5);
  color: #6b8aad;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}

.sort-btn.active {
  background: rgba(0, 217, 255, 0.15);
  border-color: rgba(0, 217, 255, 0.5);
  color: #00d9ff;
}

/* ── Status banner (trailer detail) ─────────────── */
.status-banner {
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.status-banner.available   { background: rgba(0,255,136,0.1);  color: #00ff88; border-bottom: 1px solid rgba(0,255,136,0.3); }
.status-banner.rented      { background: rgba(0,217,255,0.1);  color: #00d9ff; border-bottom: 1px solid rgba(0,217,255,0.3); }
.status-banner.maintenance { background: rgba(255,184,0,0.1);  color: #ffb800; border-bottom: 1px solid rgba(255,184,0,0.3); }
.status-banner.alarming    { background: rgba(255,77,109,0.12); color: #ff4d6d; border-bottom: 1px solid rgba(255,77,109,0.4); animation: alarmPulse 1.5s ease-in-out infinite; }

/* ── Info sections (trailer detail) ─────────────── */
.info-section {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.875rem;
}

.info-label { color: #6b8aad; font-size: 0.8rem; }
.info-value { color: #e8f0fe; font-weight: 500; }

/* ── Vitals strip ────────────────────────────────── */
.vitals-strip {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(0, 217, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vitals-strip::-webkit-scrollbar { display: none; }

.vital {
  flex: 1;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.6rem 0.5rem;
  border-right: 1px solid rgba(0, 217, 255, 0.07);
  text-align: center;
}
.vital:last-child { border-right: none; }
.vital-icon  { font-size: 1rem; color: #6b8aad; }
.vital-value { font-size: 0.8rem; font-weight: 600; color: #e8f0fe; }
.vital-label { font-size: 0.6rem; color: #4a6080; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Tap-through row ─────────────────────────────── */
.tap-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
  text-decoration: none;
  color: inherit;
  min-height: 56px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tap-row:active { background: rgba(0, 217, 255, 0.05); }
.tap-row-label { flex: 1; font-size: 0.875rem; color: #c0c8d1; }
.tap-row-value { font-size: 0.875rem; font-weight: 500; color: #e8f0fe; }
.tap-row-icon  { color: #4a6080; font-size: 0.85rem; }
.tap-row.alarm .tap-row-label { color: #ff4d6d; }

/* ── Call button ─────────────────────────────────── */
.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #00ff88;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,255,136,0.3);
  background: rgba(0,255,136,0.08);
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.call-btn:active { background: rgba(0,255,136,0.16); }

/* ── Rental cards (CS list) ─────────────────────── */
.rental-card {
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.08);
  position: relative;
}

.rental-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.rental-name {
  font-size: 1rem;
  font-weight: 600;
  color: #e8f0fe;
  flex: 1;
}

.rental-meta {
  font-size: 0.8rem;
  color: #6b8aad;
  margin-bottom: 0.55rem;
}

.rental-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(0, 217, 255, 0.25);
  background: rgba(19, 47, 76, 0.7);
  color: #00d9ff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.action-btn:active { background: rgba(0, 217, 255, 0.12); }
.action-btn.secondary { color: #6b8aad; border-color: rgba(107,138,173,0.2); }

/* ── Fleet cards (2-col grid) ────────────────────── */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
}

.fleet-card {
  background: rgba(19, 47, 76, 0.65);
  border: 1px solid rgba(0, 217, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
  -webkit-tap-highlight-color: transparent;
}
.fleet-card:active { background: rgba(0, 217, 255, 0.07); }
.fleet-card.alarm  {
  border-color: rgba(255, 77, 109, 0.6);
  animation: alarmPulse 2s ease-in-out infinite;
}

.fleet-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fleet-id {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #e8f0fe;
}

.fleet-coral {
  font-size: 0.7rem;
  color: #6b8aad;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-vitals {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #6b8aad;
  flex-wrap: wrap;
}

.fleet-dist {
  font-size: 0.72rem;
  color: #00d9ff;
  font-weight: 600;
}

/* ── Coral group header ──────────────────────────── */
.coral-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(10, 25, 41, 0.8);
  border-bottom: 1px solid rgba(0, 217, 255, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.coral-group-name { font-size: 0.8rem; font-weight: 700; color: #00d9ff; letter-spacing: 0.05em; }
.coral-group-count { font-size: 0.7rem; color: #4a6080; }

/* ── Customers ───────────────────────────────────── */
.search-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: rgba(8, 20, 35, 0.95);
  border-bottom: 1px solid rgba(0, 217, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(19, 47, 76, 0.7);
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 10px;
  color: #e8f0fe;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.search-input:focus { border-color: rgba(0, 217, 255, 0.6); }
.search-input::placeholder { color: #4a6080; }

.customer-card {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.customer-card:active { background: rgba(0, 217, 255, 0.04); }
.customer-name  { font-size: 0.95rem; font-weight: 600; color: #e8f0fe; margin-bottom: 0.2rem; }
.customer-phone { font-size: 0.82rem; color: #00ff88; margin-bottom: 0.15rem; }
.customer-stats { font-size: 0.75rem; color: #4a6080; }

/* ── Bottom sheet ────────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10, 22, 38, 0.99);
  border-top: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 16px 16px 0 0;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 101;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 36px; height: 4px;
  background: rgba(0, 217, 255, 0.3);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

/* ── Transaction detail panel ────────────────────── */
.txn-panel {
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 1rem 0.75rem;
}

.txn-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(0, 217, 255, 0.05);
  color: #00d9ff;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.txn-toggle:active { background: rgba(0, 217, 255, 0.1); }

.txn-body {
  display: none;
  border-top: 1px solid rgba(0, 217, 255, 0.12);
  background: rgba(8, 20, 35, 0.5);
}
.txn-body.open { display: block; }

.txn-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a6080;
  padding-top: 0.75rem;
  padding-bottom: 0.3rem;
}

.txn-card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.txn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: #6b8aad;
}
.txn-row span:last-child { color: #c0c8d1; }

.txn-refund-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 217, 255, 0.06);
}
.txn-refund-row:last-of-type { border-bottom: none; }

.txn-receipt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px;
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 8px;
  color: #00d9ff;
  background: rgba(0, 217, 255, 0.06);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  width: 100%;
}
.txn-receipt-btn:active { background: rgba(0, 217, 255, 0.12); }

/* ── Refund panel ─────────────────────────────────  */
.refund-panel {
  border: 1px solid rgba(255, 184, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem;
}

.refund-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(255, 184, 0, 0.07);
  color: #ffb800;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.refund-body {
  display: none;
  padding: 1rem;
  gap: 0.75rem;
  flex-direction: column;
  border-top: 1px solid rgba(255, 184, 0, 0.2);
  background: rgba(10, 25, 41, 0.5);
}
.refund-body.open { display: flex; }

.form-label {
  font-size: 0.75rem;
  color: #6b8aad;
  margin-bottom: 0.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-group-label {
  font-size: 0.7rem;
  color: #00d9ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  margin-top: 0.1rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(19, 47, 76, 0.8);
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 8px;
  color: #e8f0fe;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: rgba(0, 217, 255, 0.6); }

.photo-upload-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 10px 12px;
  background: rgba(19, 47, 76, 0.5);
  border: 1px dashed rgba(0, 217, 255, 0.35);
  border-radius: 8px;
  color: #6b8aad;
  font-size: 0.9rem;
  cursor: pointer;
  box-sizing: border-box;
}
.photo-upload-label:active { background: rgba(0, 217, 255, 0.08); }

.tag-coral-row {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 217, 255, 0.07);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 8px;
  color: #6b8aad;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-refund {
  width: 100%;
  padding: 12px;
  background: rgba(255, 184, 0, 0.15);
  border: 1px solid rgba(255, 184, 0, 0.4);
  border-radius: 8px;
  color: #ffb800;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.btn-refund:active { background: rgba(255, 184, 0, 0.25); }
.btn-refund:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Confirm modal ───────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-backdrop.open { display: flex; }

.modal-box {
  background: rgba(10, 22, 38, 0.99);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
}

.modal-title { font-size: 1rem; font-weight: 700; color: #e8f0fe; margin-bottom: 0.5rem; }
.modal-body  { font-size: 0.875rem; color: #6b8aad; margin-bottom: 1.25rem; line-height: 1.5; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-cancel  {
  flex: 1; padding: 11px; border-radius: 8px;
  border: 1px solid rgba(107,138,173,0.3);
  background: transparent; color: #6b8aad;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; min-height: 44px;
}
.btn-confirm {
  flex: 1; padding: 11px; border-radius: 8px;
  border: 1px solid rgba(255, 77, 109, 0.4);
  background: rgba(255, 77, 109, 0.15);
  color: #ff4d6d;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; min-height: 44px;
}
.btn-confirm:active { background: rgba(255, 77, 109, 0.25); }
.btn-confirm.safe {
  border-color: rgba(0,217,255,0.4);
  background: rgba(0,217,255,0.12);
  color: #00d9ff;
}
.btn-confirm.safe:active { background: rgba(0,217,255,0.22); }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(19, 47, 76, 0.95);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e8f0fe;
  z-index: 300;
  opacity: 0;
  transition: all 0.25s ease-out;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.toast.success { border-color: rgba(0,255,136,0.4); color: #00ff88; }
.toast.error   { border-color: rgba(255,77,109,0.4); color: #ff4d6d; }
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Leaflet map container ───────────────────────── */
.map-container {
  width: 100%;
  height: 220px;
  position: relative;
  background: rgba(8, 20, 35, 0.9);
}

.map-no-gps {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: #4a6080;
  font-size: 0.875rem;
}

/* ── Tracker full-height ─────────────────────────── */
.tracker-wrap {
  position: relative;
  height: 100%;
}

#tracker-map {
  position: absolute;
  inset: 0;
}

.tracker-drawer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  max-height: 42vh;
  background: rgba(8, 20, 35, 0.96);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tracker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tracker-row:active { background: rgba(0, 217, 255, 0.05); }
.tracker-row.selected { background: rgba(0, 217, 255, 0.08); border-left: 3px solid #00d9ff; }
.tracker-row.alarm-row { border-left: 3px solid #ff4d6d; background: rgba(255,77,109,0.05); }

.tracker-id   { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 0.9rem; color: #e8f0fe; min-width: 48px; }
.tracker-info { flex: 1; font-size: 0.75rem; color: #6b8aad; }
.tracker-age  { font-size: 0.7rem; color: #4a6080; }

/* ── Empty states ────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  color: #4a6080;
  text-align: center;
}
.empty-state i   { font-size: 2.5rem; opacity: 0.4; }
.empty-state p   { font-size: 0.9rem; line-height: 1.5; }

/* ── Loader ──────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #4a6080;
  font-size: 0.875rem;
  gap: 0.5rem;
}

/* ── Count bar ───────────────────────────────────── */
.count-bar {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  color: #4a6080;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
  background: rgba(8, 20, 35, 0.6);
}

/* ── Actions grid ───────────────────────────────────  */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0.5rem 1rem 0.75rem;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 4px;
  background: rgba(19, 47, 76, 0.6);
  border: 1px solid rgba(0, 217, 255, 0.18);
  border-radius: 10px;
  color: #6b8aad;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  min-height: 64px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.action-tile i { font-size: 1.2rem; }
.action-tile:active { opacity: 0.7; }

.action-tile.tile-green   { color: #00ff88; border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.08); }
.action-tile.tile-amber   { color: #ffb800; border-color: rgba(255,184,0,0.4); background: rgba(255,184,0,0.07); }
.action-tile.tile-danger  { color: #ff4d6d; border-color: rgba(255,77,109,0.3); }
.action-tile.tile-danger:active { background: rgba(255,77,109,0.1); }
.action-tile.tile-pending {
  color: #00d9ff;
  border-color: rgba(0, 217, 255, 0.5);
  background: rgba(0, 217, 255, 0.08);
  animation: pendingPulse 1.2s ease-in-out infinite;
  pointer-events: none; /* prevent double-tap while pending */
}
@keyframes pendingPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Toggle row ─────────────────────────────────────  */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.07);
  gap: 1rem;
}

.toggle-row-label { font-size: 0.875rem; font-weight: 600; color: #e8f0fe; }
.toggle-row-sub   { font-size: 0.72rem; color: #4a6080; margin-top: 2px; }

/* iOS-style toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(74, 96, 128, 0.4);
  border-radius: 13px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle-switch input:checked + .toggle-slider { background: #00AEEF; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Coral picker ────────────────────────────────────  */
.coral-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(0, 217, 255, 0.08);
  cursor: pointer;
  font-size: 0.9rem;
  color: #c0c8d1;
  -webkit-tap-highlight-color: transparent;
}
.coral-pick-row:active { background: rgba(0, 217, 255, 0.05); }
.coral-pick-row.coral-current { color: #00d9ff; font-weight: 600; }

/* ── Job type chips ──────────────────────────────────  */
.job-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 20px;
  background: rgba(19, 47, 76, 0.5);
  color: #6b8aad;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.job-chip input { display: none; }
.job-chip:has(input:checked) {
  background: rgba(0, 174, 239, 0.15);
  border-color: rgba(0, 174, 239, 0.5);
  color: #00AEEF;
}

/* ── Header logo ─────────────────────────────────── */
.header-logo {
  height: 22px;
  width: auto;
  display: block;
  /* Show white parts of the wordmark on dark bg via invert trick */
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

/* ── Login page ──────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #0d2a45 0%, #0a1929 60%);
  padding: 1.5rem;
  gap: 0;
  overflow: hidden;
}

/* Mascot image above card */
.login-mascot-wrap {
  position: relative;
  width: min(280px, 80vw);
  margin-bottom: -24px;
  z-index: 2;
  filter: drop-shadow(0 8px 24px rgba(0, 174, 239, 0.25));
}

.login-mascot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  /* Blend white bg with dark page */
  mix-blend-mode: screen;
  opacity: 0.95;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: rgba(13, 35, 60, 0.92);
  border: 1px solid rgba(0, 174, 239, 0.35);
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 174, 239, 0.1);
}

.login-wordmark {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto 0.75rem;
  /* Make it pop on dark card */
  filter: brightness(0) invert(1);
}

.login-subtitle {
  font-size: 0.8rem;
  color: #6b8aad;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 14px;
  background: rgba(0, 174, 239, 0.12);
  border: 1px solid rgba(0, 174, 239, 0.45);
  border-radius: 12px;
  color: #00AEEF;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 52px;
  transition: all 0.2s;
  box-shadow: 0 0 20px rgba(0, 174, 239, 0.1);
}
.btn-google:active {
  background: rgba(0, 174, 239, 0.22);
  box-shadow: 0 0 30px rgba(0, 174, 239, 0.2);
}

.login-fine-print {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: #3a4a5a;
}
.login-app-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: #00aeef;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.login-app-link:hover { opacity: 1; }
.login-app-download {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 1.25rem;
  text-align: center;
}
.login-app-label {
  font-size: 0.7rem;
  color: #3a4a5a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.btn-download-android {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a2e44;
  color: #a8d8f0;
  border: 1px solid rgba(0,174,239,0.25);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-download-android:hover {
  background: #1e3a56;
  border-color: rgba(0,174,239,0.5);
}

/* ── Utility ─────────────────────────────────────── */
.text-muted  { color: #6b8aad; }
.text-danger { color: #ff4d6d; }
.text-green  { color: #00ff88; }
.text-cyan   { color: #00d9ff; }
.text-amber  { color: #ffb800; }
.fw-bold     { font-weight: 700; }
.mt-1        { margin-top: 0.5rem; }
.p-1         { padding: 1rem; }
.hidden      { display: none !important; }

/* Ensure all interactive elements meet 44px touch target */
button, a, .rental-card, .customer-card, .fleet-card, .tracker-row {
  -webkit-tap-highlight-color: transparent;
}
