/* ===================================================================
   Vehicle Fleet Management - Telegram Mini App Theme & Stylesheet
   Designed for Mobile & Telegram WebApp with Khmer Language Support
   =================================================================== */

:root {
  /* Telegram Core Variables fallback */
  --tg-theme-bg-color: #0f172a;
  --tg-theme-secondary-bg-color: #1e293b;
  --tg-theme-text-color: #f8fafc;
  --tg-theme-hint-color: #94a3b8;
  --tg-theme-link-color: #38bdf8;
  --tg-theme-button-color: #2563eb;
  --tg-theme-button-text-color: #ffffff;

  /* Custom App Palette */
  --primary-50: #eff6ff;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;

  /* Dark Theme Surfaces */
  --surface-bg: #0b0f19;
  --surface-card: #131b2e;
  --surface-card-subtle: #1c2640;
  --surface-card-hover: #222f4c;
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-focus: #3b82f6;

  /* Typography */
  --font-khmer: 'Kantumruy Pro', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-en: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-rose: 0 0 20px rgba(244, 63, 94, 0.3);
}

/* Light Theme overrides when Telegram is in light mode */
body.tg-light {
  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-card-subtle: #f1f5f9;
  --surface-card-hover: #e2e8f0;
  --surface-border: rgba(0, 0, 0, 0.08);
  --tg-theme-text-color: #0f172a;
  --tg-theme-hint-color: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-khmer);
  background-color: var(--surface-bg);
  color: var(--tg-theme-text-color);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

/* App Outer Shell */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-bg);
  position: relative;
  padding-bottom: 24px;
}

/* ===================================================================
   Header & User Profile Badge
   =================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(19, 27, 46, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-border);
  transition: all 0.2s ease;
}

.user-profile-badge:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.08);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-500), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.avatar-circle i {
  width: 18px;
  height: 18px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plate-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  color: var(--tg-theme-text-color);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:active {
  transform: scale(0.92);
}

/* ===================================================================
   Main Content & Tab Transitions
   =================================================================== */
.main-content {
  flex: 1;
  padding: 16px;
}

.tab-view {
  display: none;
  animation: fadeInSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-view.active {
  display: block;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.page-title-bar h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--tg-theme-text-color);
}

.back-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--tg-theme-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.back-circle-btn:active {
  transform: scale(0.92);
  background: var(--surface-card-hover);
}

/* ===================================================================
   Welcome Hero Banner
   =================================================================== */
.welcome-hero {
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 50%, #0f172a 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-subtitle {
  font-size: 12.5px;
  color: #93c5fd;
  display: block;
  margin-bottom: 4px;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.hero-car-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.hero-icon-graphic {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}

/* ===================================================================
   Services Grid
   =================================================================== */
.section-title {
  margin-bottom: 12px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.service-card {
  display: flex;
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:active {
  transform: scale(0.98);
  background: var(--surface-card-hover);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-fuel .card-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.card-mileage .card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.card-repair .card-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-500);
}

.card-fuelcard .card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
}

.card-insurance .card-icon {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.card-vehicle .card-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.card-text {
  flex: 1;
}

.card-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  margin-bottom: 2px;
}

.card-text p {
  font-size: 12.5px;
  color: var(--tg-theme-hint-color);
}

.arrow-icon {
  color: var(--tg-theme-hint-color);
  opacity: 0.6;
}

/* ===================================================================
   Recent Activity History
   =================================================================== */
.recent-section {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

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

.section-header-flex h3 {
  font-size: 15px;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--tg-theme-link-color);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  text-align: center;
  padding: 24px 0;
  color: var(--tg-theme-hint-color);
}

.empty-state i {
  width: 32px;
  height: 32px;
  opacity: 0.5;
  margin-bottom: 6px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--surface-border);
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.act-tag.fuel { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.act-tag.mileage { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.act-tag.repair { background: rgba(59, 130, 246, 0.2); color: var(--primary-500); }
.act-tag.card { background: rgba(99, 102, 241, 0.2); color: var(--accent-indigo); }
.act-tag.accident { background: rgba(244, 63, 94, 0.2); color: var(--accent-rose); }

.act-info {
  display: flex;
  flex-direction: column;
}

.act-title {
  font-size: 13.5px;
  font-weight: 600;
}

.act-time {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
}

.act-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tg-theme-text-color);
}

/* ===================================================================
   Form Containers, Inputs, Buttons
   =================================================================== */
.form-container {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.form-info-box {
  display: flex;
  gap: 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #bfdbfe;
  font-size: 12.5px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.form-info-box i {
  width: 20px;
  height: 20px;
  color: var(--tg-theme-link-color);
  flex-shrink: 0;
}

.alert-banner {
  display: flex;
  gap: 12px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  color: #fecdd3;
  margin-bottom: 18px;
}

.alert-banner i {
  color: var(--accent-rose);
  flex-shrink: 0;
}

.autofill-banner {
  display: flex;
  justify-content: space-between;
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.banner-item {
  display: flex;
  flex-direction: column;
}

.banner-item .lbl {
  font-size: 11.5px;
  color: var(--tg-theme-hint-color);
}

.banner-item .val {
  font-size: 14px;
  color: var(--tg-theme-text-color);
}

.banner-item .val.highlight {
  color: var(--accent-amber);
  font-weight: 700;
}

.form-group {
  margin-bottom: 16px;
}

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

.required {
  color: var(--accent-rose);
}

.form-helper {
  display: block;
  font-size: 11.5px;
  color: var(--tg-theme-hint-color);
  margin-top: 4px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--tg-theme-hint-color);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  background: var(--surface-card-subtle);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  font-size: 14.5px;
  font-family: var(--font-khmer);
  color: var(--tg-theme-text-color);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--surface-border-focus);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control::placeholder {
  color: var(--tg-theme-hint-color);
  opacity: 0.6;
}

.text-uppercase {
  text-transform: uppercase;
}

textarea.form-control {
  padding-left: 14px;
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  appearance: none;
  cursor: pointer;
}

/* ===================================================================
   Chip Selector & Currency Toggle
   =================================================================== */
.chip-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-item {
  flex: 1;
  cursor: pointer;
}

.chip-item input[type="radio"] {
  display: none;
}

.chip-item span {
  display: block;
  text-align: center;
  padding: 9px 8px;
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  transition: all 0.2s;
}

.chip-item input[type="radio"]:checked + span {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary-500);
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.currency-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.currency-toggle {
  display: flex;
  background: var(--surface-card-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.curr-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--tg-theme-hint-color);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.curr-btn.active {
  background: var(--primary-600);
  color: #ffffff;
}

/* ===================================================================
   Provider Cards (Repair: AVIS, CITYLINK, TOYOTA) & (Card: TOTAL, TELA, N/A)
   =================================================================== */
.provider-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.provider-card {
  cursor: pointer;
}

.provider-card input[type="radio"] {
  display: none;
}

.p-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
  background: var(--surface-card-subtle);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  height: 100%;
}

.provider-card input[type="radio"]:checked + .p-card-inner {
  border-color: var(--primary-500);
  background: rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.provider-cards-grid.single-caught-grid {
  grid-template-columns: 1fr;
}

.provider-card.only-caught .p-card-inner {
  flex-direction: row;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary-500);
  border-width: 2px;
}

.provider-card.only-caught .p-name {
  font-size: 13.5px;
}

.provider-card.only-caught .p-tag {
  font-size: 11px;
  padding: 3px 8px;
}

.p-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.p-tag.avis { background: #dc2626; color: #fff; }
.p-tag.citylink { background: #0284c7; color: #fff; }
.p-tag.toyota { background: #b91c1c; color: #fff; }

.p-tag.total { background: #ea580c; color: #fff; }
.p-tag.tela { background: #16a34a; color: #fff; }
.p-tag.na { background: #64748b; color: #fff; }

.p-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--tg-theme-text-color);
  margin-bottom: 2px;
}

.p-sub {
  font-size: 10px;
  color: var(--tg-theme-hint-color);
}

/* ===================================================================
   Insurance Subviews & Cards
   =================================================================== */
.insurance-tabs-nav {
  display: flex;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.sub-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--tg-theme-hint-color);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.sub-tab-btn.active {
  background: var(--primary-600);
  color: #fff;
}

.sub-tab-btn.alert-sub.active {
  background: var(--accent-rose);
  color: #fff;
}

.subview {
  display: none;
}

.subview.active {
  display: block;
}

.insurance-card-banner {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(6, 78, 59, 0.25);
}

.ins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ins-badge {
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.ins-icon {
  color: #34d399;
}

.ins-company {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
}

.ins-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.fleet-admin-contact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fleet-admin-contact-bar:active {
  transform: scale(0.98);
  background: rgba(2, 132, 199, 0.25);
}

.contact-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-left i {
  width: 20px;
  height: 20px;
  color: #38bdf8;
}

.contact-text {
  display: flex;
  flex-direction: column;
}

.contact-text .c-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.contact-text .c-sub {
  font-size: 11px;
  color: #7dd3fc;
  font-weight: 600;
}

.btn-chat-pill {
  background: #0284c7;
  color: #fff;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  pointer-events: none;
}

.tg-direct-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.tg-direct-chip i {
  width: 12px;
  height: 12px;
}

.tg-contact-highlight {
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.tg-chat-btn-action {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.btn-tg-direct {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  pointer-events: none; /* allows outer card click to handle smoothly */
}

.btn-tg-direct i {
  width: 16px;
  height: 16px;
}

.hotline-btn.tg-hotline {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.35);
}

.hotline-btn.tg-hotline .hotline-name {
  color: #38bdf8;
}

.hotline-btn.tg-hotline .hotline-num {
  color: #7dd3fc;
}

.emergency-box {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.emergency-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent-rose);
}

.emergency-title h4 {
  font-size: 14px;
  font-weight: 700;
}

.hotline-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hotline-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--tg-theme-text-color);
  transition: all 0.2s;
}

.hotline-btn:active {
  background: var(--surface-card-hover);
  transform: scale(0.98);
}

.hotline-name {
  font-size: 13px;
  font-weight: 600;
}

.hotline-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.instruction-box {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 12.5px;
}

.instruction-box h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.instruction-box ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--tg-theme-hint-color);
}

/* ===================================================================
   Vehicle Info Card
   =================================================================== */
.search-bar-plate {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.vehicle-detail-card {
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.veh-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.veh-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.veh-plate-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.veh-status-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.veh-status-chip.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.veh-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-item.full-col {
  grid-column: span 2;
}

.spec-item .lbl {
  font-size: 11.5px;
  color: var(--tg-theme-hint-color);
}

.spec-item .val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
}

.veh-maintenance-box {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.maint-item {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.maint-item .lbl {
  color: var(--tg-theme-hint-color);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.maint-item strong {
  font-size: 14px;
  color: var(--primary-500);
}

/* ===================================================================
   Live Request Statuses & Vehicle History Timeline
   =================================================================== */
.vehicle-history-section {
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-with-icon h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.title-with-icon i {
  width: 18px;
  height: 18px;
}

.active-count-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 1px 7px;
  border-radius: 12px;
}

.btn-refresh-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
  color: var(--tg-theme-hint-color);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-sm i {
  width: 14px;
  height: 14px;
}

.btn-refresh-sm.spinning i {
  animation: spinSlow 0.8s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-refresh-sm:active {
  transform: scale(0.92);
  color: #fff;
}

/* Live Request Status Cards */
.veh-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.veh-status-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.veh-status-card.approved { border-left-color: var(--accent-emerald); }
.veh-status-card.in-progress { border-left-color: #38bdf8; }
.veh-status-card.completed { border-left-color: #a855f7; }
.veh-status-card.rejected { border-left-color: var(--accent-rose); }

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-tag {
  font-family: monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.status-badge-chip.pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge-chip.approved { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-badge-chip.in-progress { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-badge-chip.completed { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.status-badge-chip.rejected { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

.card-main-row {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.card-sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--tg-theme-hint-color);
}

/* History Chips */
.history-chip-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.h-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  color: var(--tg-theme-hint-color);
  font-family: var(--font-khmer);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.h-chip.active {
  background: var(--primary-600);
  border-color: var(--primary-500);
  color: #fff;
}

/* History Timeline List */
.veh-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

.veh-timeline-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--primary-500);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.veh-timeline-item.fuel { border-left-color: #34d399; }
.veh-timeline-item.mileage { border-left-color: #38bdf8; }
.veh-timeline-item.repair { border-left-color: #fbbf24; }
.veh-timeline-item.card { border-left-color: #c084fc; }
.veh-timeline-item.accident { border-left-color: #fb7185; }

.tl-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-title {
  font-weight: 700;
  color: #fff;
  font-size: 12.5px;
}

.tl-sub {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
}

.tl-right {
  text-align: right;
}

.tl-val {
  font-weight: 700;
  color: #fff;
}

.text-cyan { color: #38bdf8 !important; }
.text-amber { color: #fbbf24 !important; }

/* ===================================================================
   Buttons & Actions
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-khmer);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #be123c);
  color: #ffffff;
  box-shadow: var(--shadow-glow-rose);
}

.btn-secondary {
  background: var(--surface-card-subtle);
  color: var(--tg-theme-text-color);
  border: 1px solid var(--surface-border);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 20px;
  font-size: 15.5px;
}

.mt-4 {
  margin-top: 18px;
}

/* ===================================================================
   Bottom Navigation Bar
   =================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 68px;
  background: rgba(19, 27, 46, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding: 0 8px;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--tg-theme-hint-color);
  font-size: 11px;
  font-family: var(--font-khmer);
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-item i {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--primary-500);
  font-weight: 700;
}

.nav-item.active i {
  transform: translateY(-2px);
}

/* ===================================================================
   Modal Dialogs & Toggle Switch
   =================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}

input:checked + .slider { background-color: var(--primary-600); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.tg-id-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-card-subtle);
  border: 1px dashed var(--surface-border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  font-size: 12px;
}

.tg-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tg-id-val {
  font-family: var(--font-en);
  font-weight: 700;
  color: var(--tg-theme-link-color);
}

.tg-id-val.device-val {
  color: var(--accent-amber);
  font-size: 11px;
}

.mt-1 {
  margin-top: 4px;
}

/* ===================================================================
   Toast Notifications
   =================================================================== */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 380px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(19, 27, 46, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  animation: slideDownFade 0.3s ease forwards;
  pointer-events: auto;
}

.toast-msg.success { border-color: var(--accent-emerald); }
.toast-msg.error { border-color: var(--accent-rose); }
.toast-msg.info { border-color: var(--primary-500); }

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

.main-content {
  padding-bottom: 24px;
}

/* ===================================================================
   Incident Report Launch Card & Emergency Contacts
   =================================================================== */
.incident-launch-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.22), rgba(15, 23, 42, 0.7));
  border: 1.5px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 20px;
}

.incident-launch-card:hover, .incident-launch-card:active {
  transform: translateY(-2px) scale(0.99);
  border-color: #fb7185;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.32), rgba(15, 23, 42, 0.85));
  box-shadow: 0 12px 30px rgba(225, 29, 72, 0.25);
}

.launch-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
}

.launch-icon-box i {
  width: 24px;
  height: 24px;
}

.launch-content {
  flex: 1;
}

.launch-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.launch-content p {
  font-size: 12px;
  color: #fda4af;
  line-height: 1.35;
}

.launch-arrow i {
  width: 20px;
  height: 20px;
  color: #fb7185;
}

/* Contacts Section */
.contacts-heading {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.contact-card.primary-contact {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.6));
}

.c-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.c-avatar.icon-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.c-avatar.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.c-avatar.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.c-avatar.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.c-avatar i {
  width: 22px;
  height: 22px;
}

.c-details {
  flex: 1;
}

.c-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.c-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 1px;
}

.c-sub {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
  display: block;
}

.c-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 3px;
}

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

.btn-contact-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-contact-action:active {
  transform: scale(0.9);
}

.btn-contact-action.call {
  background: #10b981;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-contact-action.tg {
  background: #0284c7;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.btn-contact-action i {
  width: 17px;
  height: 17px;
}

/* Emergency Grid Row */
.emergency-grid-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.em-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  transition: transform 0.2s ease;
}

.em-btn:active {
  transform: scale(0.95);
}

.em-btn.police {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa;
}

.em-btn.ambulance {
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #fb7185;
}

.em-btn.fire {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.em-btn i {
  width: 20px;
  height: 20px;
}

