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

:root {
  --sidebar-bg: #1a1f2e;
  --sidebar-hover: #252c3d;
  --sidebar-active: #2d3654;
  --sidebar-accent: #e05c2e;
  --sidebar-text: #a8b3c8;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 220px;
  --topbar-h: 56px;
  --primary: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f0f2f5;
  --border: #dde1e7;
  --text: #1a1f2e;
  --muted: #64748b;
  --radius: 8px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── LOGIN ─────────────────────────────────── */
.login-page { display: flex; min-height: 100vh; }
.login-left { flex: 1; background: linear-gradient(160deg, #1a1f2e 0%, #2d3654 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; color: white; }
.login-left-logo { font-size: 64px; margin-bottom: 20px; }
.login-left h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.login-left p { color: #a8b3c8; font-size: 16px; }
.login-right { width: 460px; display: flex; align-items: center; justify-content: center; padding: 48px; background: white; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

/* ─── LAYOUT ─────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; }
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.sidebar-brand-icon { font-size: 24px; }
.sidebar-brand-name { color: white; font-size: 15px; font-weight: 700; line-height: 1.2; }
.sidebar-brand-sub { color: var(--sidebar-text); font-size: 11px; }
.sidebar-section { padding: 16px 0 8px; }
.sidebar-section-label { padding: 0 16px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(168,179,200,.4); }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; background: none; width: 100%; transition: all .15s; border-left: 3px solid transparent; }
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.sidebar-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active); border-left-color: var(--sidebar-accent); }
.sidebar-link svg, .sidebar-link .ico { width: 16px; height: 16px; opacity: .8; flex-shrink: 0; font-style: normal; font-size: 15px; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sidebar-accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--sidebar-text); font-size: 11px; }
.logout-btn { background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 18px; padding: 4px; border-radius: 4px; }
.logout-btn:hover { color: white; }

/* ─── MAIN ───────────────────────────────────── */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: white; border-bottom: 1px solid var(--border); height: var(--topbar-h); display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.page-body { padding: 28px; flex: 1; }

/* ─── PAGE HEADER ────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 20px; font-weight: 700; }

/* ─── STATS ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: white; border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-ico.blue { background: #eff6ff; }
.stat-ico.orange { background: #fff7ed; }
.stat-ico.green { background: #f0fdf4; }
.stat-ico.purple { background: #faf5ff; }
.stat-num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── CARD ───────────────────────────────────── */
.card { background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.card-head-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; }

/* ─── TABLE CONTROLS ─────────────────────────── */
.table-controls { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.table-controls label { display: flex; align-items: center; gap: 6px; }
.table-controls select, .search-input { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 13px; background: white; color: var(--text); }
.search-box { display: flex; align-items: center; gap: 8px; }
.search-input { min-width: 180px; }
.search-input:focus { outline: none; border-color: var(--primary); }

/* ─── TABLE ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 800px; }
.table thead { background: #f8fafc; }
.table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 13px 14px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbfd; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ─── BOOKING # ──────────────────────────────── */
.booking-num { font-weight: 700; color: var(--primary); font-size: 13px; }
.booking-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── PASSENGER CELL ─────────────────────────── */
.pax-name { font-weight: 700; color: #e05c2e; font-size: 13.5px; }
.pax-phone { font-size: 12px; color: var(--muted); }
.pax-email { font-size: 12px; color: var(--muted); }
.pax-counts { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ─── ADDRESS CELL ───────────────────────────── */
.addr-row { display: flex; gap: 6px; font-size: 12.5px; }
.addr-label { font-weight: 700; color: var(--muted); width: 58px; flex-shrink: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; padding-top: 1px; }
.addr-val { color: var(--text); }
.flight-tag { display: inline-flex; align-items: center; gap: 4px; background: #f0f0f0; border-radius: 4px; padding: 2px 7px; font-size: 11px; color: #555; margin-top: 4px; }

/* ─── TIME CELL ──────────────────────────────── */
.time-cell { min-width: 120px; }
.time-pickup { font-weight: 600; font-size: 13px; }
.time-dropoff { font-size: 12px; color: var(--muted); }
.time-duration { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── AGENT CELL ─────────────────────────────── */
.agent-cell { display: flex; align-items: center; gap: 8px; }
.agent-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.agent-av.big { width: 44px; height: 44px; font-size: 17px; }
.agent-name { font-weight: 600; font-size: 13px; }
.agent-user { font-size: 11px; color: var(--muted); }

/* ─── BADGES ─────────────────────────────────── */
.badge { display: inline-block; padding: 4px 11px; border-radius: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-pending   { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-confirmed { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-scheduled { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-complete  { background: #1e293b; color: white; border: 1px solid #1e293b; }
.badge-rejected  { background: #fef2f2; color: #b91c1b; border: 1px solid #fecaca; }
.badge-cancelled { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* ─── VEHICLE TAG ────────────────────────────── */
.vehicle-tag { display: inline-block; background: #e2e8f0; color: var(--text); border-radius: 4px; padding: 3px 9px; font-size: 12px; font-weight: 600; }

/* ─── PRICE ──────────────────────────────────── */
.price-cell { font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; }

/* ─── BUTTONS ────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 5px 10px; font-size: 12px; }
.btn-ghost:hover { background: #f8fafc; color: var(--text); }

/* ─── FORMS ──────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; font-size: 13.5px; color: var(--text); font-family: inherit; transition: border .15s; background: white; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.field-row { display: grid; gap: 0 14px; }
.field-row.col2 { grid-template-columns: 1fr 1fr; }
.field-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px; margin-top: 4px; }
.req { color: var(--danger); }

/* ─── MODAL ──────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; z-index: 300; padding: 30px 20px; overflow-y: auto; }
.modal-overlay.hidden { display: none; }
.modal { background: white; border-radius: 10px; width: 100%; max-width: 680px; box-shadow: 0 24px 64px rgba(0,0,0,.25); margin: auto; }
.modal-lg { max-width: 860px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; max-height: 75vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: #f8fafc; border-radius: 0 0 10px 10px; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.close-btn:hover { background: #f1f5f9; color: var(--text); }

/* ─── DETAIL ─────────────────────────────────── */
.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.detail-cell { padding: 11px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.detail-cell:nth-child(even) { border-right: none; }
.detail-cell:nth-last-child(-n+2) { border-bottom: none; }
.detail-cell.full { grid-column: span 2; border-right: none; }
.detail-cell label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 3px; }
.detail-cell span { font-size: 13.5px; font-weight: 500; }
.agent-info-bar { display: flex; align-items: center; gap: 12px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 14px; margin-bottom: 20px; }
.agent-info-bar .agent-name { font-size: 15px; font-weight: 700; }
.status-banner { border-radius: 7px; padding: 11px 16px; text-align: center; font-weight: 600; font-size: 14px; margin-top: 16px; }
.status-banner.confirmed { background: #dcfce7; color: #166534; }
.status-banner.rejected  { background: #fee2e2; color: #991b1b; }
.status-banner.pending   { background: #fff7ed; color: #92400e; }
.status-banner.scheduled { background: #eff6ff; color: #1d4ed8; }
.status-banner.complete  { background: #1e293b; color: white; }

/* ─── MISC ───────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state .empty-ico { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }
.error-msg { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.error-msg.hidden { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border-radius: 4px; padding: 2px 8px; font-size: 12px; color: var(--muted); }

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar collapses to icons only */
  .sidebar { width: 56px; }
  .sidebar-brand-name, .sidebar-section-label, .sidebar-link span, .sidebar-user-info { display: none; }
  .sidebar-brand { padding: 14px 10px; justify-content: center; }
  .sidebar-link { justify-content: center; padding: 12px 0; }
  .sidebar-footer { padding: 10px; }
  .sidebar-user { justify-content: center; flex-direction: column; gap: 6px; }
  .main-content { margin-left: 56px; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { font-size: 14px; }
  .btn { padding: 7px 11px; font-size: 12px; }

  /* Login page */
  .login-left { display: none; }
  .login-right { width: 100%; padding: 24px 20px; }
  .login-card { max-width: 100%; }

  /* Forms */
  .field-row.col2, .field-row.col3 { grid-template-columns: 1fr; }

  /* Detail grid */
  .detail-grid { grid-template-columns: 1fr; }
  .detail-cell:nth-child(even) { border-right: none; }
  .detail-cell { border-right: none; }
  .detail-cell.full { grid-column: span 1; }

  /* Modal */
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-body { max-height: 65vh; }
  .modal-lg { max-width: 100%; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 20px; }

  /* Page body */
  .page-body { padding: 14px; }

  /* Table: make it scrollable */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-head { flex-direction: column; align-items: flex-start; }
  .table-footer { flex-direction: column; gap: 6px; }
}
