/* ===== Rakeeb Dashboard — Saudi Vibe =====
 *
 * Web-font @import was removed and replaced with a sibling <link> in
 * Rakeeb Dashboard.html. The @import was forcing a SERIAL round trip
 * (parse this CSS → discover @import → fetch the font CSS → fetch the
 * woff2s), adding ~700 ms to LCP per GTmetrix. The <link> in HTML now
 * downloads the font CSS in parallel with this stylesheet, and we trim
 * the loaded weight axes to the ones the design actually uses. */

:root {
  /* Saudi-inspired palette */
  --saudi-green: #006C35;       /* official Saudi flag green */
  --saudi-green-deep: #00582B;
  --saudi-green-soft: #0E8B4A;
  --gold: #C9A24A;              /* warm gold accent */
  --gold-soft: #E2C97F;
  --sand: #F4EFE6;              /* warm light bg */
  --sand-2: #ECE5D6;
  --ink: #0E1A14;               /* near-black with green tint */
  --ink-2: #1A2A22;
  --muted: #5C6B62;
  --line: #E2DCCB;
  --card: #FFFFFF;
  --bg: #FAF7F0;

  /* Status */
  --ok: #1F9D55;
  --warn: #E8A317;
  --bad: #D64545;
  --info: #2E7DAF;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(14, 26, 20, 0.04), 0 1px 3px rgba(14, 26, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(14, 26, 20, 0.06), 0 2px 4px rgba(14, 26, 20, 0.04);
  --shadow-lg: 0 12px 32px rgba(14, 26, 20, 0.08), 0 4px 8px rgba(14, 26, 20, 0.04);
}

[data-theme="dark"] {
  --saudi-green: #18A55B;
  --saudi-green-deep: #0E7A41;
  --saudi-green-soft: #2BC373;
  --gold: #E2C97F;
  --gold-soft: #F0DDA0;
  --sand: #131A16;
  --sand-2: #1A2520;
  --ink: #F1ECE0;
  --ink-2: #D6CFBE;
  --muted: #8A9A91;
  --line: #243029;
  --card: #14201A;
  --bg: #0C1410;

  --ok: #2BC373;
  --warn: #F0B83A;
  --bad: #ED6B6B;
  --info: #5BA8D5;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  overflow: hidden;
  height: 100vh;
}

[lang="ar"], [lang="ar"] * {
  font-family: 'IBM Plex Sans Arabic', 'Manrope', system-ui, sans-serif;
}

[dir="rtl"] {
  font-family: 'IBM Plex Sans Arabic', 'Manrope', sans-serif;
}

/* App layout */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  /* Pin the row to 100vh so .main's overflow-y can actually create a scroll
   * context. Without this, the implicit row sizes to content and .main grows
   * past the viewport with no scrollbar (html/body have overflow:hidden, so
   * the overflow just clips). */
  grid-template-rows: 100vh;
  height: 100vh;
  width: 100vw;
}

/* Grid tracks stay in source order — RTL flips visual placement automatically */

/* ===== Sidebar ===== */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 4px;
  position: relative;
  /* Now that .app pins each row to 100vh, the sidebar can't grow past the
   * viewport — but if a future feature adds enough nav items it'd clip
   * silently. Internal scroll keeps the bottom items reachable. */
  overflow-y: auto;
}

[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--line);
}

/* Decorative wave + water tower + palms anchored to the bottom of the sidebar.
 * Sticky pins it to the bottom of the visible scroll viewport so it remains
 * visible regardless of nav length. pointer-events:none keeps clicks falling
 * through to anything underneath. The sidebar's own children sit above this
 * because they come after it in the DOM and the deco doesn't establish a
 * stacking context above them. */
.sidebar-deco {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 240px;
  margin-top: auto;
  margin-inline: -14px;
  margin-bottom: -20px;
  pointer-events: none;
  z-index: 0;
  flex-shrink: 0;
}
.sidebar-deco svg {
  display: block;
  width: 100%;
  height: 100%;
}
.sidebar > .brand,
.sidebar > .sidebar-foot,
.sidebar > div:not(.sidebar-deco) {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px 18px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.brand-mark {
  width: 190px;
  height: 190px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(0, 108, 53, 0.25);
  position: relative;
  /* overflow:hidden was clipping the conic-ring on ::before. The ring sits
   * at inset:-4px, so we need the box to render outside its own bounds.
   * The internal radial highlight on ::after still sits at inset:0 so it's
   * naturally inside the rounded square — no need to clip. */
  overflow: visible;
  animation: brand-mark-float 5s ease-in-out infinite;
}

/* Spinning conic ring around the sidebar logo — same effect as the
 * landing-page hero-logo so the dashboard's brand mark feels alive
 * instead of being a static plate. The mask trick draws ONLY the
 * 2px-wide ring (not a filled disk). */
.brand-mark::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  background: conic-gradient(from 0deg,
              transparent 0deg,
              rgba(46, 204, 113, 0.55) 60deg,
              transparent 120deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 2px;
  opacity: 0.7;
  animation: brand-mark-spin 6s linear infinite;
  pointer-events: none;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 60%);
  pointer-events: none;
}

@keyframes brand-mark-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes brand-mark-spin {
  to { transform: rotate(360deg); }
}

.brand-logo-img {
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
  flex: 0 0 190px;
}

.brand-logo-img::after {
  display: none;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-tag {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-weight: 700;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 16px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  border: none;
  background: transparent;
  width: 100%;
  text-align: start;
}

[dir="rtl"] .nav-item { text-align: right; }

.nav-item:hover {
  background: var(--sand-2);
  color: var(--ink);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0,108,53,0.10), rgba(0,108,53,0.02));
  color: var(--saudi-green);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  background: linear-gradient(90deg, rgba(43, 195, 115, 0.15), rgba(43, 195, 115, 0.02));
}

.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--saudi-green);
  border-radius: 0 3px 3px 0;
}

[dir="rtl"] .nav-item.active::before {
  border-radius: 3px 0 0 3px;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item .nav-badge {
  margin-inline-start: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bad);
  color: white;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }

/* ===== Main content =====
 *
 * `overflow-y: auto` (was `hidden`) so pages whose stacked content exceeds
 * the viewport scroll naturally — the Overview now stacks a 55vh map row
 * above a full-width activity feed, and shorter screens need to scroll to
 * reach the feed. The topbar is still pinned via `flex-shrink: 0`. */
.main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  background: var(--card);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-tools {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  width: 280px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  position: relative;
  transition: all 0.15s;
}

.icon-btn:hover { background: var(--sand); border-color: var(--ink-2); }

.icon-btn .dot {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bad);
  border: 1.5px solid var(--card);
}

.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 3px;
  height: 36px;
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.lang-toggle button.on {
  background: var(--ink);
  color: var(--bg);
}

[data-theme="dark"] .lang-toggle button.on {
  background: var(--saudi-green);
  color: white;
}

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: var(--bg);
}

/* ===== KPI strip ===== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 20px 0 20px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-unit { font-size: 12px; color: var(--muted); font-weight: 500; }

.money-kpi-value {
  font-size: 20px;
  line-height: 1.15;
  white-space: nowrap;
}

.kpi-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--muted); }

.kpi-spark {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  opacity: 0.5;
  pointer-events: none;
}

.revenue-breakdown {
  margin: 12px 20px 0;
  padding: 10px 12px;
}
.revenue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.revenue-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.revenue-filters input,
.revenue-filters select {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 12px;
}
.revenue-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.revenue-type-card {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.revenue-type-card span,
.revenue-totals span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.revenue-type-card strong {
  display: inline-block;
  font-size: 18px;
  margin-inline-end: 8px;
}
.revenue-type-card em {
  color: var(--saudi-green);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.revenue-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.revenue-totals > div {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.revenue-totals strong { font-size: 16px; }
.revenue-totals small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
}
.revenue-totals small.rev-up { color: var(--ok); }
.revenue-totals small.rev-down { color: var(--bad); }
.rev-up strong { color: var(--ok); }
.rev-down strong { color: var(--bad); }
.revenue-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.rev-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
}
.rev-badge.high { background: rgba(31,157,85,0.10); color: var(--ok); }
.rev-badge.low { background: rgba(214,69,69,0.09); color: var(--bad); }

/* ===== Supply permits by source (Dashboard) =====
 * Mirrors .revenue-breakdown so the two panels read as a pair, but each
 * card carries an extra "source name" header + a fill bar showing that
 * source's share of the day's total. */
.permits-breakdown {
  margin: 12px 20px 0;
  padding: 10px 12px;
}
.permits-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,0.015);
}
.permits-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.permits-source-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.permits-source-card.is-internal { border-inline-start: 3px solid var(--saudi-green); }
.permits-source-card.is-external { border-inline-start: 3px solid #C9A24A; }
/* Quiet-day cards: keep them visible (so the operator sees the full
 * station list) but knock the saturation down so the active sources
 * pop in comparison. */
.permits-source-card.is-zero { opacity: 0.55; background: rgba(0,0,0,0.015); }
.permits-source-card.is-zero .permits-source-amount { color: var(--muted); }
.permits-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.permits-source-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.permits-source-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.permits-source-tag.tag-internal { background: rgba(31,157,85,0.10); color: var(--ok); }
.permits-source-tag.tag-external { background: rgba(201,162,74,0.14); color: #9A6A00; }
.permits-source-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--saudi-green);
}
.permits-source-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.permits-source-bar {
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.permits-source-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--saudi-green), #1FB373);
  border-radius: 2px;
  transition: width 240ms ease-out;
}
/* Truck-type strip on the permits panel. Mirrors .revenue-type-grid
 * exactly so the two breakdowns read as a pair, plus a separate row
 * for the grand total + permit count. */
.permits-truck-head {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.permits-truck-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.permits-truck-card {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.permits-truck-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.permits-truck-card strong {
  display: inline-block;
  font-size: 18px;
  margin-inline-end: 8px;
}
.permits-truck-card em {
  color: var(--saudi-green);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.permits-truck-card.is-zero { opacity: 0.55; }
.permits-truck-card.is-zero em { color: var(--muted); }
.permits-truck-total {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0,108,53,0.08), rgba(0,108,53,0.02));
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.permits-truck-total span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.permits-truck-total strong { font-size: 22px; }
.permits-truck-total em {
  margin-inline-start: auto;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Source picker on the supply-permit form. Stretches the dropdown to the
 * full row so a long station name doesn't get truncated against a tight
 * label column. */
.sp-source select { width: 100%; }

@media (max-width: 1100px) {
  .kpi-strip,
  .revenue-type-grid,
  .revenue-totals,
  .permits-truck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .revenue-head { flex-direction: column; }
}
@media (max-width: 640px) {
  .kpi-strip,
  .revenue-type-grid,
  .revenue-totals,
  .permits-truck-grid { grid-template-columns: 1fr; }
}

/* ===== Map area =====
 *
 * The map row gets ~half the viewport (55vh, clamped 420px..640px) and the
 * activity feed lives below in its own full-width row — so the operator can
 * scan the map at a glance without it eating the whole screen, and the
 * activity feed has real reading space at the bottom (rather than being
 * capped at 280px in a sidebar).
 *
 * Side column is 380px (down from 1fr/free): wide enough for the driver
 * detail card, tracking timeline, and active-order block. The whole grid is
 * a fixed-height block so the side panel scrolls internally if its content
 * exceeds the row, and the parent .main scrolls if total page content
 * exceeds the viewport. */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  padding: 14px 24px 14px 24px;
  height: clamp(420px, 55vh, 640px);
  flex-shrink: 0;
}

@media (max-width: 1280px) {
  .overview-grid { grid-template-columns: 1fr 340px; gap: 12px; padding: 12px 16px 12px 16px; }
}
@media (max-width: 1024px) {
  .overview-grid { grid-template-columns: 1fr; height: auto; }
}

/* Activity feed lives in its own full-width row below the map+side grid.
 * No fixed height — flows naturally and the parent .main scrolls when the
 * feed plus the 55vh map row exceed the viewport. */
.overview-activity {
  padding: 0 24px 24px 24px;
  flex-shrink: 0;
}
@media (max-width: 1280px) { .overview-activity { padding: 0 16px 16px 16px; } }
.overview-activity .panel { max-height: none; }
.overview-activity .panel-body { max-height: 50vh; overflow-y: auto; }

/* Grid tracks stay in source order in RTL too */

.map-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Leaflet container needs an explicit height to render its tiles. The
   wrapping div sets width/height to 100% on its parent (.map-card) so
   without this rule the Leaflet container collapses to 0. */
.map-card .leaflet-container,
.map-card > div > div.leaflet-container {
  width:  100%;
  height: 100%;
  min-height: 300px;
  flex:   1;
  background: transparent;
  z-index: 1;
}

/* Keep the map controls + header pills above the Leaflet tile layer
 * (panes are at z-index 200-400) but BELOW any modal/drawer overlay so
 * they don't punch through opened side panels. The previous 1100 was
 * leftover from when these had to outrank Leaflet's default zoom widget;
 * we now use a custom .map-ctrl set instead so the conflict no longer
 * applies. Worst case: the small "Leaflet | OSM contributors" attribution
 * sits above a header pill — acceptable trade-off vs. controls leaking
 * through the opened sidebar drawer or AI bot panel. */
.map-card .map-header,
.map-card .map-controls,
.map-card .map-legend {
  z-index: 5;
}

.map-header {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  inset-inline-end: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.map-header > * { pointer-events: auto; }

.map-pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.active-orders-menu-wrap {
  position: relative;
  pointer-events: auto;
}
.active-orders-trigger {
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.active-orders-trigger.open,
.active-orders-trigger:hover {
  border-color: var(--saudi-green);
  color: var(--saudi-green);
}
.active-orders-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--saudi-green);
  color: white;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.active-orders-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(440px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 130px));
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 1400;
  display: flex;
  flex-direction: column;
}
.active-orders-menu-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.active-orders-menu-head strong {
  flex: 1;
  font-size: 13px;
}
.active-orders-menu-head button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.active-orders-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.active-orders-list {
  overflow: auto;
  padding: 8px;
}
.active-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
}
.active-order-row + .active-order-row {
  border-top-color: var(--line);
}
.active-order-row:hover {
  background: var(--sand);
}
.active-order-main {
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: inherit;
  cursor: pointer;
  font-family: inherit;
}
.active-order-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.active-order-top span {
  font-size: 12px;
  font-weight: 800;
  color: var(--saudi-green);
}
.active-order-top strong {
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-order-meta,
.active-order-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.active-order-meta span {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-order-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}
.btn.danger {
  border-color: rgba(214,69,69,0.32);
  color: var(--bad);
  background: rgba(214,69,69,0.08);
}
.btn.danger:hover {
  background: rgba(214,69,69,0.14);
}
.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  position: relative;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--bad);
  opacity: 0.3;
  animation: ping 1.6s infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

.map-controls {
  position: absolute;
  inset-inline-end: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-ctrl {
  width: 36px;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.map-ctrl:hover { background: var(--sand); }

.map-legend {
  position: absolute;
  inset-inline-start: 14px;
  bottom: 14px;
  z-index: 5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--card);
}

.map-gps-strip {
  position: absolute;
  top: 64px;
  inset-inline-start: 14px;
  /* z-index = 5 matches .map-legend below. The previous 1100 was leftover
   * from when these cards were tested above a Leaflet popup; in production
   * it punched through the mobile-drawer overlay (z-index:70) and any
   * modal underneath it. 5 keeps them above tile/marker layers (z-index 0-3
   * inside the Leaflet container) without escaping the map card itself. */
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
}

.gps-card,
.gps-selected {
  min-width: 86px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
}

.gps-card span,
.gps-selected span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 5px;
}

.gps-card strong,
.gps-selected strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.gps-card.good { border-color: color-mix(in srgb, var(--ok) 36%, var(--line)); }
.gps-card.warn { border-color: color-mix(in srgb, var(--warn) 42%, var(--line)); }
.gps-card.bad  { border-color: color-mix(in srgb, var(--bad) 36%, var(--line)); }
.gps-card.good strong { color: var(--ok); }
.gps-card.warn strong { color: var(--warn); }
.gps-card.bad strong  { color: var(--bad); }

.gps-selected {
  min-width: 150px;
  max-width: 240px;
}

.gps-selected span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-driver-icon,
.rk-station-icon,
.rk-customer-icon {
  background: transparent;
  border: 0;
}

.rk-driver-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.rk-driver-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.18;
  transform: scale(0.96);
}

.rk-driver-wrap.selected .rk-driver-halo {
  opacity: 0.24;
  animation: markerPulse 1.7s ease-out infinite;
}

@keyframes markerPulse {
  0% { transform: scale(0.82); opacity: 0.28; }
  100% { transform: scale(1.55); opacity: 0; }
}

.rk-driver-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid;
  box-shadow: 0 5px 14px rgba(13, 31, 23, 0.34);
}

.rk-speed-bubble {
  position: absolute;
  z-index: 3;
  inset-inline-start: calc(50% + 12px);
  top: -4px;
  min-width: 25px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}

.rk-station-wrap,
.rk-customer-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.rk-station-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--gold);
  border: 3px solid #fff;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(13, 31, 23, 0.24);
}

.rk-station-label,
.rk-customer-label {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.rk-customer-pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--bad);
  border: 3px solid #fff;
  box-shadow: 0 5px 14px rgba(13, 31, 23, 0.26);
}

.rk-map-popup {
  min-width: 150px;
  display: grid;
  gap: 4px;
  font-family: inherit;
}

.rk-map-popup strong { font-size: 13px; color: var(--ink); }
.rk-map-popup span { color: var(--muted); font-size: 11px; }
.rk-map-popup div { color: var(--ink-2); font-size: 11px; }
.rk-map-popup code {
  color: var(--muted);
  font-size: 10px;
  direction: ltr;
}

.rk-live-map .leaflet-popup-content-wrapper,
.rk-live-map .leaflet-popup-tip {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.rk-live-map .leaflet-tooltip {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 920px) {
  .map-gps-strip {
    top: auto;
    inset-inline-start: 10px;
    inset-inline-end: 58px;
    bottom: 12px;
    overflow-x: auto;
  }
  .map-legend { display: none; }
}

/* Maintenance + fuel cost cards on the Dashboard. Two-column grid that
 * collapses to one on narrow screens. Spacing mirrors the kpi-strip /
 * permits-truck-grid above so the section reads as part of the same KPI
 * family rather than a separate region. */
.ops-cost-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px 18px 20px;
}
@media (max-width: 880px) {
  .ops-cost-strip { grid-template-columns: 1fr; }
}

.ops-dashboard-card{padding:15px 16px;display:grid;gap:12px;min-width:0}
.ops-dashboard-head{display:flex;align-items:center;gap:9px}
.ops-dashboard-icon{width:34px;height:34px;border-radius:8px;display:grid;place-items:center;flex:0 0 auto}
.ops-dashboard-head strong{display:block;font-size:13px}
.ops-dashboard-head span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.ops-dashboard-main{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.ops-dashboard-main strong{font-size:22px;line-height:1.15;white-space:nowrap}
.ops-dashboard-main span{font-size:11px;color:var(--muted);font-weight:700;text-align:end}
.ops-dashboard-split{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ops-mini-title{font-size:11px;color:var(--muted);font-weight:800;margin-bottom:8px}
.ops-mini-columns{height:118px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(42px,1fr);gap:7px;align-items:end;overflow:hidden}
.ops-mini-col{height:100%;display:grid;grid-template-rows:1fr auto auto;gap:4px;text-align:center;min-width:0}
.ops-mini-plot{height:66px;border:1px solid var(--line);border-radius:8px;background:rgba(0,0,0,0.025);display:flex;align-items:flex-end;justify-content:center;padding:5px}
.ops-mini-plot span{display:block;width:100%;max-width:26px;min-height:4px;border-radius:5px 5px 2px 2px}
.ops-mini-col b{font-size:10px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ops-mini-col em{font-size:10px;font-style:normal;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ops-mini-empty{height:118px;display:grid;place-items:center;border:1px dashed var(--line);border-radius:8px;color:var(--muted);font-size:11px}
.ops-dashboard-foot{border-top:1px solid var(--line);padding-top:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}
.ops-dashboard-foot span{color:var(--muted);font-weight:700}
.ops-dashboard-loading{padding:20px;color:var(--muted);font-size:13px;text-align:center;grid-column:1/-1}
.ops-dashboard-loading.error{color:var(--bad)}
@media (max-width:1100px){.ops-dashboard-split{grid-template-columns:1fr}}

.report-ops-section{margin-top:14px;overflow:hidden}
.report-ops-loading{padding:22px;text-align:center;color:var(--muted);font-size:13px}
.report-ops-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.report-ops-mark{width:8px;height:28px;border-radius:6px;flex:0 0 auto}
.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.report-kpi{border:1px solid var(--line);border-radius:8px;background:rgba(0,0,0,0.018);padding:11px 12px;min-width:0}
.report-kpi span{display:block;color:var(--muted);font-size:11px;font-weight:700;margin-bottom:6px}
.report-kpi strong{display:block;font-size:18px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.report-analytics-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:12px;padding:14px 16px}
.report-chart-card,.report-table-card{border:1px solid var(--line);border-radius:8px;background:var(--card);padding:14px;min-width:0}
.report-card-title{font-size:12px;font-weight:800;color:var(--ink);margin-bottom:12px}
.report-col-chart{height:230px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(70px,1fr);gap:10px;align-items:end;overflow-x:auto;padding:4px 2px 0}
.report-col{height:100%;display:grid;grid-template-rows:1fr auto auto auto;gap:5px;text-align:center;min-width:70px}
.report-col-plot{height:138px;display:flex;align-items:flex-end;justify-content:center;background:linear-gradient(to top, rgba(0,0,0,0.035), transparent);border:1px solid var(--line);border-radius:8px;padding:7px}
.report-col-bar{width:100%;max-width:42px;min-height:4px;border-radius:6px 6px 3px 3px;box-shadow:0 8px 16px rgba(0,0,0,0.08)}
.report-col strong{font-size:12px;line-height:1.2;color:var(--ink);white-space:nowrap}
.report-col span{font-size:11px;color:var(--ink-2);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.report-col em{font-style:normal;font-size:10px;color:var(--muted);line-height:1.25;min-height:24px}
.report-empty{display:grid;place-items:center;min-height:170px;color:var(--muted);font-size:12px;text-align:center}
.report-empty-wide{min-height:120px;border-top:1px solid var(--line)}
.report-party-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 16px 14px}
.report-party-card{border:1px solid var(--line);border-radius:8px;background:rgba(0,0,0,0.018);padding:11px 12px}
.report-party-card span,.report-party-card em{display:block;color:var(--muted);font-size:11px;font-style:normal}
.report-party-card strong{display:block;font-size:16px;margin:4px 0;color:var(--ink)}
.report-table-card{margin:0 16px 16px;padding:0}
.report-table-card .report-card-title{padding:13px 14px;margin:0;border-bottom:1px solid var(--line)}
.report-table-wrap{overflow:auto}
.report-detail-table{min-width:760px}
.report-detail-table td span{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.report-empty-cell{text-align:center;color:var(--muted);padding:24px!important}
@media (max-width:1200px){
  .report-analytics-grid{grid-template-columns:1fr}
  .report-kpi-grid,.report-party-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:720px){
  .report-kpi-grid,.report-party-grid{grid-template-columns:1fr}
  .report-analytics-grid{padding:12px}
  .report-table-card{margin:0 12px 12px}
}

/* ===== Side panels ===== */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  gap: 8px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-sub {
  font-size: 11px;
  color: var(--muted);
}

.panel-action {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--saudi-green);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.panel-body {
  padding: 0 16px 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* Driver list */
.driver-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
}
.driver-row:hover { background: var(--sand); }
.driver-row.selected { background: var(--sand); border-color: var(--saudi-green); }

.driver-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saudi-green-soft), var(--saudi-green));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  position: relative;
}

.driver-avatar .status-pip {
  position: absolute;
  bottom: -1px;
  inset-inline-end: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--ok);
}

.driver-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.driver-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; }

.driver-stat {
  text-align: end;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.driver-stat strong { color: var(--ink); font-size: 13px; display: block; font-weight: 700; }

.status-pip.moving { background: var(--ok); }
.status-pip.idle { background: var(--warn); }
.status-pip.break { background: var(--info); }
.status-pip.offline { background: var(--muted); }

/* Activity feed */
.feed-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  align-items: start;
}
.feed-item:last-child { border-bottom: none; }

.feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--sand);
  color: var(--ink-2);
  flex-shrink: 0;
}
.feed-icon.ok { background: rgba(31, 157, 85, 0.12); color: var(--ok); }
.feed-icon.warn { background: rgba(232, 163, 23, 0.14); color: var(--warn); }
.feed-icon.bad { background: rgba(214, 69, 69, 0.12); color: var(--bad); }
.feed-icon.info { background: rgba(46, 125, 175, 0.12); color: var(--info); }

.feed-text { font-size: 12px; line-height: 1.4; }
.feed-text strong { font-weight: 700; }
.feed-time { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ===== Generic page ===== */
.page-pad {
  padding: 16px 20px 20px;
  height: 100%;
  overflow: auto;
}

.page-grid {
  display: grid;
  gap: 12px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: start;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--sand);
  position: sticky;
  top: 0;
}
[dir="rtl"] .table th { text-align: right; }
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:hover td { background: var(--sand); }
.table tr:last-child td { border-bottom: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.chip.ok { background: rgba(31, 157, 85, 0.12); color: var(--ok); }
.chip.warn { background: rgba(232, 163, 23, 0.16); color: #b87a09; }
.chip.bad { background: rgba(214, 69, 69, 0.12); color: var(--bad); }
.chip.info { background: rgba(46, 125, 175, 0.12); color: var(--info); }
.chip.neutral { background: var(--sand-2); color: var(--ink-2); }
[data-theme="dark"] .chip.warn { color: var(--warn); }

.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Mini bar/progress */
.bar {
  height: 5px;
  background: var(--sand-2);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--saudi-green);
  border-radius: 99px;
}
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn:hover { background: var(--sand); }
.btn.primary { background: var(--saudi-green); color: white; border-color: var(--saudi-green); }
.btn.primary:hover { background: var(--saudi-green-deep); }
.btn.ghost { border-color: transparent; }

/* Section titles */
.h-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 6px 4px 12px;
}
.h-row h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.h-row p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* Charts */
.spark-line {
  width: 100%;
  height: 60px;
}

.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut svg { width: 100px; height: 100px; }

/* Settings */
.setting-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.company-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.settings-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-field span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.settings-field input,
.logo-editor input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
}

.settings-field input[readonly],
.logo-editor input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.logo-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
}

.logo-preview {
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--saudi-green);
  font-size: 28px;
  font-weight: 900;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.ops-settings-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.settings-note {
  margin: 0 16px 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0,108,53,0.08);
  color: var(--saudi-green);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .company-settings-grid,
  .logo-editor {
    grid-template-columns: 1fr;
  }
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: 13px; font-weight: 600; }
.setting-row .desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.setting-row .ctrl { margin-inline-start: auto; }

.toggle {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.toggle.on { background: var(--saudi-green); }
.toggle.on::after { transform: translateX(16px); }
[dir="rtl"] .toggle.on::after { transform: translateX(-16px); }

/* utility */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* Driver detail card */
.driver-card {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.driver-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.driver-card-top .driver-avatar { width: 48px; height: 48px; font-size: 14px; }
.driver-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.driver-card-stats .ds {
  background: var(--sand);
  padding: 8px 10px;
  border-radius: var(--r-sm);
}
.driver-card-stats .ds-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.driver-card-stats .ds-value { font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Tweak panel font fix when arabic */
[lang="ar"] .tweaks-panel-title,
[lang="ar"] .tweaks-section-title { font-family: 'IBM Plex Sans Arabic', sans-serif; }
/* Supply permit */
.sp-grid{display:grid;grid-template-columns:minmax(360px,0.9fr) minmax(420px,1.1fr);gap:16px;align-items:start}
.sp-form{padding:16px}
.sp-open-notice{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:9px 11px;border:1px solid rgba(31,157,85,0.28);border-radius:8px;background:rgba(31,157,85,0.08);color:var(--ok);font-size:12px;font-weight:700}
.sp-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.sp-fields label,.sp-extra-row label{display:block;font-size:11px;font-weight:700;color:var(--muted);margin-bottom:6px}
.sp-fields input,.sp-fields select,.sp-fields textarea,.sp-extra-row input{width:100%;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);padding:10px 12px;font-family:inherit;font-size:13px;outline:none}
.sp-fields textarea{resize:vertical;grid-column:1/-1}
.sp-fields>div:has(textarea){grid-column:1/-1}
.sp-extra-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0 10px}
.sp-extra-list{display:grid;gap:8px}
.sp-extra-row{display:grid;grid-template-columns:1fr 1.4fr 34px;gap:8px;align-items:center}
.sp-preview{min-width:0}
.sp-paper{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:24px;box-shadow:var(--shadow-sm);min-height:680px;color:var(--ink)}
.sp-head{display:flex;align-items:center;justify-content:space-between;gap:18px;border-bottom:2px solid var(--ink);padding-bottom:14px}
.sp-brand{display:flex;align-items:center;gap:12px;min-width:0}
.sp-brand img,.sp-mark{width:64px;height:64px;border-radius:8px;border:1px solid var(--line);object-fit:contain;flex:0 0 auto}
.sp-mark{display:grid;place-items:center;background:var(--saudi-green);color:white;font-size:24px;font-weight:800;border-color:var(--saudi-green)}
.sp-brand strong{display:block;font-size:20px}
.sp-brand span{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.sp-no{text-align:end}.sp-no span{display:block;color:var(--muted);font-size:11px;font-weight:700}.sp-no strong{font-size:18px}
.sp-paper h1{text-align:center;margin:22px 0 18px;font-size:30px}
.sp-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-bottom:16px}
.sp-summary>div,.sp-preview-fields>div{border:1px solid var(--line);border-radius:8px;padding:12px;background:rgba(0,0,0,0.02)}
.sp-summary span,.sp-preview-fields span{display:block;font-size:11px;color:var(--muted);font-weight:700;margin-bottom:6px}
.sp-summary strong,.sp-preview-fields strong{font-size:15px}
.sp-preview-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sp-preview-fields>div:last-child{grid-column:1/-1;min-height:82px}
.sp-signs{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:46px}
.sp-signs span{border-top:1px solid var(--ink);padding-top:9px;text-align:center;color:var(--muted);font-size:12px}
.sp-saved-panel{margin-top:16px;padding:16px}
.sp-saved-wrap{overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--card)}
.sp-saved-table{width:100%;border-collapse:collapse;min-width:980px}
.sp-saved-table th,.sp-saved-table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:inherit;white-space:nowrap;font-size:13px}
.sp-saved-table th{font-size:11px;color:var(--muted);font-weight:800;background:rgba(0,0,0,0.025)}
.sp-saved-table tbody tr:hover{background:rgba(0,108,53,0.05)}
.sp-saved-table tbody tr.is-opened{background:rgba(31,157,85,0.1)}
.sp-saved-table tbody tr.is-opened td:first-child{box-shadow:inset 3px 0 0 var(--ok)}
[dir="rtl"] .sp-saved-table tbody tr.is-opened td:first-child{box-shadow:inset -3px 0 0 var(--ok)}
.sp-saved-table tbody tr:last-child td{border-bottom:0}
.sp-saved-table .btn{min-height:30px;padding:6px 10px;font-size:12px}
.sp-empty{padding:18px;color:var(--muted);font-size:13px;text-align:center}
.sp-empty-start{margin-top:16px;padding:18px}
.sp-empty-start .panel-head{align-items:center}
@media (max-width:1100px){.sp-grid{grid-template-columns:1fr}.sp-paper{min-height:auto}.sp-summary{grid-template-columns:1fr}.sp-preview-fields{grid-template-columns:1fr}}

/* ============================================================
 * ===== LOGIN PAGE — design handoff (rakeeeeeb-login v2) ======
 * ============================================================
 * Two-pane layout (Saudi-green identity throughout):
 *   - Brand pane (right in RTL): mini landing page that SCROLLS with
 *     the document (hero+stats, why, live-ops mock, features, driver
 *     app, pricing, CTA). Has scroll-progress bar pinned to top.
 *   - Form pane (left in RTL): position:sticky, stays in view as the
 *     brand pane scrolls past it. Green-accented login card.
 *
 * Palette is scoped via --green-* custom props on the .login-page
 * wrapper so the dashboard isn't affected. Generic class names from
 * the design (btn, field, input, tabs, etc.) are scoped with the
 * `.login-page` ancestor selector to avoid collisions. Legacy
 * `.login-*` selectors used by the React component are kept too so
 * the component code stays readable; they map onto the design-class
 * styles via shared rule blocks below. */
.login-page {
  /* Saudi-green identity palette */
  --green-950: #062A1B;
  --green-900: #08361F;
  --green-800: #0B4D34;
  --green-700: #0E5C3D;
  --green-600: #006C35;        /* Saudi flag green */
  --green-500: #0B7A45;
  --green-400: #1F9D5E;
  --green-300: #2ECC71;        /* accent */
  --green-200: #A7E3BF;
  --green-100: #D6F1E0;
  --green-50:  #EAF6EE;

  --gold:    #C9A227;
  --ink:     #0E2419;
  --ink-2:   #324A3D;
  --ink-3:   #6A7E73;
  --line:    #E1EAE3;
  --paper:   #FFFFFF;
  --bg:      #F4F8F4;
  --danger:  #B0322B;

  /* Legacy aliases — old React component still references these names */
  --login-navy-700: var(--green-800);
  --login-navy-600: var(--green-700);
  --login-navy-800: var(--green-900);
  --login-navy-900: var(--green-950);
  --login-navy-500: var(--green-500);
  --login-water-700: var(--green-700);
  --login-water-500: var(--green-600);
  --login-water-300: var(--green-300);
  --login-green-800: var(--green-800);
  --login-green-600: var(--green-600);
  --login-sand-50: var(--bg);
  --login-sand-100: var(--green-50);
  --login-line: var(--line);
  --login-ink: var(--ink);
  --login-ink-2: var(--ink-2);
  --login-ink-3: var(--ink-3);
  --login-danger: var(--danger);

  position: fixed; inset: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: start;
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
.login-page * { box-sizing: border-box; }

@media (max-width: 1080px) {
  .login-page { grid-template-columns: 1fr; }

  /* MOBILE-FIRST ORDERING: the form pane comes BEFORE the brand pane
   * visually — on a phone the user opens the URL to log in, not to read
   * a landing page. Brand-pane stays accessible by scrolling down for
   * anyone curious about the marketing/feature content.
   *
   * In source order: brand-pane first, form-pane second. We swap the
   * visual order with explicit grid-row placement. */
  .login-page .login-form-pane,
  .login-page .form-pane {
    grid-row: 1;
    /* Fill the viewport so the user sees a complete login screen at
     * first paint with no need to scroll. min-height (not height) lets
     * the form grow if the inputs ever need more room. */
    min-height: 100vh;
  }
  .login-page .brand-pane {
    grid-row: 2;
  }
}

/* ============== MOBILE OVERRIDES (≤640px) ==============
 * The 1080px breakpoint above flips the page to a single column.
 * Below 640px we ALSO need to scale everything down or the user
 * sees: 60px hero h1, 4-col stats grid, 3-col why-cards crushed
 * into 320px, brand-pane padding eating half the width, etc.
 *
 * Strategy:
 *   - Reduce padding everywhere brand-side has 40-48px → 18-22px
 *   - Drop multi-column grids to 1-2 cols
 *   - Scale display headings (60px / 38px / 32px) to mobile sizes
 *   - Hide pure-decoration items (hero-deco, orbs partially)
 *   - Stack the brand-top + brand-foot rows
 * ======================================================= */
@media (max-width: 640px) {
  /* --- Brand-pane (the dark-green left/right pane) --- */
  .login-page .brand-pane {
    padding: 22px 18px 28px;   /* was 40px 48px 48px */
  }
  /* Top row: gov badge + meta — stack instead of space-between
   * so neither line has to truncate. */
  .login-page .brand-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
  }
  .login-page .gov-badge { padding: 6px 11px; font-size: 11px; }
  .login-page .top-meta { gap: 10px; flex-wrap: wrap; font-size: 11px; }

  /* Sections: less vertical breathing room — phone screens are short */
  .login-page .section { padding-block: 36px; }

  /* Hero: the headline is the biggest source of overflow. 60px → 32px
   * (still impactful, fits two lines of "إدارة محطات…" text). */
  .login-page .hero { gap: 16px; }
  .login-page .hero-logo { width: 80px; height: 80px; border-radius: 18px; padding: 10px; }
  .login-page .hero h1 { font-size: 32px; max-width: none; }
  .login-page .hero .lede { font-size: 14px; line-height: 1.6; }

  /* Section h2 — same scale-down */
  .login-page .section h2 { font-size: 24px; max-width: none; }
  .login-page .section .sub { font-size: 13.5px; margin-bottom: 22px; }
  .login-page .section-eyebrow { font-size: 10px; margin-bottom: 10px; }

  /* Pills wrap a bit tighter */
  .login-page .pill { padding: 6px 11px; font-size: 12px; }

  /* Stats row: 4 cols at 64px each = 256px content + gaps. On a
   * 360px-wide phone with side padding ≈ 320px usable, that's a
   * crush. Drop to 2 columns. */
  .login-page .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page .stat { padding: 12px 14px; }
  .login-page .stat .v { font-size: 20px; }

  /* "Why Raqeeb" cards — 3 cols → 1 col stack */
  .login-page .why-grid { grid-template-columns: 1fr; gap: 10px; }
  .login-page .why-card { padding: 16px 14px; }
  .login-page .why-card h3 { font-size: 15px; }
  .login-page .why-card p { font-size: 13px; }

  /* Features grid: 2 cols → 1 col on phone (each cell has icon+text
   * which needs ~250px to read comfortably) */
  .login-page .feat-grid { grid-template-columns: 1fr; }
  .login-page .feat-item { padding: 14px 14px; }

  /* Mock dashboard: the 3-col tile row collapses, but keep the
   * url bar / window chrome visible */
  .login-page .mock { padding: 14px; }
  .login-page .mock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .login-page .mock-tile { padding: 10px; }
  .login-page .mock-tile .num { font-size: 18px; }

  /* Pricing: 3 cols → 1 col */
  .login-page .price-grid { grid-template-columns: 1fr; gap: 10px; }
  .login-page .price-card { padding: 18px 16px; }

  /* Tagline CTA */
  .login-page .tagline { padding: 22px 18px; }
  .login-page .tagline h3 { font-size: 18px; }

  /* Brand-foot: stack the two halves so neither has to crush */
  .login-page .brand-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 11.5px;
  }
  .login-page .brand-foot .left { flex-wrap: wrap; gap: 10px 14px; }

  /* Hide the decorative truck/water-tower silhouette on phones —
   * it's positioned absolute and at this width it overlaps content
   * or disappears off-screen. The brand-pane already has the orbs
   * + grid pattern carrying visual weight. */
  .login-page .section .hero-deco { display: none; }

  /* Form-pane: tighter padding so the card uses more of the width */
  .login-page .form-pane,
  .login-page .login-form-pane { padding: 24px 16px; }
  .login-page .login-shell { gap: 10px; }
  .login-page .login-card { padding: 22px 18px; border-radius: 14px; }
  .login-page .login-card form { gap: 12px; }
  .login-page .title-block h2,
  .login-page .login-title-block h2 { font-size: 22px; }
  .login-page .brand-stack .logo-mark,
  .login-page .login-logo-mark { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 16px; }

  /* The "Demo creds" box on the dev login uses max-width:460px which
   * is wider than the form on mobile — let it shrink. */
  .login-page .login-demo,
  .login-page .login-server-warn { max-width: 100%; }

  /* Tabs (driver / supervisor) — labels can wrap on smaller widths */
  .login-page .tabs button,
  .login-page .login-tabs button { padding: 8px 8px; font-size: 12px; }

  /* Form footer (lang switch + remember-me) — give it room to wrap */
  .login-page .foot,
  .login-page .login-foot { flex-wrap: wrap; gap: 8px; }

  /* Inputs: bump font-size to 16px to defeat iOS Safari's auto-zoom
   * on focus (anything <16px triggers zoom-in). 14px label is fine. */
  .login-page .input input,
  .login-page .login-input input { font-size: 16px; }
}

/* ============== ANIMATIONS ============== */
@keyframes login-fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes login-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes login-orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -40px) scale(1.08); }
  66%      { transform: translate(-25px, 20px) scale(0.96); }
}
@keyframes login-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
  50%      { box-shadow: 0 0 0 14px rgba(46, 204, 113, 0); }
}
@keyframes login-ping {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}
@keyframes login-float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes login-wave-shift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes login-truck-drive {
  0%   { left: -8%; }
  100% { left: 108%; }
}
@keyframes login-notif-in {
  0%        { transform: translateY(-30px); opacity: 0; }
  15%, 85%  { transform: translateY(0); opacity: 1; }
  100%      { transform: translateY(-30px); opacity: 0; }
}
@keyframes login-spin { to { transform: rotate(360deg); } }

/* Reveal-on-scroll base — JS adds .in once visible */
.login-page .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.login-page .reveal.in { opacity: 1; transform: translateY(0); }
.login-page .reveal.delay-1 { transition-delay: 0.08s; }
.login-page .reveal.delay-2 { transition-delay: 0.16s; }
.login-page .reveal.delay-3 { transition-delay: 0.24s; }
.login-page .reveal.delay-4 { transition-delay: 0.32s; }
.login-page .reveal.delay-5 { transition-delay: 0.40s; }
.login-page .reveal.delay-6 { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  .login-page *, .login-page *::before, .login-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .login-page .reveal { opacity: 1; transform: none; }
}

/* ============================================================
 * Design's brand pane + form pane CSS — scoped under .login-page
 * ============================================================ */

/* ===== Brand pane (right in RTL) =====
 * grid-column placement is desktop-only (see the @media (min-width: 1081px)
 * block paired with .form-pane below) — at narrow widths we let it flow
 * naturally as grid row 1 above the form pane. */
.login-page .brand-pane {
  position: relative;
  background:
    radial-gradient(1100px 600px at 85% 5%, rgba(46,204,113,0.14), transparent 60%),
    radial-gradient(900px 700px at 10% 95%, rgba(11,77,52,0.45), transparent 60%),
    linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 45%, var(--green-950) 100%);
  color: #EAF6EE;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 48px 48px;
}
.login-page .brand-pane::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 30px);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, black 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at 60% 40%, black 30%, transparent 80%);
  pointer-events: none;
}
.login-page .brand-pane::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 92% 92%, rgba(46,204,113,0.10) 0 60px, transparent 90px);
  pointer-events: none;
}

.login-page .orb {
  position: absolute; border-radius: 50%; filter: blur(50px);
  pointer-events: none; animation: login-orbDrift 22s ease-in-out infinite;
  will-change: transform;
}
.login-page .orb.a { width: 380px; height: 380px; background: #0B7A45; top: -100px; left: -90px; opacity: 0.55; }
.login-page .orb.b { width: 300px; height: 300px; background: #2ECC71; bottom: -80px; right: -60px; opacity: 0.25; animation-delay: -7s; animation-duration: 28s; }
.login-page .orb.c { width: 220px; height: 220px; background: #1F9D5E; top: 42%; left: 50%; opacity: 0.30; animation-delay: -14s; animation-duration: 26s; }

.login-page .scroll-progress {
  position: fixed;
  top: 0; right: 0; height: 3px;
  width: 50%;
  z-index: 30;
  pointer-events: none;
  background: rgba(255,255,255,0.06);
}
@media (max-width: 1080px) { .login-page .scroll-progress { width: 100%; } }
.login-page .scroll-progress::after {
  content: ""; display: block;
  height: 100%; width: var(--scroll-pct, 0%);
  background: linear-gradient(90deg, #2ECC71, #A7E3BF);
  transition: width 0.12s linear;
  box-shadow: 0 0 12px rgba(46,204,113,0.6);
}

/* Wave silhouettes at the bottom of the brand pane */
.login-page .waves {
  position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  pointer-events: none;
  background: radial-gradient(80% 80% at 50% 100%, rgba(46,204,113,0.08), transparent 60%);
}
.login-page .waves svg { position: absolute; bottom: -1px; left: 0; width: 100%; }

/* === Top bar === */
.login-page .brand-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  color: #BDD8C7; font-size: 13px;
}
.login-page .gov-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.login-page .gov-badge svg { width: 16px; height: 16px; }
.login-page .top-meta { display: inline-flex; gap: 14px; align-items: center; opacity: 0.85; }
.login-page .top-meta .live { display: inline-flex; align-items: center; gap: 6px; color: #A7E3BF; }
.login-page .top-meta .live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #2ECC71;
  animation: login-pulse 1.8s ease-in-out infinite;
}

/* Section spacing for scroll landing */
.login-page .section {
  position: relative; z-index: 2;
  padding-block: 64px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.login-page .section:first-of-type { border-top: 0; }

/* Hero-section decoration: palm + water tower silhouette anchored to the
 * bottom-end (visual LEFT in RTL) of the first section. Pointer-events
 * disabled so it never blocks clicks on the form pane (which sits to the
 * left of the brand pane in LTR / right in RTL). The container is
 * absolute-positioned inside the section (which is position:relative).
 *
 * Raised ~15cm off the section floor and resized larger per the user's
 * request — the previous 240×180 anchored at bottom:0 was too small and
 * sat behind the stats row. */
.login-page .section .hero-deco {
  position: absolute;
  bottom: 11cm;              /* lifted; lowered 4cm from the previous 15cm */
  inset-inline-end: 0;       /* Visual LEFT in RTL because brand-pane is on the right */
  width: 360px;
  height: 270px;
  pointer-events: none;
  opacity: 0.92;
  z-index: 1;
}
.login-page .section .hero-deco svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Smaller viewports: scale down + lift less so it doesn't escape off-screen */
@media (max-width: 1280px) {
  .login-page .section .hero-deco { bottom: 4cm; width: 280px; height: 210px; }
}
@media (max-width: 1080px) {
  .login-page .section .hero-deco { bottom: 0;   width: 220px; height: 165px; opacity: 0.75; }
}
.login-page .section-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.32em;
  color: #A7E3BF; text-transform: uppercase;
  margin-bottom: 14px;
}
.login-page .section-eyebrow::before { content: ""; width: 24px; height: 1px; background: #2ECC71; }
.login-page .section h2 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 300; font-size: 38px; line-height: 1.15;
  color: #fff; margin: 0 0 12px;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.login-page .section .sub {
  color: #BDD8C7; font-size: 16px; line-height: 1.7;
  max-width: 56ch; margin: 0 0 32px;
}

/* === Hero === */
.login-page .hero {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 22px;
}
.login-page .hero-logo {
  width: 110px; height: 110px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.4);
  animation: login-float-y 5s ease-in-out infinite;
  position: relative;
}
.login-page .hero-logo::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 28px;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(46,204,113,0.6) 60deg, transparent 120deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 2px; opacity: 0.7;
  animation: login-spin 6s linear infinite;
}
.login-page .hero-logo img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }

/* Light-pane variant of hero-logo. Used in `.brand-stack` above the sign-
 * in form so the form side gets the same physical presence as the dark
 * hero pane on the right — same size (110px), same float + spin
 * animations, same conic ring (tinted green to read on the cream
 * background instead of the white-on-navy variant). The image keeps its
 * natural colours (no `brightness(0) invert(1)` filter that the dark
 * variant uses). A soft halo radial-gradient sits BEHIND the plate via
 * `.hero-logo-halo` to mirror the glow that the dark hero pane gets for
 * free from its blurred orbs. */
.login-page .hero-logo.is-light {
  width: 110px; height: 110px;
  background: #fff;
  border: 1px solid var(--line, #E4E2D9);
  border-radius: 24px;
  padding: 16px;
  box-shadow:
    0 1px 0 rgba(11,77,52,0.05),
    0 8px 18px -8px rgba(11,77,52,0.18),
    0 24px 48px -20px rgba(11,77,52,0.32);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  /* Soft green halo bleeding outward — same radial-gradient idea the
   * dark hero pane gets from its blurred orbs. Sits behind the plate via
   * a negative-z pseudo so the logo stays sharp on top. */
  isolation: isolate;
}
.login-page .hero-logo.is-light::before {
  content: "";
  position: absolute;
  inset: -28px;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%,
              rgba(31, 107, 69, 0.22) 0%,
              rgba(31, 107, 69, 0.10) 40%,
              transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.login-page .hero-logo.is-light::after {
  /* Tinted variant of the conic ring so it reads against the white plate.
   * Same animation parameters as the dark variant so the two plates feel
   * synchronised when both are visible. */
  background: conic-gradient(from 0deg,
              transparent 0deg,
              rgba(31, 107, 69, 0.65) 60deg,
              transparent 120deg);
  opacity: 0.9;
}
.login-page .hero-logo.is-light img {
  filter: none; /* keep the natural-colour transparent logo */
}
.login-page .eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 11.5px; letter-spacing: 0.32em;
  color: #A7E3BF; text-transform: uppercase;
}
.login-page .eyebrow::before { content: ""; width: 32px; height: 1px; background: #2ECC71; opacity: 0.7; }
.login-page .hero h1 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 300;
  font-size: 60px; line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0; color: #fff;
  text-wrap: pretty;
  max-width: 14ch;
}
.login-page .hero h1 .accent {
  background: linear-gradient(180deg, #D6F1E0 0%, #2ECC71 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-page .hero .lede {
  max-width: 52ch;
  color: #C7DDD0;
  font-size: 17px; line-height: 1.75;
  margin: 0;
}

/* Feature pills */
.login-page .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.login-page .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: #D6F1E0; font-size: 13px; font-weight: 500;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.login-page .pill:hover {
  background: rgba(46,204,113,0.14);
  border-color: rgba(46,204,113,0.40);
  transform: translateY(-2px);
}
.login-page .pill svg { width: 14px; height: 14px; color: #2ECC71; }

/* Stats — using the design's class name (.stats) but scoped */
.login-page .stats {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  margin-top: 8px;
}
.login-page .stat {
  background: rgba(8,54,31,0.55);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background 0.3s;
  position: relative;
}
.login-page .stat:hover { background: rgba(46,204,113,0.12); }
.login-page .stat::after {
  content: ""; position: absolute; bottom: 0; right: 0; left: 0;
  height: 2px; background: #2ECC71; transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s ease;
}
.login-page .stat:hover::after { transform: scaleX(1); }
.login-page .stat .v {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400; font-size: 24px; color: #fff;
  display: flex; align-items: baseline; gap: 4px;
}
.login-page .stat .v small { font-size: 12px; color: #A7E3BF; font-weight: 600; }
.login-page .stat .l { font-size: 12px; color: #9FB6A8; letter-spacing: 0.02em; }

/* Why cards (3 col) */
.login-page .why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.login-page .why-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 20px;
  transition: background 0.35s, transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  position: relative;
  overflow: hidden;
}
.login-page .why-card::before {
  content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(46,204,113,0.18), transparent 40%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.login-page .why-card:hover::before { opacity: 1; }
.login-page .why-card:hover {
  background: rgba(46,204,113,0.06);
  border-color: rgba(46,204,113,0.45);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(46,204,113,0.35);
}
.login-page .why-card:hover .ic { transform: rotate(-8deg) scale(1.08); background: rgba(46,204,113,0.25); }
.login-page .why-card .ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(46,204,113,0.15);
  border: 1px solid rgba(46,204,113,0.25);
  display: flex; align-items: center; justify-content: center;
  color: #2ECC71;
  margin-bottom: 14px;
  transition: transform 0.35s, background 0.35s;
}
.login-page .why-card .ic svg { width: 20px; height: 20px; }
.login-page .why-card h3 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400; font-size: 17px;
  margin: 0 0 6px; color: #fff;
}
.login-page .why-card p { margin: 0; color: #BDD8C7; font-size: 13.5px; line-height: 1.65; }

/* Feature list (2 col) */
.login-page .feat-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px; overflow: hidden;
}
.login-page .feat-item {
  background: rgba(8,54,31,0.55);
  padding: 18px 20px;
  display: flex; gap: 14px; align-items: flex-start;
  transition: background 0.3s;
  position: relative;
}
.login-page .feat-item:hover { background: rgba(46,204,113,0.10); }
.login-page .feat-item:hover .ic { transform: scale(1.15); background: rgba(46,204,113,0.30); }
.login-page .feat-item .ic {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 9px;
  background: rgba(46,204,113,0.12);
  color: #2ECC71;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s, background 0.3s;
}
.login-page .feat-item .ic svg { width: 18px; height: 18px; }
.login-page .feat-item .t { font-family: 'Tajawal', sans-serif; font-weight: 400; font-size: 15px; color: #fff; margin: 0 0 4px; }
.login-page .feat-item .d { font-size: 13px; color: #A7BCAE; line-height: 1.6; margin: 0; }

/* Mock dashboard */
.login-page .mock {
  margin-top: 8px;
  background: linear-gradient(180deg, #0E5C3D 0%, #08361F 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.55);
}
.login-page .mock-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.login-page .mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.login-page .mock-bar i:first-child { background: #FF6058; }
.login-page .mock-bar i:nth-child(2) { background: #FFBD2E; }
.login-page .mock-bar i:nth-child(3) { background: #27CA40; }
.login-page .mock-bar .url {
  margin-inline-start: auto;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 3px 12px; font-size: 11px; color: #A7E3BF;
  direction: ltr; font-family: ui-monospace, monospace;
}
.login-page .mock-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.login-page .mock-tile {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.login-page .mock-tile::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(46,204,113,0.10) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: login-shimmer 4s linear infinite;
  pointer-events: none;
}
.login-page .mock-tile .lab { font-size: 11px; color: #A7BCAE; margin-bottom: 6px; }
.login-page .mock-tile .num { font-family: 'Tajawal', sans-serif; font-weight: 400; font-size: 22px; color: #fff; }
.login-page .mock-tile .delta { font-size: 11px; color: #2ECC71; margin-top: 4px; }
.login-page .mock-map {
  margin-top: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  height: 140px; position: relative; overflow: hidden;
}
.login-page .mock-map::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(46,204,113,0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(46,204,113,0.06) 0 1px, transparent 1px 24px);
}
.login-page .mock-map .pin {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #2ECC71; box-shadow: 0 0 0 6px rgba(46,204,113,0.20);
  animation: login-pulse 2s ease-in-out infinite;
  transition: top 4s linear, left 4s linear;
}
.login-page .mock-map .pin::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid #2ECC71;
  animation: login-ping 2.4s cubic-bezier(0,0,0.2,1) infinite;
}
.login-page .mock-map .truck {
  position: absolute; top: 50%; left: 0;
  width: 18px; height: 10px; border-radius: 2px;
  background: linear-gradient(90deg, #2ECC71, #A7E3BF);
  transform: translateY(-50%);
  animation: login-truck-drive 8s linear infinite;
  box-shadow: 0 0 12px rgba(46,204,113,0.6);
}
.login-page .mock-map .truck::before {
  content: ""; position: absolute; right: -4px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: #2ECC71; transform: translateY(-50%);
  box-shadow: 0 0 8px #2ECC71;
}
.login-page .mock-map .route { position: absolute; inset: 0; pointer-events: none; }
.login-page .mock-map .route path {
  fill: none; stroke: rgba(46,204,113,0.4); stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: login-wave-shift 1.5s linear infinite;
}

/* Driver app */
.login-page .driver-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
}
.login-page .phone {
  width: 160px; height: 300px;
  background: #08361F;
  border: 8px solid #062A1B;
  border-radius: 28px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  padding: 14px 10px;
  position: relative; overflow: hidden;
  animation: login-float-y 4s ease-in-out infinite;
}
.login-page .phone::before {
  content: ""; position: absolute; top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 5px; border-radius: 5px;
  background: rgba(255,255,255,0.15);
}
.login-page .phone-screen {
  height: 100%; border-radius: 14px;
  background: linear-gradient(180deg, #0B4D34, #062A1B);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.login-page .phone-screen .h { color: #A7E3BF; font-size: 10px; letter-spacing: 0.2em; text-align: center; }
.login-page .phone-screen .pcard {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff; font-size: 11px;
  animation: login-notif-in 5s ease-in-out infinite;
}
.login-page .phone-screen .pcard:nth-of-type(2) { animation-delay: -1.6s; }
.login-page .phone-screen .pcard:nth-of-type(3) { animation-delay: -3.2s; }
.login-page .phone-screen .pcard .t { font-weight: 700; margin-bottom: 2px; }
.login-page .phone-screen .pcard .s { color: #A7BCAE; font-size: 10px; }
.login-page .phone-screen .btn-mini {
  margin-top: auto;
  background: #2ECC71; color: #062A1B;
  border-radius: 8px; padding: 8px;
  text-align: center; font-weight: 700; font-size: 11px;
}

/* Pricing */
.login-page .price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.login-page .price-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.login-page .price-card:hover {
  transform: translateY(-6px);
  border-color: rgba(46,204,113,0.40);
  box-shadow: 0 24px 48px -24px rgba(46,204,113,0.5);
}
.login-page .price-card.featured {
  background: rgba(46,204,113,0.08);
  border-color: rgba(46,204,113,0.40);
}
.login-page .price-card .tag {
  position: absolute; top: -10px; right: 16px;
  background: #2ECC71; color: #062A1B;
  font-size: 10px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
  letter-spacing: 0.06em;
}
.login-page .price-card .name { font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: 14px; color: #A7E3BF; }
.login-page .price-card .amt {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800; font-size: 30px; color: #fff;
  display: flex; align-items: baseline; gap: 6px;
}
.login-page .price-card .amt small { font-size: 12px; color: #A7BCAE; font-weight: 500; }
.login-page .price-card ul {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #BDD8C7;
}
.login-page .price-card li { display: flex; align-items: center; gap: 8px; }
.login-page .price-card li::before {
  content: ""; width: 14px; height: 14px; flex: 0 0 14px;
  background: #2ECC71;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>") center/contain no-repeat;
}

/* Tagline strip */
.login-page .tagline {
  margin-top: 8px;
  border-radius: 16px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(46,204,113,0.18), rgba(46,204,113,0.04));
  border: 1px solid rgba(46,204,113,0.30);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-page .tagline::before {
  content: ""; position: absolute; inset: -2px;
  background: linear-gradient(90deg, transparent, rgba(46,204,113,0.25), transparent);
  background-size: 200% 100%;
  animation: login-shimmer 6s linear infinite;
  pointer-events: none;
}
.login-page .tagline h3 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400; font-size: 26px; color: #fff;
  margin: 0 0 8px; line-height: 1.25;
}
.login-page .tagline p { color: #BDD8C7; margin: 0 0 14px; }
.login-page .tagline .cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #2ECC71; color: #062A1B;
  padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: filter 0.15s, transform 0.06s;
}
.login-page .tagline .cta:hover { filter: brightness(1.08); }
.login-page .tagline .cta:active { transform: translateY(1px); }
.login-page .tagline .cta svg { width: 14px; height: 14px; transform: scaleX(-1); }

.login-page .brand-foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  color: #9FB6A8; font-size: 12px;
  margin-top: 24px;
}
.login-page .brand-foot .left { display: inline-flex; gap: 18px; align-items: center; }
.login-page .brand-foot .left a { color: #BDD8C7; text-decoration: none; }
.login-page .brand-foot .left a:hover { color: #fff; }

/* ===== Form pane (left in RTL) ===== */
/* Base: laid out as a regular grid item, no sticky behaviour. The sticky/
 * full-viewport-height variant is opt-in below for desktop only.
 *
 * RATIONALE: previously this rule was a single block with `position: sticky;
 * top: 0; height: 100vh; grid-column: 2`. On mobile the @media (max-width:
 * 1080px) override had to hammer those four properties back to sane values
 * with !important. The override sometimes failed to apply (cache races,
 * mobile-specific cascade quirks observed in the wild) and the form pane
 * ended up sticky-pinned over the brand pane, with hero text visible BEHIND
 * the form. Splitting the rule by min-width is bulletproof: at narrow widths
 * the sticky rule simply doesn't exist, so there's nothing to override. */
.login-page .form-pane,
.login-page .login-form-pane {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 28px;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(46,204,113,0.07), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(11,77,52,0.06), transparent 60%),
    var(--bg);
  overflow-y: auto;
}
@media (min-width: 1081px) {
  .login-page .form-pane,
  .login-page .login-form-pane {
    position: sticky;
    top: 0;
    height: 100vh;
    grid-column: 2;
  }
  /* Brand-pane gets its explicit grid-column placement only at desktop too —
   * same reason: at narrow widths we want auto so the panes flow in source
   * order. The block is here (not at @media max-width:1080px) so that the
   * normal cascade — without !important — is enough. */
  .login-page .brand-pane { grid-column: 1; }
}
/* Top + bottom green bands */
.login-page .ornament-top,
.login-page .login-ornament {
  position: absolute; top: 0; right: 0; left: 0; height: 8px;
  background: linear-gradient(90deg, var(--green-800) 0%, var(--green-600) 50%, var(--green-300) 100%);
  z-index: 5;
}
.login-page .ornament-bot {
  position: absolute; bottom: 0; right: 0; left: 0; height: 8px;
  background: linear-gradient(90deg, var(--green-300) 0%, var(--green-600) 50%, var(--green-800) 100%);
  z-index: 5;
}

.login-page .login-shell {
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* Logo + wordmark stacked above the card */
.login-page .brand-stack {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.login-page .brand-stack .logo-mark,
.login-page .login-logo-mark {
  width: 78px; height: 78px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  box-shadow:
    0 1px 0 rgba(11,77,52,0.04),
    0 14px 28px -16px rgba(11,77,52,0.30);
  flex: 0 0 78px;
}
.login-page .brand-stack .logo-mark img,
.login-page .login-logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.login-page .brand-stack .ar,
.login-page .login-logo-text .ar {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400; font-size: 30px; color: var(--green-800);
  line-height: 1; letter-spacing: -0.01em;
  margin-top: 6px;
}
.login-page .brand-stack .en,
.login-page .login-logo-text .en {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 11px; letter-spacing: 0.36em; color: var(--green-600);
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.login-page .brand-stack .en::before, .login-page .brand-stack .en::after {
  content: ""; width: 18px; height: 1px; background: var(--green-300);
}

/* Login card */
.login-page .login-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 32px 26px;
  box-shadow:
    0 1px 0 rgba(11,77,52,0.04),
    0 12px 32px -16px rgba(11,77,52,0.18),
    0 30px 60px -30px rgba(11,77,52,0.22);
  position: relative;
  overflow: hidden;
}
.login-page .login-card::before {
  content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  background: linear-gradient(90deg, var(--green-800), var(--green-600), var(--green-300));
}
.login-page .title-block,
.login-page .login-title-block { text-align: center; margin-bottom: 22px; }
.login-page .title-block h2,
.login-page .login-title-block h2 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400; font-size: 24px;
  margin: 0 0 6px; color: var(--green-900);
  letter-spacing: -0.01em;
}
.login-page .title-block p,
.login-page .login-title-block p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.6; }

/* Tabs */
.login-page .tabs,
.login-page .login-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.login-page .tabs button,
.login-page .login-tabs button {
  appearance: none; border: 0; background: transparent;
  font: inherit; cursor: pointer;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.login-page .tabs button[aria-selected="true"],
.login-page .login-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--green-800);
  box-shadow: 0 1px 2px rgba(11,77,52,0.06), 0 6px 14px -8px rgba(11,77,52,0.25);
}
.login-page .tabs button svg,
.login-page .login-tabs button svg { width: 16px; height: 16px; }
.login-page .tabs button[aria-selected="true"] svg,
.login-page .login-tabs button[aria-selected="true"] svg { color: var(--green-600); }

.login-page .login-card form { display: flex; flex-direction: column; gap: 14px; }

.login-page .field,
.login-page .login-field { position: relative; }
.login-page .field label,
.login-page .login-field label {
  display: block; font-size: 13px; color: var(--ink-2);
  margin-bottom: 8px; font-weight: 600;
}
.login-page .field label .link { float: left; }
.login-page .input,
.login-page .login-input {
  display: flex; align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-page .input:hover,
.login-page .login-input:hover { border-color: #C5D6CB; }
.login-page .input:focus-within,
.login-page .login-input:focus-within {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(0,108,53,0.14);
}
.login-page .input.error,
.login-page .login-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(176,50,43,0.10);
}
.login-page .input svg.lead,
.login-page .login-input svg.lead {
  width: 18px; height: 18px; flex: 0 0 18px;
  margin-inline-start: 14px;
  color: var(--green-600);
}
.login-page .input input,
.login-page .login-input input {
  flex: 1; min-width: 0;
  appearance: none; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink);
  padding: 13px 12px;
  font-size: 15px;
  text-align: right;
}
[dir="ltr"] .login-page .input input,
[dir="ltr"] .login-page .login-input input { text-align: left; }
.login-page .input input::placeholder,
.login-page .login-input input::placeholder { color: #9CAFA3; }
.login-page .input .toggle,
.login-page .login-toggle {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 0 14px; height: 100%;
  display: flex; align-items: center;
  color: var(--green-700);
  font-size: 12.5px; font-weight: 600;
}
.login-page .input .toggle:hover,
.login-page .login-toggle:hover { color: var(--green-900); }

.login-page .row,
.login-page .login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: -2px;
}
.login-page .check,
.login-page .login-check {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none;
  color: var(--ink-2); font-size: 13.5px;
  position: relative;
}
.login-page .check input,
.login-page .login-check input { position: absolute; opacity: 0; pointer-events: none; }
.login-page .check .box,
.login-page .login-check .box {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid #C5D6CB; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.login-page .check .box svg,
.login-page .login-check .box svg { width: 12px; height: 12px; opacity: 0; }
.login-page .check input:checked + .box,
.login-page .login-check input:checked + .box {
  background: var(--green-600); border-color: var(--green-600);
}
.login-page .check input:checked + .box svg,
.login-page .login-check input:checked + .box svg { opacity: 1; }

.login-page .link,
.login-page .login-link {
  color: var(--green-700);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.login-page .link:hover,
.login-page .login-link:hover { text-decoration: underline; color: var(--green-900); }

.login-page .login-card .btn,
.login-page .login-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 100%; padding: 14px 16px;
  border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 15px;
  color: #fff;
  background: linear-gradient(180deg, var(--green-600) 0%, var(--green-800) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 8px 18px -8px rgba(11,77,52,0.55);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.06s ease, filter 0.15s;
  margin-top: 6px;
}
.login-page .login-card .btn:hover,
.login-page .login-btn:hover { filter: brightness(1.08); }
.login-page .login-card .btn:active,
.login-page .login-btn:active { transform: translateY(1px); }
.login-page .login-card .btn svg,
.login-page .login-btn svg { width: 16px; height: 16px; }
.login-page .login-card .btn[disabled],
.login-page .login-btn[disabled] { opacity: 0.7; cursor: progress; }
.login-page .login-card .btn .label-default,
.login-page .login-btn .label-default { display: flex; align-items: center; gap: 10px; }
.login-page .login-card .btn .spinner,
.login-page .login-btn .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: login-spin 0.8s linear infinite;
  display: none;
}
.login-page .login-card .btn.loading .spinner,
.login-page .login-btn.loading .spinner { display: inline-block; }
.login-page .login-card .btn.loading .label-default,
.login-page .login-btn.loading .label-default { display: none; }

.login-page .foot,
.login-page .login-foot {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-3);
}
.login-page .foot .lang,
.login-page .login-lang {
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  color: var(--ink-2); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.login-page .foot .lang:hover,
.login-page .login-lang:hover { border-color: var(--green-600); color: var(--green-800); }

.login-page .alert,
.login-page .login-alert {
  display: none; align-items: flex-start; gap: 10px;
  background: #FBECEA; border: 1px solid #F1C9C5;
  color: #7A201A;
  border-radius: 10px; padding: 10px 12px;
  font-size: 13px; line-height: 1.5;
  margin-bottom: 12px;
}
.login-page .alert.show,
.login-page .login-alert.show { display: flex; }
.login-page .alert svg,
.login-page .login-alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; color: #B0322B; }

.login-page .below,
.login-page .login-below {
  text-align: center; color: var(--ink-3); font-size: 12px;
  margin-top: 4px;
}
.login-page .below a,
.login-page .login-below a { color: var(--green-700); font-weight: 600; text-decoration: none; }
.login-page .below a:hover,
.login-page .login-below a:hover { text-decoration: underline; }

.login-page .login-demo {
  width: 100%; max-width: 460px;
  margin: 14px auto 0;
  padding: 12px 14px;
  background: rgba(0,108,53,0.06);
  color: var(--green-800);
  border-radius: 10px;
  border: 1px solid rgba(0,108,53,0.12);
  font-size: 12px; line-height: 1.6;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
}
.login-page .login-demo-title { font-weight: 700; margin-bottom: 4px; }

.login-page .login-server-warn {
  width: 100%; max-width: 460px;
  margin: 12px auto 0;
  padding: 10px 14px;
  background: rgba(176,50,43,0.08);
  color: var(--danger);
  border-radius: 10px;
  font-size: 12px; text-align: center;
}
.login-page .login-server-warn code { font-family: ui-monospace, monospace; font-size: 11.5px; }

.login-page .login-ribbon { display: none; }

/* ===== Login modal (forgot password / request access / terms / privacy) =====
 * Lives outside the .login-page grid so it covers BOTH panes. We use the
 * login palette (var(--login-*)) so the modal matches the rest of the
 * sign-in screen without depending on the dashboard's theme variables. */
.login-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 54, 31, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 1200;
  animation: login-modal-fade-in 0.15s ease-out;
}
@keyframes login-modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.login-modal {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px -16px rgba(8, 54, 31, 0.45);
  display: flex; flex-direction: column;
  max-height: min(85vh, 720px);
  overflow: hidden;
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  color: var(--login-ink, #0E2419);
}
.login-modal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--login-line, #E1EAE3);
}
.login-modal header h3 {
  margin: 0;
  font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--login-navy-700, #0B4D34);
}
.login-modal-close {
  appearance: none; border: 0; background: transparent;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--login-ink-3, #6A7E73);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.login-modal-close:hover {
  background: var(--login-sand-100, #EAF6EE);
  color: var(--login-ink, #0E2419);
}
.login-modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--login-ink-2, #324A3D);
}
.login-modal-body p { margin: 0 0 10px; }
.login-modal-body ol, .login-modal-body ul {
  margin: 8px 0 12px;
  padding-inline-start: 22px;
}
.login-modal-body li { margin-bottom: 6px; }
.login-modal-body h4 {
  font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--login-navy-700, #0B4D34);
  font-weight: 700;
}
.login-modal-body h4:first-child { margin-top: 0; }
.login-modal-body a {
  color: var(--login-water-700, #0E5C3D);
  font-weight: 600;
  text-decoration: none;
}
.login-modal-body a:hover { text-decoration: underline; }
.login-modal-contact {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--login-sand-100, #EAF6EE);
  border-radius: 10px;
  font-size: 13.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.login-modal-contact strong {
  font-weight: 700;
  color: var(--login-ink, #0E2419);
}
.login-modal-contact .sep { color: var(--login-ink-3, #6A7E73); }
.login-modal-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--login-sand-100, #EAF6EE);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.login-modal-tabs button {
  appearance: none; border: 0; background: transparent;
  font: inherit; cursor: pointer;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600; font-size: 13.5px;
  color: var(--login-ink-2, #324A3D);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.login-modal-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--login-navy-700, #0B4D34);
  box-shadow: 0 1px 2px rgba(11, 77, 52, 0.06), 0 6px 14px -8px rgba(11, 77, 52, 0.18);
}

/* =====================================================================
 * Rakeeb dark-emerald sidebar theme
 * Overrides the default light sidebar to match the brand mockup —
 * dark forest green background, white nav cards with subtle borders,
 * bright-green active pill with end-side accent bar, and the wave +
 * water tower + palms decoration anchored to the bottom.
 * Specificity-wins approach (selectors are .sidebar-prefixed) so this
 * block sits below the original rules and intentionally overrides them.
 * ===================================================================== */
.sidebar {
  background: #0B4D34;
  background-image:
    radial-gradient(circle at 20% 8%, rgba(255,255,255,0.04) 0, transparent 28%),
    radial-gradient(circle at 80% 4%, rgba(255,255,255,0.03) 0, transparent 22%);
  border-right: 0;
  color: #fff;
}
[dir="rtl"] .sidebar { border-left: 0; }

.sidebar .brand {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 6px 14px;
  /* The logo PNG carries its own dark-emerald canvas which extends to the
   * top of the sidebar — zero top padding keeps the image edge-to-edge. */
}
.sidebar .brand-logo-img {
  flex: none;
  width: 100%;
  max-width: 220px;
  height: auto;
  background: transparent;
  padding: 0;
  /* The image already carries the matching dark-emerald background — we
   * only need a subtle drop-shadow so it doesn't look 100% flat against
   * the sidebar. */
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.30));
}
.sidebar .brand-tag { display: none; }

.sidebar .nav-section {
  color: rgba(255,255,255,0.42);
  padding: 14px 6px 6px;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.sidebar .nav-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 11px 14px;
  margin: 4px 0;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  gap: 12px;
}
.sidebar .nav-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #fff;
}
.sidebar .nav-item .nav-icon {
  color: rgba(255,255,255,0.85);
  opacity: 1;
}

.sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(46,204,113,0.22), rgba(46,204,113,0.08));
  border-color: rgba(46,204,113,0.35);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-item.active .nav-icon { color: #fff; }

/* Override the default ::before accent bar — wider, brighter, taller. */
.sidebar .nav-item.active::before {
  background: #2ECC71;
  width: 4px;
  top: 4px;
  bottom: 4px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(46,204,113,0.55);
}
/* In the mockup the accent bar sits on the visual LEFT — which is the
 * inline-END in RTL. Flip it for RTL only. */
[dir="rtl"] .sidebar .nav-item.active::before {
  inset-inline-start: auto;
  inset-inline-end: 0;
  border-radius: 0 4px 4px 0;
}

/* Chevron at the inline-end of inactive nav items — drawn purely with
 * borders (no extra DOM). Active items hide it because the accent bar
 * already marks them. */
.sidebar .nav-item::after {
  content: '';
  width: 6px;
  height: 6px;
  border-top: 1.5px solid rgba(255,255,255,0.4);
  border-right: 1.5px solid rgba(255,255,255,0.4);
  margin-inline-start: auto;
  flex-shrink: 0;
  transform: rotate(45deg);
}
[dir="rtl"] .sidebar .nav-item::after { transform: rotate(-135deg); }
.sidebar .nav-item.active::after { display: none; }
.sidebar .nav-item .nav-badge { margin-inline-start: 0; }

/* Footer (user + logout) */
.sidebar .sidebar-foot {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 6px 8px;
}
.sidebar .avatar {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}
.sidebar .user-name { color: #fff; }
.sidebar .user-role { color: rgba(255,255,255,0.55); }
.sidebar .sidebar-foot .icon-btn {
  color: rgba(255,255,255,0.75);
  background: transparent;
  border: 0;
}
.sidebar .sidebar-foot .icon-btn:hover {
  background: rgba(255,255,255,0.08);
}

/* =====================================================================
 * AI Bot UI — floating button + slide-in drawer + chat surface
 * Lives outside the dashboard's normal grid; renders into the body via
 * fixed positioning. Class names are `bot-*` so they don't collide with
 * existing dashboard styles. Palette pulled from the Saudi-green CSS
 * vars defined at the top of this file.
 * ===================================================================== */

/* ── Floating button (FAB) ────────────────────────────────────────────── */
.bot-fab {
  position: fixed;
  bottom: 24px;
  /* Pinned to the visual LEFT edge regardless of RTL/LTR — matches the
   * drawer that now slides in from the left. Using physical `left`
   * (instead of inset-inline-end) makes the placement direction-agnostic. */
  left: 24px;
  right: auto;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  box-shadow:
    0 6px 16px -4px rgba(0,108,53,0.45),
    0 12px 32px -8px rgba(0,108,53,0.30),
    inset 0 1px 0 rgba(255,255,255,0.18);
  z-index: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.bot-fab:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.06);
}
.bot-fab:active { transform: translateY(0) scale(0.98); }

/* Pulsing ring around the FAB to draw attention. Pure CSS, no JS. */
.bot-fab-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(46,204,113,0.6);
  animation: bot-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes bot-pulse {
  0%   { transform: scale(0.95); opacity: 0.6; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.bot-fab-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--bad);
  color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: grid; place-items: center;
  border: 2px solid #fff;
}

/* ── Overlay + sliding panel ─────────────────────────────────────────── */
.bot-overlay {
  position: fixed; inset: 0;
  background: rgba(14,26,20,0.42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  /* 1700 sits above the sidebar drawer (1600). When both happen to be
   * open (rare — the bot button is hidden in a desktop layout but
   * possible on tablet), the bot overlay covers the sidebar cleanly. */
  z-index: 1700;
  display: flex;
  /* Drawer pinned to the visual LEFT edge of the viewport regardless of
   * direction. In LTR, flex-start is left. In RTL, flex-start is right —
   * so we use flex-end in RTL to keep the panel on the left. */
  justify-content: flex-start;
  animation: bot-fade-in 0.18s ease-out;
}
[dir="rtl"] .bot-overlay { justify-content: flex-end; }
@keyframes bot-fade-in { from { opacity: 0; } to { opacity: 1; } }

.bot-panel {
  position: relative;
  width: 100%; max-width: 480px; height: 100%;
  background: var(--card);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  /* Slide in from the visual LEFT — translateX(-100%) is always physical
   * leftward regardless of writing direction, so a single keyframe works
   * for both LTR and RTL. */
  animation: bot-slide-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes bot-slide-in {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@media (max-width: 640px) {
  .bot-panel { max-width: 100%; }
}

/* ── Header ──────────────────────────────────────────────────────────── */
.bot-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,108,53,0.04) 0%, transparent 100%);
  flex-shrink: 0;
}
.bot-header-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px -2px rgba(0,108,53,0.4);
}
.bot-header-title {
  font-weight: 800; font-size: 15px; color: var(--ink);
  letter-spacing: -0.01em;
}
.bot-header-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 2px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.bot-header-status { display: inline-flex; align-items: center; gap: 4px; }

.bot-icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--bg);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.bot-icon-btn:hover {
  background: rgba(0,108,53,0.06);
  border-color: var(--saudi-green);
  color: var(--saudi-green);
}

/* ── Messages area ───────────────────────────────────────────────────── */
.bot-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0,108,53,0.03) 0%, transparent 40%),
    var(--bg);
  scroll-behavior: smooth;
}

/* Empty state */
.bot-empty {
  margin: auto 0;
  padding: 24px 8px;
  text-align: center;
}
.bot-empty-emoji { font-size: 36px; margin-bottom: 8px; }
.bot-empty-title {
  font-weight: 800; font-size: 18px; color: var(--ink);
  margin-bottom: 6px;
}
.bot-empty-sub {
  font-size: 13px; color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 32ch; margin-inline: auto;
}
.bot-quick-prompts {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.bot-quick-chip {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit; font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.06s;
}
.bot-quick-chip:hover {
  background: rgba(0,108,53,0.06);
  border-color: var(--saudi-green);
  color: var(--saudi-green-deep);
  transform: translateY(-1px);
}

/* ── Message rows + bubbles ──────────────────────────────────────────── */
.bot-row {
  display: flex; gap: 8px;
  animation: bot-msg-in 0.22s ease-out;
}
@keyframes bot-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bot-row.user { justify-content: flex-end; }
.bot-row.asst { justify-content: flex-start; }

.bot-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 4px -1px rgba(0,108,53,0.3);
}

.bot-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.6;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.bot-bubble.user {
  background: linear-gradient(180deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  border-end-end-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,108,53,0.18);
}
.bot-bubble.asst {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-end-start-radius: 4px;
}
[dir="rtl"] .bot-bubble.user { border-end-end-radius: 14px; border-end-start-radius: 4px; }
[dir="rtl"] .bot-bubble.asst { border-end-start-radius: 14px; border-end-end-radius: 4px; }

.bot-source {
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 700;
}

.bot-text > div { margin: 0; }
.bot-bullet { padding-inline-start: 4px; }

/* ── Tool call indicator ─────────────────────────────────────────────── */
.bot-tool-call {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  padding: 4px 10px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(0,108,53,0.03);
}
.bot-tool-call code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--saudi-green);
  font-size: 10.5px;
}
.bot-tool-icon { font-size: 12px; }

/* ── Typing indicator ────────────────────────────────────────────────── */
.bot-typing {
  display: flex; gap: 4px; align-items: center; height: 14px;
}
.bot-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: bot-typing-bounce 1.2s infinite ease-in-out;
}
.bot-typing span:nth-child(2) { animation-delay: 0.15s; }
.bot-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bot-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Inline error ────────────────────────────────────────────────────── */
.bot-error {
  background: rgba(214,69,69,0.08);
  border: 1px solid rgba(214,69,69,0.2);
  color: var(--bad);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

/* ── History sidebar (overlay inside the panel) ──────────────────────── */
.bot-history {
  position: absolute; inset: 0;
  background: var(--card);
  z-index: 5;
  display: flex; flex-direction: column;
  animation: bot-fade-in 0.15s ease-out;
}
.bot-history-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.bot-history-list {
  flex: 1; overflow-y: auto;
  padding: 8px;
}
.bot-history-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.bot-history-item:hover { background: rgba(0,108,53,0.04); }
.bot-history-item.active {
  background: rgba(0,108,53,0.07);
  border: 1px solid rgba(0,108,53,0.18);
}
.bot-history-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-inline-end: 22px;
}
.bot-history-time {
  font-size: 10.5px; color: var(--muted); margin-top: 2px;
}
.bot-history-del {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  inset-inline-end: 8px;
  width: 24px; height: 24px;
  appearance: none; border: 0; background: transparent;
  cursor: pointer;
  border-radius: 6px;
  color: var(--muted);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.bot-history-item:hover .bot-history-del { opacity: 1; }
.bot-history-del:hover { color: var(--bad); background: rgba(214,69,69,0.08); }

/* ── Input bar ───────────────────────────────────────────────────────── */
.bot-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--card);
  flex-shrink: 0;
}
.bot-input {
  flex: 1;
  appearance: none;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  resize: none;
  max-height: 120px;
  min-height: 42px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bot-input:focus {
  outline: none;
  border-color: var(--saudi-green);
  box-shadow: 0 0 0 4px rgba(0,108,53,0.10);
}
.bot-input:disabled { opacity: 0.6; cursor: progress; }

.bot-send {
  appearance: none; border: 0; cursor: pointer;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px -2px rgba(0,108,53,0.4);
  transition: transform 0.06s, filter 0.15s;
}
.bot-send:hover:not(:disabled) { filter: brightness(1.06); }
.bot-send:active:not(:disabled) { transform: translateY(1px); }
.bot-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Footer hint ─────────────────────────────────────────────────────── */
.bot-foot {
  font-size: 10.5px; color: var(--muted);
  text-align: center;
  padding: 6px 12px 10px;
  background: var(--card);
}
.bot-foot kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  color: var(--ink-2);
  background: var(--sand-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ── Inline chat form (presentForm widget) ─────────────────────────── */
.bot-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bot-form-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--saudi-green-deep);
}
.bot-form-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: -4px;
  line-height: 1.5;
}
.bot-form-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bot-form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.bot-form-req {
  color: var(--bad);
  font-size: 12px;
  line-height: 1;
}
.bot-form-input {
  appearance: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bot-form-input:focus {
  outline: none;
  border-color: var(--saudi-green);
  box-shadow: 0 0 0 3px rgba(0,108,53,0.10);
}
.bot-form-input:disabled {
  background: var(--sand-2);
  color: var(--muted);
  cursor: not-allowed;
}
.bot-form-input[type="number"] { direction: ltr; text-align: end; }
.bot-form-input[type="tel"]    { direction: ltr; text-align: end; }
.bot-form-input[type="email"]  { direction: ltr; text-align: end; }
.bot-form-input[type="date"],
.bot-form-input[type="time"]   { direction: ltr; text-align: end; font-family: ui-monospace, monospace; }
/* Native picker indicator (calendar/clock icon) — keep visible in RTL */
.bot-form-input[type="date"]::-webkit-calendar-picker-indicator,
.bot-form-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(85deg);
  cursor: pointer;
}
.bot-form-hint {
  font-size: 11px;
  color: var(--bad);
  background: rgba(214,69,69,0.06);
  padding: 6px 10px;
  border-radius: 6px;
}
.bot-form-submit {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--saudi-green) 0%, var(--saudi-green-deep) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.06s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 2px 6px -2px rgba(0,108,53,0.40);
}
.bot-form-submit:hover:not(:disabled) { filter: brightness(1.06); }
.bot-form-submit:active:not(:disabled) { transform: translateY(1px); }
.bot-form-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════
 *  OFFLINE OVERLAY — Saudi desert edition
 *  ────────────────────────────────────────────────────────────────
 *  Full-bleed overlay shown when navigator.onLine is false.
 *  Source: claude.ai/design "no internt" handoff (2026-05-09).
 *  Every class is prefixed `.offline-` to namespace away from the
 *  rest of the app — `.spinner` would otherwise collide with the
 *  app's existing button-loading spinner.
 * ════════════════════════════════════════════════════════════════ */

.offline-page {
  position: fixed; inset: 0;
  z-index: 99999;
  background: #0a0a2a;
  color: #f5e8d6;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

.offline-scene {
  position: absolute; inset: 0;
  overflow: hidden;
}

.offline-backdrop { position: absolute; inset: 0; }
.offline-cave-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.offline-palms {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.offline-paintings {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .7;
}

.offline-fg-rocks {
  position: absolute; left: 0; right: 0; bottom: 0; height: 200px;
  pointer-events: none;
}

/* ───── Bedouin + tablet stage (right side) ───── */
.offline-caveman-stage {
  position: absolute;
  right: 8%;
  bottom: 14%;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  z-index: 5;
  filter: drop-shadow(0 30px 30px rgba(0,0,0,.5));
  direction: ltr;
}
.offline-caveman-wrap {
  position: relative;
  animation: offline-cm-breath 4s ease-in-out infinite;
}
@keyframes offline-cm-breath {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(.4deg); }
}

/* ───── Stone tablet ───── */
.offline-stone-tablet {
  position: relative;
  width: 300px; height: 210px;
  margin-bottom: 60px;
  cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
  animation: offline-tab-bob 3.5s ease-in-out infinite .5s;
}
@keyframes offline-tab-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(-1deg); }
}
.offline-stone-tablet:hover { filter: brightness(1.1); transform: scale(1.04) rotate(-3deg) translateY(-4px); }
.offline-tablet-svg { width: 100%; height: 100%; display: block; }
.offline-tablet-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 22px 36px 18px;
  color: #1a0d05;
  pointer-events: none;
  direction: rtl;
}
.offline-tablet-line-1 {
  font-family: 'Aref Ruqaa', 'Tajawal', 'Reem Kufi', serif;
  font-size: 22px; line-height: 1.05; font-weight: 700;
  color: #3a1e08;
  text-shadow: 0 1px 0 rgba(255,255,255,.2);
  margin-top: 42px;
}
.offline-tablet-line-2 {
  font-family: 'Tajawal', sans-serif;
  font-size: 13px; line-height: 1.3; font-weight: 500;
  color: #5a3818;
  margin-top: 6px;
  max-width: 230px;
  opacity: .9;
}
.offline-tablet-cta {
  margin-top: 10px;
  font-family: 'Reem Kufi', 'Tajawal', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #9d3a25;
  letter-spacing: .05em;
  animation: offline-tab-cta 1.6s ease-in-out infinite;
}
@keyframes offline-tab-cta {
  0%, 100% { opacity: .6; transform: translateX(0); }
  50%      { opacity: 1;  transform: translateX(-2px); }
}

/* ───── Overlay UI (headline, retry) ───── */
.offline-overlay-ui {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  max-width: 560px;
  color: #f5e8d6;
  text-align: right;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.6));
  direction: rtl;
}
@media (min-width: 901px) {
  .offline-overlay-ui { right: auto; left: 8%; text-align: left; direction: rtl; }
}

.offline-status-row {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Reem Kufi', 'Tajawal', 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: .04em;
  color: rgba(245,232,214,.75);
  margin-bottom: 18px;
}
.offline-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e23a1a;
  animation: offline-pulse 1.6s ease-out infinite;
}
@keyframes offline-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(226,58,26,.7); }
  70%  { box-shadow: 0 0 0 12px rgba(226,58,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,58,26,0); }
}

.offline-display-headline {
  font-family: 'Aref Ruqaa', 'Tajawal', serif;
  font-size: clamp(54px, 7vw, 110px);
  line-height: 1.05;
  font-weight: 700;
  color: #fef0d4;
  text-shadow:
    0 2px 0 #6a3a14,
    0 4px 0 #3a1e08,
    0 8px 32px rgba(0,0,0,.7);
  margin-bottom: 22px;
  text-wrap: balance;
  letter-spacing: -.01em;
}

.offline-display-sub {
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  color: #f4c890;
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 36px;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}

.offline-cta-row {
  display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Stone button — sandstone */
.offline-stone-btn {
  appearance: none; border: none; background: transparent; padding: 0; cursor: pointer;
  filter: drop-shadow(0 6px 0 #2a1a08) drop-shadow(0 12px 24px rgba(0,0,0,.5));
  transition: transform .15s ease, filter .15s ease;
}
.offline-stone-btn:hover { transform: translateY(-2px); }
.offline-stone-btn:active {
  transform: translateY(4px);
  filter: drop-shadow(0 2px 0 #2a1a08) drop-shadow(0 4px 12px rgba(0,0,0,.5));
}
.offline-stone-btn-face {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Reem Kufi', 'Tajawal', sans-serif;
  font-size: 18px; font-weight: 700;
  letter-spacing: .02em;
  color: #fef0d4;
  padding: 18px 30px;
  background: radial-gradient(ellipse at 30% 20%, #e8c068 0%, #b88838 35%, #6a4818 100%);
  border-radius: 22px 28px 26px 24px / 24px 22px 28px 26px;
  border: 2px solid #3a1e08;
  text-shadow: 0 2px 0 rgba(0,0,0,.45);
  position: relative;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.25),
    inset 0 -8px 20px rgba(0,0,0,.35);
}
.offline-stone-btn-face::before {
  content: ""; position: absolute; inset: 6px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.08) 0 6px, transparent 7px),
    radial-gradient(circle at 20% 80%, rgba(0,0,0,.18) 0 4px, transparent 5px);
  pointer-events: none;
}

.offline-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: offline-spin .8s linear infinite;
}
@keyframes offline-spin { to { transform: rotate(360deg); } }

.offline-ghost-btn {
  appearance: none;
  background: rgba(0, 108, 53, .15);
  border: 1.5px solid rgba(255, 255, 255, .35);
  color: #f5e8d6;
  font-family: 'Reem Kufi', 'Tajawal', sans-serif;
  font-size: 14px; font-weight: 600;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .02em;
}
.offline-ghost-btn:hover {
  background: rgba(0, 108, 53, .35);
  border-color: #f5e8d6;
  transform: translateY(-1px);
}

.offline-error-meta {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: rgba(245,232,214,.4);
  letter-spacing: .05em;
  direction: ltr;
}

/* ───── Fire pit + Dallah ───── */
.offline-fire-pit {
  position: absolute;
  left: 6%;
  bottom: 10%;
  width: 240px; height: 240px;
  z-index: 4;
}
.offline-fire-glow {
  position: absolute; left: 50%; top: 60%; transform: translate(-50%,-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,138,43,.45) 0%, rgba(255,138,43,.12) 30%, transparent 60%);
  pointer-events: none;
  animation: offline-glow-flicker 1.4s ease-in-out infinite;
  z-index: 0;
}
@keyframes offline-glow-flicker {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: .85; }
  50%      { transform: translate(-50%,-50%) scale(1.07); opacity: 1; }
}
.offline-fire-rocks { position: absolute; bottom: 0; left: 30px; width: 160px; height: 30px; z-index: 2; }
.offline-fr {
  position: absolute; bottom: 0;
  background: radial-gradient(ellipse at top, #8a6a4a, #3a2010);
  border-radius: 50% 60% 40% 50% / 60% 50% 50% 40%;
  border: 2px solid #1a0d05;
}
.offline-fr0 { left: 0;   width: 38px; height: 30px; }
.offline-fr1 { left: 30px; width: 34px; height: 26px; }
.offline-fr2 { left: 60px; width: 40px; height: 32px; }
.offline-fr3 { left: 96px; width: 32px; height: 24px; }
.offline-fr4 { left: 124px; width: 36px; height: 28px; }

.offline-fire {
  position: absolute;
  left: 110px; bottom: 18px;
  width: 120px; height: 140px;
  z-index: 1;
}
.offline-flame {
  position: absolute; left: 0; bottom: 0;
  width: 80px; height: 120px;
  background: radial-gradient(ellipse at bottom, #ffd96b 0%, #ff8a2b 35%, #e23a1a 70%, transparent 100%);
  border-radius: 50% 50% 30% 30% / 80% 80% 30% 30%;
  filter: blur(3px);
  mix-blend-mode: screen;
  animation: offline-flame 1.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.offline-flame.offline-f1 { width: 90px; height: 130px; opacity: .9; animation-duration: 1.4s; }
.offline-flame.offline-f2 { width: 60px; height: 100px; opacity: .95; animation-duration: 1.0s; animation-delay: .2s; left: 8px; }
.offline-flame.offline-f3 {
  width: 36px; height: 80px; opacity: 1; animation-duration: .7s; animation-delay: .05s; left: 20px;
  background: radial-gradient(ellipse at bottom, #fff8d4 0%, #ffd96b 50%, #ff8a2b 80%, transparent 100%);
}
@keyframes offline-flame {
  0%, 100% { transform: scale(1,1) skewX(0); }
  25%      { transform: scale(.92,1.08) skewX(2deg); }
  50%      { transform: scale(1.04,.96) skewX(-2deg); }
  75%      { transform: scale(.96,1.04) skewX(1deg); }
}

.offline-ember {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #ffd96b 0%, #ff8a2b 70%, transparent 100%);
  filter: blur(.5px);
  animation: offline-ember 2.4s ease-out infinite;
  opacity: 0;
}
.offline-ember.offline-e1 { left: 30%; bottom: 20px; animation-delay: .0s; --dx: -16px; }
.offline-ember.offline-e2 { left: 55%; bottom: 30px; animation-delay: .8s; --dx: 22px; }
.offline-ember.offline-e3 { left: 42%; bottom: 25px; animation-delay: 1.4s; --dx: 4px; }
.offline-ember.offline-e4 { left: 68%; bottom: 18px; animation-delay: 2.0s; --dx: -28px; }
@keyframes offline-ember {
  0%   { transform: translate(0,0) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--dx,20px),-180px) scale(.4); opacity: 0; }
}

.offline-dallah {
  position: absolute;
  right: 0;
  bottom: 30px;
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
}
.offline-steam {
  animation: offline-steam 2.5s ease-in-out infinite;
  transform-origin: 60px 24px;
}
.offline-steam2 { animation-delay: 1.2s; }
@keyframes offline-steam {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: .7; }
  100% { opacity: 0; transform: translateY(-24px); }
}

/* Scene flicker tied to fire */
.offline-scene .offline-backdrop { animation: offline-scene-flicker 3.2s ease-in-out infinite; }
@keyframes offline-scene-flicker {
  0%, 100% { filter: brightness(1); }
  35%      { filter: brightness(1.04); }
  60%      { filter: brightness(.98); }
  78%      { filter: brightness(1.03); }
}

/* ─────────── Runner overlay ─────────── */
.offline-runner-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: offline-fade-in .25s ease;
  direction: ltr;
}
@keyframes offline-fade-in { from { opacity: 0; } to { opacity: 1; } }

.offline-runner-window {
  width: min(960px, 100%);
  background: #f4dfb6;
  border-radius: 14px;
  border: 3px solid #3a1e08;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
  animation: offline-pop-in .35s cubic-bezier(.22,1.2,.36,1);
}
@keyframes offline-pop-in {
  from { transform: scale(.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.offline-runner-chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: #3a1e08;
  color: #f4d6a8;
  border-bottom: 3px solid #1a0d05;
  font-family: 'Reem Kufi', 'Tajawal', sans-serif;
}
.offline-runner-title { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.offline-runner-stats { display: flex; align-items: center; gap: 18px; font-size: 13px; color: #a08a78; }
.offline-runner-stats b { color: #f4d6a8; }
.offline-runner-x {
  appearance: none; background: transparent; border: none;
  color: #a08a78; font-size: 18px; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
}
.offline-runner-x:hover { background: rgba(255,255,255,.08); color: #f4d6a8; }

.offline-runner-stage {
  position: relative;
  height: 360px;
  background: linear-gradient(180deg, #f4d68a 0%, #e8b07a 60%, #d4986a 100%);
  overflow: hidden;
  cursor: pointer;
}
.offline-runner-floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  background:
    repeating-linear-gradient(90deg, #8a5a30 0 4px, transparent 4px 12px) 0 4px / 80px 100% repeat-x,
    linear-gradient(180deg, #c8a060 0%, #6a4020 100%);
  border-top: 2px solid #3a1e08;
}

.offline-runner-caveman {
  position: absolute;
  left: 120px;
  bottom: 30px;
  width: 90px; height: 130px;
  z-index: 5;
  transition: transform .03s linear;
}

.offline-obstacle { position: absolute; z-index: 4; }
.offline-obstacle svg { display: block; width: 100%; height: 100%; }

.offline-runner-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
  color: #f4dfb6;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  font-family: 'Aref Ruqaa', 'Tajawal', serif;
  direction: rtl;
}
.offline-msg-big { font-size: 40px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 3px 0 #3a1e08; }
.offline-msg-small { font-size: 15px; margin-top: 10px; color: #e8c890; font-family: 'Tajawal', sans-serif; font-weight: 500; }
.offline-msg-tiny { font-size: 11px; margin-top: 14px; color: #a08a78; font-family: ui-monospace, monospace; letter-spacing: .1em; direction: ltr; }

.offline-runner-foot {
  padding: 10px 16px;
  background: #3a1e08;
  color: #a08a78;
  font-size: 11px; font-family: ui-monospace, monospace; letter-spacing: .1em;
  display: flex; justify-content: space-between;
  direction: ltr;
}

/* Mobile */
@media (max-width: 900px) {
  .offline-overlay-ui { left: 5%; right: 5%; max-width: none; top: 6%; transform: none; text-align: right; }
  .offline-caveman-stage { right: 5%; bottom: 5%; gap: 0; flex-direction: column; align-items: center; }
  .offline-caveman-stage .offline-caveman-wrap { display: none; }
  .offline-stone-tablet { width: 240px; height: 170px; margin-bottom: 0; }
  .offline-display-headline { font-size: 52px; }
  .offline-fire-pit { left: 60%; transform: scale(.6); }
  .offline-runner-overlay { padding: 12px; }
  .offline-runner-stage { height: 260px; }
}

/* ====================================================================
 *  DASHBOARD MOBILE RESPONSIVENESS
 *  --------------------------------------------------------------------
 *  The dashboard's `.app` is a 248px sidebar + 1fr main grid that's
 *  hardcoded for desktop. On a 360-414px phone the sidebar eats most
 *  of the screen and the main column gets crushed (~110px wide). We
 *  fix this with two breakpoints:
 *
 *    ≤1024px  Sidebar becomes a slide-in drawer behind a backdrop
 *             overlay. A hamburger button in the topbar opens it.
 *             Click on overlay / ESC / click on a nav-item / window
 *             resize past the breakpoint all close it.
 *
 *    ≤768px   Topbar tightens: hide the topbar-sub line and the
 *             280px-wide search input (those are nice-to-haves).
 *             KPI strip drops from 3 cols to 2.
 *
 *    ≤480px   KPI strip stacks to a single column. Topbar-tools
 *             gap shrinks further so live + lang + theme + bell
 *             still fit on one line.
 *
 *  Side-effects:
 *    - z-index hierarchy (bottom → top):
 *        sidebar-overlay 70 < sidebar 80 < bot-overlay 900 < bot-panel 950
 *        < ModalShell 1000 < notifs/toast 1100-1400 < ModalShell2 9000
 *      → Anything more important than navigation will visually sit on
 *        top of the drawer if it happens to be open.
 *    - body.body-scroll-lock added by JS while the drawer's open
 *      so the underlying page doesn't scroll behind the drawer.
 *    - RTL flip handled via inset-inline-* and translateX(±100%).
 * ==================================================================== */

/* === Hamburger button — visible only on tablet/phone === */
.topbar-toggle {
  display: none; /* desktop default */
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-inline-end: 4px;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.topbar-toggle:hover { background: var(--sand); border-color: var(--ink-2); }
.topbar-toggle:active { transform: scale(0.96); }
.topbar-toggle svg { width: 20px; height: 20px; pointer-events: none; }

/* === Backdrop behind the open drawer === */
.sidebar-overlay {
  display: none; /* hidden on desktop — only injected/shown on mobile */
  position: fixed;
  inset: 0;
  background: rgba(11, 77, 52, 0.45);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  /* z-index 1500 sits above every Leaflet pane (max ~700) and our map
   * overlays (z-index 5), so the drawer always covers the map cleanly.
   * Was 70, which let high-z map controls leak through. */
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Body lock while drawer is open — prevents the underlying page from
 * scrolling when the user swipes inside the drawer. JS toggles this. */
body.body-scroll-lock {
  overflow: hidden;
  /* Preserve scroll position when the lock is removed by holding the
   * scroll height open — without this, fixing the body resets to top. */
}

/* === Generic table-overflow wrapper ===
 * Drop-in for any data table that has 5+ columns. The parent .panel
 * already has overflow:hidden for its border-radius, so we add an
 * inner scroller that takes the horizontal scroll. WebkitOverflowScrolling
 * gives smooth momentum scrolling on iOS Safari. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
 *  ≤1024px — Sidebar becomes drawer
 * ============================================ */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 280px;
    max-width: 86vw;
    /* Slide off-screen by default. The translation direction matches
     * the sidebar's physical position (start = left in LTR, right in
     * RTL) so it always slides "out" toward the screen edge it lives
     * against. */
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
                box-shadow 0.28s;
    /* z-index 1600 = sidebar-overlay (1500) + 100. Always sits above the
     * scrim that covers the rest of the page, including the live map. */
    z-index: 1600;
    /* Remove the right-border that was separating from main — drawer
     * has its own shadow when open. */
    border-right: 0;
  }
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
    border-left: 0;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.04),
      0 12px 40px -8px rgba(11, 77, 52, 0.35);
  }

  /* Brand mark is too large for an 86vw drawer — scale down. */
  .brand-mark {
    width: 130px;
    height: 130px;
    border-radius: 18px;
  }
  .brand-logo-img { flex: 0 0 130px; }

  /* Hamburger appears */
  .topbar-toggle {
    display: inline-flex;
  }

  /* The decorative palms+wave at the bottom of the sidebar gets in the
   * way at narrow widths (it's drawn at 280px viewport width). Shrink
   * it so nav items still have room. */
  .sidebar-deco {
    height: 160px;
  }

  /* Show the overlay element when explicitly opened. JS adds .open. */
  .sidebar-overlay {
    display: block;
  }
}

/* ============================================
 *  ≤768px — Topbar + KPI tighten
 * ============================================ */
@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 8px 14px;
    gap: 8px;
    flex-wrap: wrap; /* allow tools to wrap below title if needed */
  }
  .topbar-title { font-size: 15px; line-height: 1.3; }
  /* Hide the small "subtitle" line — the title alone is enough on phone */
  .topbar-sub { display: none; }
  /* Drop the 280px-wide search box. The same data is reachable from
   * each page's own filter; the topbar one is a nice-to-have, not a
   * critical control. */
  .search { display: none; }
  .topbar-tools { gap: 6px; }
  /* Live indicator pill — slightly smaller */
  .topbar-tools > div[title] { font-size: 10px; padding: 3px 8px; }
  /* Theme + notifications buttons */
  .topbar .icon-btn { width: 32px; height: 32px; }
  /* Lang toggle — slimmer */
  .lang-toggle { height: 32px; }
  .lang-toggle button { padding: 3px 8px; font-size: 11px; }

  /* KPI strip 3 cols → 2 cols */
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 14px 0;
    gap: 10px;
  }
  .kpi { padding: 10px 12px; }

  /* Tables: drop font + padding so columns fit better. The .table-wrap
   * provides horizontal scroll for the rest. */
  .table { font-size: 12px; }
  .table th { padding: 10px 12px; font-size: 10px; }
  .table td { padding: 10px 12px; }
}

/* ============================================
 *  Order-detail modal — 3-pane (timeline / map / data) layout
 *  --------------------------------------------
 *  Desktop: 320px  1fr  320px  →  unusable on anything <960px wide.
 *  Tablet/phone: stack vertically.
 *
 *  We override the inline style with !important. The map pane (1fr in
 *  desktop) needs an explicit height when stacked, otherwise its
 *  Leaflet container collapses to 0. We set min-height to give it a
 *  usable map area while still letting the parent overflow scroll.
 * ============================================ */
@media (max-width: 1024px) {
  .order-detail-body {
    grid-template-columns: 1fr !important;
    overflow: auto !important; /* the parent now scrolls vertically */
  }
  .order-detail-body > div {
    /* Strip the borderInlineEnd that visually separated panes — when
     * stacked, a bottom border reads better. */
    border-inline-end: 0 !important;
    border-bottom: 1px solid var(--line);
  }
  .order-detail-body > div:last-child {
    border-bottom: 0;
  }
  /* The middle pane is the map — give it a definite height when
   * stacked since the parent grid no longer constrains it. */
  .order-detail-body > div:nth-child(2) {
    min-height: 320px;
  }
}

/* ============================================
 *  WhatsApp 3-pane — conversations / chat / order builder
 *  --------------------------------------------
 *  Same pattern as order-detail. The two side panels are operator-
 *  facing power-user tools, so stacking them vertically on mobile
 *  is acceptable (they're still all reachable via scroll). A bigger
 *  refactor would single-pane the layout with tabs but that's out
 *  of scope for the responsive fix.
 * ============================================ */
@media (max-width: 1024px) {
  .whatsapp-3pane {
    grid-template-columns: 1fr !important;
    height: auto !important;       /* let the parent main scroll */
    overflow-y: auto;
  }
  .whatsapp-3pane > .panel {
    min-height: 360px;             /* each pane gets a usable height */
  }
}

/* ============================================
 *  Modal forms — collapse 2-col grids on phone
 *  --------------------------------------------
 *  Every Add/Edit modal renders a `<div style="display:grid;
 *  grid-template-columns:1fr 1fr">` for its form. On a 360px phone
 *  that's ~170px per column — too tight for label + input. The grids
 *  are inline-styled (React style prop), so we override with !important.
 *  Targeting the attribute selector matches React's serialization of
 *  `gridTemplateColumns: "1fr 1fr"` → `grid-template-columns: 1fr 1fr`.
 * ============================================ */
@media (max-width: 640px) {
  .modal-body div[style*="grid-template-columns"][style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Same applies to 3-col grids inside modals (a couple of inline
   * "1fr 1fr 1fr" usages exist for tighter layouts that also crush). */
  .modal-body div[style*="grid-template-columns"][style*="1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
 *  ≤480px — Stack KPI + smallest tweaks
 * ============================================ */
@media (max-width: 480px) {
  .topbar {
    padding: 8px 10px;
  }
  .topbar-title { font-size: 14px; }
  .topbar-tools { gap: 4px; }

  /* KPI single column on the smallest screens */
  .kpi-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Hide the live-indicator pill text on the tightest screens — the
   * green dot alone is enough. We use a pseudo on the parent to keep
   * the dot visible but hide the label text. */
  .topbar-tools > div[title] {
    font-size: 0; /* hides the text node */
    padding: 3px;
  }
  .topbar-tools > div[title] span {
    /* The dot stays visible because it's a span with explicit width/height */
    font-size: initial;
  }
}

/* ============================================
 *  ≤720px — Page-level responsive fixes
 *  --------------------------------------------
 *  Every list page (Drivers / Fleet / Orders / Stations / Customers /
 *  Invoices / Maintenance / Fuel) shares a common markup:
 *
 *     <div class="h-row">
 *        <div><h2>title</h2><p>sub</p></div>
 *        <div style="display:flex; gap:8">    ← actions
 *           [Filter] [Export] [+Add]
 *        </div>
 *     </div>
 *
 *  On a 360-414px phone the actions row outgrows the available width,
 *  collides with the title, and the whole section becomes unreadable.
 *  Below we let the actions wrap onto their own line and stretch each
 *  button to share the row evenly. Same trick for the inline KPI grids
 *  (`gridTemplateColumns: "repeat(4, 1fr)"`) — squeeze them to 2 cols on
 *  phones and 1 col on the smallest viewports.
 *
 *  All selectors target attributes/classes that already exist in the
 *  React markup — no JSX changes required for the 8 pages to react.
 * ============================================ */
@media (max-width: 720px) {

  /* (1) Section header: drop actions onto a second row when needed.
   *     Stretching width:100% + flex-wrap on the action container makes
   *     the buttons distribute evenly. Each button gets `flex:1` so 3
   *     equal buttons fit comfortably side-by-side.
   */
  .h-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  .h-row > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  .h-row > div:last-child .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    /* Trim padding so 3 buttons + Arabic labels still fit on a 360px screen */
    padding: 8px 10px;
    font-size: 12px;
  }

  /* (2) Inline 4/5-col KPI grids → 2 cols on phone.
   *     React inlines style={{gridTemplateColumns:"repeat(4, 1fr)"}} which
   *     CSS sees as `repeat(4` in the value. Attribute-substring selector
   *     matches both 4-col and 5-col variants used by Drivers/Reports.
   */
  .page-pad div[style*="repeat(4"],
  .page-pad div[style*="repeat(5"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  /* (3) Search row: ensure input grows + counter pill drops below if
   *     space runs out. The existing flex container has no flex-wrap,
   *     so set it here. The counter span gets a sensible whitespace.
   */
  .page-pad > div[style*="display:flex"][style*="marginBottom"][style*="alignItems"] {
    flex-wrap: wrap;
  }
  .page-pad input[type="text"],
  .page-pad input[type="search"] {
    min-width: 0;
    flex: 1 1 200px;
  }

  /* (4) Tables: tighter cells + ellipsis on long IDs/notes
   *     The .table-wrap (parent .panel > overflow:auto div) already
   *     scrolls; this just trims wasted width inside.
   */
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 10px; }
  .table td { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
  /* Driver-row sub-line ("drv_xxx · صباحي") — keep the shift label,
   * shrink the id so it doesn't wrap to two lines. */
  .table td > div > div:nth-child(2) {
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  /* (5) Live-map header chips (the "بث مباشر • الرياض" pill, [إيقاف]
   *     button, the All/Moving/Stopped tab strip, and the active-orders
   *     dropdown trigger). The map container itself already shrinks; we
   *     just let the .map-pill chips in the .map-header wrap above the
   *     map instead of overlapping it.
   */
  .map-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }
  .map-header .map-pill {
    font-size: 10px !important;
    padding: 3px 6px !important;
  }
  /* The All/Moving/Idle/Break filter tabs sit inside one .map-pill.
   * Let the buttons wrap inside that container so all 4 stay reachable
   * even when the pill itself takes the full row. */
  .map-header .map-pill > button {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }

  /* (6) Map overlays — GPS-status strip + legend.
   *     Both are absolute-positioned over the Leaflet canvas. On a 360px
   *     phone they cover most of the actual map. Promote them to flow
   *     under the map (still inside the .map-card) so the map stays
   *     visible. The legend stays compact horizontally; the GPS strip
   *     wraps if 3 cards don't fit on one row.
   */
  .map-card .map-gps-strip,
  .map-card .map-legend {
    position: static !important;
    margin: 8px 10px 0 !important;
  }
  .map-card .map-gps-strip {
    flex-wrap: wrap;
    pointer-events: auto;
  }
  .map-card .map-gps-strip .gps-card {
    min-width: 70px !important;
    flex: 1 1 90px;
    padding: 6px 8px !important;
  }
  .map-card .map-gps-strip .gps-card strong { font-size: 14px !important; }
  .map-card .map-legend {
    flex-direction: row !important;
    flex-wrap: wrap;
    padding: 8px 10px !important;
    font-size: 10px !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
  .map-card .map-legend .legend-row {
    gap: 5px !important;
  }
}

/* ============================================
 *  ≤480px — Smallest phones (single-column everything)
 * ============================================ */
@media (max-width: 480px) {

  /* KPI grids collapse to a single column — 2 cols become unreadable
   * once the card padding eats most of the width. */
  .page-pad div[style*="repeat(4"],
  .page-pad div[style*="repeat(5"],
  .page-pad div[style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Section title row: scale the heading slightly so it doesn't dominate
   * the viewport. */
  .h-row h2 { font-size: 16px; }
  .h-row p { font-size: 11px; }

  /* Action buttons: keep them readable but smaller. The flex:1 from the
   * 720px block already makes them share the row evenly. */
  .h-row > div:last-child .btn {
    padding: 7px 8px;
    font-size: 11px;
    gap: 4px;
  }

  /* Hide button icons under 360px to give the Arabic label more room.
   * (svg is the icon; first-of-type targets only the leading icon, keeping
   * any trailing arrows intact.) */
  .h-row > div:last-child .btn > svg:first-of-type {
    width: 12px;
    height: 12px;
  }

  /* Tables: hide the long sub-line entirely on the tightest screens —
   * the row is still clickable to open the edit modal which shows full
   * details. */
  .table td > div > div:nth-child(2) {
    display: none;
  }
}


