:root {
  color-scheme: dark;
  --bg: #0e1013;
  --surface: #171b20;
  --well: #1e242b;
  --well-2: #242b33;
  --border: #2a3138;
  --border-hover: #3c4650;
  --text: #eef0f2;
  --text-muted: #8a929c;
  --text-faint: #5c646d;
  --accent: #e07b1a;
  --accent-hover: #f4923a;
  --accent-ink: #1c0f02;
  --accent-soft: rgba(224, 123, 26, .16);
  --accent-border: rgba(224, 123, 26, .4);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .15);
  --warning: #eab308;
  --warning-soft: rgba(234, 179, 8, .15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .15);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .55);
  --font-display: 'Big Shoulders Display', 'IBM Plex Sans Arabic', system-ui, Tahoma, sans-serif;
  --font-body: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'IBM Plex Sans Arabic', ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bidi { unicode-bidi: plaintext; }

a { color: inherit; text-decoration: none; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  position: relative;
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; gap: 8px 14px; }
  .brand-caption { display: none; }
  .topbar-right { gap: 8px 14px; }
  .nav-links { gap: 12px; }
  .nav-item { font-size: 12.5px; }
}

.brand {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-icon svg { display: block; width: 100%; height: 100%; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .01em;
  color: var(--text);
}
.brand-caption {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-item {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-item:hover { color: var(--text); }
.nav-item.current { color: var(--accent-hover); }
/* Count of people waiting for access, next to "Users" (admins only). */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-inline-start: 6px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.nav-badge[hidden] { display: none; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.caret { width: 9px; height: 9px; transition: transform .15s ease; flex-shrink: 0; }
.nav-item[aria-expanded="true"] .caret { transform: rotate(180deg); }

.nav-dept-wrap { position: relative; display: inline-flex; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  width: 320px;
  background: var(--well);
  border: 1px solid var(--border-hover);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.dropdown-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dept-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.dept-row:hover, .dept-row:focus-visible { background: var(--well-2); outline: none; }

.dept-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dept-icon svg { width: 17px; height: 17px; }
.dept-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dept-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--well);
  padding: 3px;
  border-radius: 8px;
  flex-shrink: 0;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--well-2); color: var(--accent-hover); }

.breadcrumbs a:hover { color: var(--accent-hover); }
.breadcrumbs .sep { color: var(--border-hover); }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-narrow {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
  z-index: 1;
}

h1 { font-family: var(--font-display); font-weight: 700; font-size: 30px; margin: 0 0 6px; letter-spacing: .005em; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.subtitle { color: var(--text-muted); margin: 0 0 28px; font-size: 14.5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  text-align: center;
}

.hero-card .brand { justify-content: center; margin-bottom: 8px; }
.hero-card .brand-icon { width: 32px; height: 32px; }
.hero-card .brand-word { font-size: 22px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 6px;
  text-align: start;
}

select, input[type="text"], input[type="search"], input[type="date"],
input[type="number"], input[type="password"], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 70px; }

.password-field-wrap { position: relative; }
.password-field-wrap input { padding-inline-end: 42px; }
.password-toggle-btn {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn svg { width: 18px; height: 18px; }
.password-toggle-btn:hover { color: var(--text); background: var(--well-2); }
.password-toggle-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="number"], input[type="date"] { direction: ltr; text-align: left; }

/* Dates always render left-to-right regardless of page language, so the
   icon/padding here are pinned with physical (not logical) properties —
   inset-inline-end would flip to the left in RTL and land on top of the
   ltr-forced text instead of at its visual end. */
.date-field-wrap { position: relative; }
.date-field-wrap .date-text-input { padding-right: 42px; padding-left: 12px; direction: ltr; text-align: left; }
.date-field-wrap .date-native-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.date-icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}
.date-icon-btn svg { width: 18px; height: 18px; }
.date-icon-btn:hover { color: var(--text); background: var(--well-2); }
.date-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary { background: var(--well); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--well-2); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border-hover); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.field-error { font-size: 13px; color: var(--danger); margin-top: 8px; min-height: 1px; }

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--well);
}
.checklist-item { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.checklist-item input { width: auto; accent-color: var(--accent); }
.checklist-empty { color: var(--text-muted); font-size: 13px; }

/* Report download format picker — two big stacked choices. */
.download-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.download-choice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: start;
  padding: 14px 16px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.download-choice strong { font-size: 15px; }
.download-choice span { font-size: 13px; color: var(--text-muted); }
.download-choice:hover { border-color: var(--accent); }
.checklist-scroll { max-height: 320px; overflow-y: auto; }
.function-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 2px 26px;
  padding-inline-start: 12px;
  border-inline-start: 2px solid var(--border);
}
.function-list .checklist-item { font-size: 13px; color: var(--text-muted); }
.function-list-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 220px; }

.module-list { display: flex; flex-direction: column; gap: 14px; }

.module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.module-item:hover { box-shadow: var(--shadow-md); border-color: var(--accent-border); transform: translateY(-1px); }
.module-item .mi-title { font-weight: 600; font-size: 15.5px; }
.module-item .mi-sub { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.module-item .mi-arrow { color: var(--accent); font-size: 18px; }

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.vehicle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.vehicle-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-border); transform: translateY(-1px); }

.vc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vc-plate { font-weight: 700; font-size: 16px; }
.vc-code { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.vc-type { margin-top: 10px; font-size: 14px; }
.vc-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-neutral { background: var(--well); color: var(--text-muted); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent-hover); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .es-icon { font-size: 36px; margin-bottom: 10px; }

/* Vehicle detail */
.vehicle-panel {
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.vehicle-panel .vp-main { flex: 1; min-width: 280px; }
.vp-plate { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.vp-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px 24px;
}
.vp-item .vp-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.vp-item .vp-value { font-size: 14.5px; }
.vp-actions { display: flex; gap: 10px; align-items: flex-start; }

/* Repeat-issue alerts (manager-facing) */
.alert-banner {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.alert-banner .alert-title { font-weight: 700; color: var(--danger); display: flex; align-items: center; gap: 8px; }
.alert-banner .alert-rule { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 8px; }
.alert-banner ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.alert-banner .alert-vehicle-link { color: var(--text); font-weight: 700; cursor: pointer; text-decoration: underline; }
.alert-banner .alert-toggle { margin-inline-start: auto; }
.alert-banner .alert-actions { margin-inline-start: auto; display: flex; gap: 8px; }

/* Alerts popup: one collapsible block per flagged vehicle */
.alert-vehicle { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--well); }
.alert-vehicle > summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
}
.alert-vehicle > summary::-webkit-details-marker { display: none; }
.alert-vehicle > summary::before { content: "▸"; color: var(--text-muted); }
.alert-vehicle[open] > summary::before { content: "▾"; }
.alert-vehicle .av-plate { font-weight: 700; font-family: var(--font-display); font-size: 16px; }
.alert-vehicle .av-issues { color: var(--text-muted); font-size: 13px; flex: 1 1 220px; }
.alert-vehicle .av-total { font-size: 13px; color: var(--danger); font-weight: 700; margin-inline-start: auto; }
.alert-vehicle .av-body { padding: 0 14px 14px; }
.alert-vehicle .av-sub { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; margin: 14px 0 6px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-tile {
  flex: 1;
  min-width: 160px;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.stat-tile .stat-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); }

.report-section { margin-bottom: 30px; }
.report-section h2 { font-size: 18px; margin-bottom: 4px; }
.report-section .report-caption { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.report-totals-row td { font-weight: 700; border-top: 1px solid var(--border-hover); background: var(--well); }

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: flex-end;
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar .ff-keyword { flex: 1; min-width: 200px; }
.filter-bar .ff-date { width: 150px; }

.receipt-list { display: flex; flex-direction: column; gap: 12px; }

.receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.receipt-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-border); }

.rc-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid var(--accent-border);
}

.rc-main { flex: 1; min-width: 0; }
.rc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-vendor { font-weight: 600; font-size: 15px; }
.rc-date { color: var(--text-muted); font-size: 13px; }
.rc-sub { margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.rc-amount { font-weight: 700; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-notes { margin-top: 6px; font-size: 13px; color: var(--text-muted); }

/* Data table (Users / Overview) */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: start;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; font-family: var(--font-mono); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--well); }
.data-table td.wrap { white-space: normal; }
.data-table .row-clickable { cursor: pointer; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px 28px;
  position: relative;
}
.modal.modal-lg { max-width: 760px; }
.modal.modal-xl { max-width: 1040px; }

/* Vehicle report popup: header and footer stay put while the body scrolls,
   so the Download button is always reachable. */
.modal.report-modal { overflow-y: hidden; display: flex; flex-direction: column; }
.report-popup-body { overflow-y: auto; max-height: calc(88vh - 210px); margin: 0 -8px; padding: 0 8px; }
.report-popup-body .report-section { margin-bottom: 26px; }
.report-popup-body .stat-row { margin-bottom: 18px; }
.report-popup-body .stat-tile { flex: 1 1 150px; }
.report-popup-body .stat-tile .stat-value { font-size: 20px; }
.report-popup-body .table-wrap { max-height: 360px; overflow: auto; }
.report-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 24px; margin-bottom: 20px; }
.modal.modal-confirm { max-width: 420px; }

.modal-close {
  position: absolute;
  top: 18px; inset-inline-end: 18px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--well); color: var(--text); }

.modal h2 { margin-bottom: 4px; }
.modal .modal-sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 10px; flex-wrap: wrap; }
.modal-footer .right-actions { display: flex; gap: 10px; margin-inline-start: auto; }

.file-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.file-drop.dragover { border-style: solid; border-color: var(--accent-hover); background: var(--accent-soft); color: var(--text); transform: scale(1.01); }

/* Lightbox */
.lightbox-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 110;
}
.lightbox-backdrop.open { display: flex; }
.lightbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.lightbox-header .lb-title { font-weight: 600; font-size: 14.5px; }
.lightbox-body { padding: 20px; display: flex; justify-content: center; }
.lightbox-body img { max-width: 100%; border-radius: 8px; display: block; }
.lightbox-actions { display: flex; gap: 8px; }

.pdf-placeholder {
  width: 100%;
  min-height: 320px;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}
.pdf-placeholder .pp-icon { font-size: 40px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--well-2);
  border: 1px solid var(--border-hover);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 18px;
  cursor: pointer;
}
.back-link:hover { color: var(--accent-hover); }

.category-chip { text-transform: capitalize; }
.mono { font-family: var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.footer-note {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

/* ---------- Hero: background motif + facts pill (home + login) ---------- */

.security-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.security-bg-layer {
  position: absolute;
  opacity: 0;
  color: var(--accent);
  transition: opacity 2.4s ease;
}
.security-bg-layer.active { opacity: .06; }
.security-bg-layer svg { display: block; width: 100%; height: 100%; }

.hazard-rule {
  height: 4px;
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, transparent 10px 20px);
  opacity: .5;
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent-hover);
  text-align: center;
  margin-bottom: 14px;
}

.security-facts {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 22px auto 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 9px;
  padding: 10px 18px;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.security-facts .sf-icon { color: var(--accent); flex-shrink: 0; }
.security-facts .sf-text {
  opacity: 0;
  transition: opacity .5s ease;
}
.security-facts .sf-text.show { opacity: 1; }

/* ---------- Login page ---------- */

.login-card { max-width: 380px; margin: 0 auto; }
.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: none;
}
.login-error.show { display: block; }
.login-hint { color: var(--text-muted); font-size: 12.5px; margin-top: 18px; text-align: center; }

/* ---------- Home dashboard ---------- */

.dashboard-hero { text-align: center; padding: 20px 0 8px; position: relative; z-index: 1; }
.dashboard-hero .hint-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent-hover);
  font-weight: 600;
  margin-top: 6px;
}
.dashboard-hero .hint-arrow svg { width: 15px; height: 15px; }
