:root {
  --ink: #0b2636;
  --muted: #647784;
  --line: #dce5e8;
  --surface: #ffffff;
  --surface-2: #f4f7f7;
  --canvas: #eef3f2;
  --brand: #087f68;
  --brand-strong: #056654;
  --brand-soft: #dff3ee;
  --navy: #082337;
  --danger: #b42318;
  --danger-soft: #fef0ee;
  --warning: #a15c07;
  --warning-soft: #fff5df;
  --success: #087f5b;
  --success-soft: #e3f5ee;
  --shadow: 0 8px 28px rgba(8, 35, 55, .08);
  --radius: 14px;
  --sidebar: 272px;
  --scrollbar-size: 10px;
  --scrollbar-track: #e4ebeb;
  --scrollbar-thumb: #9aadaa;
  --font-ui: "Segoe UI", Arial, sans-serif;
  --font-arabic: Tahoma, "Segoe UI", Arial, sans-serif;
  --z-dropdown: 200;
  --z-popover: 300;
  --z-backdrop: 500;
  --z-dialog: 600;
  --z-toast: 900;
}

* { box-sizing: border-box; }
html { font-size: 16px; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); scrollbar-width: thin; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font-ui); line-height: 1.55; }
html[lang="ar"] body { font-family: var(--font-arabic); }
*::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 2px solid var(--scrollbar-track); border-radius: 999px; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(9, 164, 136, .35); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: -80px; right: 1rem; padding: .65rem 1rem; background: white; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ui-icon { width: 1.15rem; height: 1.15rem; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app-shell.sidebar-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; color: #d9e5e9; background: var(--navy); border-inline-end: 1px solid rgba(255,255,255,.05); overflow-y: auto; }
.brand-panel { height: 94px; display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 122px; height: auto; filter: brightness(0) invert(1); opacity: .96; }
.brand-caption { padding-inline-start: .75rem; border-inline-start: 1px solid rgba(255,255,255,.2); font-size: .78rem; color: #9fb2bc; }
.sidebar-close, .sidebar-scrim { display: none; }
.tenant-chip { display: flex; align-items: center; gap: .65rem; margin: 1rem; padding: .75rem .8rem; background: rgba(9,164,136,.13); border: 1px solid rgba(83,213,188,.18); border-radius: 11px; }
.tenant-chip span:last-child { min-width: 0; display: grid; }
.tenant-chip small { color: #89a4af; font-size: .7rem; }
.tenant-chip strong { color: white; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.tenant-dot { width: 9px; height: 9px; flex: 0 0 auto; background: #30d3af; border-radius: 50%; box-shadow: 0 0 0 4px rgba(48,211,175,.12); }
.side-nav { padding: .5rem .8rem 1.25rem; display: grid; gap: .18rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; color: #bdccd2; min-height: 43px; padding: .58rem .75rem; border-radius: 9px; font-size: .9rem; transition: background .18s, color .18s; }
.side-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.side-nav a.active { color: white; background: rgba(9,164,136,.2); box-shadow: inset -3px 0 #18b595; }
.nav-mark { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; color: #52cbb3; }
.nav-mark .ui-icon { width: 1.2rem; height: 1.2rem; }
.nav-section { margin: 1rem .75rem .3rem; color: #6f8a96; font-size: .69rem; font-weight: 700; letter-spacing: .06em; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: .65rem; padding: 1rem; background: rgba(0,0,0,.12); border-top: 1px solid rgba(255,255,255,.07); }
.user-avatar { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--brand); border-radius: 11px; font-weight: 800; }
.user-meta { min-width: 0; display: grid; flex: 1; }
.user-meta strong { color: #f6fafb; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #829ba6; font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .icon-button { color: #b5c5cb; background: transparent; }
.page-column { min-width: 0; }
.topbar { min-height: 82px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .85rem clamp(1rem, 3vw, 2.35rem); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.eyebrow { display: block; color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .03em; }
.top-actions { display: flex; align-items: center; gap: .55rem; }
.mobile-menu { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer; }
.mobile-menu:hover { color: var(--brand); background: var(--brand-soft); }
.sidebar-collapsed .brand-panel { justify-content: center; padding-inline: .55rem; }
.sidebar-collapsed .brand-logo { width: 54px; }
.sidebar-collapsed .brand-caption, .sidebar-collapsed .tenant-chip span:last-child,
.sidebar-collapsed .nav-section, .sidebar-collapsed .user-meta { display: none; }
.sidebar-collapsed .tenant-chip { justify-content: center; margin-inline: .7rem; padding-inline: .4rem; }
.sidebar-collapsed .side-nav { padding-inline: .55rem; }
.sidebar-collapsed .side-nav a { justify-content: center; padding-inline: .45rem; font-size: 0; }
.sidebar-collapsed .nav-mark .ui-icon { width: 1.25rem; height: 1.25rem; }
.sidebar-collapsed .sidebar-footer { justify-content: center; padding-inline: .45rem; flex-wrap: wrap; }
.main-content { width: min(1540px, 100%); margin: 0 auto; padding: clamp(1rem, 2.5vw, 2.2rem); }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h2 { margin: 0 0 .2rem; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.page-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(8,35,55,.035); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 64px; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 1.15rem; }
.stacked-card { margin-top: 1rem; }
.exchange-card { margin-bottom: 1rem; }
.import-form { display: flex; align-items: end; gap: 1rem; }
.import-form .field { flex: 1; margin: 0; }
.settings-lookups { margin-top: 1rem; align-items: start; }
.card-subtitle { color: var(--muted); font-size: .78rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr); gap: 1rem; }
.full-width-table { width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { position: relative; overflow: hidden; min-height: 126px; padding: 1.05rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stat small { color: var(--muted); font-size: .78rem; }
.stat strong { display: block; margin-top: .38rem; color: var(--ink); font-size: 1.75rem; line-height: 1.1; }
.stat span { display: inline-block; margin-top: .6rem; color: var(--brand-strong); font-size: .73rem; font-weight: 700; }
.stat.warning::before { background: #e8a12a; }
.stat.danger::before { background: #cf4a40; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .52rem .9rem; border: 1px solid transparent; border-radius: 9px; color: white; background: var(--brand); cursor: pointer; font-weight: 700; font-size: .84rem; transition: transform .12s, background .16s, border-color .16s; }
.button:hover { color: white; background: var(--brand-strong); }
.button:active { transform: translateY(1px); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.secondary:hover, .button.ghost:hover { color: var(--brand-strong); border-color: #9acac0; background: #f5fbf9; }
.button.ghost { color: var(--ink); background: transparent; border-color: transparent; }
.button.danger { background: var(--danger); }
.button.danger:hover { background: #8f1c13; }
.button.small { min-height: 34px; padding: .35rem .65rem; font-size: .75rem; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.icon-button:hover { color: var(--brand); border-color: #a8ccc5; }
.icon-button .ui-icon { width: 1.12rem; height: 1.12rem; }
.notification-button { position: relative; }
.notification-count { position: absolute; inset-inline-end: -.42rem; top: -.42rem; min-width: 1.2rem; height: 1.2rem; display: grid; place-items: center; padding: 0 .2rem; color: white; background: var(--danger); border: 2px solid var(--surface); border-radius: 999px; font-size: .62rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

.filter-bar { display: flex; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; background: #f9fbfb; border-bottom: 1px solid var(--line); }
.search-box { position: relative; width: min(380px,100%); }
.search-box input { padding-inline: 2.35rem; }
.search-box::before { content: ""; position: absolute; z-index: 1; inset-inline-start: .82rem; top: calc(50% - 7px); width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-box::after { content: ""; position: absolute; z-index: 1; inset-inline-start: 1.55rem; top: calc(50% + 5px); width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); transform-origin: left center; pointer-events: none; }
[dir="rtl"] .search-box::after { transform: rotate(-45deg); transform-origin: right center; }
.search-clear { position: absolute; z-index: 2; inset-inline-end: .42rem; top: 50%; width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 7px; transform: translateY(-50%); }
.search-clear:hover { color: var(--danger); background: var(--danger-soft); }
.search-clear .ui-icon { width: .95rem; height: .95rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
table tbody tr.actionable-row, table tbody tr:has(a[href], button:not(:disabled), summary) { background: color-mix(in srgb, var(--brand-soft) 42%, transparent); transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease; }
table tbody tr.actionable-row:hover, table tbody tr:has(a[href], button:not(:disabled), summary):hover { background: color-mix(in srgb, var(--brand-soft) 82%, white); box-shadow: inset 3px 0 var(--brand); }
[dir="rtl"] table tbody tr.actionable-row:hover, [dir="rtl"] table tbody tr:has(a[href], button:not(:disabled), summary):hover { box-shadow: inset -3px 0 var(--brand); }
table tbody tr.actionable-row:focus-within, table tbody tr:has(a[href], button:not(:disabled), summary):focus-within { background: var(--brand-soft); outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: -2px; }
th { padding: .75rem 1rem; text-align: start; color: var(--muted); background: #f7f9f9; border-bottom: 1px solid var(--line); font-size: .73rem; white-space: nowrap; }
td { padding: .82rem 1rem; border-bottom: 1px solid #e8eeee; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.notification-row-link { display: block; min-height: 1.2rem; color: inherit; text-decoration: none; }
.notification-main-link { margin: -.82rem -1rem; padding: .82rem 1rem; }
.notification-row-link:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: .18rem; }
.notification-row-link:focus-visible { outline: 3px solid rgba(8,127,104,.28); outline-offset: 3px; border-radius: 5px; }
.notification-row-link .badge { text-decoration: none; }
.cell-title { display: grid; }
.cell-title strong { color: var(--ink); font-size: .84rem; }
.cell-title small { color: var(--muted); font-size: .71rem; }
.numeric { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: .3rem; min-height: 25px; padding: .2rem .52rem; border-radius: 999px; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.neutral { color: #526772; background: #eaf0f1; }
.actions { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.text-action { padding: .25rem; border: 0; color: var(--brand-strong); background: transparent; cursor: pointer; font-weight: 700; font-size: .76rem; }
.text-danger { color: var(--danger); }
.pagination { min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.pagination-links { display: flex; gap: .35rem; }
.pagination-links a, .pagination-links span { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
.pagination-links span { opacity: .45; }
.pagination-links .ui-icon { width: 1rem; height: 1rem; }

.form-card { max-width: 900px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.field { display: grid; align-content: start; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: .78rem; font-weight: 800; }
.field-hint { color: var(--muted); font-size: .69rem; }
input, select, textarea { width: 100%; min-height: 43px; padding: .58rem .72rem; color: var(--ink); background: white; border: 1px solid #c8d4d8; border-radius: 9px; }
input:hover, select:hover, textarea:hover { border-color: #9bafb6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,127,104,.11); outline: 0; }
input[readonly], input:disabled, select:disabled { color: #71828b; background: #edf2f2; cursor: not-allowed; }
textarea { min-height: 102px; resize: none; }
select { appearance: auto; }
.input-validation-error { border-color: var(--danger); background: #fffafa; }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: .73rem; }
.validation-summary-errors { margin-bottom: 1rem; padding: .75rem 1rem; background: var(--danger-soft); border-inline-start: 3px solid var(--danger); border-radius: 7px; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }
.form-actions { display: flex; justify-content: flex-start; gap: .55rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: stretch; gap: .4rem; }
.password-field input { min-width: 0; }
.password-field button { min-width: 4.5rem; padding: .5rem .75rem; border: 1px solid #c8d4d8; border-radius: 9px; color: var(--brand-strong); background: white; font-size: .72rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.password-field button:hover { border-color: #9acac0; background: #f5fbf9; }
.password-field button:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,127,104,.11); outline: 0; }
.check-row { display: flex; align-items: center; gap: .5rem; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--brand); }

.empty-state { min-height: 250px; display: grid; place-items: center; padding: 2rem; text-align: center; }
.empty-state > div { max-width: 400px; }
.empty-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto .8rem; color: var(--brand); background: var(--brand-soft); border-radius: 16px; }
.empty-mark .ui-icon { width: 1.55rem; height: 1.55rem; }
.empty-state h3 { margin: 0 0 .3rem; }
.empty-state p { margin: 0 0 1rem; color: var(--muted); font-size: .84rem; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: .7rem; padding-bottom: 1rem; }
.timeline-item::before { content: ""; position: absolute; top: 15px; bottom: -3px; inset-inline-start: 6px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 13px; height: 13px; margin-top: .2rem; z-index: 1; background: var(--brand); border: 3px solid var(--brand-soft); border-radius: 50%; }
.timeline-content strong { display: block; font-size: .8rem; }
.timeline-content span { color: var(--muted); font-size: .71rem; }
.timeline-content p { margin: .2rem 0 0; color: #49606c; font-size: .75rem; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .85rem 1rem; }
.detail-item { display: grid; gap: .1rem; }
.detail-item small { color: var(--muted); font-size: .68rem; }
.detail-item strong { font-size: .84rem; }
.notice { padding: .8rem 1rem; color: #6e490d; background: var(--warning-soft); border: 1px solid #f2d396; border-radius: 10px; font-size: .78rem; }
.notice.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.notice.danger { color: var(--danger); background: var(--danger-soft); border-color: #efc1bc; }
.tracker-health-summary { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .8rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.tracker-health-summary > div { display: grid; gap: .12rem; }
.tracker-health-summary strong { font-size: .88rem; }
.tracker-health-summary span { color: var(--muted); font-size: .72rem; }
.tracker-health-dot { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 4px white, 0 0 0 5px var(--line); }
.tracker-health-dot.success { background: var(--success); }
.tracker-health-dot.warning { background: #d68a13; }
.tracker-health-dot.danger { background: var(--danger); }
.tracker-health-dot.neutral { background: var(--muted); }
.tracker-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.tracker-actions form { margin: 0; }
.tracker-mode-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0 0 1rem; padding: 0; border: 0; }
.tracker-mode-choice legend { grid-column: 1 / -1; margin-bottom: .15rem; font-size: .8rem; font-weight: 800; }
.tracker-mode-choice label { display: flex; align-items: flex-start; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.tracker-mode-choice label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 15%, transparent); background: var(--brand-soft); }
.tracker-mode-choice input { width: auto; min-height: auto; margin-top: .15rem; }
.tracker-mode-choice span { display: grid; gap: .18rem; }
.tracker-mode-choice strong { font-size: .8rem; }
.tracker-mode-choice small, .tracker-commissioning-hint { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.tracker-setup-panel { margin-bottom: .8rem; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; }
.tracker-setup-panel[hidden] { display: none; }
.tracker-commissioning-hint { margin-bottom: .25rem; }
.toast { position: relative; z-index: var(--z-toast); display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; padding: .75rem 1rem; border: 1px solid; border-radius: 10px; box-shadow: var(--shadow); font-size: .8rem; }
.toast-mark { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.toast-mark .ui-icon { width: .9rem; height: .9rem; }
.toast button { width: 32px; height: 32px; display: grid; place-items: center; margin-inline-start: auto; padding: 0; border: 0; border-radius: 7px; color: inherit; background: transparent; cursor: pointer; }
.toast button:hover { background: rgba(255,255,255,.55); }
.toast.success { color: var(--success); background: var(--success-soft); border-color: #b5dfd0; }
.toast.warning { color: var(--warning); background: var(--warning-soft); border-color: #efd49f; }
.toast.danger { color: var(--danger); background: var(--danger-soft); border-color: #efc1bc; }
.confirm-dialog { width: min(430px, calc(100% - 2rem)); padding: 1.35rem; color: var(--ink); border: 0; border-radius: 15px; box-shadow: 0 24px 70px rgba(7,29,42,.3); text-align: center; }
.confirm-dialog::backdrop { background: rgba(4,20,31,.58); backdrop-filter: blur(2px); }
.confirm-dialog h2 { margin: .65rem 0 .25rem; font-size: 1.15rem; }
.confirm-dialog p { color: var(--muted); font-size: .83rem; }
.dialog-mark { width: 50px; height: 50px; display: grid; place-items: center; margin: auto; color: var(--danger); background: var(--danger-soft); border-radius: 50%; }
.dialog-mark .ui-icon { width: 1.35rem; height: 1.35rem; }
.dialog-actions { display: flex; justify-content: center; gap: .55rem; margin-top: 1rem; }
.task-dialog { width: min(680px, calc(100% - 2rem)); max-height: min(820px, calc(100dvh - 2rem)); padding: 0; color: var(--ink); border: 0; border-radius: var(--radius); box-shadow: 0 24px 70px rgba(7,29,42,.32); }
.task-dialog::backdrop { background: rgba(4,20,31,.62); backdrop-filter: blur(2px); }
.task-dialog > form { max-height: inherit; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.task-dialog-content { max-height: inherit; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.task-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.task-dialog-head h2 { margin: .1rem 0 .2rem; font-size: 1.2rem; }
.task-dialog-head p { margin: 0; color: var(--muted); font-size: .78rem; }
.task-dialog-body { overflow-y: auto; padding: 1.15rem; scrollbar-gutter: stable; }
.task-dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; padding: .85rem 1.15rem; background: var(--surface); border-top: 1px solid var(--line); }
.form-dialog { width: min(760px, calc(100% - 2rem)); }
.form-dialog .form-grid { align-items: start; }
.action-loading { position: fixed; inset: 0; z-index: calc(var(--z-dialog) + 20); display: grid; place-content: center; justify-items: center; gap: .75rem; color: white; background: rgba(4,20,31,.55); backdrop-filter: blur(2px); }
.action-loading[hidden] { display: none; }
.action-loading strong { padding: .55rem .85rem; border-radius: 999px; background: rgba(4,20,31,.78); }
.loading-spinner { width: 2.6rem; height: 2.6rem; border: 4px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: action-spin .72s linear infinite; }
.button[data-loading="true"], button[data-loading="true"] { position: relative; cursor: wait; opacity: .75; pointer-events: none; }
.button[data-loading="true"]::after, button[data-loading="true"]::after { content: ""; width: .85rem; height: .85rem; margin-inline-start: .45rem; display: inline-block; vertical-align: -.12rem; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: action-spin .72s linear infinite; }
@keyframes action-spin { to { transform: rotate(360deg); } }
.choice-field { margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: .45rem; font-size: .78rem; font-weight: 800; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .45rem; }
.bulk-select-all { margin: .8rem 0; color: var(--brand-strong); }
.bulk-candidate-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); max-height: 46vh; overflow-y: auto; padding: .15rem; }
.bulk-candidate-grid .check-row span { display: grid; gap: .05rem; }
.bulk-candidate-grid .check-row small { color: var(--muted); }
.choice-grid .check-row { min-height: 42px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.role-choices .choice-grid { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
.role-choice-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.choice-grid .role-choice-card .check-row { flex: 1; border: 0; border-radius: 0; background: transparent; }
.role-choice-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 15%, transparent); }
.role-choice { align-items: flex-start; }
.role-choice strong, .role-choice small { display: block; }
.role-choice small { margin-top: .18rem; color: var(--muted); line-height: 1.35; }
.role-permission-details { padding: .5rem .7rem; border-top: 1px solid var(--line); }
.role-permission-details summary { cursor: pointer; color: var(--brand); font-size: .76rem; font-weight: 800; }
.permission-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.permission-tags span { padding: .25rem .48rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .72rem; line-height: 1.25; }
.effective-permissions { margin-top: .85rem; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.effective-permissions-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.effective-permissions-heading > strong { font-size: .9rem; }
.permission-count { padding: .2rem .48rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.effective-permissions > p { margin: .3rem 0 0; color: var(--muted); font-size: .76rem; }
.effective-permission-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin-top: .75rem; }
.effective-permission-group { min-width: 0; }
.effective-permission-group > strong { font-size: .76rem; color: var(--muted); }
.effective-permission-group .permission-tags { margin-top: .35rem; }
.role-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.photo-source-field { border: 0; padding: 0; min-width: 0; }
.photo-source-field legend { margin-bottom: .45rem; font-weight: 700; }
.photo-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.photo-source-grid label { display: grid; gap: .35rem; padding: .55rem .7rem; border: 1px dashed var(--line); border-radius: 9px; background: var(--surface-2); font-size: .8rem; font-weight: 700; }
.photo-source-grid label:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
@media (max-width: 520px) { .photo-source-grid { grid-template-columns: 1fr; } }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.row-actions > form { margin: 0; }
.inline-editor { position: relative; min-width: 5rem; }
.inline-editor summary { list-style: none; cursor: pointer; }
.inline-editor summary::-webkit-details-marker { display: none; }
.inline-editor[open] > form { display: grid; width: min(340px, calc(100vw - 3rem)); gap: .65rem; margin-top: .65rem; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.inline-editor label { display: grid; gap: .3rem; color: var(--muted); font-size: .75rem; font-weight: 700; }
.danger-text { color: var(--danger); }
details.action-menu { position: relative; }
details.action-menu > summary { list-style: none; cursor: pointer; }
details.action-menu > summary::-webkit-details-marker { display: none; }
.action-popover { position: absolute; z-index: 8; inset-inline-end: 0; top: calc(100% + .35rem); width: min(320px, calc(100vw - 2rem)); padding: .65rem; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.action-popover .field { margin-bottom: .5rem; }
.action-popover input, .action-popover select { min-height: 36px; font-size: .74rem; }
.map-card { min-width: 0; overflow: hidden; }
.map-card-head { align-items: center; display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: .75rem 1rem; }
.map-card-title { min-width: 0; }
.map-source-picker { display: flex; min-width: 0; align-items: center; gap: .45rem; }
.map-source-picker label { color: var(--muted); font-size: .73rem; font-weight: 700; white-space: nowrap; }
.map-source-picker select { width: min(250px, 100%); min-width: 0; min-height: 38px; font-size: .78rem; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem 1rem; color: var(--muted); font-size: .73rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px white, 0 0 0 4px var(--line); }
.legend-dot.assigned { background: var(--success); }
.legend-dot.unassigned { background: var(--danger); }
.legend-dot.gps-live { background: var(--success); }
.legend-dot.gps-delayed { background: #d68a13; }
.legend-dot.gps-stale { background: var(--danger); }
.map-status-bar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .45rem 1rem; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.map-status-counts, .map-refresh-state { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .9rem; }
.map-status-counts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.map-status-counts .status-live strong { color: var(--success); }
.map-status-counts .status-attention strong { color: var(--danger); }
.map-refresh-state { justify-content: flex-end; }
.map-refresh-state .button { min-height: 32px; padding-block: .35rem; }
.map-stage { position: relative; min-width: 0; }
.saudi-map { position: relative; z-index: 0; height: clamp(420px, 64vh, 720px); overflow: hidden; background: var(--surface-2); }
.map-empty-overlay { position: absolute; z-index: 450; inset: 50% auto auto 50%; width: min(430px, calc(100% - 2rem)); padding: 1.25rem; transform: translate(-50%, -50%); text-align: center; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(5px); }
.map-empty-overlay[hidden] { display: none; }
.map-empty-overlay h3 { margin: .6rem 0 .25rem; }
.map-empty-overlay p { margin: 0 auto .8rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.representative-map-marker-shell { background: transparent; border: 0; }
.representative-map-marker { width: 36px; height: 36px; display: grid; place-items: center; color: white; border: 3px solid white; border-radius: 50% 50% 50% 12%; box-shadow: 0 5px 16px rgba(7,29,42,.35); transform: rotate(-45deg); }
.representative-map-marker span { width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.representative-map-marker.assigned { background: var(--success); }
.representative-map-marker.unassigned { background: var(--danger); }
.representative-map-marker.gps-live { background: var(--success); }
.representative-map-marker.gps-delayed { background: #d68a13; }
.representative-map-marker.gps-stale, .representative-map-marker.gps-offline { background: var(--danger); }
.representative-map-marker.gps-neverreported { background: var(--muted); }
.leaflet-marker-icon:focus-visible .representative-map-marker { outline: 3px solid var(--ink); outline-offset: 3px; }
.leaflet-control-zoom a { color: var(--ink); font-family: var(--font-ui); }
.leaflet-popup { max-width: calc(100vw - 2rem); }
.leaflet-popup-content-wrapper { max-width: 100%; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 42px rgba(7,29,42,.24); }
.leaflet-popup-content { width: min(30rem, calc(100vw - 4rem)); max-width: min(30rem, calc(100vw - 4rem)); max-height: min(26rem, calc(100vh - 9rem)); margin: 1rem 1.1rem; overflow: auto; scrollbar-gutter: stable; }
.map-popup-content { color: var(--ink); }
.map-popup-head { display: flex; align-items: start; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.map-popup-head strong { min-width: 0; font-size: .85rem; }
.map-popup-content .badge { flex: 0 0 auto; }
.map-popup-content dl { display: grid; gap: .42rem; margin: 0 0 .65rem; }
.map-popup-content dl > div { display: grid; grid-template-columns: minmax(72px, .7fr) minmax(0, 1.3fr); gap: .6rem; }
.map-popup-content dt { color: var(--muted); font-size: .68rem; }
.map-popup-content dd { margin: 0; overflow-wrap: anywhere; font-size: .72rem; }
@media (max-width: 520px) {
  .map-card-head { grid-template-columns: 1fr; align-items: stretch; }
  .map-source-picker { display: grid; grid-template-columns: 1fr; }
  .map-source-picker select { width: 100%; }
  .map-legend { padding-top: .2rem; }
  .map-status-bar, .map-refresh-state { align-items: stretch; flex-direction: column; }
  .map-refresh-state { width: 100%; }
  .map-refresh-state .button { width: 100%; }
  .saudi-map { height: clamp(360px, 58vh, 540px); }
  .leaflet-popup-content { max-width: calc(100vw - 4rem); margin: .7rem; }
  .map-popup-head { align-items: stretch; flex-direction: column; gap: .4rem; }
  .map-popup-content .badge { align-self: flex-start; }
  .map-popup-content dl > div { grid-template-columns: 1fr; gap: .1rem; padding-block: .22rem; border-bottom: 1px solid var(--line); }
  .map-popup-content dl > div:last-child { border-bottom: 0; }
}
.map-error { padding: .75rem 1rem; color: var(--danger); background: var(--danger-soft); border-top: 1px solid #efc1bc; font-size: .78rem; }
.checklist-fieldset { display: grid; gap: .45rem; margin: .7rem 0; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; }
.checklist-fieldset legend { padding-inline: .35rem; color: var(--ink); font-size: .76rem; font-weight: 700; }
.required-mark { color: var(--danger); font-style: normal; }
.report-filters { margin-bottom: 1rem; }
.report-filters .filter-bar { align-items: end; }
.filter-fields { display: flex; gap: .75rem; }
.notification-filters { align-items: end; }
.notification-filters .filter-fields { flex: 1; align-items: end; }
.notification-filters .search-box { width: min(430px, 100%); }
.filter-select { width: min(220px, 100%); display: grid; gap: .3rem; }
.filter-select label { color: var(--muted); font-size: .7rem; font-weight: 800; }
.chart-card { margin-bottom: 1rem; }
.fleet-bars { display: grid; gap: .85rem; padding: 1rem; }
.fleet-bars > div { display: grid; grid-template-columns: 100px minmax(0, 1fr) 40px; align-items: center; gap: .75rem; font-size: .8rem; }
.fleet-bars meter { width: 100%; height: 18px; accent-color: var(--brand); }

.auth-body { min-height: 100vh; background: var(--navy); }
.auth-language { position: fixed; z-index: 2; inset-block-start: 1rem; inset-inline-end: 1rem; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background-image: linear-gradient(rgba(8,35,55,.88), rgba(8,35,55,.96)), url('/img/rasd-icon.png'); background-size: cover, 520px; background-position: center; background-repeat: no-repeat; }
.login-card { width: min(440px, 100%); padding: clamp(1.4rem,4vw,2.25rem); background: white; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; box-shadow: 0 32px 80px rgba(0,0,0,.32); }
.login-brand { display: grid; justify-items: center; margin-bottom: 1.25rem; }
.login-brand img { width: 170px; }
.login-brand p { margin: .35rem 0 0; color: var(--muted); font-size: .8rem; }
.login-card h1 { margin: 0 0 .25rem; font-size: 1.35rem; }
.login-intro { margin: 0 0 1.2rem; color: var(--muted); font-size: .82rem; }
.login-card .field { margin-bottom: .9rem; }
.login-card .button { width: 100%; min-height: 45px; margin-top: .9rem; }
.login-footnote { margin: 1rem 0 0; color: var(--muted); font-size: .68rem; text-align: center; }
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-page .code { color: var(--brand); font-size: 4rem; font-weight: 900; line-height: 1; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .app-shell.sidebar-collapsed { display: block; }
  .sidebar { position: fixed; inset-inline-start: 0; width: min(var(--sidebar), 88vw); transform: translateX(105%); transition: transform .22s ease; box-shadow: -18px 0 45px rgba(0,0,0,.25); }
  [dir="ltr"] .sidebar { transform: translateX(-105%); box-shadow: 18px 0 45px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  [dir="ltr"] .sidebar.open { transform: translateX(0); }
  .sidebar-close { width: 38px; height: 38px; display: grid; place-items: center; margin-inline-start: auto; flex: 0 0 auto; color: white; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-radius: 9px; font-size: 1.35rem; cursor: pointer; }
  .sidebar-scrim { position: fixed; z-index: 19; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(8,35,55,.48); }
  .app-shell.sidebar-open .sidebar-scrim { display: block; }
  .mobile-menu { display: block; }
  .sidebar-collapsed .brand-panel { justify-content: flex-start; padding: 1.1rem 1.35rem; }
  .sidebar-collapsed .brand-logo { width: 122px; }
  .sidebar-collapsed .brand-caption, .sidebar-collapsed .tenant-chip span:last-child,
  .sidebar-collapsed .nav-section, .sidebar-collapsed .user-meta { display: initial; }
  .sidebar-collapsed .tenant-chip { justify-content: flex-start; margin: 1rem; padding: .75rem .8rem; }
  .sidebar-collapsed .side-nav { padding: .5rem .8rem 1.25rem; }
  .sidebar-collapsed .side-nav a { justify-content: flex-start; padding: .58rem .75rem; font-size: .9rem; }
  .sidebar-collapsed .sidebar-footer { justify-content: flex-start; padding: 1rem; flex-wrap: nowrap; }
  .topbar { min-height: 72px; }
  .main-content { padding: 1rem; }
  .page-head { align-items: start; flex-direction: column; }
  .grid.two, .grid.three, .form-grid, .detail-list { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .import-form { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .stat-grid, .grid.four { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-fields { width: 100%; flex-direction: column; }
  .page-actions, .page-actions .button { width: 100%; }
  .pagination { align-items: start; flex-direction: column; }
  .top-actions .ghost:not(.language-switch) { display: none; }
  .language-switch { padding-inline: .55rem; font-size: .72rem; }
  .topbar h1 { font-size: 1.05rem; }
  .task-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .task-dialog-actions { flex-direction: column-reverse; }
  .task-dialog-actions .button, .task-dialog-actions .ghost { width: 100%; }
  .tracker-mode-choice { grid-template-columns: 1fr; }
  .tracker-actions { align-items: stretch; flex-direction: column; }
  .tracker-actions form, .tracker-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.history-cards { display: grid; gap: .75rem; }
.history-report { border: 1px solid var(--border, #d8dee8); border-radius: .75rem; padding: .85rem 1rem; }
.history-report summary { cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.history-report[open] summary { margin-bottom: 1rem; }
.history-report h4 { margin: 1rem 0 .5rem; }
.report-list { margin: .5rem 0; padding-inline-start: 1.25rem; }
.report-list li { display: flex; justify-content: space-between; gap: 1rem; padding-block: .25rem; }
.vehicle-report-dialog { width: min(940px, calc(100% - 2rem)); border-radius: 20px; overflow: hidden; box-shadow: 0 32px 90px rgba(3, 22, 34, .42); }
.vehicle-report-dialog .task-dialog-head { color: white; background: linear-gradient(125deg, var(--navy), #10445c); border: 0; }
.vehicle-report-dialog .task-dialog-head h2 { font-size: 1.28rem; }
.vehicle-report-dialog .task-dialog-head p { color: #b9d0da; }
.vehicle-report-dialog .task-dialog-head .icon-button { color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.vehicle-report-dialog .task-dialog-body { padding: 1.25rem; background: #f1f5f5; }
.vehicle-report-dialog .task-dialog-actions { background: white; box-shadow: 0 -8px 25px rgba(8,35,55,.04); }
.vehicle-history-report { display: grid; gap: 1rem; }
.report-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 122px; padding: 1.25rem 1.4rem; color: white; border-radius: 16px; box-shadow: 0 12px 30px rgba(8,35,55,.14); }
.report-hero::after { content: ""; position: absolute; width: 190px; height: 190px; inset-block-start: -110px; inset-inline-end: -45px; border: 28px solid rgba(255,255,255,.08); border-radius: 50%; }
.report-hero > * { position: relative; z-index: 1; }
.report-hero-assignment { background: linear-gradient(125deg, #087f68, #0ca786); }
.report-hero-maintenance { background: linear-gradient(125deg, #8a520d, #d48a1f); }
.report-hero-accident { background: linear-gradient(125deg, #8f251c, #cf4a3b); }
.report-kicker { display: block; margin-bottom: .18rem; color: rgba(255,255,255,.76); font-size: .69rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.report-hero h3 { margin: 0; color: white; font-size: 1.55rem; }
.report-hero p { margin: .2rem 0 0; color: rgba(255,255,255,.82); font-size: .79rem; }
.report-hero h3 a, .report-hero p a { color: inherit; text-decoration-color: rgba(255,255,255,.55); }
.report-hero .badge { background: white; border-color: rgba(255,255,255,.7); box-shadow: 0 5px 18px rgba(0,0,0,.14); }
.report-section { padding: 1.1rem; background: white; border: 1px solid #dfe8ea; border-radius: 15px; box-shadow: 0 7px 22px rgba(8,35,55,.05); }
.report-section-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.report-section-index { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: var(--brand-strong); background: var(--brand-soft); border-radius: 11px; font-size: .76rem; font-weight: 900; }
.report-section-head h4 { margin: 0; font-size: .95rem; }
.report-section-head p { margin: .1rem 0 0; color: var(--muted); font-size: .7rem; }
.report-section-return { border-color: #d9d9f3; background: linear-gradient(180deg, #fbfbff, white 140px); }
.report-section-return .report-section-index { color: #5147a5; background: #eceafb; }
.report-section-timeline .report-section-index, .report-section-parts .report-section-index { color: var(--warning); background: var(--warning-soft); }
.report-section-incident .report-section-index, .report-section-resolution .report-section-index { color: var(--danger); background: var(--danger-soft); }
.report-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.report-data-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-field { min-width: 0; display: grid; align-content: start; gap: .22rem; padding: .72rem .8rem; background: #f7f9f9; border: 1px solid #e7eded; border-radius: 10px; }
.report-field.full { grid-column: 1 / -1; }
.report-field > span { color: var(--muted); font-size: .67rem; font-weight: 800; }
.report-field > strong { overflow-wrap: anywhere; font-size: .79rem; line-height: 1.55; }
.report-field.emphasis { background: #f0eefc; border-color: #ddd9f4; }
.report-field.emphasis-danger { color: var(--danger); background: var(--danger-soft); border-color: #f4ccc7; }
.report-narrative { border-inline-start: 4px solid var(--brand); }
.report-accident .report-narrative { border-inline-start-color: var(--danger); }
.report-file-action { width: fit-content; margin-top: .2rem; }
.report-subsection { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed #ccd9dc; }
.report-subsection h5 { margin: 0 0 .65rem; font-size: .78rem; }
.report-flow-separator { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; color: #655bb5; font-size: .68rem; font-weight: 900; letter-spacing: .04em; }
.report-flow-separator span { height: 1px; background: linear-gradient(90deg, transparent, #bdb7e5); }
[dir="ltr"] .report-flow-separator span:last-child, [dir="rtl"] .report-flow-separator span:first-child { background: linear-gradient(90deg, #bdb7e5, transparent); }
.report-empty-panel { display: grid; gap: .2rem; padding: 1rem; color: #5147a5; background: #f0eefc; border: 1px dashed #aaa2dc; border-radius: 11px; text-align: center; }
.report-empty-panel span, .report-empty-value { color: var(--muted); font-size: .74rem; }
.report-empty-value { margin: 0; padding: .85rem; background: #f7f9f9; border-radius: 9px; text-align: center; }
.report-table-wrap { border: 1px solid #e0e8ea; border-radius: 11px; }
.report-table { min-width: 560px; }
.report-table thead th { color: #3f5967; background: #edf3f3; font-size: .68rem; }
.report-table td { vertical-align: middle; font-size: .74rem; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-state { display: inline-flex; align-items: center; gap: .3rem; padding: .24rem .52rem; border-radius: 999px; font-size: .66rem; font-weight: 800; }
.report-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.report-state.positive { color: var(--success); background: var(--success-soft); }
.report-state.negative { color: var(--danger); background: var(--danger-soft); }
.report-actions { display: flex; justify-content: flex-end; }
.muted-report-value, .table-cell-note { color: var(--muted); }
.table-cell-note { display: block; margin-top: .2rem; }
.history-report-loading { min-height: 8rem; display: grid; place-items: center; color: var(--muted); }
[data-vehicle-history-section] { transition: opacity .18s ease; }
[data-representative-history-section] { transition: opacity .18s ease; }
[data-vehicle-history-section].is-loading, [data-representative-history-section].is-loading { opacity: .55; pointer-events: none; }
.document-view-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.document-detail-list { grid-template-columns: 1fr; }
.document-preview-card { min-width: 0; }
.document-preview { min-height: 70vh; background: #eef2f5; display: grid; place-items: center; overflow: auto; }
.document-preview-frame { width: 100%; min-height: 70vh; border: 0; background: #fff; }
.document-preview-image { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; margin: auto; padding: 1rem; object-fit: contain; }
@media (max-width: 980px) {
  .document-view-layout { grid-template-columns: 1fr; }
  .report-data-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .vehicle-report-dialog .task-dialog-body { padding: .7rem; }
  .report-hero { min-height: 105px; padding: 1rem; align-items: flex-start; }
  .report-hero h3 { font-size: 1.25rem; }
  .report-section { padding: .85rem; }
  .report-data-grid, .report-data-grid-three { grid-template-columns: 1fr; }
  .report-field.full { grid-column: auto; }
  .report-section-head { align-items: flex-start; }
}
.row-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.filter-grid { flex-wrap: wrap; align-items: end; }
.filter-grid .field { min-width: 9rem; margin: 0; }
.representative-details-layout, .representative-details-layout > *, .representative-details-main,
.representative-details-main > *, [data-representative-details] .page-head > div:first-child,
[data-representative-details] .timeline-content { min-width: 0; }
[data-representative-details] .page-head h2,
[data-representative-details] .page-head p,
[data-representative-details] .detail-item strong,
[data-representative-details] .detail-item span,
[data-representative-details] .timeline-content p { overflow-wrap: anywhere; }
[data-representative-details] .page-actions { align-items: center; }
[data-representative-details] .page-actions > form { margin: 0; }
[data-representative-details] .card-head { flex-wrap: wrap; }
[data-representative-details] .table-wrap { max-width: 100%; }
@media (max-width: 680px) {
  [data-representative-details] .page-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-representative-details] .page-actions > .badge { grid-column: 1 / -1; width: fit-content; }
  [data-representative-details] .page-actions > a,
  [data-representative-details] .page-actions > form,
  [data-representative-details] .page-actions > form > button { width: 100%; }
  [data-representative-details] .card-head { align-items: flex-start; }
  [data-representative-details] .card-head > a { max-width: 100%; overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  [data-representative-details] .page-actions { grid-template-columns: 1fr; }
  [data-representative-details] .page-actions > .badge { grid-column: auto; }
}
.audit-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(135px, 1fr)) auto; align-items: end; justify-content: stretch; }
.audit-filter-grid .field { min-width: 0; margin: 0; }
.audit-filter-actions { display: flex; align-items: center; gap: .4rem; }
@media (max-width: 1200px) {
  .audit-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .audit-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 760px) {
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .audit-filter-grid { grid-template-columns: 1fr; }
  .audit-filter-actions { grid-column: auto; }
  .audit-filter-actions .button { flex: 1; }
}
