/* ── extracted from original <style> block 1 ── */

  
  
* { font-family: 'Prompt', sans-serif; font-weight: 700; }

.web-badge { display:inline-block; padding:2px 7px; border-radius:5px; font-size:11px; font-weight:700; background:#e0f2fe; color:#0284c7; border:1px solid #7dd3fc; margin-left:4px; }


/* force date input format dd/mm/yyyy */
input[type="date"]::-webkit-datetime-edit-fields-wrapper { direction: ltr; }
input[type="date"] { -webkit-text-fill-color: #0c2d4a; }

/* ─── CUSTOM ALERT / CONFIRM MODAL ─── */
#customAlertOverlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
#customAlertOverlay.show { opacity: 1; pointer-events: all; }
#customAlertBox {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  width: 420px; max-width: 92vw;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1);
}
#customAlertOverlay.show #customAlertBox { transform: scale(1) translateY(0); }
#customAlertHeader {
  padding: 22px 24px 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
#customAlertIcon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
#customAlertIcon.warn  { background: #fef9c3; }
#customAlertIcon.error { background: #fee2e2; }
#customAlertIcon.info  { background: #e0f2fe; }
#customAlertIcon.success { background: #dcfce7; }
#customAlertTitle {
  font-size: 17px; font-weight: 700; color: #0c2d4a;
  text-align: center; line-height: 1.3;
}
#customAlertMsg {
  padding: 12px 24px 20px;
  font-size: 14px; color: #475569;
  text-align: center; line-height: 1.6;
}
#customAlertFooter {
  padding: 14px 24px 22px;
  display: flex; gap: 10px; justify-content: center;
  border-top: 1px solid #f1f5f9;
}
.cal-btn {
  flex: 1; max-width: 160px;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer; border: none; transition: all 0.15s;
}
.cal-btn.primary { background: linear-gradient(135deg,#0369a1,#38bdf8); color: #fff; box-shadow: 0 4px 14px rgba(59,130,246,0.35); }
.cal-btn.primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.5); transform: translateY(-1px); }
.cal-btn.secondary { background: #f1f5f9; color: #475569; }
.cal-btn.secondary:hover { background: #e2e8f0; }
.cal-btn.danger { background: linear-gradient(135deg,#b91c1c,#ef4444); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.35); }
.cal-btn.danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.5); transform: translateY(-1px); }


/* ── extracted from original <style> block 2 ── */

:root {
  /* ขนาด UI/ตัวอักษรทั้งระบบ (1 = ปกติ, 0.9 = เล็กลง 10%) */
  --ui-scale: 0.8;
  /* Core palette - clean light */
  --bg-root:      #e0f2fe;
  --bg-sidebar:   #023e8a;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f0f9ff;
  --bg-card:      #ffffff;
  --bg-hover:     #bae6fd;
  --bg-input:     #f0f9ff;

  /* Borders */
  --border-subtle:  rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.10);
  --border-strong:  rgba(0,0,0,0.18);
  --border-accent:  rgba(59,130,246,0.40);

  /* Brand colors */
  --brand:        #0284c7;
  --brand-light:  #38bdf8;
  --brand-dark:   #0369a1;
  --brand-glow:   rgba(2,132,199,0.18);
  --brand-soft:   rgba(2,132,199,0.08);

  /* Text */
  --text-primary:   #0c2d4a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-accent:    #0284c7;

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;
  --info:    #0891b2;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  --glow-brand: 0 0 24px rgba(37,99,235,0.15);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --sidebar-w: 220px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — font scale & layout
   ═══════════════════════════════════════ */

/* Desktop default already set above */

/* Tablet landscape 1024px */
@media (max-width: 1024px) {
  :root { --sidebar-w: 180px; }
  body  { font-size: 18px; }
  .main-content { padding: 18px 18px; }
  .page-header  { font-size: 16px !important; }
  .create-grid  { grid-template-columns: 1fr 1fr; }
}

/* Tablet portrait 768px — collapse sidebar to icon rail */
@media (max-width: 768px) {
  :root { --sidebar-w: 64px; }
  body  { font-size: 16px; }

  .sidebar-logo   { padding: 14px 0; justify-content: center; }
  .sidebar-logo .logo-text { display: none; }
  .sidebar-logo .logo-version { display: none; }
  .logo-mark      { width: 44px; height: 36px; }

  .sidebar-user   { padding: 10px 0; justify-content: center; }
  .sidebar-user .user-info { display: none; }
  .sidebar-avatar { margin: 0; }

  .sidebar-section { display: none; }
  .sidebar-spacer  { display: none; }

  .nav-item       { padding: 12px 0; justify-content: center; gap: 0; }
  .nav-item .nav-label  { display: none; }
  .nav-item .nav-badge  { position: absolute; top: 6px; right: 8px; }
  .nav-item       { position: relative; }

  .sidebar-bottom { padding: 10px 0; }
  .sidebar-bottom a { padding: 10px 0; justify-content: center; }
  .sidebar-bottom a span:not(:first-child) { display: none; }

  .main-content   { padding: 14px 14px; margin-left: var(--sidebar-w); }
  .page-header    { font-size: 14px !important; }
  .create-grid    { grid-template-columns: 1fr; }

  /* Table — horizontal scroll */
  .table-wrap, #today-table-wrap, #upcoming-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 700px; }

  /* KPI grids */
  #drv-kpi { grid-template-columns: repeat(2,1fr) !important; }
  #db-kpi, #rpt-kpi { grid-template-columns: repeat(2,1fr) !important; }
}

/* Mobile 480px */
@media (max-width: 480px) {
  :root { --sidebar-w: 0px; }
  body  { font-size: 14px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    width: 220px !important;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Mobile overlay when sidebar open */
  #sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 199;
    background: rgba(0,0,0,0.45);
  }
  .sidebar.mobile-open ~ #sidebar-overlay { display: block; }

  .main-content { margin-left: 0 !important; padding: 12px 10px; }

  /* Mobile top bar */
  .page-topbar { flex-wrap: wrap; gap: 8px; }
  .page-topbar h1 { font-size: 14px !important; }

  /* hide less important table columns */
  .col-hide-mobile { display: none !important; }

  /* KPI full width */
  #drv-kpi { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
  #db-kpi, #rpt-kpi { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }

  /* Drivers header stack */
  #page-drivers > div:first-child { flex-direction: column; align-items: flex-start !important; gap: 12px; }
  #page-drivers > div:first-child > div:last-child { flex-wrap: wrap; }
  #page-drivers input#drv-search { width: 100% !important; }

  /* Action popup full width */
  .action-popup { width: 96vw !important; }
  .apm-body { grid-template-columns: 1fr 1fr 1fr !important; }

  /* Modals full screen */
  .modal-box { width: 98vw !important; max-width: 98vw !important; border-radius: 14px !important; }
}

/* Mobile hamburger button (show on ≤480px) */
#mobile-menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 201;
  width: 40px; height: 40px; border-radius: 10px;
  background: #023e8a; border: none; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
@media (max-width: 480px) {
  #mobile-menu-btn { display: flex; }
  .main-content { padding-top: 56px !important; }
}

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

body {
  font-family: 'Prompt', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  zoom: var(--ui-scale, 0.8); /* ลดขนาดตัวอักษร/UI ทั้งระบบ — ปรับค่าได้ที่ --ui-scale */
}

/* ─── SCROLLBAR ─── */
html, body, * {
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 85, 105, .42) transparent;
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }
@media (forced-colors: active) {
  html, body, * { scrollbar-color: auto; }
}

/* ─────────────────── SIDEBAR ─────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-mark {
  width: 140px; height: 76px;
  background: transparent;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
}
.logo-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.logo-info .brand-name {
  font-family: 'Prompt', sans-serif;
  font-size: 18px; font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.logo-info .brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

.user-ava {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Prompt', sans-serif;
  font-weight: 700; font-size: 15px; color: white;
  flex-shrink: 0;
  border: 1.5px solid rgba(59,130,246,0.4);
}

.user-info .user-name { font-size: 15px; font-weight: 700; color: #ffffff; }
.user-info .user-role { font-size: 14px; color: rgba(255,255,255,0.5); }

.sidebar-section {
  padding: 20px 20px 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-item {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  text-decoration: none;
  border-radius: 0;
  margin: 1px 8px;
  border-radius: 8px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(56,189,248,0.15);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.35);
}

.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px rgba(56,189,248,0.5)); }

.nav-icon { font-size: 18px; width: 18px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--warning);
  color: #1a0f00;
  font-size: 12px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  font-family: 'Prompt', sans-serif;
}

.nav-badge.blue {
  background: var(--brand);
  color: white;
}

.sidebar-spacer { flex: 1; }

.sidebar-bottom {
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
}

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 15px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}

/* ─────────────────── MAIN ─────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg-root);
}

/* Top bar */
.topbar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-page-title {
  font-family: 'Prompt', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
}
.topbar-breadcrumb { font-size: 14px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.booking-id-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--brand-soft);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--brand-light);
}

.btn-primary {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: white;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(59,130,246,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59,130,246,0.45);
}

.btn-ghost {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ─────────────────── PAGE SECTIONS ─────────────────── */
.page-content { padding: 24px 28px; }
.page-section { display: none; animation: fadeUp 0.22s ease; }
.page-section.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─────────────────── CARD / SURFACE ─────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

.card-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ─────────────────── FORM ELEMENTS ─────────────────── */
.form-label {
  font-size: 14px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}

.form-label .req { color: var(--danger); }

.form-input, .form-select {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 15px;
  font-family: 'Prompt', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus {
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-select option { background: var(--bg-card); }

.form-group { display: flex; flex-direction: column; }

.input-with-btn { position: relative; }
.input-with-btn .form-input { padding-right: 44px; cursor: pointer; }
.input-icon-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  background: var(--brand-soft);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer;
  transition: all 0.15s;
}
.input-icon-btn:hover { background: var(--brand); }

/* Number input */
.num-wrap { display: flex; align-items: center; gap: 0; }
.num-btn {
  width: 32px; height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 20px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.num-btn:first-child { border-radius: 8px 0 0 8px; }
.num-btn:last-child  { border-radius: 0 8px 8px 0; }
.num-btn:hover { background: var(--brand); border-color: var(--brand); }
.num-val {
  width: 44px; height: 38px;
  border: 1px solid var(--border-default);
  border-left: none; border-right: none;
  background: var(--bg-input);
  color: var(--text-primary);
  text-align: center;
  font-family: 'Prompt', sans-serif;
  font-size: 17px; font-weight: 700;
  outline: none;
}
.num-unit { font-size: 14px; color: var(--text-muted); margin-left: 8px; }

/* ─────────────────── CREATE FORM ─────────────────── */
.create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.form-col { display: flex; flex-direction: column; gap: 16px; }
.form-sections { display: flex; flex-direction: column; gap: 16px; }

.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, #0c4a6e, #0284c7);
}

.section-num {
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Prompt', sans-serif;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.section-head-title {
  font-family: 'Prompt', sans-serif;
  font-size: 15px; font-weight: 700;
  color: #ffffff;
}

.section-head-sub { font-size: 14px; color: rgba(255,255,255,0.6); margin-left: auto; }

.section-body { padding: 18px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.field-row.single { grid-template-columns: 1fr; }
.field-row:last-child { margin-bottom: 0; }

/* Job type pills */
.job-type-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.job-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
  background: var(--bg-input);
}

.job-pill:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
.job-pill.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.job-pill .jp-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent;
  transition: all 0.15s; flex-shrink: 0;
}
.job-pill.selected .jp-check { background: var(--brand); border-color: var(--brand); color: white; }
.job-pill .jp-icon { font-size: 20px; }
.job-pill .jp-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.job-pill .jp-sub   { font-size: 12px; color: var(--text-muted); }

/* Charter package area */
.pkg-area {
  margin-top: 10px;
  border: 1px solid #7dd3fc;
  background: #e0f2fe;
  border-radius: 10px;
  padding: 12px;
  animation: fadeUp 0.2s ease;
}

.pkg-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.15s;
  gap: 10px;
  margin-bottom: 6px;
}
.pkg-card:last-child { margin-bottom: 0; }
.pkg-card:hover { border-color: var(--brand); background: var(--bg-elevated); }
.pkg-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.pkg-card .pc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: 'Prompt', sans-serif; }
.pkg-card .pc-desc { font-size: 12px; color: var(--text-muted); }
.pkg-card .pc-price { font-family: 'Prompt', sans-serif; font-size: 15px; font-weight: 700; color: var(--brand-light); white-space: nowrap; }
.pkg-card .pc-dot { width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; transition: all 0.15s; flex-shrink: 0; }
.pkg-card.selected .pc-dot { background: var(--brand); border-color: var(--brand); color: white; }

/* Needs chips */
.needs-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
@keyframes urgentPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50%      { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
@keyframes pinDrop {
  0%   { transform: translateY(-30px) scale(0.8); opacity:0; }
  60%  { transform: translateY(4px) scale(1.05); opacity:1; }
  80%  { transform: translateY(-4px) scale(0.97); }
  100% { transform: translateY(0) scale(1); opacity:1; }
}
.need-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
  background: var(--bg-input);
  font-size: 14px; font-weight: 700; color: var(--text-secondary);
  user-select: none;
}
.need-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.need-chip.checked { border-color: var(--brand); background: var(--brand-soft); color: #0c2d4a; }
.need-chip .nc-chk {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; flex-shrink: 0; transition: all 0.15s;
}
.need-chip.checked .nc-chk { background: var(--brand); border-color: var(--brand); color: white; }
.luggage-counter { display: flex; align-items: center; gap: 3px; margin-left: 4px; }
.lug-btn { background: transparent; border: none; color: var(--brand-light); font-size: 17px; font-weight: 700; cursor: pointer; padding: 0 2px; line-height: 1; }
.lug-count { font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 14px; color: var(--brand-light); min-width: 14px; text-align: center; }

/* Route inputs */
.route-stack { display: flex; flex-direction: column; gap: 6px; }
.route-line { display: flex; align-items: center; gap: 10px; }
.route-dot-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.route-dot-icon.pickup  { background: rgba(239,68,68,0.2); }
.route-dot-icon.dropoff { background: rgba(34,197,94,0.2); }
.route-connector { width: 2px; height: 12px; background: var(--border-default); margin-left: 11px; }

/* Map section */
.map-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
#leaflet-map { height: 200px !important; }
.map-pin-info {
  display: none;
  gap: 6px; flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}
.map-badge {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
}
.map-badge.from { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.map-badge.to   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.map-badge.dist { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border-accent); }

.map-ctrl {
  position: absolute; top: 8px; right: 8px; z-index: 100;
  display: flex; flex-direction: column; gap: 4px;
}
.map-ctrl-btn {
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.map-ctrl-btn:hover { background: var(--brand); border-color: var(--brand); }

/* Payment */
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.pay-opt {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 8px;
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
  background: var(--bg-input);
}
.pay-opt:hover { border-color: var(--border-strong); }
.pay-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt .po-ico { font-size: 21px; }
.pay-opt .po-lbl { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-align: center; }
.pay-opt.selected .po-lbl { color: var(--brand-light); }

/* ─────────────────── SUMMARY PANEL ─────────────────── */
.summary-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.summary-top {
  padding: 16px 18px;
  background: linear-gradient(135deg, #0c4a6e, #0284c7);
  border-bottom: 1px solid var(--border-subtle);
}

.summary-top h3 {
  font-family: 'Prompt', sans-serif;
  font-size: 17px; font-weight: 700; color: #ffffff;
}

.summary-top p { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.summary-rows { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }

.s-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; font-size: 14px;
}
.s-label { color: var(--text-muted); font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.s-val { font-weight: 700; color: var(--text-primary); text-align: right; word-break: break-word; max-width: 55%; }
.s-divider { height: 1px; background: var(--border-subtle); }

.summary-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: #e0f2fe;
}
.st-label { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
.st-price {
  font-family: 'Prompt', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--brand);
}

.summary-actions { padding: 14px 18px; display: flex; flex-direction: row; gap: 8px; border-top: 1px solid var(--border-subtle); }

.btn-submit {
  flex: 1; padding: 13px;
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: white; border: none; border-radius: 10px;
  font-size: 17px; font-family: 'Prompt', sans-serif; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(34,197,94,0.35);
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(34,197,94,0.5); }
.btn-submit:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

.btn-outline {
  flex: 1; padding: 10px;
  background: transparent; color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  font-size: 15px; font-family: 'Prompt', sans-serif; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
}
.btn-outline:hover { background: #fee2e2; border-color: #dc2626; color: #991b1b; }

/* Route summary in panel */
.route-summary { display: flex; flex-direction: column; gap: 4px; }
.rs-row { display: flex; align-items: flex-start; gap: 7px; font-size: 14px; }
.rs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.rs-connector { width: 2px; height: 8px; margin-left: 3px; background: var(--border-default); margin-bottom: 0; }
.s-empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 8px 0; font-style: italic; }

/* ─────────────────── TABLE PAGES ─────────────────── */
.filter-strip {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  font-size: 14px; font-family: 'Prompt', sans-serif; font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-tab.active { background: var(--brand-soft); color: var(--brand-light); border-color: var(--border-accent); }

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 200px;
  transition: border-color 0.15s;
}
.search-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-glow); }
.search-wrap input {
  border: none; outline: none;
  font-size: 15px; font-family: 'Prompt', sans-serif;
  color: var(--text-primary); background: transparent; flex: 1;
}
.search-wrap input::placeholder { color: var(--text-muted); }

/* Table */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }

.data-table thead tr {
  background: #0c4a6e;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.bk-no { font-family: 'Prompt', sans-serif; font-size: 14px; font-weight: 700; color: #0c2d4a; }
.cust-name { font-weight: 700; }
.cust-phone { font-size: 14px; color: #0c2d4a; margin-top: 2px; }
.route-truncate { font-size: 14px; color: #0c2d4a; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ปรับขนาดตัวอักษรในตารางให้เท่ากันทุกคอลัมน์ */
.data-table tbody td,
.data-table tbody td .bk-no,
.data-table tbody td .cust-name,
.data-table tbody td .cust-phone,
.data-table tbody td .route-truncate,
.data-table tbody td .price-val { font-size: 13px !important; }
/* หมายเหตุ: ตัดข้อความให้สั้น แสดงเต็มเมื่อชี้เมาส์ */
.note-clamp { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; max-width:200px; line-height:1.35; cursor:help; }
.price-val { font-family: 'Prompt', sans-serif; font-weight: 700; color: var(--text-primary); }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }

.s-waiting { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.s-waiting::before { background: #f59e0b; }
.s-matched { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.s-matched::before { background: #22c55e; }
.s-sending { background: #bae6fd; color: #0369a1; border: 1px solid #93c5fd; }
.s-sending::before { background: #38bdf8; animation: pulse-dot 1.2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.s-done    { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.s-done::before    { background: #8b5cf6; }

/* Flow step indicator in table */
.flow-steps {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; white-space: nowrap;
}
.flow-step {
  display: flex; align-items: center; gap: 3px;
  padding: 3px 7px; border-radius: 12px;
  font-weight: 700; opacity: 0.35;
}
.flow-step.active { opacity: 1; }
.flow-step.done-step { opacity: 0.6; text-decoration: line-through; }
.flow-arrow { color: #cbd5e1; font-size: 11px; }

/* Complete job button */
.btn-complete-job {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
  color: white; border: none; border-radius: 7px;
  font-size: 14px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(139,92,246,0.35);
}
.btn-complete-job:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,92,246,0.5); }

/* Send to driver button */
.btn-send-driver {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  color: white; border: none; border-radius: 7px;
  font-size: 14px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.s-cancel  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.s-cancel::before  { background: #ef4444; }

.type-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.t-transfer { background: transparent; color: #0c2d4a; }
.t-charter  { background: transparent; color: #0c2d4a; }

/* Action buttons */
/* View detail fields */
.vd-field { display: flex; flex-direction: column; gap: 3px; }
.vd-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.vd-val   { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.action-btn-group { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

/* Dropdown action menu */
.action-dropdown { position: relative; display: inline-block; }

.action-dropdown-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: #0c4a6e;
  color: white;
  border: none; border-radius: 7px;
  font-size: 14px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.action-dropdown-btn:hover { background: #0284c7; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.action-dropdown-btn .arrow { font-size: 11px; }

/* Action Popup Modal */
.action-popup-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center; justify-content: center;
}
.action-popup-overlay.open { display: flex; animation: fadeIn 0.18s ease; }

.action-popup {
  background: #ffffff;
  border-radius: 16px;
  width: 700px; max-width: 95vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: popIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.apm-header {
  background: linear-gradient(135deg, #0c4a6e, #0284c7);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.apm-header-left { display: flex; flex-direction: column; gap: 2px; }
.apm-title { font-family: 'Prompt', sans-serif; font-size: 17px; font-weight: 700; color: #fff; }
.apm-id    { font-family: 'Prompt', sans-serif; font-size: 14px; color: rgba(255,255,255,0.65); }
.apm-cust  { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 1px; }
.apm-close {
  width: 30px; height: 30px; border: none;
  background: rgba(255,255,255,0.15); border-radius: 7px;
  cursor: pointer; font-size: 17px; color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0;
}
.apm-close:hover { background: rgba(255,255,255,0.28); }

.apm-body { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.apm-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 20px 16px;
  border-radius: 12px;
  cursor: pointer; transition: all 0.15s;
  border: 1.5px solid transparent;
  text-align: center;
  background: none; width: 100%;
  font-family: 'Prompt', sans-serif;
}
.apm-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.apm-btn-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.apm-btn-text { display: flex; flex-direction: column; gap: 1px; align-items: center; }
.apm-btn-label { font-size: 14px; font-weight: 700; }
.apm-btn-desc  { font-size: 12px; opacity: 0.7; }

.apm-view  { background: #bae6fd; border-color: #60a5fa; }
.apm-view:hover  { background: #7dd3fc; border-color: #38bdf8; }
.apm-view .apm-btn-icon  { background: #93c5fd; }
.apm-view .apm-btn-label { color: #1e3a8a; }
.apm-view .apm-btn-desc  { color: #0369a1; }

.apm-edit  { background: #fef08a; border-color: #facc15; }
.apm-edit:hover  { background: #fde047; border-color: #eab308; }
.apm-edit .apm-btn-icon  { background: #fde047; }
.apm-edit .apm-btn-label { color: #713f12; }
.apm-edit .apm-btn-desc  { color: #a16207; }

.apm-match { background: #bbf7d0; border-color: #4ade80; }
.apm-match:hover { background: #86efac; border-color: #22c55e; }
.apm-match .apm-btn-icon  { background: #4ade80; }
.apm-match .apm-btn-label { color: #14532d; }
.apm-match .apm-btn-desc  { color: #15803d; }

.apm-del   { background: #fecdd3; border-color: #f87171; }
.apm-del:hover   { background: #fca5a5; border-color: #ef4444; }
.apm-del .apm-btn-icon  { background: #f87171; }
.apm-del .apm-btn-label { color: #7f1d1d; }
.apm-del .apm-btn-desc  { color: #be123c; }

.apm-cancel-job { background: #fed7aa; border-color: #fb923c; }
.apm-cancel-job:hover { background: #fdba74; border-color: #f97316; }
.apm-cancel-job .apm-btn-icon  { background: #fb923c; }
.apm-cancel-job .apm-btn-label { color: #431407; }
.apm-cancel-job .apm-btn-desc  { color: #c2410c; }

.apm-footer { padding: 12px 20px; border-top: 1px solid var(--border-subtle); grid-column: 1 / -1; }
.apm-cancel-btn {
  width: 100%; padding: 10px;
  background: #f8fafc; border: 1px solid var(--border-default);
  border-radius: 8px; font-size: 15px; font-weight: 700;
  font-family: 'Prompt', sans-serif; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.apm-cancel-btn:hover { background: #f1f5f9; color: var(--text-primary); }

.ab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 14px; font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer; transition: all 0.15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.ab-view {
  background: #e0f2fe; color: #0369a1;
  border-color: #7dd3fc;
}
.ab-view:hover { background: #bae6fd; border-color: #93c5fd; }

.ab-edit {
  background: #fefce8; color: #a16207;
  border-color: #fde68a;
}
.ab-edit:hover { background: #fef9c3; border-color: #fcd34d; }

.ab-match {
  background: #f0fdf4; color: #15803d;
  border-color: #bbf7d0;
}
.ab-match:hover { background: #dcfce7; border-color: #86efac; }

.ab-del {
  background: #fff1f2; color: #be123c;
  border-color: #fecdd3;
}
.ab-del:hover { background: #ffe4e6; border-color: #fda4af; }

.action-btn { display: none; } /* hide old style */

.status-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 14px; font-weight: 700;
  background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a;
  cursor: pointer;
}

.empty-state {
  padding: 60px 20px; text-align: center;
  color: var(--text-muted); font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Route cells */
.route-cell { display: flex; flex-direction: column; gap: 3px; }
.route-from { display: flex; align-items: flex-start; gap: 5px; font-size: 14px; color: var(--text-primary); font-weight: 700; }
.route-to   { display: flex; align-items: flex-start; gap: 5px; font-size: 14px; color: var(--text-muted); }
.r-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.r-dot.red  { background: #ef4444; }
.r-dot.green { background: #22c55e; }

.date-cell-today { color: #ef4444 !important; font-weight: 700; }
.date-cell-soon  { color: #f97316 !important; font-weight: 700; }

/* ─────────────────── DATE FILTER BAR ─────────────────── */
.date-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.date-bar label { font-size: 14px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.date-bar input[type=date] {
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Prompt', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.date-bar input[type=date]:focus { border-color: var(--brand); }
.btn-show-all {
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 7px;
  background: var(--bg-elevated);
  font-size: 14px; font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  font-family: 'Prompt', sans-serif;
}
.btn-show-all:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

/* ─────────────────── SETTINGS ─────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.pkg-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  gap: 12px;
  transition: all 0.15s;
}
.pkg-item:hover { border-color: var(--border-default); background: var(--bg-hover); }
.pkg-item-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.pkg-icon { font-size: 21px; flex-shrink: 0; margin-top: 2px; }
.pkg-name { font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.pkg-desc { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.pkg-price { font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 17px; color: var(--brand-light); white-space: nowrap; }
.pkg-actions { display: flex; gap: 5px; }
.pkg-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s;
}
.pkg-btn.edit:hover { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); }
.pkg-btn.del:hover  { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }

.fare-input {
  width: 100%; height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 0 16px;
  font-size: 21px; font-family: 'Prompt', sans-serif; font-weight: 700;
  color: var(--text-primary); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fare-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.fare-preview {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px; color: #92400e;
  display: flex; align-items: center; gap: 8px;
}
.fare-preview strong { font-family: 'Prompt', sans-serif; font-size: 18px; }

/* ─────────────────── MODALS ─────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 440px; max-width: 95vw;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }

.modal-box h3 { font-family: 'Prompt', sans-serif; font-size: 21px; margin-bottom: 8px; color: var(--text-primary); }
.modal-box p { font-size: 15px; color: var(--text-secondary); margin-bottom: 20px; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  font-size: 15px; font-family: 'Prompt', sans-serif; font-weight: 700;
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.modal-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.modal-btn.danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.modal-btn.danger:hover { background: rgba(239,68,68,0.25); }

/* Package Modal */
.pkg-modal-box { width: 460px; }
.pkg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.pkg-form-group { display: flex; flex-direction: column; gap: 6px; }
.pkg-form-group.full { grid-column: 1/-1; }
.pkg-form-group label { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; }

/* MAP PICKER MODAL */
.schedule-range-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: -0.25rem 0 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #bce8eb;
  border-radius: 10px;
  background: #effafb;
  color: #31566d;
  font-size: 0.78rem;
  line-height: 1.5;
}
.schedule-range-note[hidden] { display: none; }
.schedule-range-note i { color: #008f9a; margin-top: 0.12rem; }

.map-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6,32,80,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
  }
  .map-modal-overlay.active { display: flex; }
  .map-modal-box {
    background: #fff;
    border-radius: 18px;
    width: min(680px, 95vw);
    height: min(680px, 90vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  }
  .map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e8edf5;
    background: #f7faff;
  }
  .map-modal-title {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
  }
  .map-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
  }
  .map-modal-close:hover { background: #f0f0f0; color: #333; }
  .map-search-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e8edf5;
  }
  .map-search-bar input {
    width: 100%;
    border: 1.5px solid #ccd8f0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-family: 'Prompt', sans-serif;
    font-size: 0.9rem;
    outline: none;
    color: var(--dark);
    transition: border 0.2s;
  }
  .map-search-bar input:focus { border-color: var(--gold); }
  #map-canvas { flex: 1; min-height: 0; height: 100%; z-index: 0; position: relative; display: block; }
  #map-canvas > div, #map-canvas iframe, #map-canvas canvas { width: 100% !important; height: 100% !important; }
  .map-confirm-bar {
    min-height: 74px;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e8edf5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f7faff;
  }
  .map-selected-label {
    flex: 1;
    font-size: 0.82rem;
    color: #52657d;
    font-family: 'Prompt', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .map-confirm-btn {
    min-width: 158px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: #dfe6ee;
    color: #7b8ba0;
    border: 1px solid #d4dde8;
    padding: 0.7rem 1.25rem;
    border-radius: 12px;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: not-allowed;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
  }
  .map-confirm-btn.is-ready {
    background: linear-gradient(135deg, #064b70 0%, #001b3f 100%);
    color: #fff;
    border-color: #001b3f;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,27,63,0.24), 0 0 0 3px rgba(0,184,196,0.12);
  }
  .map-confirm-btn.is-ready:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,27,63,0.3), 0 0 0 3px rgba(0,184,196,0.2); }
  .map-confirm-btn.is-ready:active { transform: translateY(0); }
  .map-confirm-btn:focus-visible { outline: 3px solid rgba(0,184,196,0.35); outline-offset: 2px; }

  @media (max-width: 620px) {
    .map-confirm-bar { align-items: stretch; flex-direction: column; }
    .map-selected-label { white-space: normal; }
    .map-confirm-btn { width: 100%; }
  }

/* ─────────────────── SUCCESS MODAL ─────────────────── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200001;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(0, 27, 63, .68);
  backdrop-filter: blur(10px);
}
.success-overlay.open { display: flex; animation: successBackdropIn .18s ease-out; }
@keyframes successBackdropIn { from { opacity: 0; } to { opacity: 1; } }

.success-dialog {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 78px rgba(0, 16, 38, .34);
  animation: successDialogIn .2s ease-out;
  outline: none;
}
@keyframes successDialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.success-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #e5edf1;
  background: #fff;
}
.success-dialog-title-wrap { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.success-dialog-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f5f1;
  color: #187d62;
  font-size: 18px;
}
.success-dialog-header h2 {
  margin: 0;
  color: #001b3f;
  font: 750 18px/1.4 "Noto Sans Thai", "Prompt", sans-serif;
}
.success-dialog-header p {
  margin: 3px 0 0;
  color: #718398;
  font: 500 12px/1.55 "Noto Sans Thai", "Prompt", sans-serif;
}
.success-dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #526a80;
  font: 500 20px/1 Arial, sans-serif;
  cursor: pointer;
}
.success-dialog-close:hover { background: #eef3f6; color: #001b3f; }

.success-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px;
  overflow-y: auto;
}
.success-booking-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #d9e2e8;
  border-left: 4px solid #00b8c4;
  border-radius: 14px;
  background: #f8fbfc;
}
.success-booking-copy { min-width: 0; display: grid; gap: 5px; }
.success-booking-label {
  color: #64778a;
  font: 700 12px/1.4 "Noto Sans Thai", "Prompt", sans-serif;
}
.success-booking-copy strong {
  overflow-wrap: anywhere;
  color: #001b3f;
  font: 800 21px/1.35 "Noto Sans Thai", "Prompt", sans-serif;
  letter-spacing: .06em;
}
.success-booking-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf7f8;
  color: #007f89;
  font-size: 17px;
}
.success-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #efd49e;
  border-radius: 12px;
  background: #fff9ed;
}
.success-info-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff0cc;
  color: #9a620f;
  font-size: 15px;
}
.success-info-row div { min-width: 0; display: grid; gap: 2px; }
.success-info-row strong { color: #7a4b08; font: 750 13px/1.45 "Noto Sans Thai", "Prompt", sans-serif; }
.success-info-row div span { color: #9a620f; font: 500 11px/1.5 "Noto Sans Thai", "Prompt", sans-serif; }

.success-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid #e5edf1;
  background: #f7fafb;
}
.success-dialog-primary {
  min-width: 118px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  background: #001b3f;
  color: #fff;
  font: 700 13px "Noto Sans Thai", "Prompt", sans-serif;
  cursor: pointer;
}
.success-dialog-primary:hover { background: #003b68; }
.success-dialog-primary:active { transform: translateY(1px); }
.success-dialog-close:focus-visible,
.success-dialog-primary:focus-visible {
  outline: 3px solid rgba(0, 184, 196, .28);
  outline-offset: 2px;
}

body.success-dialog-open { overflow: hidden; }
body.success-dialog-open .sidebar,
body.success-dialog-open .sidebar-toggle { visibility: hidden !important; }

@media (max-width: 520px) {
  .success-overlay { padding: 12px; }
  .success-dialog { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .success-dialog-header, .success-dialog-body { padding: 17px; }
  .success-dialog-footer { padding: 12px 17px; }
  .success-dialog-primary { width: 100%; }
  .success-booking-copy strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .success-overlay.open, .success-dialog { animation: none; }
}

/* ─────────────────── MISC ─────────────────── */
.local-warning {
  display: none; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: #1e293b; border: 1px solid #334155;
  color: #f8fafc; padding: 12px 24px; border-radius: 10px;
  font-size: 15px; font-family: 'Prompt', sans-serif;
  z-index: 9999; box-shadow: var(--shadow-lg); text-align: center; max-width: 520px;
}
.local-warning a { color: var(--brand-light); text-decoration: none; font-weight: 700; }

/* Action group in table */
.action-grp { display: flex; flex-direction: column; gap: 4px; }
.action-row { display: flex; gap: 4px; }

/* Add stop btn */
.add-stop-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1.5px dashed var(--border-default);
  border-radius: 7px;
  font-size: 14px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.add-stop-btn:hover { border-color: var(--brand); color: var(--brand-light); }

.route-connector-line { width: 2px; height: 12px; background: var(--border-default); margin-left: 11px; }


/* ── extracted from original <style> block 3 ── */

#stp-hour-list::-webkit-scrollbar,#stp-min-list::-webkit-scrollbar{display:none;}
.stp-item{height:40px;line-height:40px;text-align:center;font-family:'Prompt',sans-serif;font-size:18px;font-weight:700;color:#94a3b8;scroll-snap-align:center;cursor:pointer;border-radius:8px;user-select:none;transition:color 0.12s;}
.stp-item.active{color:#0369a1;font-size:20px;}


/* ── extracted from original <style> block 4 ── */

@keyframes loginSlideUp { from { opacity:0; transform:translateY(24px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes orbFloat { 0%,100% { transform:translateY(0px); } 50% { transform:translateY(-30px); } }
#login-screen.hidden { display:none !important; opacity:0 !important; pointer-events:none !important; }
