/* Điều phối xe BVMSGTV — giao diện v3. Thứ tự import quyết định độ ưu tiên. */
/* =====================================================================
   BVMSGTV Điều phối xe — Hệ thống giao diện v3 (v2.9.0)
   Bố cục: sidebar tối cố định + vùng nội dung sáng, mật độ thông tin cao.
   ===================================================================== */

:root {
  /* Nền tối cho sidebar / header ứng dụng tài xế */
  --ink-950: #081816;
  --ink-900: #0c211e;
  --ink-800: #133029;
  --ink-700: #1c3f38;
  --ink-text: #cfdcd9;
  --ink-muted: #83a09a;

  /* Thương hiệu: xanh ngọc bệnh viện */
  --brand-700: #084a43;
  --brand-600: #0b5e55;
  --brand-500: #107262;
  --brand-400: #1f9a84;
  --brand-300: #5cc4ae;
  --brand-100: #d5ede7;
  --brand-50: #edf7f4;

  /* Trung tính (hơi ngả xanh ngọc) */
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #eef2f1;
  --border: #e1e7e5;
  --border-strong: #cad5d2;
  --text: #0e1c1a;
  --text-2: #3e4f4b;
  --muted: #687a76;
  --faint: #9aa8a5;

  /* Ngữ nghĩa */
  --success: #0c8158; --success-bg: #e6f4ec; --success-line: #b9e0cb;
  --warning: #a8590a; --warning-bg: #fdf1df; --warning-line: #f1d2a2;
  --danger: #bf3328;  --danger-bg: #fcebe8;  --danger-line: #f3c2bc;
  --info: #2556bd;    --info-bg: #eaf0fc;    --info-line: #c4d4f5;
  --amber: #c9860f;   --amber-bg: #fff6e5;   --amber-line: #f2d9a6;

  /* Chữ */
  --font: "Be Vietnam Pro", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --fs-xs: 11px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;

  /* Hình khối */
  --r-xs: 6px; --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sh-1: 0 1px 2px rgba(12, 33, 30, .05);
  --sh-2: 0 1px 2px rgba(12, 33, 30, .04), 0 4px 14px rgba(12, 33, 30, .06);
  --sh-pop: 0 20px 50px rgba(8, 24, 22, .22), 0 2px 6px rgba(8, 24, 22, .08);
  --focus: 0 0 0 3px rgba(31, 154, 132, .28);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --gutter: 24px;

  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
#root { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.012em; }
img { max-width: 100%; display: block; }
code { font-family: var(--font-mono); font-size: .92em; }
small { font-size: var(--fs-sm); }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { background: var(--brand-100); }
.ui-icon { flex: 0 0 auto; display: inline-block; vertical-align: middle; }

/* ---------- Form controls ---------- */
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #b3c1be; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-400); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; 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='%23687a76' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--brand-500); flex: 0 0 auto; }
input[type="file"] { padding: 8px; font-size: var(--fs-sm); }
label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
label > small, .form-help { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); line-height: 1.45; }
fieldset { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); display: grid; gap: 12px; }
legend { padding: 0 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid > .span-2, .span-2 { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.form-grid > .form-actions { grid-column: 1 / -1; }
.form-error, .form-warning, .form-success {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid; font-size: var(--fs-sm); font-weight: 500; line-height: 1.45;
}
.form-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.form-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.form-success { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.confirmation-check, .odometer-confirmation-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); font-weight: 500; color: var(--text); line-height: 1.45; }
.confirmation-check input, .odometer-confirmation-check input { margin-top: 2px; }

/* ---------- Buttons ---------- */
.primary-button, .secondary-button, .approve-button, .reject-button, .danger-button, .text-button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: var(--fs-base); font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.primary-button:active, .secondary-button:active, .approve-button:active, .reject-button:active, .danger-button:active { transform: translateY(1px); }
.primary-button { background: var(--brand-600); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--sh-1); }
.primary-button:hover:not(:disabled) { background: var(--brand-700); text-decoration: none; }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-1); }
.secondary-button:hover:not(:disabled) { background: var(--surface-2); border-color: #b3c1be; text-decoration: none; }
.approve-button { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.approve-button:hover:not(:disabled) { background: #d6ede1; }
.reject-button { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.reject-button:hover:not(:disabled) { background: var(--danger-bg); }
.danger-button { background: var(--danger); color: #fff; }
.danger-button:hover:not(:disabled) { background: #a32a20; }
.text-button { min-height: 32px; padding: 0 8px; background: transparent; color: var(--brand-500); }
.text-button:hover:not(:disabled) { background: var(--brand-50); }
.icon-button { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--muted); border-radius: var(--r-sm); font-size: 15px; }
.icon-button:hover { background: var(--surface-3); color: var(--text); }
.compact, .primary-button.compact, .secondary-button.compact, .approve-button.compact, .reject-button.compact { min-height: 32px; padding: 0 11px; font-size: var(--fs-sm); }
.approve-button, .reject-button { font-size: var(--fs-sm); min-height: 34px; padding: 0 12px; }
.full, .primary-button.full, .danger-button.full, .reject-button.full { width: 100%; min-height: 46px; }
button:disabled, .primary-button:disabled, .secondary-button:disabled { opacity: .5; box-shadow: none; }
.danger-text { color: var(--danger) !important; }
.warning-text { color: var(--warning) !important; }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; overflow: hidden; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-header > div { display: grid; gap: 3px; min-width: 0; }
.panel-header h2 { font-size: var(--fs-md); font-weight: 700; }
.panel-header p { font-size: var(--fs-sm); color: var(--muted); }
.panel > .muted, .panel > p.muted { padding: 16px 18px; }
.eyebrow { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-500); }
.muted, .muted-copy { color: var(--muted); font-size: var(--fs-sm); }
.count-pill { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.count-pill.danger { background: var(--danger-bg); color: var(--danger); }
.note-box { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.note-box strong { color: var(--text); font-size: var(--fs-sm); }
.rejection-box { padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger); font-size: var(--fs-sm); }
.resolution-box { padding: 10px 12px; border-radius: var(--r-sm); background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success); font-size: var(--fs-sm); }
.readonly-notice { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--info-line); background: var(--info-bg); color: var(--info); font-size: var(--fs-sm); font-weight: 500; }
.demo-notice { padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-bg); color: var(--warning); font-size: var(--fs-sm); }

.inline-message { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--success-line); background: var(--success-bg); color: var(--success); font-size: var(--fs-sm); font-weight: 600; }
.inline-message.error { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.inline-message button { border: 0; background: transparent; color: inherit; opacity: .7; padding: 2px 6px; border-radius: var(--r-xs); }
.inline-message button:hover { opacity: 1; background: rgba(0,0,0,.05); }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.toolbar > div { display: grid; gap: 3px; min-width: 0; }
.toolbar strong, .toolbar-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.toolbar-note { font-size: var(--fs-sm); color: var(--muted); }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); width: fit-content; max-width: 100%; }
.filter-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-xs); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; }
.filter-tabs button:hover { color: var(--text); background: var(--surface-2); }
.filter-tabs button.active { background: var(--ink-900); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
thead th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfb; }
td strong { display: block; color: var(--text); font-weight: 600; }
td small { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.clickable-table-row { cursor: pointer; }
.clickable-table-row:focus-visible td { background: var(--brand-50); }
.money-cell { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ---------- Badges ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; line-height: 1;
  background: var(--surface-3); color: var(--text-2);
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status-active, .status-in_use, .status-completed, .status-resolved, .status-available, .status-approved, .status-paid, .status-fleet_approved, .status-converted { background: var(--success-bg); color: var(--success); }
.status-pending_fleet, .status-pending_director, .status-pending_accountant, .status-pending, .status-scheduled { background: var(--warning-bg); color: var(--warning); }
.status-assigned, .status-accepted, .status-ready, .status-reported { background: var(--info-bg); color: var(--info); }
.status-maintenance, .status-handling, .status-in_progress { background: #f1ecfb; color: #6343b8; }
.status-cancelled, .status-rejected, .status-out_of_service { background: var(--danger-bg); color: var(--danger); }
.status-active::before { animation: badge-pulse 1.6s ease-in-out infinite; }
@keyframes badge-pulse { 50% { opacity: .25; } }
.role-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-xs); background: var(--brand-50); color: var(--brand-600); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.severity-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); }
.severity-low { background: var(--info-bg); color: var(--info); }
.severity-medium { background: var(--warning-bg); color: var(--warning); }
.severity-high { background: var(--danger-bg); color: var(--danger); }
.severity-critical { background: var(--danger); color: #fff; }
.approval-route-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--success-line); background: var(--success-bg); color: var(--success); font-size: var(--fs-xs); font-weight: 600; width: fit-content; }
.deadline-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.deadline-badge.neutral { background: var(--surface-3); color: var(--muted); }
.deadline-badge.success { background: var(--success-bg); color: var(--success); }
.deadline-badge.warning { background: var(--warning-bg); color: var(--warning); }
.deadline-badge.danger { background: var(--danger-bg); color: var(--danger); }
.plate { font-family: var(--font-mono); font-weight: 600; letter-spacing: .02em; }

/* ---------- Detail lists ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.detail-grid > div { display: grid; gap: 3px; padding: 11px 13px; background: var(--surface); min-width: 0; }
.detail-grid span { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.detail-grid strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-grid small { color: var(--muted); font-size: var(--fs-xs); }
.detail-grid-wide, .compact-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-list { display: grid; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 13px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); }
.detail-list strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.compact-record-list { display: grid; gap: 6px; }
.compact-record-list > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.compact-record-list > div > small { grid-column: 1 / -1; color: var(--muted); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Empty, loading, network ---------- */
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; background: var(--surface-3); color: var(--muted); }
.empty-state h3 { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.empty-state p { max-width: 44ch; font-size: var(--fs-sm); }
.loading-state { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); background: var(--bg); }
.spinner, .spinner-small, .login-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand-500); animation: spin .8s linear infinite; }
.spinner-small, .login-spinner { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-card { min-height: 180px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.network-banner { position: sticky; top: 0; z-index: 70; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 16px; font-size: var(--fs-sm); font-weight: 600; }
.network-banner.offline { background: var(--ink-900); color: #fff; }
.network-banner.syncing { background: var(--amber-bg); color: var(--warning); border-bottom: 1px solid var(--amber-line); }
.network-banner button { border: 0; border-radius: var(--r-xs); padding: 4px 10px; background: rgba(0,0,0,.08); font-weight: 700; }
.data-error-banner { margin: 12px var(--gutter) 0; padding: 10px 14px; border-radius: var(--r); background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger); font-size: var(--fs-sm); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(8, 24, 22, .55); backdrop-filter: blur(3px); animation: fade-in .15s ease-out; }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-pop); overflow: hidden; animation: pop-in .18s ease-out; }
.modal-card.modal-wide { width: min(920px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: var(--fs-lg); font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-body > * { flex-shrink: 0; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* ---------- Responsive primitives ---------- */
@media (max-width: 760px) {
  :root { --gutter: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid, .detail-grid-wide, .compact-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal-card, .modal-card.modal-wide { width: 100%; max-height: 94vh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet-in .22s ease-out; }
  .modal-body { padding: 16px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .toolbar { align-items: stretch; }
  .filter-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  thead th, tbody td { padding: 10px 12px; }
}
@media (max-width: 420px) { .detail-grid, .detail-grid-wide, .compact-detail-grid { grid-template-columns: 1fr; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
@media print {
  .sidebar, .topbar, .mobile-nav, .notification-toast-stack, .network-banner, .report-export-actions { display: none !important; }
  .app-shell { display: block !important; }
  .main-area { margin: 0 !important; }
  body, .panel { background: #fff; box-shadow: none; }
}
.toolbar > .filter-tabs { display: flex; }
/* =====================================================================
   Khung ứng dụng văn phòng: sidebar tối, topbar, điều hướng di động
   ===================================================================== */

.app-shell { min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--ink-900);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(31, 154, 132, .16), transparent 60%);
  color: var(--ink-text);
  border-right: 1px solid rgba(255, 255, 255, .04);
  transition: width .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; margin: 14px 12px 8px; padding: 8px; border: 0; border-radius: var(--r); background: transparent; color: #fff; text-align: left; }
.sidebar-brand:hover { background: rgba(255, 255, 255, .05); }
.sidebar-brand-logo { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #fff; overflow: hidden; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.sidebar-brand-logo img { width: 32px; height: 32px; object-fit: contain; }
.sidebar-brand-copy { display: grid; gap: 1px; min-width: 0; }
.sidebar-brand-copy strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-brand-copy small { font-size: 11px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; display: grid; align-content: start; gap: 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.side-nav-group { display: grid; gap: 2px; }
.side-nav-label { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #5f7d77; }
.side-nav button {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-text); font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background-color .12s, color .12s;
}
.side-nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav button.active { background: rgba(92, 196, 174, .14); color: #fff; font-weight: 600; }
.side-nav button.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-300); }
.side-nav button.active .side-nav-icon { color: var(--brand-300); }
.side-nav-icon { position: relative; display: grid; place-items: center; width: 20px; color: var(--ink-muted); }
.side-nav button:hover .side-nav-icon { color: #fff; }
.side-nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav-badge { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-nav-dot { position: absolute; top: -5px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: #e5484d; color: #fff; font-size: 9.5px; font-weight: 700; box-shadow: 0 0 0 2px var(--ink-900); }

.sidebar-footer { padding: 10px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); display: grid; gap: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, .04); color: #fff; text-align: left; }
.sidebar-user:hover { background: rgba(255, 255, 255, .08); }
.sidebar-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--brand-400); color: #fff; font-weight: 700; font-size: 14px; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-copy { display: grid; min-width: 0; }
.sidebar-user-copy strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy small { font-size: 11px; color: var(--ink-muted); }
.sidebar-footer-actions { display: flex; gap: 6px; }
.sidebar-icon-button { flex: 1; height: 32px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-sm); background: transparent; color: var(--ink-muted); }
.sidebar-icon-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-icon-button.logout:hover { background: rgba(229, 72, 77, .16); border-color: rgba(229, 72, 77, .3); color: #ff9a9d; }
.sidebar-floating-tooltip { position: fixed; z-index: 90; transform: translateY(-50%); padding: 6px 10px; border-radius: var(--r-xs); background: var(--ink-950); color: #fff; font-size: 12px; font-weight: 600; box-shadow: var(--sh-pop); pointer-events: none; white-space: nowrap; }

/* Sidebar thu gọn */
.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .sidebar-brand { justify-content: center; margin-inline: 8px; }
.sidebar-collapsed .sidebar-brand-copy, .sidebar-collapsed .side-nav-label, .sidebar-collapsed .side-nav-text, .sidebar-collapsed .sidebar-user-copy { display: none; }
.sidebar-collapsed .side-nav { padding-inline: 10px; gap: 10px; }
.sidebar-collapsed .side-nav-group + .side-nav-group { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-collapsed .side-nav button { justify-content: center; padding: 0; }
.sidebar-collapsed .side-nav button.active::before { left: -10px; }
.sidebar-collapsed .sidebar-user { justify-content: center; padding: 6px; }
.sidebar-collapsed .sidebar-footer-actions { flex-direction: column; }

/* ---------- Vùng nội dung ---------- */
.main-area { min-width: 0; margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .2s ease; padding-bottom: 40px; }
.sidebar-collapsed .main-area { margin-left: var(--sidebar-w-collapsed); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: var(--topbar-h); padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-mobile-brand { display: none; }
.topbar-heading { display: grid; gap: 1px; min-width: 0; flex: 1; }
.page-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.page-breadcrumb .ui-icon { color: var(--faint); }
.topbar-heading h1 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar-icon-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); }
.topbar-icon-button:hover { background: var(--surface-2); color: var(--text); }
.ui-icon.spinning { animation: spin .8s linear infinite; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 2px; }
.connection-dot.online { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.connection-dot.offline { background: var(--danger); box-shadow: 0 0 0 3px rgba(191, 51, 40, .18); }
.topbar-avatar { width: 36px; height: 36px; display: none; place-items: center; border: 0; border-radius: 50%; overflow: hidden; background: var(--brand-500); color: #fff; font-weight: 700; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.page-description { padding: 18px var(--gutter) 0; color: var(--muted); font-size: var(--fs-sm); max-width: 90ch; }
.page-content { padding: 16px var(--gutter) 0; display: grid; gap: 16px; align-content: start; min-width: 0; }
.page-content > * { min-width: 0; }

/* ---------- Tìm kiếm toàn cục ---------- */
.global-search-trigger { display: flex; align-items: center; gap: 8px; width: 300px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); text-align: left; }
.global-search-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.global-search-trigger strong { flex: 1; font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search-trigger kbd, kbd { padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.global-search-overlay, .notification-overlay, .mobile-more-overlay { position: fixed; inset: 0; z-index: 900; border: 0; background: rgba(8, 24, 22, .4); backdrop-filter: blur(2px); animation: fade-in .15s ease-out; }
.global-search-panel { position: fixed; z-index: 901; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-pop); overflow: hidden; animation: pop-in .16s ease-out; }
.global-search-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.global-search-panel > header span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.global-search-panel > header h2 { font-size: var(--fs-md); }
.global-search-input { display: flex; align-items: center; gap: 10px; margin: 6px 16px 10px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--muted); }
.global-search-input:focus-within { border-color: var(--brand-400); box-shadow: var(--focus); }
.global-search-input input { border: 0; box-shadow: none; padding: 12px 0; font-size: 15px; background: transparent; }
.global-search-results { overflow-y: auto; padding: 4px 8px 10px; display: grid; gap: 2px; border-top: 1px solid var(--border); }
.global-search-results > button { display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 10px; padding: 9px 8px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; }
.global-search-results > button:hover, .global-search-results > button:focus-visible { background: var(--brand-50); }
.global-search-results > button > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); }
.global-search-results > button div { display: grid; gap: 1px; min-width: 0; }
.global-search-results strong { font-size: 13.5px; font-weight: 600; }
.global-search-results small, .global-search-results time { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search-results i { color: var(--faint); font-style: normal; }
.global-search-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; color: var(--muted); }
.global-search-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-3); }
.global-search-empty strong { color: var(--text); }

/* ---------- Trung tâm thông báo ---------- */
.notification-center { position: relative; }
.notification-bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); }
.notification-bell:hover { background: var(--surface-2); color: var(--text); }
.notification-bell strong { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.notification-popover { position: fixed; z-index: 901; top: 72px; right: 16px; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 96px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-pop); overflow: hidden; animation: pop-in .16s ease-out; }
.notification-popover-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; }
.notification-popover-header span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.notification-popover-header h2 { font-size: var(--fs-lg); }
.notification-tools { display: flex; gap: 6px; padding: 0 16px 10px; border-bottom: 1px solid var(--border); }
.notification-tools button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-xs); padding: 4px 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.notification-tools button:hover:not(:disabled) { background: var(--surface-2); }
.notification-permission-card { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 10px 12px; border: 1px solid var(--info-line); border-radius: var(--r); background: var(--info-bg); color: var(--info); text-align: left; }
.notification-permission-card div { flex: 1; display: grid; }
.notification-permission-card small { color: var(--text-2); }
.notification-list { overflow-y: auto; padding: 6px 8px 10px; display: grid; gap: 2px; }
.notification-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 26px 10px 8px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; }
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: #f4faf8; }
.notification-item-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); }
.notification-item.priority-important .notification-item-icon { background: var(--warning-bg); color: var(--warning); }
.notification-item.priority-urgent .notification-item-icon { background: var(--danger-bg); color: var(--danger); }
.notification-item-copy { display: grid; gap: 2px; min-width: 0; }
.notification-item-copy strong { font-size: 13px; font-weight: 600; }
.notification-item-copy small { font-size: 12px; color: var(--text-2); }
.notification-item-copy time { font-size: 11px; color: var(--faint); }
.notification-item > i { position: absolute; top: 16px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-400); }
.notification-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.notification-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-3); }
.notification-empty strong { color: var(--text); }
.notification-toast-stack { position: fixed; z-index: 950; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(360px, calc(100vw - 24px)); }
.notification-toast { display: grid; grid-template-columns: 32px 1fr 20px; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--border); border-left: 3px solid var(--brand-400); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-pop); text-align: left; animation: pop-in .2s ease-out; }
.notification-toast.priority-important { border-left-color: var(--amber); }
.notification-toast.priority-urgent { border-left-color: var(--danger); }
.notification-toast > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); }
.notification-toast div { display: grid; gap: 2px; min-width: 0; }
.notification-toast strong { font-size: 13px; }
.notification-toast small { font-size: 12px; color: var(--muted); }
.notification-toast i { color: var(--faint); font-style: normal; display: grid; place-items: center; }

/* ---------- Trực tuyến ---------- */
.presence-dot { position: relative; display: inline-block; width: 9px; height: 9px; min-width: 9px; border-radius: 50%; background: #b7c3c0; vertical-align: middle; }
.presence-dot.online { background: #12b76a; }
.presence-dot.online::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(18, 183, 106, .35); animation: presence-pulse 2.2s ease-out infinite; }
.presence-dot.overlay { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
@keyframes presence-pulse { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.presence-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.presence-label.online { color: var(--success); }
.presence-count-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 600; }
.online-users { position: relative; }
.online-users-button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-size: 13px; }
.online-users-button:hover { background: var(--surface-2); }
.online-users-button strong { font-variant-numeric: tabular-nums; color: var(--text); }
.online-users-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(340px, 88vw); max-height: 420px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-pop); animation: pop-in .15s ease-out; }
.online-users-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 6px 8px 10px; border-bottom: 1px solid var(--border); }
.online-users-head > div { display: grid; gap: 1px; }
.online-users-head small { color: var(--muted); font-size: var(--fs-xs); }
.online-users-mode { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.online-users-mode.live { background: var(--success-bg); color: var(--success); }
.online-users-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 1px; }
.online-users-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); }
.online-users-list li:hover { background: var(--surface-2); }
.online-users-list li > div { display: grid; min-width: 0; }
.online-users-list strong { font-size: 13px; font-weight: 600; }
.online-users-list small { color: var(--muted); font-size: var(--fs-xs); }
.online-users-avatar { position: relative; width: 32px; height: 32px; min-width: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: 13px; }
.online-users-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.online-users-empty { margin: 12px 8px; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Điều hướng di động ---------- */
.mobile-nav, .mobile-more-sheet { display: none; }

@media (max-width: 1100px) {
  .global-search-trigger { width: 38px; padding: 0; justify-content: center; }
  .global-search-trigger strong, .global-search-trigger kbd { display: none; }
}

@media (max-width: 920px) {
  :root { --topbar-h: 56px; }
  .sidebar, .sidebar-floating-tooltip { display: none; }
  .main-area, .sidebar-collapsed .main-area { margin-left: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .topbar { gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top, 0px); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
  .topbar-mobile-brand { display: block; }
  .topbar-mobile-brand button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
  .topbar-mobile-brand img { width: 28px; height: 28px; object-fit: contain; }
  .page-breadcrumb { display: none; }
  .topbar-heading h1 { font-size: var(--fs-lg); }
  .topbar-actions { gap: 6px; }
  .topbar-actions .online-users, .topbar-icon-button.refresh { display: none; }
  .topbar-avatar { display: grid; }
  .connection-dot { display: none; }
  .page-description { display: none; }
  .page-content { padding-top: 14px; gap: 14px; }
  .notification-popover { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 86vh; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-in .2s ease-out; }
  .notification-toast-stack { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; width: auto; }
  .global-search-panel { top: 0; left: 0; transform: none; width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }

  .mobile-nav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .mobile-nav button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); }
  .mobile-nav button small { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
  .mobile-nav button.active { color: var(--brand-600); }
  .mobile-nav button.active .mobile-nav-icon { background: var(--brand-50); }
  .mobile-nav-icon { position: relative; width: 44px; height: 28px; display: grid; place-items: center; border-radius: 999px; }
  .mobile-nav-badge { position: absolute; top: -4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: #e5484d; color: #fff; font-size: 9.5px; font-weight: 700; box-shadow: 0 0 0 2px #fff; }

  .mobile-more-sheet {
    position: fixed; z-index: 901; left: 0; right: 0; bottom: 0;
    display: grid; gap: 14px; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-pop); animation: sheet-in .2s ease-out;
  }
  .mobile-more-sheet::before { content: ''; justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  .mobile-more-user { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .mobile-more-user div { display: grid; }
  .mobile-more-user small { color: var(--muted); }
  .mobile-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mobile-more-grid button { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-2); }
  .mobile-more-grid button > span { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--brand-600); box-shadow: var(--sh-1); }
  .mobile-more-grid button strong { font-size: 12px; font-weight: 600; }
  .mobile-more-grid button.active { border-color: var(--brand-300); background: var(--brand-50); }
  .mobile-more-logout { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 1px solid var(--danger-line); border-radius: var(--r); background: var(--surface); color: var(--danger); font-weight: 600; }
}
.sidebar-collapsed .sidebar-icon-button { flex: 0 0 32px; }
/* =====================================================================
   Thành phần dùng chung: ngày giờ, tệp đính kèm, ảnh, ghi âm
   ===================================================================== */

/* Ô nhập ngày DD/MM/YYYY */
.vietnam-date-control { width: 100%; min-width: 0; display: grid; gap: 5px; }
.vietnam-date-input-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 42px; width: 100%; min-width: 0; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.vietnam-date-input-row:hover { border-color: #b3c1be; }
.vietnam-date-input-row:focus-within { border-color: var(--brand-400); box-shadow: var(--focus); }
.vietnam-date-text-input { min-width: 0; min-height: 38px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.vietnam-native-picker-button { position: relative; display: grid; place-items: center; border-left: 1px solid var(--border); background: var(--surface-2); color: var(--muted); overflow: hidden; }
.vietnam-date-input-row:focus-within .vietnam-native-picker-button { color: var(--brand-500); }
.vietnam-calendar-icon { display: grid; pointer-events: none; }
.vietnam-calendar-icon svg { width: 18px; height: 18px; }
.vietnam-native-picker-input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; min-height: 0 !important; margin: 0; padding: 0; opacity: 0; border: 0; cursor: pointer; }
.vietnam-date-hint { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.vietnam-date-hint b { color: var(--text-2); font-weight: 600; }

/* Chọn nhiều tệp */
.plan-multi-upload-field { gap: 8px; }
.plan-multi-upload-box { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-2); transition: border-color .15s, background-color .15s; }
.plan-multi-upload-box:hover, .plan-multi-upload-box:focus-within { border-color: var(--brand-400); background: var(--brand-50); }
.plan-multi-upload-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface); color: var(--brand-500); box-shadow: var(--sh-1); }
.plan-multi-upload-copy { display: grid; gap: 2px; }
.plan-multi-upload-copy strong { font-size: 13px; color: var(--text); }
.plan-multi-upload-copy small { font-weight: 400; color: var(--muted); }
.plan-multi-upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.selected-plan-files { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.selected-plan-files-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.selected-plan-files-head strong { font-size: 13px; color: var(--text); }
.selected-plan-files-head small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.selected-plan-file-list { display: grid; gap: 6px; }
.selected-plan-file-list > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.selected-plan-file-list > div > div { display: grid; min-width: 0; }
.selected-plan-file-list strong { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-plan-file-list small { font-size: 11px; font-weight: 400; color: var(--muted); }
.selected-plan-file-list button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); }
.selected-plan-file-list button:hover { background: var(--danger-bg); color: var(--danger); }
.file-type { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.file-type.file-pdf { background: #fdecea; color: #c2372c; }
.file-type.file-doc { background: #e8effc; color: #2556bd; }
.file-type.file-xls { background: #e6f4ec; color: #0c8158; }
.file-type.file-ppt { background: #fdf0e5; color: #b6540f; }
.file-type.file-image { background: var(--brand-50); color: var(--brand-600); }

/* Xem tệp đính kèm */
.attachment-open-button { gap: 6px; }
.attachment-simple-viewer { display: grid; gap: 12px; }
.attachment-simple-image-stage { position: relative; border-radius: var(--r); background: var(--ink-950); overflow: hidden; }
.attachment-simple-image-stage img { max-width: 100%; max-height: 68vh; width: auto; height: auto; margin: auto; }
.attachment-simple-empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; border-radius: var(--r); background: var(--surface-2); color: var(--muted); text-align: center; }
.attachment-simple-empty strong { color: var(--text); }
.attachment-thumbnail-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.attachment-thumbnail-strip button { flex: 0 0 72px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.attachment-thumbnail-strip button.active { border-color: var(--brand-400); }
.attachment-thumbnail-strip img { width: 100%; height: 100%; object-fit: cover; }
.attachment-document-links { display: grid; gap: 8px; }
.attachment-document-links > strong { font-size: var(--fs-sm); color: var(--text-2); }
.attachment-document-links > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.attachment-document-links a, .attachment-document-links .unavailable { display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); text-decoration: none; }
.attachment-document-links a:hover { border-color: var(--brand-300); background: var(--brand-50); }
.attachment-document-links a > span:nth-child(2), .attachment-document-links .unavailable > span:nth-child(2) { display: grid; min-width: 0; }
.attachment-document-links b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-document-links small { font-size: 11px; color: var(--muted); }
.attachment-document-links em { color: var(--faint); display: grid; }
.attachment-document-links .unavailable { opacity: .6; }
.attachment-zoom-stage { position: relative; width: 100%; min-height: min(64vh, 680px); display: grid; place-items: center; overflow: hidden; touch-action: none; overscroll-behavior: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.attachment-zoom-stage img { transform-origin: center center; will-change: transform; transition: transform .14s ease-out; }
.attachment-zoom-stage.is-zoomed img { transition: none; cursor: grab; }
.attachment-zoom-stage.is-zoomed:active img { cursor: grabbing; }
.attachment-zoom-controls { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r); background: rgba(255,255,255,.94); box-shadow: var(--sh-2); }
.attachment-zoom-controls button { min-width: 34px; height: 34px; border: 0; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text); font-size: 18px; font-weight: 600; }
.attachment-zoom-controls button:disabled { opacity: .35; }
.attachment-zoom-controls .zoom-value { min-width: 54px; padding: 0 8px; font-size: 12px; font-family: var(--font-mono); }
.attachment-zoom-hint { position: absolute; left: 12px; bottom: 16px; color: rgba(255,255,255,.7); font-size: 11px; pointer-events: none; }
.modal-backdrop, .modal-card { overscroll-behavior: contain; }

/* Xem trước ảnh / phóng to */
.inline-image-preview { width: min(100%, 520px); display: grid; padding: 0; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); overflow: hidden; color: var(--brand-600); text-align: left; }
.inline-image-preview:hover { border-color: var(--brand-300); }
.inline-image-preview img { width: 100%; max-height: 340px; object-fit: contain; background: var(--surface-3); }
.inline-image-preview span { padding: 8px 12px; font-size: var(--fs-xs); font-weight: 600; text-align: center; }
.inline-image-preview.compact { width: 84px; min-width: 84px; }
.inline-image-preview.compact img { width: 100%; height: 56px; object-fit: cover; }
.inline-image-preview.compact span { padding: 4px; font-size: 10px; }
.image-lightbox { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: rgba(5, 16, 14, .9); backdrop-filter: blur(6px); animation: fade-in .15s ease-out; }
.image-lightbox-content { max-width: min(1100px, 94vw); max-height: 90dvh; display: grid; gap: 10px; justify-items: center; }
.image-lightbox-content img { max-width: 100%; max-height: 82dvh; object-fit: contain; border-radius: var(--r); }
.image-lightbox-content p { color: rgba(255,255,255,.75); font-size: var(--fs-sm); text-align: center; }
.image-lightbox-close { position: fixed; top: 16px; right: 16px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.image-lightbox-close:hover { background: rgba(255,255,255,.22); }

/* Chụp ảnh / chọn tệp */
.media-input { position: relative; display: grid; gap: 8px; justify-items: center; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-2); text-align: center; cursor: pointer; }
.media-input:hover { border-color: var(--brand-400); background: var(--brand-50); }
.media-input.processing { opacity: .8; }
.media-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.media-title .ui-icon { color: var(--brand-500); }
.media-input input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.media-preview { max-height: 220px; width: auto; border-radius: var(--r-sm); box-shadow: var(--sh-2); }
.file-selected { font-size: var(--fs-xs); font-weight: 500; color: var(--success); }
.media-processing { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.media-error { font-size: var(--fs-xs); color: var(--danger); }

/* Ghi âm */
.audio-recorder { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.audio-recorder > div:first-child { display: grid; gap: 2px; }
.audio-recorder > div:first-child strong { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.audio-recorder > div:first-child small { color: var(--muted); font-size: var(--fs-xs); }
.record-start, .record-stop { min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); font-weight: 600; }
.record-stop { border-color: var(--danger); background: var(--danger); color: #fff; animation: badge-pulse 1.4s ease-in-out infinite; }
.audio-result { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.audio-result audio { flex: 1; min-width: 0; height: 36px; }
.audio-result button { border: 0; background: transparent; color: var(--danger); font-weight: 600; font-size: var(--fs-sm); }
.audio-recorder > p { grid-column: 1 / -1; color: var(--danger); font-size: var(--fs-xs); }

@media (max-width: 600px) {
  .attachment-zoom-stage { min-height: calc(100dvh - 160px); max-height: calc(100dvh - 130px); }
  .attachment-zoom-stage img { max-width: 100%; max-height: calc(100dvh - 165px); }
  .attachment-zoom-hint { display: none; }
  .modal-backdrop { touch-action: pan-y; }
  .attachment-simple-image-stage { touch-action: none; }
  .attachment-document-links > div { grid-template-columns: 1fr; }
  .image-lightbox { padding: 10px; }
}
/* =====================================================================
   Trang Tổng quan
   ===================================================================== */
.dashboard { display: grid; gap: 16px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.dashboard-heading h2 { font-size: var(--fs-2xl); font-weight: 700; text-transform: capitalize; }
.dashboard-heading-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.dashboard-heading-stats span { display: inline-flex; align-items: baseline; gap: 5px; height: 30px; padding: 0 12px; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); color: var(--muted); }
.dashboard-heading-stats b { color: var(--text); font-variant-numeric: tabular-nums; }

/* KPI */
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.metric-card { display: grid; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-top p { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); }
.metric-card > strong { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card > small { font-size: var(--fs-xs); color: var(--muted); }
.metric-card.success .metric-icon { background: var(--success-bg); color: var(--success); }
.metric-card.warning .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-card.warning > strong { color: var(--warning); }
.metric-card.danger .metric-icon { background: var(--danger-bg); color: var(--danger); }
.metric-card.danger > strong { color: var(--danger); }

.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.dashboard-main, .dashboard-side { display: grid; gap: 16px; min-width: 0; }
.time-cell { font-family: var(--font-mono); font-weight: 600; color: var(--text); white-space: nowrap; }
.inline-adhoc { display: inline-flex; align-items: center; height: 17px; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--amber-bg); color: var(--warning); font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }

/* Việc cần xử lý */
.action-center { background: var(--ink-900); color: #fff; border-radius: var(--r-lg); padding: 16px; display: grid; gap: 14px; box-shadow: var(--sh-2); background-image: radial-gradient(90% 120% at 100% 0%, rgba(92, 196, 174, .18), transparent 55%); }
.action-center-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.action-center-heading > div { display: grid; gap: 2px; }
.action-center-heading span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; color: var(--brand-300); }
.action-center-heading h2 { font-size: var(--fs-lg); font-weight: 700; }
.action-center-heading p { font-size: var(--fs-sm); color: var(--ink-muted); }
.action-center-heading > strong { min-width: 44px; height: 44px; padding: 0 10px; display: grid; place-items: center; border-radius: 12px; font-size: 20px; font-variant-numeric: tabular-nums; }
.action-center-heading > strong.has-work { background: #fff; color: var(--ink-900); }
.action-center-heading > strong.all-done { background: rgba(92, 196, 174, .18); color: var(--brand-300); }
.action-center-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.action-center-card { display: grid; grid-template-columns: 34px 1fr auto 16px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); background: rgba(255,255,255,.05); color: #fff; text-align: left; transition: background-color .12s, border-color .12s; }
.action-center-card:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.action-center-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(255,255,255,.08); color: #fff; }
.action-center-card.warning .action-center-icon { background: rgba(242, 193, 78, .16); color: #f5c95d; }
.action-center-card.danger .action-center-icon { background: rgba(229, 72, 77, .18); color: #ff8f93; }
.action-center-card.success .action-center-icon { background: rgba(92, 196, 174, .18); color: var(--brand-300); }
.action-center-copy { display: grid; min-width: 0; }
.action-center-copy strong { font-size: 13px; font-weight: 600; }
.action-center-copy small { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-center-card > b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.action-center-card > i { color: var(--ink-muted); display: grid; }
.action-center-empty { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(255,255,255,.05); font-size: var(--fs-sm); }
.action-center-empty span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(92, 196, 174, .2); color: var(--brand-300); }
.action-center-empty small { margin-left: auto; color: var(--ink-muted); }

/* Không gian theo vai trò */
.role-workspace { display: grid; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.role-workspace-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.role-workspace-heading > div { display: grid; gap: 3px; }
.role-workspace-heading span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.role-workspace-heading h3 { font-size: var(--fs-md); font-weight: 700; }
.role-workspace-heading p { font-size: var(--fs-sm); color: var(--muted); max-width: 70ch; }
.role-workspace-heading > strong { flex: 0 0 auto; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: var(--fs-xs); font-weight: 600; }
.director-kpi-grid, .director-brief-grid, .finance-overview-grid, .admin-security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.director-kpi-grid article, .director-brief-grid article, .finance-overview-grid article, .admin-security-grid article { display: grid; gap: 3px; padding: 12px 14px; background: var(--surface); }
.director-kpi-grid span, .director-brief-grid span, .finance-overview-grid span, .admin-security-grid span { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.director-kpi-grid strong, .finance-overview-grid strong, .admin-security-grid strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.director-brief-grid strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.director-kpi-grid small, .director-brief-grid small, .finance-overview-grid small, .admin-security-grid small { font-size: var(--fs-xs); color: var(--muted); }
.director-kpi-grid .urgent strong, .admin-security-grid .warning strong { color: var(--danger); }
.director-brief-grid .warning { background: #fffbf3; }
.director-brief-grid .warning strong { color: var(--warning); }
.workspace-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workspace-list, .workspace-breakdown { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.workspace-list h4, .workspace-breakdown h4 { margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 700; }
.workspace-list article { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); }
.workspace-list article div { display: grid; min-width: 0; }
.workspace-list article strong { font-size: 13px; }
.workspace-list article small { font-size: var(--fs-xs); color: var(--muted); }
.workspace-list article > span { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.workspace-list.danger article > span { color: var(--danger); }
.workspace-list.success article > span { color: var(--success); }
.workspace-list.warning article > span { color: var(--warning); }
.workspace-empty { font-size: var(--fs-sm); color: var(--muted); padding: 6px 2px; }
.workspace-breakdown > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.workspace-breakdown strong { font-variant-numeric: tabular-nums; }
.vehicle-health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.vehicle-health-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.vehicle-health-card > div { display: grid; }
.vehicle-health-card > div strong { font-family: var(--font-mono); font-size: 14px; }
.vehicle-health-card > div span { font-size: var(--fs-xs); color: var(--muted); }
.vehicle-health-card em { width: fit-content; font-style: normal; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); }
.vehicle-health-card.needs-attention { border-color: var(--warning-line); background: #fffbf3; }
.vehicle-health-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: var(--fs-xs); color: var(--muted); }
.vehicle-health-card li { display: flex; justify-content: space-between; gap: 8px; }
.vehicle-health-card li strong { color: var(--text-2); font-weight: 600; }
.role-distribution-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.role-distribution-grid div { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.role-distribution-grid strong { font-variant-numeric: tabular-nums; }

/* Giám sát vị trí */
.live-trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 14px; }
.live-trip-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.live-trip-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.live-trip-top > div { display: grid; }
.live-trip-top strong { font-family: var(--font-mono); font-size: 15px; }
.live-trip-top small { color: var(--muted); font-size: var(--fs-xs); }
.live-trip-route { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-trip-route div { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.live-trip-route span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.live-trip-route strong { font-size: 13px; }
.live-trip-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: var(--fs-xs); color: var(--muted); }
.live-trip-meta strong { color: var(--text-2); font-weight: 600; }
.live-trip-map, .trip-detail-live-map { position: relative; height: 200px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.live-trip-map iframe, .trip-detail-live-map iframe { width: 100%; height: 100%; border: 0; }
.live-map-logo-marker, .trip-detail-logo-marker { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 999px; background: var(--ink-900); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 600; box-shadow: var(--sh-pop); pointer-events: none; }
.live-map-logo-marker img, .trip-detail-logo-marker img { width: 22px; height: 22px; border-radius: 50%; background: #fff; object-fit: contain; }
.live-location-freshness { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #fff; box-shadow: var(--sh-2); }
.live-location-freshness.live { color: var(--success); }
.live-location-freshness.delayed { color: var(--warning); }
.live-location-freshness.stale { color: var(--danger); }
.live-trip-location { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: var(--fs-xs); }
.live-trip-location code { color: var(--muted); }
.live-trip-location.empty { color: var(--muted); padding: 10px; border-radius: var(--r-sm); background: var(--surface-2); }

/* Cảnh báo & kiểm tra dữ liệu */
.alert-list, .operational-insight-list { display: grid; padding: 6px; }
.alert-item, .operational-insight-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 9px 8px; border-radius: var(--r-sm); }
.operational-insight-item { grid-template-columns: 28px 1fr 16px; border: 0; background: transparent; text-align: left; width: 100%; }
.operational-insight-item:hover { background: var(--surface-2); }
.alert-item > span, .operational-insight-item > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); }
.alert-item.warning > span, .operational-insight-item.warning > span { background: var(--warning-bg); color: var(--warning); }
.alert-item.danger > span, .operational-insight-item.danger > span { background: var(--danger-bg); color: var(--danger); }
.alert-item div, .operational-insight-item div { display: grid; gap: 1px; min-width: 0; }
.alert-item strong, .operational-insight-item strong { font-size: 13px; font-weight: 600; }
.alert-item small, .operational-insight-item small { font-size: var(--fs-xs); color: var(--muted); }
.operational-insight-item i { color: var(--faint); align-self: center; display: grid; }
.alert-panel .empty-state, .insight-panel .empty-state { padding: 24px 16px; }

/* Hoạt động gần đây */
.timeline { display: grid; padding: 6px; }
.timeline-item { display: grid; grid-template-columns: 28px 1fr 16px; gap: 10px; align-items: start; width: 100%; padding: 9px 8px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; }
.timeline-item:hover { background: var(--surface-2); }
.timeline-dot { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--brand-50); color: var(--brand-600); }
.timeline-dot.danger { background: var(--danger-bg); color: var(--danger); }
.timeline-item div { display: grid; gap: 1px; min-width: 0; }
.timeline-item strong { font-size: 13px; font-weight: 600; }
.timeline-item p { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-item small { font-size: 11px; color: var(--faint); }
.timeline-chevron { color: var(--faint); align-self: center; }

/* Người dùng trực tuyến */
.online-users-panel .count-pill { gap: 6px; }
.online-users-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.online-user-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.online-user-chip strong { font-size: 12px; font-weight: 600; }
.online-user-chip small { color: var(--muted); font-size: 11px; }
.online-user-chip.role-driver { border-color: var(--success-line); background: var(--success-bg); }
.online-users-chips .muted { padding: 4px 0; }
.online-users-offline { margin: 0 14px 12px; font-size: var(--fs-sm); }
.online-users-offline summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
.online-users-offline ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.online-users-offline li { display: flex; align-items: center; gap: 8px; }
.online-users-offline li strong { font-weight: 500; }
.online-users-offline li small { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }

/* Chi tiết hoạt động (modal) */
.activity-detail-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.activity-detail-summary span { font-size: var(--fs-sm); color: var(--muted); }
.activity-detail-summary strong { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.incident-detail-summary strong { font-size: var(--fs-lg); color: var(--danger); }
.activity-receipt-section { display: grid; gap: 8px; }
.activity-receipt-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.activity-receipt-heading h3 { font-size: var(--fs-md); }
.activity-receipt-heading span { font-size: var(--fs-xs); color: var(--muted); }
.activity-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

@media (max-width: 1360px) { .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .dashboard-columns { grid-template-columns: 1fr; } .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dashboard-heading h2 { font-size: var(--fs-xl); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { padding: 12px; }
  .metric-card > strong { font-size: 21px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .workspace-columns { grid-template-columns: 1fr; }
  .role-workspace-heading { flex-direction: column; }
  .live-trip-grid { grid-template-columns: 1fr; padding: 10px; }
  .action-center-grid { grid-template-columns: 1fr; }
  .trip-panel table th:nth-child(4), .trip-panel table td:nth-child(4) { display: none; }
}
@media (max-width: 760px) {
  .director-kpi-grid, .director-brief-grid, .finance-overview-grid, .admin-security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .director-kpi-grid strong, .finance-overview-grid strong, .admin-security-grid strong { font-size: 18px; }
  .action-center-empty small { display: none; }
}
/* =====================================================================
   Điều xe: hàng chờ, bộ lọc, danh sách chuyến, lịch, chi tiết chuyến
   ===================================================================== */

/* Hàng chờ (đề nghị đã duyệt, chuyến đột xuất) */
.approved-request-queue, .adhoc-review-queue { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.approved-request-queue { border-top: 3px solid var(--brand-400); }
.adhoc-review-queue { border-top: 3px solid var(--amber); }
.approved-request-queue .panel-header, .adhoc-review-queue .panel-header { padding: 14px 16px; }
.approved-request-list, .adhoc-review-list { display: grid; }
.approved-request-row, .adhoc-review-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border); }
.approved-request-row:first-child, .adhoc-review-row:first-child { border-top: 0; }
.approved-request-row:hover, .adhoc-review-row:hover { background: var(--surface-2); }
.approved-request-main, .adhoc-review-main { display: grid; gap: 3px; min-width: 0; }
.approved-request-main strong, .adhoc-review-main strong { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; font-weight: 600; }
.approved-request-main span, .adhoc-review-main span, .adhoc-review-main small { font-size: var(--fs-xs); color: var(--muted); }
.adhoc-review-main small { color: var(--text-2); }
.approved-request-actions, .adhoc-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.record-focus-pulse { animation: focus-pulse 1.2s ease-in-out 3; }
@keyframes focus-pulse { 50% { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-400); } }

.adhoc-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--amber-bg); color: var(--warning); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; width: fit-content; }
.adhoc-chip.acknowledged { background: var(--success-bg); color: var(--success); }
.adhoc-chip.flagged { background: var(--danger-bg); color: var(--danger); }
.adhoc-reason-box { padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-bg); border: 1px solid var(--amber-line); color: #6d4a07; font-size: var(--fs-sm); line-height: 1.5; }
.adhoc-reason-box small { color: var(--warning); font-weight: 600; }

/* Thanh công cụ & bộ lọc */
.trip-toolbar .toolbar-title { font-size: var(--fs-lg); }
.trip-filter-panel { display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.trip-status-tabs { border: 0; padding: 0; background: transparent; gap: 4px; width: 100%; }
.trip-status-tabs button { border: 1px solid var(--border); background: var(--surface); }
.trip-status-tabs button.active { border-color: var(--ink-900); }
.trip-filter-grid { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 10px; align-items: end; min-width: 0; }
.trip-filter-grid > label { min-width: 0; }
.trip-clear-filter { min-height: 40px; }
.dispatch-view-switch { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dispatch-view-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.dispatch-view-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.dispatch-view-tabs button:hover { color: var(--text); }
.dispatch-view-tabs button.active { background: var(--brand-50); color: var(--brand-600); }
.calendar-nav-controls { display: flex; align-items: center; gap: 6px; }
.calendar-nav-controls strong { min-width: 200px; text-align: center; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* Danh sách chuyến */
.trip-list { display: grid; }
.dispatch-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); }
.dispatch-card:first-child { border-top: 0; }
.dispatch-card:hover { background: #fafcfb; }
.dispatch-time { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.dispatch-time strong { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text); }
.dispatch-time small { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dispatch-main { display: grid; gap: 5px; min-width: 0; }
.dispatch-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.dispatch-title h3 { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.dispatch-title .plate { font-size: 14px; color: var(--text); }
.dispatch-driver { font-weight: 500; color: var(--text-2); }
.dispatch-route { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-2); }
.dispatch-route .ui-icon { color: var(--faint); }
.dispatch-route strong { color: var(--text); font-weight: 600; }
.dispatch-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); color: var(--muted); }
.dispatch-meta span, .dispatch-meta a { display: inline-flex; align-items: center; gap: 5px; }
.dispatch-meta .ui-icon { color: var(--faint); }
.checklist-alert { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 9px; border-radius: var(--r-xs); background: var(--warning-bg); color: var(--warning); font-size: var(--fs-xs); font-weight: 600; }
.dispatch-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 360px; }
.dispatch-actions .secondary-button, .dispatch-actions .approve-button, .dispatch-actions .reject-button { min-height: 32px; padding: 0 11px; font-size: var(--fs-sm); }

/* Lịch */
.trip-calendar-panel .calendar-day-list { display: grid; gap: 6px; padding: 12px; }
.calendar-trip-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--brand-400); border-radius: var(--r-sm); background: var(--surface); text-align: left; }
.calendar-trip-card:hover { background: var(--surface-2); }
.calendar-trip-card time { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.calendar-trip-card div { display: grid; min-width: 0; }
.calendar-trip-card strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-trip-card small { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-trip-card.compact { grid-template-columns: 1fr; gap: 4px; padding: 7px 8px; }
.calendar-trip-card.compact .status-badge { justify-self: start; }
.trip-calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-week-day { display: grid; align-content: start; gap: 8px; min-height: 220px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0; }
.calendar-week-day.today { border-color: var(--brand-300); box-shadow: inset 0 3px 0 var(--brand-400); }
.calendar-day-heading { display: grid; justify-items: start; gap: 0; padding: 4px 6px; border: 0; border-radius: var(--r-xs); background: transparent; text-align: left; }
.calendar-day-heading:hover { background: var(--surface-2); }
.calendar-day-heading span { font-size: var(--fs-xs); color: var(--muted); text-transform: capitalize; }
.calendar-day-heading strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calendar-day-heading small { font-size: 10.5px; color: var(--faint); }
.calendar-week-trips { display: grid; gap: 6px; }
.calendar-no-trip { font-size: var(--fs-xs); color: var(--faint); padding: 4px 6px; }
.calendar-month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.calendar-month-weekdays span { padding: 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-align: center; letter-spacing: .06em; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-month-grid button { display: grid; align-content: start; gap: 4px; min-height: 92px; padding: 8px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; }
.calendar-month-grid button:nth-child(7n) { border-right: 0; }
.calendar-month-grid button:hover { background: var(--surface-2); }
.calendar-month-grid button > span { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.calendar-month-grid button.outside { background: #fafbfb; color: var(--faint); }
.calendar-month-grid button.today > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-600); color: #fff; }
.calendar-month-grid button > strong { width: fit-content; padding: 1px 7px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: 11px; }
.calendar-month-grid button > small { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* Chi tiết chuyến (modal) */
.trip-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.trip-detail-heading > div { display: grid; gap: 4px; min-width: 0; }
.trip-detail-heading h2 { font-size: var(--fs-xl); font-weight: 700; }
.trip-detail-heading p { font-size: var(--fs-sm); color: var(--muted); }
.trip-detail-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.trip-detail-section h3 { font-size: var(--fs-md); font-weight: 700; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-title-row > strong { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.trip-approval-section { padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.adhoc-detail-section { background: #fffcf5; border-color: var(--amber-line); }
.approval-timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; counter-reset: step; }
.approval-timeline span { position: relative; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.approval-timeline span.done { border-color: var(--success-line); background: var(--success-bg); color: var(--success); }
.approval-explain { font-size: var(--fs-xs); color: var(--muted); }
.active-trip-live-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--success-line); border-radius: var(--r); background: #f5fbf8; }
.active-trip-live-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.active-trip-live-head > div { display: flex; align-items: center; gap: 10px; }
.active-trip-live-head > div > div { display: grid; }
.active-trip-live-head small { color: var(--muted); font-size: var(--fs-xs); }
.live-pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 0 rgba(18,183,106,.5); animation: live-ring 1.6s ease-out infinite; }
@keyframes live-ring { to { box-shadow: 0 0 0 10px rgba(18,183,106,0); } }
.trip-detail-live-map { height: 260px; }
.active-trip-live-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.active-trip-live-actions code { color: var(--muted); font-size: var(--fs-xs); }
.active-trip-no-location { padding: 12px; border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); }
.trip-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.location-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.location-updated-label { color: var(--muted); font-size: var(--fs-xs); }
.trip-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.trip-media-grid a { display: grid; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; color: var(--text-2); text-decoration: none; }
.trip-media-grid img { width: 100%; height: 130px; object-fit: cover; background: var(--surface-3); }
.trip-media-grid span { padding: 7px 10px; font-size: var(--fs-xs); font-weight: 600; }
.trip-history-timeline { display: grid; gap: 0; padding-left: 4px; }
.trip-history-event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 12px; }
.trip-history-event:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.trip-history-dot { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 3px solid var(--surface); background: var(--brand-400); box-shadow: 0 0 0 1px var(--border-strong); }
.trip-history-event.success .trip-history-dot { background: var(--success); }
.trip-history-event.warning .trip-history-dot { background: var(--amber); }
.trip-history-event.danger .trip-history-dot { background: var(--danger); }
.trip-history-event > div { display: grid; gap: 1px; }
.trip-history-event time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.trip-history-event strong { font-size: 13px; font-weight: 600; }
.trip-history-event small { font-size: var(--fs-xs); color: var(--text-2); }
.checklist-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.checklist-summary span { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
.checklist-summary span.ok { background: var(--success-bg); color: var(--success); }
.checklist-summary span.ok::before { content: '✓'; }
.checklist-summary span.bad { background: var(--danger-bg); color: var(--danger); }
.checklist-summary span.bad::before { content: '✕'; }
.checklist-summary p { width: 100%; font-size: var(--fs-sm); color: var(--text-2); }
.trip-detail-actions { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); }

/* Form tạo chuyến */
.approved-request-confirmation { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--success-line); border-radius: var(--r); background: var(--success-bg); font-size: var(--fs-sm); color: var(--text-2); }
.approved-request-confirmation strong { display: inline-flex; align-items: center; gap: 6px; color: var(--success); }
.approval-route-preview { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.approval-route-preview.bypass { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

@media (max-width: 1280px) { .trip-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trip-filter-grid > label:first-child { grid-column: 1 / -1; } }
@media (max-width: 1100px) {
  .dispatch-card { grid-template-columns: 64px minmax(0, 1fr); }
  .dispatch-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .trip-calendar-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .approved-request-row, .adhoc-review-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .trip-filter-grid { grid-template-columns: 1fr 1fr; }
  .trip-filter-grid > label:nth-child(2), .trip-clear-filter { grid-column: 1 / -1; }
  .dispatch-card { padding: 12px; gap: 12px; }
  .dispatch-view-switch { flex-direction: column; align-items: stretch; }
  .dispatch-view-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .dispatch-view-tabs button { justify-content: center; }
  .calendar-nav-controls strong { min-width: 0; flex: 1; font-size: var(--fs-xs); }
  .trip-calendar-week { grid-template-columns: 1fr; }
  .calendar-week-day { min-height: 0; }
  .calendar-month-grid button { min-height: 62px; padding: 5px; }
  .calendar-month-grid button > small { display: none; }
  .approval-timeline { grid-auto-flow: row; }
  .trip-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-detail-actions { bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
/* =====================================================================
   Hồ sơ xe · Chi phí · Sự cố · Bảo dưỡng · Đề nghị · Tài khoản · Hồ sơ
   ===================================================================== */

/* ---------- Hồ sơ xe ---------- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vehicle-card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.vehicle-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.vehicle-photo { position: relative; height: 150px; background: linear-gradient(135deg, var(--ink-800), var(--ink-950)); overflow: hidden; }
.vehicle-photo > img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-photo-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: rgba(255,255,255,.35); }
.vehicle-photo-placeholder small { font-size: 11px; color: rgba(255,255,255,.45); }
.vehicle-photo-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,24,22,.25) 0%, transparent 35%, rgba(8,24,22,.78) 100%); }
.vehicle-photo-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; }
.vehicle-chip { height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 11px; font-weight: 600; backdrop-filter: blur(6px); }
.vehicle-photo .status-badge { background: rgba(255,255,255,.94); }
.vehicle-photo-bottom { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.vehicle-photo-bottom h2 { display: inline-block; padding: 2px 8px; margin-bottom: 4px; border-radius: 5px; background: #fff; color: var(--ink-900); font-size: 16px; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.vehicle-photo-bottom p { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.9); }
.vehicle-body { display: grid; gap: 12px; padding: 14px; align-content: start; }
.vehicle-subline { font-size: var(--fs-xs); color: var(--muted); }
.vehicle-km { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.vehicle-km > div { display: grid; gap: 1px; }
.vehicle-km span { font-size: 11px; color: var(--muted); }
.vehicle-km strong { font-family: var(--font-mono); font-size: 17px; font-weight: 600; }
.vehicle-km-side { text-align: right; }
.vehicle-km-side strong { font-size: 13px; }
.vehicle-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.vehicle-meta-card { display: grid; gap: 0; }
.vehicle-meta-card span { font-size: 11px; color: var(--muted); }
.vehicle-meta-card strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vehicle-driver-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.vehicle-driver { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vehicle-driver > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); }
.vehicle-driver div { display: grid; min-width: 0; }
.vehicle-driver small { font-size: 11px; color: var(--muted); }
.vehicle-driver strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-card-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.vehicle-assign-button { height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-xs); background: var(--surface); font-size: 12px; font-weight: 600; }
.vehicle-assign-button:hover { background: var(--surface-2); }
.vehicle-open-link { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--brand-500); }
.vehicle-detail-header { display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; align-items: center; }
.vehicle-detail-header > div:nth-child(2) { display: grid; gap: 4px; justify-items: start; }
.vehicle-detail-header h2 { font-size: var(--fs-xl); }
.vehicle-detail-header p { color: var(--muted); font-size: var(--fs-sm); }
.vehicle-detail-media { height: 120px; border-radius: var(--r); overflow: hidden; background: linear-gradient(135deg, var(--ink-800), var(--ink-950)); }
.vehicle-detail-media img { width: 100%; height: 100%; object-fit: cover; }
.large-vehicle-icon { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.4); }
.mini-stats > div { flex: 1; min-width: 150px; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.mini-stats strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: var(--fs-xs); color: var(--muted); }
.assign-driver-form { display: grid; gap: 14px; }
.assign-driver-vehicle { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.assign-driver-vehicle > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--ink-900); color: #fff; }
.assign-driver-vehicle div { display: grid; }
.assign-driver-vehicle small { color: var(--muted); }
.assign-driver-note, .assign-driver-empty { font-size: var(--fs-sm); color: var(--muted); }
.assign-driver-empty { color: var(--warning); }
.image-url-preview { display: grid; gap: 6px; }
.image-url-preview img { max-height: 180px; border-radius: var(--r-sm); object-fit: cover; }
.image-url-preview span { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Chi phí ---------- */
.expense-workflow-panel { display: grid; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.expense-workflow-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.expense-workflow-heading > div:first-child { display: grid; gap: 3px; }
.expense-workflow-heading span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.expense-workflow-heading h2 { font-size: var(--fs-md); font-weight: 700; }
.expense-workflow-total { display: grid; justify-items: end; }
.expense-workflow-total small { color: var(--muted); font-size: var(--fs-xs); }
.expense-workflow-total strong { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.expense-workflow-steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 6px; align-items: center; }
.expense-workflow-steps article { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.expense-workflow-steps article b { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); font-size: 12px; color: var(--text-2); }
.expense-workflow-steps article div { display: grid; min-width: 0; }
.expense-workflow-steps article strong { font-size: 13px; font-weight: 600; }
.expense-workflow-steps article small { font-size: 11px; color: var(--muted); }
.expense-workflow-steps article.has-items { border-color: var(--warning-line); background: var(--warning-bg); }
.expense-workflow-steps article.has-items b { background: var(--amber); border-color: var(--amber); color: #fff; }
.workflow-arrow { color: var(--faint); display: grid; }
.expense-detail-modal { display: grid; gap: 14px; }
.expense-detail-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.expense-detail-summary > div { display: grid; }
.expense-detail-summary span { font-size: var(--fs-sm); color: var(--muted); }
.expense-detail-summary strong { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Banner quy trình (sự cố, bảo dưỡng) ---------- */
.approval-workflow-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--brand-400); border-radius: var(--r); background: var(--surface); }
.approval-workflow-banner > div { display: grid; gap: 2px; }
.approval-workflow-banner h2 { font-size: var(--fs-md); font-weight: 600; }

/* ---------- Sự cố ---------- */
.incident-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.incident-card { display: grid; gap: 10px; align-content: start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--info); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.incident-card.severity-medium { border-left-color: var(--amber); }
.incident-card.severity-high { border-left-color: var(--danger); }
.incident-card.severity-critical { border-left-color: var(--danger); background: #fffafa; }
.incident-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.incident-card.severity-low .severity-chip { background: var(--info-bg); color: var(--info); }
.incident-card.severity-medium .severity-chip { background: var(--warning-bg); color: var(--warning); }
.incident-card.severity-high .severity-chip { background: var(--danger-bg); color: var(--danger); }
.incident-card.severity-critical .severity-chip { background: var(--danger); color: #fff; }
.incident-card h2 { font-size: var(--fs-md); font-weight: 700; }
.incident-card > p { font-size: var(--fs-sm); color: var(--text-2); }
.incident-card > small { font-size: var(--fs-xs); color: var(--muted); }
.incident-info { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); color: var(--muted); }
.incident-info span { display: inline-flex; align-items: center; gap: 5px; }
.incident-info .plate { font-size: 12px; color: var(--text-2); }
.media-links { display: flex; flex-wrap: wrap; gap: 6px; }
.media-links a { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.media-links a:hover { border-color: var(--brand-300); color: var(--brand-600); }
.incident-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.incident-actions:empty { display: none; }

/* ---------- Đề nghị xe ---------- */
.department-request-summary { display: grid; gap: 12px; padding: 16px; background: var(--ink-900); color: #fff; border-radius: var(--r-lg); background-image: radial-gradient(90% 120% at 100% 0%, rgba(92,196,174,.18), transparent 55%); }
.department-request-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.department-request-summary-head span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; color: var(--brand-300); }
.department-request-summary-head h2 { font-size: var(--fs-lg); }
.department-request-summary-head > strong { min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--ink-900); font-size: 20px; }
.department-request-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.department-request-summary-grid button { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); background: rgba(255,255,255,.05); color: #fff; text-align: left; }
.department-request-summary-grid button:hover { background: rgba(255,255,255,.1); }
.department-request-summary-grid button > span { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(255,255,255,.1); }
.department-request-summary-grid strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.department-request-summary-grid small { font-size: 11.5px; color: var(--ink-muted); }
.department-request-summary-grid button.danger > span { background: rgba(229,72,77,.2); color: #ff9a9d; }
.request-hero-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.request-hero-card > div { display: grid; gap: 4px; max-width: 70ch; }
.request-hero-card h2 { font-size: var(--fs-lg); }
.request-hero-card p { font-size: var(--fs-sm); color: var(--muted); }
.request-review-heading { align-items: flex-end; }
.request-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.request-card { display: grid; gap: 12px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.request-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.request-card-head > div { display: grid; gap: 3px; min-width: 0; }
.request-card-head h3 { font-size: var(--fs-md); font-weight: 700; }
.request-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.request-meta-grid > div { display: grid; padding: 8px 10px; background: var(--surface); }
.request-meta-grid span { font-size: 11px; color: var(--muted); }
.request-meta-grid strong { font-size: 13px; font-weight: 600; }
.request-note { padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.request-document-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.request-no-document { font-size: var(--fs-xs); color: var(--faint); }
.request-card > small { font-size: var(--fs-xs); color: var(--muted); }
.request-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.request-empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }

/* ---------- Tài khoản ---------- */
.account-toolbar strong { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 220px 240px; gap: 10px; }
.account-table td:last-child, .account-table th:last-child { text-align: right; }
.profile-cell { display: flex; align-items: center; gap: 12px; }
.profile-cell > div { display: grid; min-width: 0; }
.profile-avatar { position: relative; width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-avatar.large { width: 88px; height: 88px; flex-basis: 88px; font-size: 30px; }
.account-work-info { display: grid; gap: 1px; }
.account-work-info strong { font-size: 13px; }
.account-work-info span, .account-work-info small { font-size: var(--fs-xs); color: var(--muted); }
.account-state-stack { display: grid; gap: 5px; justify-items: start; }
.account-state { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; }
.account-state.active { background: var(--success-bg); color: var(--success); }
.account-state.locked { background: var(--surface-3); color: var(--muted); }
.account-row-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.account-row-actions .reject-button, .account-row-actions .approve-button { min-height: 32px; }
.avatar-picker { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.avatar-preview { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 12px; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker > div:last-child { display: grid; gap: 6px; }
.avatar-upload-button { position: relative; display: inline-flex; align-items: center; gap: 6px; width: fit-content; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.avatar-remove-button { border: 0; background: transparent; padding: 0; color: var(--danger); font-size: 12px; font-weight: 600; text-align: left; }
.account-active-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }

/* ---------- Hồ sơ cá nhân ---------- */
.self-account-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1100px; }
.self-account-summary { grid-row: span 2; display: grid; justify-items: center; gap: 14px; padding: 24px 18px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.self-account-avatar { width: 104px; height: 104px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--ink-900); color: #fff; font-size: 38px; font-weight: 700; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.self-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.self-account-name { display: grid; gap: 3px; }
.self-account-name span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.self-account-name h2 { font-size: var(--fs-xl); }
.self-account-name p { color: var(--muted); font-size: var(--fs-sm); }
.self-avatar-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.self-avatar-upload { cursor: pointer; }
.self-account-work-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.self-account-work-grid > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); }
.self-account-work-grid span { font-size: 11px; color: var(--muted); }
.self-account-work-grid strong { font-size: 13px; font-weight: 600; }
.success-text { color: var(--success) !important; }
.self-account-card { display: grid; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.self-account-section-title div { display: grid; gap: 2px; }
.self-account-section-title strong { font-size: var(--fs-md); }
.self-account-section-title span { font-size: var(--fs-xs); color: var(--muted); }
.password-title { padding-top: 14px; border-top: 1px solid var(--border); }
.self-account-policy { padding: 10px 12px; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); font-size: var(--fs-xs); }
.self-account-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.self-account-logout { height: 40px; padding: 0 14px; border: 1px solid var(--danger-line); border-radius: var(--r-sm); background: var(--surface); color: var(--danger); font-weight: 600; }
.self-account-logout:hover { background: var(--danger-bg); }

@media (max-width: 1000px) {
  .expense-workflow-steps { grid-template-columns: 1fr 1fr; }
  .workflow-arrow { display: none; }
  .self-account-layout { grid-template-columns: 1fr; }
  .self-account-summary { grid-row: auto; }
  .department-request-summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) { .account-filters { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .vehicle-grid, .incident-grid, .request-grid { grid-template-columns: 1fr; }
  .vehicle-detail-header { grid-template-columns: 1fr; }
  .vehicle-detail-media { height: 160px; }
  .expense-workflow-total { justify-items: start; }
  .self-account-work-grid { grid-template-columns: 1fr 1fr; }
  .account-table th:nth-child(2), .account-table td:nth-child(2) { display: none; }
  .account-row-actions { flex-direction: column; align-items: stretch; }
  .request-meta-grid { grid-template-columns: 1fr 1fr; }
}

.vehicle-photo-placeholder { padding-bottom: 48px; }
@media (max-width: 760px) {
  .account-toolbar strong { font-size: var(--fs-md); }
  .account-table thead { display: none; }
  .account-table, .account-table tbody { display: block; }
  .account-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .account-table tr:last-child { border-bottom: 0; }
  .account-table td { display: block; padding: 0; border: 0; background: transparent !important; }
  .account-table td:nth-child(1) { grid-column: 1; }
  .account-table td:nth-child(3) { grid-column: 2; grid-row: 1; align-self: center; }
  .account-table td:nth-child(4) { grid-column: 1 / -1; }
  .account-table td:nth-child(4) .account-state-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .account-table td:nth-child(5) { grid-column: 1 / -1; text-align: left; }
  .account-row-actions { flex-direction: row; justify-content: flex-start; }
  .account-table td[colspan] { grid-column: 1 / -1; }
}
/* =====================================================================
   Báo cáo
   ===================================================================== */
.report-filter-card { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.report-filter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.report-filter-heading > div:first-child { display: grid; gap: 3px; }
.report-filter-heading span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.report-filter-heading h2 { font-size: var(--fs-lg); }
.report-filter-heading p { font-size: var(--fs-sm); color: var(--muted); }
.report-export-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.report-period-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); width: fit-content; max-width: 100%; }
.report-period-tabs button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.report-period-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.report-date-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.report-date-controls > label { min-width: 220px; }
.report-date-controls.custom > label { flex: 1; }
.report-period-arrow, .report-today-button { height: 40px; min-width: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 16px; font-weight: 600; color: var(--text-2); }
.report-today-button { font-size: var(--fs-sm); }
.report-period-arrow:hover, .report-today-button:hover { background: var(--surface-2); }
.report-range-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--ink-900); color: #fff; }
.report-range-strip span { font-size: var(--fs-xs); color: var(--ink-muted); }
.report-range-strip strong { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.report-range-strip small { margin-left: auto; color: var(--ink-muted); font-size: var(--fs-xs); }

.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-kpis article, .adhoc-report-kpis article { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.report-kpis span, .adhoc-report-kpis span { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.report-kpis strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-kpis small, .adhoc-report-kpis small { font-size: var(--fs-xs); color: var(--muted); }

.report-comparison-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.report-comparison-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-comparison-grid article { display: grid; gap: 3px; padding: 14px 18px; border-left: 1px solid var(--border); }
.report-comparison-grid article:first-child { border-left: 0; }
.report-comparison-grid span { font-size: var(--fs-xs); color: var(--muted); }
.report-comparison-grid strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.report-comparison-grid small { width: fit-content; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.report-comparison-grid small.good { background: var(--success-bg); color: var(--success); }
.report-comparison-grid small.bad { background: var(--danger-bg); color: var(--danger); }

/* Khối Ban Giám đốc */
.executive-report-shell { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--ink-900); color: #fff; background-image: radial-gradient(70% 90% at 100% 0%, rgba(92,196,174,.16), transparent 60%); box-shadow: var(--sh-2); }
.executive-report-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.executive-report-header > div { display: grid; gap: 4px; max-width: 70ch; }
.executive-report-header span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; color: var(--brand-300); }
.executive-report-header h2 { font-size: var(--fs-xl); }
.executive-report-header p { font-size: var(--fs-sm); color: var(--ink-muted); }
.executive-budget-field { min-width: 240px; color: var(--ink-text); }
.executive-budget-field span { font-size: var(--fs-xs); color: var(--ink-muted); }
.executive-budget-field > div { display: flex; align-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-sm); background: rgba(255,255,255,.06); }
.executive-budget-field input { border: 0; background: transparent; color: #fff; font-family: var(--font-mono); box-shadow: none; }
.executive-budget-field input::placeholder { color: rgba(255,255,255,.35); }
.executive-budget-field b { padding: 0 12px; color: var(--ink-muted); }
.executive-budget-field small { color: var(--ink-muted); font-size: 11px; }
.executive-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.executive-kpi-grid article { display: grid; gap: 4px; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); background: rgba(255,255,255,.05); }
.executive-kpi-grid span { font-size: var(--fs-xs); color: var(--ink-muted); }
.executive-kpi-grid strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.executive-kpi-grid small { font-size: 11.5px; color: var(--ink-muted); line-height: 1.4; }
.executive-kpi-grid .forecast strong { color: var(--brand-300); }
.executive-kpi-grid .budget.over strong { color: #ff9a9d; }
.executive-budget-progress { display: grid; gap: 6px; }
.executive-budget-progress > div:first-child { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--ink-text); }
.executive-budget-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.executive-budget-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-400), var(--brand-300)); }
.executive-budget-progress small { color: var(--ink-muted); font-size: 11px; }
.executive-report-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.executive-card { display: grid; gap: 12px; align-content: start; padding: 14px; border-radius: var(--r); background: var(--surface); color: var(--text); }
.executive-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.executive-card-heading > div { display: grid; gap: 2px; }
.executive-card-heading span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; color: var(--brand-500); }
.executive-card-heading h3 { font-size: var(--fs-md); }
.executive-card-heading b { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.executive-narratives { display: grid; gap: 8px; }
.executive-narratives article { display: grid; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--info); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); }
.executive-narratives article.good { border-left-color: var(--success); }
.executive-narratives article.warning { border-left-color: var(--amber); }
.executive-narratives article.danger { border-left-color: var(--danger); }
.executive-narratives strong { font-size: 14px; }
.executive-narratives p { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.executive-forecast-list { display: grid; gap: 4px; }
.executive-forecast-list > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); }
.executive-forecast-list > div:nth-child(odd) { background: var(--surface-2); }
.executive-forecast-list > div > div { display: grid; }
.executive-forecast-list strong { font-size: 13px; }
.executive-forecast-list span { font-size: 11px; color: var(--muted); }
.executive-forecast-list b { font-variant-numeric: tabular-nums; font-size: 14px; }
.executive-forecast-list .forecast-next { background: var(--brand-50) !important; border: 1px dashed var(--brand-300); }
.executive-forecast-list .forecast-next b { color: var(--brand-600); }
.executive-tco-card { background: var(--surface); color: var(--text); border-radius: var(--r); overflow: hidden; }
.executive-tco-card .panel-header { padding: 14px 16px; }

/* Lưới báo cáo */
.reports-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reports-layout .span-full { grid-column: 1 / -1; }
.report-insight-list { display: grid; gap: 4px; padding: 8px; }
.report-insight { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 9px 8px; border-radius: var(--r-sm); }
.report-insight > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); }
.report-insight.good > span { background: var(--success-bg); color: var(--success); }
.report-insight.warning > span { background: var(--warning-bg); color: var(--warning); }
.report-insight.danger > span { background: var(--danger-bg); color: var(--danger); }
.report-insight div { display: grid; gap: 1px; }
.report-insight strong { font-size: 13px; }
.report-insight small { font-size: var(--fs-xs); color: var(--muted); }
.report-trend-list, .bar-chart, .report-ranking-list { display: grid; gap: 10px; padding: 14px 16px; }
.report-trend-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; }
.report-trend-label { display: grid; }
.report-trend-label strong { font-size: 13px; }
.report-trend-label span { font-size: 11px; color: var(--muted); }
.report-trend-track, .bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.report-trend-track div, .bar-fill { height: 100%; border-radius: inherit; background: var(--brand-400); }
.report-trend-row > strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-row { display: grid; gap: 5px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.bar-label strong { font-variant-numeric: tabular-nums; }
.report-ranking-list > div { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.report-ranking-list > div > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--text-2); }
.report-ranking-list > div:first-child > span { background: var(--ink-900); color: #fff; }
.report-ranking-list em { font-style: normal; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.report-mobile-cards { display: none; }
.report-mobile-cards article { display: grid; gap: 6px; padding: 12px; border-top: 1px solid var(--border); }
.report-mobile-cards article:first-child { border-top: 0; }
.report-mobile-cards article > div:not(.report-card-metrics):not(.report-card-title) { display: flex; gap: 12px; font-size: var(--fs-xs); color: var(--muted); }
.report-card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.report-card-title span { font-size: var(--fs-xs); color: var(--muted); }
.report-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.report-card-metrics span { display: grid; font-size: 11px; color: var(--muted); padding: 6px 8px; border-radius: var(--r-xs); background: var(--surface-2); }
.report-card-metrics b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Chuyến đột xuất trong báo cáo */
.adhoc-report-panel { border-top: 3px solid var(--amber); }
.adhoc-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 0; }
.adhoc-report-kpis article { box-shadow: none; background: var(--surface-2); border-radius: var(--r); }
.adhoc-report-kpis strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adhoc-report-kpis article.good strong { color: var(--success); }
.adhoc-report-kpis article.warning { border-color: var(--warning-line); background: var(--warning-bg); }
.adhoc-report-kpis article.warning strong { color: var(--warning); }
.adhoc-report-kpis article.danger { border-color: var(--danger-line); background: var(--danger-bg); }
.adhoc-report-kpis article.danger strong { color: var(--danger); }
.adhoc-report-panel .table-wrap { margin-top: 14px; border-top: 1px solid var(--border); }
.adhoc-report-panel td small { display: block; margin-top: 4px; }
.adhoc-report-panel > .muted { padding: 16px; }
.adhoc-report-panel .report-mobile-cards { margin-top: 12px; border-top: 1px solid var(--border); }

@media (max-width: 1200px) { .executive-report-grid { grid-template-columns: 1fr; } .executive-kpi-grid, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .reports-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .report-comparison-grid, .adhoc-report-kpis { grid-template-columns: 1fr 1fr; }
  .report-comparison-grid article:nth-child(3) { border-left: 0; }
  .report-comparison-grid article:nth-child(n+3) { border-top: 1px solid var(--border); }
  .report-kpis strong { font-size: 19px; }
  .executive-kpi-grid strong { font-size: 18px; }
  .report-desktop-table { display: none; }
  .report-mobile-cards { display: grid; }
  .report-date-controls > label { min-width: 0; flex: 1; }
  .report-range-strip small { margin-left: 0; width: 100%; }
  .report-trend-row { grid-template-columns: 1fr auto; }
  .report-trend-track { grid-column: 1 / -1; grid-row: 2; }
  .executive-report-shell { padding: 14px; }
}
/* =====================================================================
   Ứng dụng tài xế (ưu tiên điện thoại)
   ===================================================================== */
.driver-app { min-height: 100vh; background: var(--bg); padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

/* Header tối */
.driver-header { position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--ink-900); background-image: radial-gradient(120% 140% at 100% 0%, rgba(92,196,174,.22), transparent 55%); color: #fff; box-shadow: 0 6px 20px rgba(8,24,22,.18); }
.driver-header-row { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.driver-header-logo { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #fff; }
.driver-header-logo img { width: 30px; height: 30px; object-fit: contain; }
.driver-header-greeting { flex: 1; display: grid; min-width: 0; }
.driver-header-greeting small { font-size: 11.5px; color: var(--ink-muted); text-transform: capitalize; }
.driver-header-greeting strong { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-account-button { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(255,255,255,.2); border-radius: 50%; overflow: hidden; background: var(--brand-400); color: #fff; font-weight: 700; }
.driver-account-button img { width: 100%; height: 100%; object-fit: cover; }
.notification-center.compact .notification-bell { width: 38px; height: 38px; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; }
.notification-center.compact .notification-bell strong { box-shadow: 0 0 0 2px var(--ink-900); }
.driver-app .network-banner { top: 0; }

/* Nội dung */
.driver-content { max-width: 560px; margin: 0 auto; padding: 14px 14px 0; display: grid; gap: 12px; }
.driver-toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid var(--info-line); border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 500; text-align: left; box-shadow: var(--sh-2); }
.driver-toast strong { display: grid; opacity: .7; }
.driver-sync-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border-radius: var(--r); border: 1px solid var(--amber-line); background: var(--amber-bg); }
.driver-sync-card.offline { border-color: rgba(255,255,255,.1); background: var(--ink-800); color: #fff; }
.driver-sync-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(0,0,0,.06); }
.driver-sync-card div { display: grid; }
.driver-sync-card strong { font-size: 13px; }
.driver-sync-card small { font-size: 11.5px; opacity: .75; }
.driver-sync-card button { height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: var(--ink-900); color: #fff; font-size: 12px; font-weight: 600; }

/* Tiến trình chuyến */
.driver-trip-progress { display: flex; align-items: center; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.driver-trip-progress > div { display: grid; justify-items: center; gap: 3px; flex: 0 0 auto; }
.driver-trip-progress > div span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; }
.driver-trip-progress > div small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.driver-trip-progress > div.done span { background: var(--success); color: #fff; }
.driver-trip-progress > div.current span { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.driver-trip-progress > div.current small { color: var(--text); font-weight: 700; }
.driver-trip-progress > i { flex: 1; height: 2px; margin-bottom: 16px; border-radius: 2px; background: var(--border); }

/* Thẻ chuyến */
.driver-trip-card { display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2); cursor: pointer; }
.trip-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.trip-card-top > span:first-child { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-500); }
.driver-active-mode .trip-card-top > span:first-child { color: var(--success); }
.driver-vehicle-line { display: flex; align-items: center; gap: 10px; }
.driver-vehicle-line > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--ink-900); color: #fff; }
.driver-vehicle-line div { display: grid; }
.driver-vehicle-line strong { font-family: var(--font-mono); font-size: 17px; font-weight: 600; }
.driver-vehicle-line small { font-size: 12px; color: var(--muted); }
.driver-route-card { display: grid; gap: 0; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.route-view { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: start; }
.route-view div { display: grid; }
.route-view small { font-size: 11px; color: var(--muted); }
.route-view strong { font-size: 14px; font-weight: 600; }
.route-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 3px solid var(--brand-400); background: var(--surface); }
.route-dot.end { border-color: var(--amber); background: var(--amber); }
.route-line { width: 2px; height: 18px; margin: 2px 0 2px 5px; background: repeating-linear-gradient(var(--border-strong) 0 3px, transparent 3px 6px); }
.trip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.trip-meta span { display: inline-flex; align-items: center; gap: 5px; }
.trip-meta .trip-meta-link { margin-left: auto; color: var(--brand-500); font-weight: 600; }

/* Tình trạng sẵn sàng */
.driver-readiness-card { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--success-line); background: var(--success-bg); }
.driver-readiness-card.warning { border-color: var(--warning-line); background: var(--warning-bg); }
.driver-readiness-card.blocked { border-color: var(--danger-line); background: var(--danger-bg); }
.driver-readiness-head { display: flex; align-items: center; gap: 10px; }
.driver-readiness-head > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface); color: var(--success); }
.driver-readiness-card.warning .driver-readiness-head > span { color: var(--warning); }
.driver-readiness-card.blocked .driver-readiness-head > span { color: var(--danger); }
.driver-readiness-head div { display: grid; }
.driver-readiness-head strong { font-size: 13.5px; }
.driver-readiness-head small { font-size: 11.5px; color: var(--text-2); }
.driver-readiness-list { display: grid; gap: 4px; }
.driver-readiness-list > div { display: grid; padding: 7px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.7); font-size: 12px; }
.driver-readiness-list small { color: var(--text-2); }

/* Chế độ đang chạy */
.driver-driving-focus { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-xl); background: var(--ink-900); color: #fff; background-image: radial-gradient(100% 120% at 100% 0%, rgba(18,183,106,.25), transparent 60%); }
.driver-driving-focus h2 { font-size: 20px; }
.driver-driving-focus p { font-size: 12.5px; color: var(--ink-muted); }
.driver-driving-focus > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.driver-driving-focus a, .driver-driving-focus button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 46px; border: 0; border-radius: var(--r); background: #fff; color: var(--ink-900); font-weight: 700; font-size: 14px; text-decoration: none; }
.driver-driving-focus button { background: var(--danger); color: #fff; }
.driver-section-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--brand-300); text-transform: uppercase; }

/* Nút hành động chính */
.driver-primary-journey { display: grid; grid-template-columns: 44px 1fr 18px; gap: 12px; align-items: center; width: 100%; min-height: 66px; padding: 10px 14px; border: 0; border-radius: var(--r-xl); background: var(--brand-600); color: #fff; text-align: left; box-shadow: 0 10px 24px rgba(11, 94, 85, .28); }
.driver-primary-journey:active:not(:disabled) { transform: translateY(1px); }
.driver-primary-journey:disabled { background: #9fb3af; box-shadow: none; opacity: 1; }
.driver-primary-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.16); font-size: 16px; }
.driver-primary-journey > span:nth-child(2) { display: grid; gap: 2px; }
.driver-primary-journey strong { font-size: 16px; font-weight: 700; }
.driver-primary-journey small { font-size: 11.5px; color: rgba(255,255,255,.75); }
.driver-primary-arrow { display: grid; color: rgba(255,255,255,.7); }
.driver-adhoc-button { display: grid; grid-template-columns: 40px 1fr 18px; gap: 12px; align-items: center; width: 100%; min-height: 60px; padding: 10px 14px; border: 1.5px dashed var(--amber); border-radius: var(--r-xl); background: var(--amber-bg); color: #6d4a07; text-align: left; }
.driver-adhoc-button > span:nth-child(2) { display: grid; gap: 2px; }
.driver-adhoc-button strong { font-size: 14.5px; }
.driver-adhoc-button small { font-size: 11.5px; color: var(--warning); }
.driver-adhoc-button .driver-primary-arrow { color: var(--amber); }
.driver-adhoc-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--amber); color: #fff; }

/* Thao tác nhanh */
.driver-section-heading { margin-top: 4px; }
.driver-section-heading > div { display: grid; gap: 1px; }
.driver-section-heading strong { font-size: 15px; }
.driver-section-heading span { font-size: 12px; color: var(--muted); }
.driver-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.driver-quick-action { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; min-height: 68px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-align: left; box-shadow: var(--sh-1); }
.driver-quick-action:disabled { opacity: .45; }
.driver-quick-action > span:last-child { display: grid; gap: 1px; min-width: 0; }
.driver-quick-action strong { font-size: 13.5px; }
.driver-quick-action small { font-size: 11px; color: var(--muted); }
.driver-quick-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); }
.driver-quick-icon.receipt { background: var(--info-bg); color: var(--info); }
.driver-quick-icon.warning { background: var(--danger-bg); color: var(--danger); }
.driver-quick-icon.vehicle { background: var(--surface-3); color: var(--text-2); }
.maps-launch-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: var(--r-lg); background: var(--ink-900); color: #fff; font-weight: 600; text-decoration: none; }
.maps-launch-button:hover { text-decoration: none; }

/* Lịch sử chuyến đột xuất & tổng kết */
.driver-adhoc-history { display: grid; gap: 8px; }
.driver-adhoc-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.driver-adhoc-item > div { display: grid; gap: 2px; min-width: 0; }
.driver-adhoc-item strong { font-size: 13.5px; }
.driver-adhoc-item small { font-size: 11.5px; color: var(--muted); }
.driver-adhoc-item.flagged { border-color: var(--danger-line); background: #fffafa; }
.driver-adhoc-note { color: var(--danger) !important; font-weight: 600; }
.driver-adhoc-item .adhoc-chip { white-space: normal; height: auto; padding: 3px 8px; text-align: center; max-width: 150px; }
.driver-day-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.driver-day-summary > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); }
.driver-day-summary span { font-size: 11.5px; color: var(--muted); }
.driver-day-summary strong { font-family: var(--font-mono); font-size: 18px; }

/* Thanh điều hướng dưới */
.driver-bottom-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
.driver-bottom-nav button, .driver-bottom-nav a { display: grid; justify-items: center; gap: 3px; padding: 6px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); text-decoration: none; }
.driver-bottom-nav span { width: 44px; height: 28px; display: grid; place-items: center; border-radius: 999px; }
.driver-bottom-nav small { font-size: 10.5px; font-weight: 600; }
.driver-bottom-nav .active { color: var(--brand-600); }
.driver-bottom-nav .active span { background: var(--brand-50); }

/* Màn hình bật quyền */
.driver-permission-screen { max-width: 560px; margin: 0 auto; padding: 16px 14px; }
.driver-permission-card { display: grid; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.driver-permission-hero { display: flex; gap: 12px; align-items: flex-start; }
.driver-permission-lock { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; background: var(--ink-900); color: var(--brand-300); }
.driver-permission-hero > div { display: grid; gap: 3px; }
.driver-permission-hero .driver-section-label { color: var(--brand-500); }
.driver-permission-hero h1 { font-size: 20px; }
.driver-permission-hero p { font-size: 13px; color: var(--muted); }
.driver-permission-steps { display: grid; gap: 8px; }
.driver-permission-steps article { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); }
.driver-permission-steps article > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.driver-permission-steps article > div { display: grid; gap: 2px; }
.driver-permission-steps strong { font-size: 13.5px; }
.driver-permission-steps small { font-size: 12px; color: var(--muted); }
.driver-permission-steps article > button { grid-column: 1 / -1; height: 40px; border: 0; border-radius: var(--r-sm); background: var(--brand-600); color: #fff; font-weight: 600; }
.driver-permission-steps article.ready { border-color: var(--success-line); background: var(--success-bg); }
.driver-permission-steps article.ready > span { background: var(--success); color: #fff; }
.driver-permission-steps article.blocked { border-color: var(--danger-line); background: #fffafa; }
.driver-permission-message { padding: 10px 12px; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); font-size: 13px; }
.driver-secure-url { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 12px; }
.driver-secure-url code { overflow-wrap: anywhere; }
.driver-permission-help { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warning-bg); color: var(--warning); font-size: 12.5px; }
.driver-permission-recheck { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font-weight: 600; }
.driver-permission-footnote { font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Modal tài xế ---------- */
.checklist-list { display: grid; gap: 8px; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); }
.check-row strong { font-size: 14px; font-weight: 600; }
.yes-no { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-3); }
.yes-no button { min-width: 64px; height: 34px; border: 0; border-radius: var(--r-xs); background: transparent; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.yes-no .yes.active { background: var(--success); color: #fff; }
.yes-no .no.active { background: var(--danger); color: #fff; }
.segment-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--surface-3); }
.segment-control button { height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 600; color: var(--muted); }
.segment-control button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.odometer-guide { display: grid; gap: 3px; padding: 11px 12px; border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: 12.5px; }
.odometer-guide strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.odometer-ai-toggle { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.odometer-ai-toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.odometer-ai-toggle-copy { display: grid; gap: 2px; }
.odometer-ai-toggle-copy strong { font-size: 13.5px; color: var(--text); }
.odometer-ai-toggle-copy small { font-weight: 400; }
.odometer-ai-switch { width: 44px; height: 26px; padding: 3px; border-radius: 999px; background: var(--border-strong); transition: background-color .15s; }
.odometer-ai-switch i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
.odometer-ai-toggle.enabled .odometer-ai-switch { background: var(--brand-500); }
.odometer-ai-toggle.enabled .odometer-ai-switch i { transform: translateX(18px); }
.odometer-manual-mode, .ocr-status, .gemini-verify-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); font-size: 12.5px; }
.odometer-manual-mode > div, .ocr-status > div, .gemini-verify-head > div { display: grid; gap: 2px; }
.odometer-manual-mode strong, .ocr-status strong, .gemini-verify-head strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.odometer-manual-mode span, .ocr-status span, .gemini-verify-head span { color: var(--muted); }
.ocr-status.success { border-color: var(--success-line); background: var(--success-bg); }
.ocr-status.warning { border-color: var(--warning-line); background: var(--warning-bg); }
.ocr-status.error { border-color: var(--danger-line); background: var(--danger-bg); }
.ocr-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ocr-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-400); transition: width .2s; }
.gemini-verify-head { display: flex; justify-content: space-between; gap: 10px; }
.gemini-verify-head small { font-family: var(--font-mono); font-weight: 600; }
.gemini-verify-card.success { border-color: var(--success-line); }
.gemini-meta-row { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.gemini-retry-button { justify-self: start; }
.ocr-comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ocr-comparison-grid article { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.ocr-comparison-grid article.selected, .ocr-comparison-grid article.verified { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.ocr-comparison-grid span { font-size: 11.5px; color: var(--muted); }
.ocr-comparison-grid strong { font-family: var(--font-mono); font-size: 18px; }
.ocr-comparison-grid small { font-size: 11px; color: var(--muted); }
.ocr-comparison-grid button { height: 32px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 12px; font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-grid button, .incident-choice button { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.choice-grid button span { color: var(--brand-500); display: grid; }
.choice-grid button.active, .incident-choice button.active { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-700); box-shadow: 0 0 0 2px var(--brand-100); }
.incident-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.incident-choice button.active { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); box-shadow: none; }
.amount-preview { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.amount-preview strong { font-family: var(--font-mono); font-size: 16px; }
.emergency-call { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: var(--r); background: var(--danger); color: #fff; font-weight: 700; text-decoration: none; }
.start-route-confirmation { display: grid; gap: 6px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.start-route-confirmation > div:not(.route-confirm-arrow) { display: grid; gap: 1px; }
.start-route-confirmation span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.start-route-confirmation strong { font-size: 14.5px; }
.route-confirm-arrow { color: var(--faint); transform: rotate(90deg); width: 16px; }
.location-confirm-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); }
.location-confirm-card.success { border-color: var(--success-line); background: var(--success-bg); }
.location-confirm-card.error { border-color: var(--danger-line); background: #fffafa; }
.location-confirm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.location-confirm-head > div { display: grid; gap: 2px; }
.location-confirm-head strong { font-size: 13.5px; }
.location-confirm-head span { font-size: 12px; color: var(--muted); }
.location-coordinates { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.secure-open-button { height: 40px; border: 0; border-radius: var(--r-sm); background: var(--ink-900); color: #fff; font-weight: 600; }
.start-readiness-check { display: grid; gap: 8px; padding: 12px; border-radius: var(--r); border: 1px solid var(--success-line); background: var(--success-bg); }
.start-readiness-check.warning { border-color: var(--warning-line); background: var(--warning-bg); }
.start-readiness-check.blocked { border-color: var(--danger-line); background: var(--danger-bg); }
.start-readiness-title { display: flex; align-items: center; gap: 10px; }
.start-readiness-title > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface); }
.start-readiness-title div { display: grid; }
.start-readiness-title small { color: var(--text-2); font-size: 12px; }
.start-readiness-items { display: grid; gap: 4px; }
.start-readiness-items > div { display: grid; padding: 7px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.7); font-size: 12px; }
.driver-profile-form { display: grid; gap: 14px; }
.driver-profile-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--ink-900); color: #fff; }
.driver-profile-avatar { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--brand-400); font-size: 24px; font-weight: 700; }
.driver-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.driver-profile-identity { display: grid; gap: 3px; min-width: 0; }
.driver-profile-identity strong { font-size: 17px; }
.driver-profile-identity > span { font-size: 12px; color: var(--ink-muted); }
.driver-avatar-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.driver-avatar-actions .secondary-button { cursor: pointer; }
.driver-avatar-remove { border: 0; background: transparent; color: #ff9a9d; font-size: 12px; font-weight: 600; }
.driver-profile-work { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.driver-profile-work > div { display: grid; padding: 10px 12px; background: var(--surface); }
.driver-profile-work span { font-size: 11px; color: var(--muted); }
.driver-profile-work strong { font-size: 13px; }
.driver-profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.driver-profile-note { padding: 10px 12px; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); font-size: 12px; }
.driver-profile-actions { display: flex; justify-content: space-between; gap: 10px; }
.driver-profile-logout { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--danger-line); border-radius: var(--r-sm); background: var(--surface); color: var(--danger); font-weight: 600; }
.driver-vehicle-tracking-head { display: grid; gap: 8px; }
.driver-vehicle-tracking-head > div { display: flex; align-items: center; gap: 10px; }
.driver-vehicle-tracking-head > div > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--ink-900); color: #fff; }
.driver-vehicle-tracking-head > div > div { display: grid; }
.driver-vehicle-tracking-head small { color: var(--muted); font-size: 12px; }
.driver-vehicle-tracking-head p { font-size: 12.5px; color: var(--muted); }
.driver-vehicle-expiry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.driver-vehicle-expiry-grid > div { display: grid; gap: 2px; padding: 10px; border-radius: var(--r); border: 1px solid var(--success-line); background: var(--success-bg); }
.driver-vehicle-expiry-grid > div.warning { border-color: var(--warning-line); background: var(--warning-bg); }
.driver-vehicle-expiry-grid > div.danger { border-color: var(--danger-line); background: var(--danger-bg); }
.driver-vehicle-expiry-grid span { font-size: 11px; color: var(--muted); }
.driver-vehicle-expiry-grid strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.driver-vehicle-expiry-grid small { font-size: 11px; font-weight: 600; }
.driver-vehicle-tracking-form { display: grid; gap: 12px; }
.driver-date-format-note { font-size: 12px; }

/* Tạo chuyến đột xuất */
.adhoc-flow-note { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--amber-line); border-radius: var(--r); background: var(--amber-bg); color: #6d4a07; font-size: 12.5px; line-height: 1.5; }
.adhoc-flow-note strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--warning); }
.adhoc-trip-form { display: grid; gap: 12px; }
.adhoc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 480px) {
  .adhoc-form-row, .driver-profile-fields { grid-template-columns: 1fr; }
  .driver-vehicle-expiry-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 700px) { .driver-bottom-nav { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 12px; border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2); } }
/* =====================================================================
   Đăng nhập
   ===================================================================== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: var(--surface); }

.login-hero { position: relative; display: flex; flex-direction: column; gap: 32px; padding: 40px 48px; color: #fff; background: var(--ink-950); overflow: hidden; }
.login-hero-bg { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(8,24,22,.55) 0%, rgba(8,24,22,.82) 55%, rgba(8,24,22,.96) 100%),
  radial-gradient(80% 60% at 100% 0%, rgba(92,196,174,.28), transparent 60%),
  url('/hospital-real-v201.webp') center / cover no-repeat; }
.login-hero > *:not(.login-hero-bg) { position: relative; }
.login-hero-brand { display: flex; align-items: center; gap: 12px; }
.login-logo { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.login-logo img { width: 36px; height: 36px; object-fit: contain; }
.login-hero-brand div, .login-mobile-brand div { display: grid; }
.login-hero-brand strong { font-size: 17px; }
.login-hero-brand small { font-size: 12px; color: var(--ink-muted); }
.login-hero-copy { margin-top: auto; display: grid; gap: 14px; max-width: 560px; }
.login-kicker { display: inline-flex; align-items: center; gap: 8px; width: fit-content; height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); font-size: 12px; font-weight: 600; color: var(--ink-text); }
.login-kicker i { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.25); }
.login-hero-copy h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.login-hero-copy p { font-size: 15px; line-height: 1.6; color: var(--ink-text); max-width: 52ch; }
.login-capabilities { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 560px; }
.login-capabilities li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); background: rgba(255,255,255,.04); backdrop-filter: blur(4px); }
.login-capabilities li > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(92,196,174,.16); color: var(--brand-300); }
.login-capabilities div { display: grid; }
.login-capabilities strong { font-size: 14px; }
.login-capabilities small { font-size: 12px; color: var(--ink-muted); }
.login-hero-footer { font-size: 12px; color: var(--ink-muted); }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: min(400px, 100%); display: grid; gap: 24px; }
.login-mobile-brand { display: none; align-items: center; gap: 12px; }
.login-mobile-brand .login-logo { box-shadow: 0 0 0 1px var(--border); }
.login-mobile-brand strong { font-size: 16px; }
.login-mobile-brand small { font-size: 12px; color: var(--muted); }
.login-heading { display: grid; gap: 6px; }
.login-heading h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.login-heading p { color: var(--muted); font-size: 14px; }
.login-form { display: grid; gap: 16px; }
.login-field { gap: 7px; font-size: 13px; }
.login-input { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.login-input:focus-within { border-color: var(--brand-400); box-shadow: var(--focus); color: var(--brand-500); }
.login-input input { flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; box-shadow: none !important; background: transparent; font-size: 15px; color: var(--text); }
.login-input button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); }
.login-input button:hover { background: var(--surface-3); }
.login-options { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.login-options label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-2); }
.login-options > button { border: 0; background: transparent; color: var(--brand-500); font-size: 13px; font-weight: 600; }
.login-submit { width: 100%; height: 48px; font-size: 15px; }
.login-security { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.login-security .ui-icon { color: var(--brand-500); margin-top: 1px; }

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { place-items: start center; padding: calc(40px + env(safe-area-inset-top, 0px)) 20px 32px; background: var(--bg); }
  .login-card { padding: 24px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2); }
  .login-mobile-brand { display: flex; }
}
