/* ============================================================================
   1052Taxi Admin Panel — Design System
   Clean, elegant, service-oriented. Light mode only.
   Font: Inter. Colors: Slate + Indigo accent.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1E293B;
  --bg-sidebar-hover: #334155;
  --bg-sidebar-active: #4F46E5;
  --text: #0F172A;
  --text-secondary: #64748B;
  --text-sidebar: #CBD5E1;
  --text-sidebar-active: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --info: #0284C7;
  --info-light: #F0F9FF;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --transition: 150ms ease;
  --sidebar-w: 260px;
}

html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--bg-sidebar); color: var(--text-sidebar); display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.page-header { padding: 24px 32px 0; }
.page-body { padding: 24px 32px 32px; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 12px; }
.sidebar-brand-icon { width: 36px; height: 36px; background: var(--primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; font-weight: 700; }
.sidebar-brand-text { font-size: 16px; font-weight: 600; color: #fff; }
.sidebar-brand-text span { color: var(--text-sidebar); font-weight: 400; font-size: 12px; display: block; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; padding: 0 8px; margin-bottom: 8px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: var(--text-sidebar); font-size: 13.5px; font-weight: 400; transition: all var(--transition); cursor: pointer; }
.sidebar-link:hover { background: var(--bg-sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); font-weight: 500; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-link .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; }
.sidebar-user-avatar { width: 32px; height: 32px; background: #475569; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: #fff; }
.sidebar-user-role { font-size: 11px; color: #94A3B8; }

/* ── Top Header ──────────────────────────────────────────────────────────── */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 600; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); background: var(--border-light); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-card-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stat-card-icon.blue { background: var(--info-light); color: var(--info); }
.stat-card-icon.green { background: var(--success-light); color: var(--success); }
.stat-card-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-card-icon.indigo { background: var(--primary-light); color: var(--primary); }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); padding: 10px 16px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13.5px; vertical-align: middle; }
tr:hover td { background: #F8FAFC; }
tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.4; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: #F1F5F9; color: #475569; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-family: var(--font); font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all var(--transition); white-space: nowrap; line-height: 1.4; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--border-light); border-color: #CBD5E1; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }
.btn-icon svg { width: 16px; height: 16px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 13.5px; color: var(--text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-input::placeholder { color: #94A3B8; }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8.825L.35 3.175 1.4 2.1 6 6.7l4.6-4.6 1.05 1.075z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-secondary); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); color: var(--text-secondary); }
.modal-close:hover { background: var(--border-light); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-wide { max-width: 720px; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius); font-size: 13px; font-weight: 500; border: 1px solid var(--border); color: var(--text-secondary); background: #fff; }
.pagination a:hover { background: var(--border-light); color: var(--text); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Filter Tabs ─────────────────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--border-light); border: 1px solid transparent; cursor: pointer; transition: all var(--transition); }
.filter-tab:hover { color: var(--text); background: var(--border); }
.filter-tab.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ── Map Container ───────────────────────────────────────────────────────── */
.map-container { width: 100%; height: 500px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.empty-state-text { font-size: 13px; }

/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 40px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 52px; height: 52px; background: var(--primary); border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; font-weight: 700; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.login-error { background: var(--danger-light); color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.login-btn { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }

/* ── Status Dot ──────────────────────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: #CBD5E1; }
.status-dot.busy { background: var(--warning); }

/* ── Grid Layouts ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; display: inline-block; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  :root { --sidebar-w: 220px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: slideIn 200ms ease; }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
