/* =====================================================================
   Badjas Busses VMS - design system
   Brand: Badjas yellow #FFD200 + blue #1C3F94, navy topbar, light grey app background.
   ===================================================================== */
:root {
  --brand-yellow: #FFD200;
  --brand-yellow-dark: #e6bd00;
  --brand-blue: #1C3F94;
  --brand-blue-dark: #15307a;
  --navy: #0f1f45;
  --navy-2: #16295c;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --blue: #2563eb;
  --sky: #0ea5e9;
  --purple: #6366f1;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.15);
  --topbar-h: 58px;
  --footer-h: 32px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #f1f3f7; padding: 1px 5px; border-radius: 4px; }
small, .small { font-size: 12px; } .muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-right { text-align: right; } .text-center { text-align: center; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ico-sm { width: 14px; height: 14px; } .ico-lg { width: 24px; height: 24px; } .ico-xl { width: 40px; height: 40px; }
[hidden] { display: none !important; }
.hide { display: none !important; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; } .gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 20px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .ml-auto { margin-left: auto; }
.w-100 { width: 100%; }

/* ---------------- Topbar ---------------- */
.topbar { height: var(--topbar-h); background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%); border-bottom: 3px solid var(--brand-yellow); color: #fff; display: flex; align-items: center; padding: 0 16px; gap: 14px; position: sticky; top: 0; z-index: 500; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.brand img { height: 36px; width: auto; background: #fff; border-radius: 6px; padding: 2px 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 15px; letter-spacing: .01em; } .brand-text small { font-size: 10.5px; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .06em; }
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: 10px; height: 100%; }
.mainnav > a, .mainnav .dropdown-toggle { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.82); font-weight: 500; font-size: 13.5px; text-decoration: none !important; border: 0; background: transparent; cursor: pointer; font-family: inherit; position: relative; }
.mainnav > a:hover, .mainnav .dropdown-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.mainnav > a.active, .mainnav .dropdown-toggle.active { background: rgba(255,210,0,.14); color: var(--brand-yellow); }
.mainnav .ico { width: 17px; height: 17px; }
.nav-badge { background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; margin-left: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.75); padding: 6px 10px; border-radius: 20px; background: rgba(255,255,255,.06); }
.sync-indicator .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; box-shadow: 0 0 0 0 rgba(22,163,74,.6); }
.sync-indicator.ok .dot { background: var(--green); animation: pulse 2s infinite; }
.sync-indicator.warn .dot { background: var(--amber); } .sync-indicator.err .dot { background: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6);} 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0);} 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0);} }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); border: 0; cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.badge-count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--navy); }
.user-menu .dropdown-toggle { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 0; color: #fff; padding: 5px 10px 5px 5px; border-radius: 24px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500; }
.user-menu .dropdown-toggle:hover { background: rgba(255,255,255,.14); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-yellow); color: var(--navy); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.nav-toggle { display: none; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; }

/* ---------------- Dropdowns ---------------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: #fff; color: var(--text); border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 6px; display: none; z-index: 600; }
.dropdown-menu.dropdown-right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--text); font-size: 13.5px; text-decoration: none !important; width: 100%; border: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--bg); }
.dropdown-menu a.active { color: var(--brand-blue); font-weight: 600; background: #eef2ff; }
.dropdown-menu .ico { width: 16px; height: 16px; color: var(--muted); }
.dropdown-header { padding: 8px 10px 6px; display: flex; flex-direction: column; } .dropdown-header small { color: var(--muted); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------------- Page ---------------- */
.page { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px 24px 30px; }
.page-full { max-width: none; padding: 0; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - var(--footer-h)); min-height: 480px; overflow: hidden; }
.layout-full .footer { height: var(--footer-h); padding: 0 16px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted); margin: 4px 0 0; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; } .breadcrumbs .sep { margin: 0 6px; }
.footer { border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; gap: 10px; flex-wrap: wrap; }
.footer b { color: var(--text-2); }

/* ---------------- Cards & grids ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { display: flex; align-items: center; gap: 8px; }
.card-header .ico { color: var(--brand-blue); }
.card-body { padding: 18px; }
.card-body.compact { padding: 12px 14px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.kpi .kpi-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #eef2ff; color: var(--brand-blue); flex: none; }
.kpi .kpi-ico .ico { width: 20px; height: 20px; }
.kpi .kpi-ico.green { background: #ecfdf5; color: var(--green);} .kpi .kpi-ico.amber { background: #fffbeb; color: var(--amber);} .kpi .kpi-ico.red { background: #fef2f2; color: var(--red);} .kpi .kpi-ico.grey { background: #f3f4f6; color: var(--muted);} .kpi .kpi-ico.yellow { background: #fff8cc; color: #8a6d00; }
.kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; }
.stat-list .stat b { display: block; font-size: 16px; } .stat-list .stat span { color: var(--muted); font-size: 12px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tr.clickable { cursor: pointer; }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-sm th, .table-sm td { padding: 7px 10px; font-size: 13px; }
.table .row-title { font-weight: 600; color: var(--text); } .table .row-sub { color: var(--muted); font-size: 12px; }
.table tfoot td { font-weight: 700; background: #fafbfc; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .ico-xl { color: #cbd5e1; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-3 { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label, label.lbl { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.form-group .hint { font-size: 12px; color: var(--muted); }
.form-group .req { color: var(--red); }
.input, .select, .textarea, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea { width: 100%; font: inherit; font-size: 13.5px; padding: 8px 11px; border: 1px solid var(--border-2); border-radius: 8px; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(28,63,148,.15); }
input:disabled, select:disabled, textarea:disabled { background: #f3f4f6; color: var(--muted); }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.input-sm, .select-sm, input.sm, select.sm { padding: 5px 9px; font-size: 13px; border-radius: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-blue); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; background: #cbd5e1; border-radius: 11px; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--green); } .switch input:checked + .track::after { left: 19px; }
.input-group { display: flex; } .input-group input { border-radius: 8px 0 0 8px; } .input-group .addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 8px 8px 0; background: #f9fafb; color: var(--muted); font-size: 13px; white-space: nowrap; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.field-error { color: var(--red); font-size: 12px; }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.filter-bar .form-group { min-width: 140px; gap: 3px; } .filter-bar label { font-size: 11.5px; }
.filter-bar input, .filter-bar select { padding: 6px 10px; font-size: 13px; }
.search-box { position: relative; } .search-box .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; } .search-box input { padding-left: 32px; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1.25; transition: background .15s, box-shadow .15s, transform .05s; color: var(--text); background: #fff; border-color: var(--border-2); }
.btn:hover { background: #f8fafc; } .btn:active { transform: translateY(1px); } .btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; } .btn-primary:hover { background: var(--brand-blue-dark); }
.btn-accent { background: var(--brand-yellow); border-color: var(--brand-yellow); color: var(--navy); } .btn-accent:hover { background: var(--brand-yellow-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; } .btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; } .btn-success:hover { background: #15803d; }
.btn-outline-danger { color: var(--red); border-color: #fecaca; background: #fff; } .btn-outline-danger:hover { background: #fef2f2; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); } .btn-ghost:hover { background: var(--bg); }
.btn-link { background: none; border: 0; color: var(--brand-blue); padding: 0; font-weight: 500; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; } .btn-sm .ico { width: 14px; height: 14px; }
.btn-xs { padding: 3px 7px; font-size: 12px; border-radius: 5px; } .btn-xs .ico { width: 13px; height: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; } .btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); z-index: 1; }

/* ---------------- Badges / pills ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 11.5px; font-weight: 600; line-height: 1.5; background: #f3f4f6; color: var(--text-2); white-space: nowrap; }
.badge-muted { background: #f3f4f6; color: var(--muted); } .badge-blue { background: #eef2ff; color: var(--brand-blue); } .badge-green { background: #ecfdf5; color: #15803d; } .badge-amber { background: #fffbeb; color: #b45309; } .badge-red { background: #fef2f2; color: #b91c1c; } .badge-yellow { background: #fff8cc; color: #7a5f00; } .badge-navy { background: var(--navy); color: #fff; }
.sev-info { background: #eef2ff; color: #3730a3; } .sev-low { background: #ecfeff; color: #0e7490; } .sev-medium { background: #fffbeb; color: #b45309; } .sev-high { background: #fef2f2; color: #b91c1c; } .sev-critical { background: #7f1d1d; color: #fff; }
.rag-green { background: #dcfce7; color: #166534; } .rag-amber { background: #fef3c7; color: #92400e; } .rag-red { background: #fee2e2; color: #991b1b; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 6px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #f3f4f6; color: var(--text-2); white-space: nowrap; }
.status-pill .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block; flex: none; }
.st-moving { background: #dcfce7; color: #166534; } .st-moving .dot { background: var(--green); }
.st-idle { background: #fef3c7; color: #92400e; } .st-idle .dot { background: var(--amber); }
.st-stopped { background: #dbeafe; color: #1e40af; } .st-stopped .dot { background: var(--blue); }
.st-offline { background: #fee2e2; color: #991b1b; } .st-offline .dot { background: var(--red); }
.st-unknown { background: #f3f4f6; color: #6b7280; } .st-unknown .dot { background: #9ca3af; }
.ev-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; flex: none; } .ev-ico .ico { width: 16px; height: 16px; }
.io-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: #f3f4f6; color: var(--muted); }
.io-flag.on { background: #dcfce7; color: #166534; } .io-flag.off { background: #fee2e2; color: #991b1b; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; }
.tabs a.active, .tabs button.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tab-pane { display: none; } .tab-pane.active { display: block; }
.pill-tabs { display: inline-flex; background: #eef0f4; border-radius: 8px; padding: 3px; gap: 2px; }
.pill-tabs a, .pill-tabs button { padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 0; background: none; cursor: pointer; font-family: inherit; text-decoration: none !important; }
.pill-tabs .active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------------- Alerts / flashes ---------------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; border: 1px solid; }
.alert .ico { flex: none; } .alert span { flex: 1; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; } .alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; } .alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; } .alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-close { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 2px; } .alert-close:hover { opacity: 1; }
.flashes-float { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 700; width: min(560px, 92%); }
.note { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.note-blue { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; align-items: center; gap: 4px; padding: 12px 0 0; flex-wrap: wrap; }
.pagination .pg { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13px; text-decoration: none !important; }
.pagination .pg:hover { background: var(--bg); } .pagination .pg.active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); } .pagination .pg.disabled { opacity: .4; pointer-events: none; } .pagination .pg.gap { border: 0; }
.pagination .pg-info { margin-left: auto; color: var(--muted); font-size: 12.5px; }

/* ---------------- Modal / toast ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,31,69,.55); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: 92vh; display: flex; flex-direction: column; animation: slideUp .18s; }
.modal.modal-lg { max-width: 820px; } .modal.modal-xl { max-width: 1100px; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); } .modal-header h3 { font-size: 16px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; } .modal-close:hover { background: var(--bg); color: var(--text); }
.toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 8px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; min-width: 240px; max-width: 380px; animation: slideUp .2s; border-left: 4px solid var(--brand-yellow); }
.toast.success { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); } .toast.warning { border-left-color: var(--amber); }

/* ---------------- Misc ---------------- */
.progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--brand-blue); border-radius: 4px; }
.score-ring { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 14px; color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); } .timeline li:last-child { border-bottom: 0; }
.timeline .t-time { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 90px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); } .legend span { display: inline-flex; align-items: center; gap: 6px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #eef2ff; color: var(--brand-blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.vehicle-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.mini-map { height: 260px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.map-box { height: 480px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); position: relative; }
.chart-box { position: relative; height: 260px; }
.tooltip { position: relative; cursor: help; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.print-only { display: none; }
@media print { .topbar, .footer, .page-actions, .filter-bar, .pagination, .no-print { display: none !important; } .page { padding: 0; max-width: none; } .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; } .print-only { display: block; } body { background: #fff; } }

/* ---------------- Leaflet vehicle markers ---------------- */
.vm { position: relative; width: 40px; height: 40px; }
.vm .vm-arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) translateY(-22px); border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--c, #16a34a); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.vm .vm-dot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: var(--c, #16a34a); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: #fff; }
.vm .vm-dot .ico { width: 16px; height: 16px; }
.vm .vm-label { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); background: rgba(15,31,69,.92); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; }
.vm.selected .vm-dot { box-shadow: 0 0 0 4px rgba(255,210,0,.85), 0 2px 6px rgba(0,0,0,.35); }
.vm-static .vm-arrow { display: none; }
.evm { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; color: #fff; } .evm .ico { width: 14px; height: 14px; }
.stop-marker { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-blue); color: var(--brand-blue); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.stop-marker.start { border-color: var(--green); color: var(--green); } .stop-marker.end { border-color: var(--red); color: var(--red); }
.pb-marker { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-yellow); border: 3px solid var(--navy); display: flex; align-items: center; justify-content: center; color: var(--navy); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.pb-marker .ico { width: 18px; height: 18px; transform: rotate(var(--rot, 0deg)); }
.leaflet-popup-content { margin: 10px 12px; font-family: var(--font); font-size: 13px; line-height: 1.4; } .leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-control-layers { border-radius: 8px !important; }
.vpop b { font-size: 14px; } .vpop .vpop-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; } .vpop .vpop-row span:first-child { color: var(--muted); }
.vpop .vpop-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) { .mainnav > a span, .mainnav .dropdown-toggle > span { display: none; } .mainnav > a, .mainnav .dropdown-toggle { padding: 8px 10px; } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .mainnav { display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0; background: var(--navy-2); flex-direction: column; align-items: stretch; padding: 8px; margin: 0; height: auto; box-shadow: var(--shadow-lg); }
  .mainnav.open { display: flex; }
  .mainnav > a span, .mainnav .dropdown-toggle > span { display: inline; }
  .mainnav .dropdown-menu { position: static; background: transparent; border: 0; box-shadow: none; padding-left: 20px; } .mainnav .dropdown-menu a { color: rgba(255,255,255,.85); } .mainnav .dropdown-menu a:hover { background: rgba(255,255,255,.08); }
  .brand-text small { display: none; } .user-name { display: none; } .sync-indicator span { display: none; }
  .page { padding: 14px; } .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .form-grid, .form-grid-3 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; }
  .page-header { flex-direction: column; } .footer { flex-direction: column; align-items: flex-start; gap: 2px; }
}
