/* ============================================
   BAGlobal — Mobile-first agent workspace
   Faithful port of the design's styles.css
   ============================================ */

:root {
  /* Surface */
  --ink: oklch(0.22 0.03 250);
  --ink-2: oklch(0.34 0.025 250);
  --ink-3: oklch(0.50 0.02 250);
  --ink-4: oklch(0.66 0.015 250);
  --line: oklch(0.90 0.008 250);
  --line-2: oklch(0.94 0.005 250);
  --paper: oklch(0.985 0.004 90);
  --paper-2: oklch(0.965 0.006 90);
  --surface: #ffffff;
  --tint: oklch(0.96 0.012 200);

  /* Brand — Ocean & Coral */
  --brand: oklch(0.55 0.12 215);
  --brand-ink: oklch(0.30 0.10 215);
  --brand-tint: oklch(0.95 0.025 215);
  --accent: oklch(0.71 0.18 35);
  --accent-tint: oklch(0.96 0.04 35);

  /* Semantic */
  --good: oklch(0.62 0.13 155);
  --good-tint: oklch(0.95 0.03 155);
  --warn: oklch(0.78 0.15 80);
  --warn-tint: oklch(0.96 0.04 80);
  --danger: oklch(0.60 0.20 25);
  --danger-tint: oklch(0.96 0.04 25);
  --info: oklch(0.60 0.12 245);
  --info-tint: oklch(0.96 0.03 245);

  /* Type */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-he: 'Heebo', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px oklch(0.22 0.03 250 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.22 0.03 250 / 0.08);
  --shadow-lg: 0 16px 40px oklch(0.22 0.03 250 / 0.12);

  /* Drawer direction */
  --drawer-hide: translateX(-100%);
}
[dir="rtl"] { --drawer-hide: translateX(100%); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[dir="rtl"] body { font-family: var(--font-he); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

/* Utility */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.mono { font-family: var(--font-mono); font-feature-settings: "ss02"; }
.fill { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.tiny { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); }
.spacer { flex: 1; }
.tr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ============================================
   App shell — truly responsive, mobile-first

   Mobile  (< 720px):  full viewport, statusbar+appbar+scroll+tabbar
   Tablet  (720–959):  full viewport, content max-width-centered, still tab bar
   Desktop (>= 960):   sidebar + workspace, no tab bar, no hamburger
   ============================================ */
#stage, .shell {
  min-height: 100vh;
  background: var(--paper);
}
.device {
  width: 100%;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* The fake mobile status bar is a design-preview artifact.
   Real phones provide their own; real desktops don't need one.
   We only show it on the smallest viewports as a stylistic accent. */
.statusbar { display: none; }

/* App container fills the device */
.app {
  position: static;
  inset: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* Desktop sidebar styles live in the responsive block further down
   (search for ".desktop-side .ds-item"). Mobile-default keeps it hidden. */

/* Status bar */
.statusbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  position: relative;
  z-index: 5;
}
.statusbar.dark { color: var(--paper); }
.statusbar-right { display: flex; align-items: center; gap: 6px; }
.statusbar-right svg { display: block; }

/* App viewport */
.app {
  position: absolute;
  inset: 44px 0 0 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

/* Top app bar */
.appbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.appbar .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.appbar .sub { font-size: 12px; color: var(--ink-3); }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--ink);
  background: transparent;
  transition: background .15s;
  flex-shrink: 0;
  position: relative;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn.tint { background: var(--brand-tint); color: var(--brand-ink); }
.icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  inset-inline-end: 8px;
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--accent);
  border: 2px solid var(--paper);
}

/* Scroll surface */
.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  scroll-behavior: smooth;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* Bottom tab bar — hidden on mobile (footer buttons removed) and desktop. */
.tabbar {
  display: none;
  align-items: stretch;
  justify-content: space-around;
  background: oklch(1 0 0 / 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 14px) + 6px);
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  position: relative;
  text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--brand-ink); }
.tabbar a[aria-current="page"]:not(.primary)::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 18%;
  height: 2.5px;
  background: var(--brand);
  border-radius: 0 0 4px 4px;
}
.tabbar a.primary .fab {
  width: 46px; height: 46px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px oklch(0.22 0.03 250 / 0.30);
  margin-top: -14px;
}

/* Floating action button (used by some screens) */
.fab-floating {
  position: absolute;
  inset-inline-end: 18px;
  bottom: 80px;
  width: 56px; height: 56px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  box-shadow: 0 12px 30px oklch(0.22 0.03 250 / 0.30);
  z-index: 5;
}

/* Pinned action bar at the bottom of a scrolling view (used on registration / auth flows). */
.sticky-bottom {
  position: sticky;
  bottom: 0;
  background: oklch(1 0 0 / 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0) + 14px);
  margin-top: 8px;
}

/* === Card ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card.flat { border: 1px solid var(--line-2); }
.card.warm { background: oklch(0.985 0.012 50); }
.card.pad { padding: 16px; }

/* === Hero ============================================ */
.hero {
  padding: 22px 22px 28px;
  background:
    radial-gradient(700px 220px at -10% -10%, oklch(0.94 0.08 215 / 0.7), transparent 50%),
    linear-gradient(170deg, var(--brand-ink) 0%, oklch(0.20 0.04 250) 100%);
  color: var(--paper);
}

.hero-alert {
  background: oklch(1 0 0 / 0.08);
  border: 1px solid oklch(1 0 0 / 0.12);
  padding: 14px;
  color: white;
  border-radius: 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-alert .icon-tile {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* === Buttons ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  background: var(--ink);
  color: var(--paper);
  transition: transform .08s, opacity .15s, background .15s;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.brand { background: var(--brand-ink); }
.btn.accent { background: var(--accent); color: white; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.tint { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 54px; padding: 0 24px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }

/* === Inputs ========================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.input {
  height: 52px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 16px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input::placeholder { color: var(--ink-4); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.input.with-icon { padding-inline-start: 44px; }
textarea.input { height: auto; padding: 14px 16px; resize: vertical; min-height: 80px; }
select.input { padding-inline-end: 36px; appearance: none; }
.input-wrap { position: relative; width: 100%; }
.input-wrap > .icon {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 14px;
  display: flex;
  align-items: center;
  color: var(--ink-3);
}

/* === Pills / chips =================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.tint { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.chip.good { background: var(--good-tint); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-tint); color: oklch(0.42 0.12 60); border-color: transparent; }
.chip.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.chip.info { background: var(--info-tint); color: var(--info); border-color: transparent; }
.chip.accent { background: var(--accent-tint); color: oklch(0.45 0.15 35); border-color: transparent; }

/* === Lists =========================================== */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--paper-2); }

/* === KPI ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 14px 4px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  justify-content: space-between;
}
.kpi .label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.25;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi .delta { font-size: 11px; color: var(--good); font-weight: 600; }
.kpi .delta.down { color: var(--danger); }
.kpi .row-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }

/* === Avatar ========================================== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }

/* === Section header ================================== */
.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 18px 8px;
}
.section-h h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}
.section-h a { font-size: 13px; font-weight: 600; color: var(--brand-ink); cursor: pointer; }

/* === Logo ============================================ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--ink);
}
.logo .mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, oklch(0.85 0.16 80), transparent 60%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.2);
  flex-shrink: 0;
}
.logo .mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid white;
  border-top-color: transparent;
  border-right-color: transparent;
  opacity: 0.85;
}

/* Progress bar */
.bar {
  height: 6px;
  background: var(--line-2);
  border-radius: 99px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 99px;
}

/* Image placeholder */
.placeholder-img {
  background:
    repeating-linear-gradient(45deg, oklch(0.92 0.01 250) 0 12px, oklch(0.95 0.01 250) 12px 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* Sparkline svg helpers */
.spark-line { stroke: var(--brand); stroke-width: 2; fill: none; }
.spark-area { fill: var(--brand-tint); opacity: 0.6; }

/* === Mobile menu drawer ============================== */
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: oklch(0.22 0.03 250 / 0.50);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  z-index: 9;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 84%;
  max-width: 330px;
  background: var(--paper);
  box-shadow: 0 0 60px oklch(0 0 0 / 0.25);
  transform: var(--drawer-hide);
  transition: transform .28s cubic-bezier(.32,.72,.32,1);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 36px 20px 18px;
  background: linear-gradient(165deg, var(--brand-ink) 0%, oklch(0.20 0.04 250) 100%);
  color: white;
  position: relative;
}
.drawer-head .close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  color: white;
  background: oklch(1 0 0 / 0.1);
}
.tenant-card {
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: oklch(1 0 0 / 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid oklch(1 0 0 / 0.1);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.drawer-group { padding: 4px 0; }
.drawer-group > .tiny { padding: 12px 20px 6px; font-size: 10px; }
.drawer-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  position: relative;
  text-decoration: none;
}
.drawer-item:hover { background: var(--paper-2); }
.drawer-item.active { background: var(--brand-tint); color: var(--brand-ink); }
.drawer-item.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 4px;
  background: var(--brand);
}
.drawer-item .di-icon { color: var(--ink-3); flex-shrink: 0; }
.drawer-item.active .di-icon { color: var(--brand-ink); }
.drawer-item .di-label { font-size: 14px; font-weight: 600; }
.drawer-item .di-sub { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.drawer-foot { padding: 12px 18px 18px; border-top: 1px solid var(--line-2); }

/* Hotel/product card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 12px;
}
.product-card .hero-img { width: 100%; height: 160px; object-fit: cover; display: block; background: var(--paper-2); }
.product-card .body { padding: 14px 16px; }

/* Compare two cells */
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Pill stat */
.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--ink-2);
}

/* ============================================
   Responsive: desktop sidebar layout
   Mobile-first defaults above keep working below the breakpoint.
   At >= 900px we replace the phone preview with a real
   sidebar + workspace layout that fills the viewport.
   ============================================ */

/* Desktop sidebar — hidden on mobile by default */
.desktop-side { display: none; }

.scroll-inner {
  /* On mobile this is just a passthrough container */
  width: 100%;
}

@media (min-width: 900px) {
  /* Shell becomes the sidebar+workspace layout */
  body {
    background: oklch(0.97 0.005 250);
  }
  .shell {
    min-height: 100vh;
    height: 100vh;
    padding: 0;
    background: transparent;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    place-items: stretch;
  }

  /* Phone frame goes away — the device fills remaining width */
  .device {
    --device-w: auto;
    --device-h: auto;
    width: auto;
    height: 100vh;
    flex: 1;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
    background: oklch(0.97 0.005 250);
    overflow: hidden;
  }

  /* Status bar is a mobile preview only — hidden on desktop */
  .statusbar { display: none !important; }

  /* App sits flush at the top now (no status bar offset) */
  .app { inset: 0; }

  /* Desktop sidebar: 240px dark column on the inline-start */
  .desktop-side {
    display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    background: oklch(0.22 0.03 250);
    color: oklch(0.94 0.005 250);
    padding: 18px 14px;
    gap: 2px;
    overflow-y: auto;
    height: 100vh;
  }
  .desktop-side .ds-group {
    padding: 16px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: oklch(0.65 0.02 250);
  }
  .desktop-side .ds-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: oklch(0.82 0.01 250);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
  }
  .desktop-side .ds-item:hover { background: oklch(0.28 0.03 250); color: white; }
  .desktop-side .ds-item[aria-current="page"] {
    background: oklch(1 0 0 / 0.08);
    color: white;
  }
  .desktop-side .ds-item[aria-current="page"]::before {
    content: "";
    width: 3px; height: 18px;
    background: var(--accent);
    border-radius: 4px;
    margin-inline-end: -8px;
    margin-inline-start: -8px;
    flex-shrink: 0;
  }
  .desktop-side .ds-label { flex: 1; min-width: 0; }
  .desktop-side .ds-badge {
    font-size: 10px;
    padding: 0 6px;
    height: 18px;
    border-radius: 99px;
    background: oklch(1 0 0 / 0.1);
    color: white;
    display: inline-flex;
    align-items: center;
    font-weight: 700;
  }
  .desktop-side .ds-user {
    margin: 6px 4px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: oklch(1 0 0 / 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* ===== Sidebar collapse toggle ===== */
  .desktop-side {
    position: relative;
    transition: width .25s cubic-bezier(.32,.72,.32,1), padding .25s;
  }
  .side-toggle {
    position: absolute;
    top: 22px;
    inset-inline-end: -12px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 0 2px 6px oklch(0 0 0 / 0.18);
    display: grid; place-items: center;
    cursor: pointer;
    z-index: 5;
    transition: transform .25s;
  }
  .side-toggle:hover { background: white; }
  .side-collapse-toggle:checked ~ .desktop-side .side-toggle { transform: rotate(180deg); }
  [dir="rtl"] .side-toggle { transform: rotate(180deg); }
  [dir="rtl"] .side-collapse-toggle:checked ~ .desktop-side .side-toggle { transform: rotate(0deg); }

  /* Collapsed state — icon rail */
  .side-collapse-toggle:checked ~ .desktop-side {
    width: 68px;
    padding: 18px 10px;
  }
  .side-collapse-toggle:checked ~ .desktop-side .ds-logo-text,
  .side-collapse-toggle:checked ~ .desktop-side .ds-group,
  .side-collapse-toggle:checked ~ .desktop-side .ds-label,
  .side-collapse-toggle:checked ~ .desktop-side .ds-badge,
  .side-collapse-toggle:checked ~ .desktop-side .ds-user .fill,
  .side-collapse-toggle:checked ~ .desktop-side .ds-user > a {
    display: none;
  }
  .side-collapse-toggle:checked ~ .desktop-side .ds-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
  }
  .side-collapse-toggle:checked ~ .desktop-side .ds-item[aria-current="page"]::before {
    display: none;
  }
  .side-collapse-toggle:checked ~ .desktop-side .ds-item[aria-current="page"] {
    background: var(--brand);
    color: white;
  }
  .side-collapse-toggle:checked ~ .desktop-side .logo {
    justify-content: center;
    margin: 6px 0 14px !important;
  }
  .side-collapse-toggle:checked ~ .desktop-side .ds-user {
    justify-content: center;
    padding: 8px;
  }
  /* Hover tooltip when collapsed (shows the label as a popover) */
  .side-collapse-toggle:checked ~ .desktop-side .ds-item:hover::after {
    content: attr(data-label);
    position: absolute;
    inset-inline-start: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 4px 12px oklch(0 0 0 / 0.2);
  }

  /* Appbar becomes the desktop work bar */
  .appbar {
    padding: 14px 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    min-height: 64px;
    gap: 14px;
  }
  .appbar .title { font-size: 22px; }
  .appbar .sub { font-size: 13px; }
  /* Hide the hamburger menu button on desktop — sidebar replaces it */
  .appbar > a.icon-btn:first-child { display: none; }

  /* Hide the bottom tab bar and floating FAB — sidebar replaces them */
  .tabbar { display: none !important; }
  .fab-floating { display: none !important; }
  /* Tab bar is hidden on desktop, so drop the reserved bottom padding */
  .scroll { padding-bottom: 0; }

  /* Constrain content width so it reads well on wide screens */
  .scroll-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 28px 60px;
  }

  /* Dashboard hero / KPI grid feel more like a desktop dashboard */
  .scroll-inner > .hero {
    border-radius: var(--r-lg);
    padding: 28px 32px 30px;
  }
  .scroll-inner > .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 18px 0 8px;
    gap: 14px;
  }
  .kpi { min-height: 110px; padding: 16px 18px; }
  .kpi .value { font-size: 30px; }

  /* Section headers + cards align with the wider content */
  .scroll-inner > .section-h { padding: 18px 4px 8px; }
  .scroll-inner > div[style*="padding:0 14px"] { padding: 0 !important; }
  .scroll-inner > div[style*="padding: 0 14px"] { padding: 0 !important; }
  .scroll-inner > div[style*="padding:14px"] { padding: 0 0 14px !important; }
  .scroll-inner > div[style*="padding: 14px"] { padding: 0 0 14px !important; }

  /* Auth pages: keep the phone-like form column readable on desktop */
  .app .col[style*="padding:0 18px 18px"],
  .app .col[style*="padding: 0 18px 18px"] {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  /* RTL: sidebar naturally floats to the right because of flex+rtl direction */

  .drawer-scrim, .drawer { display: none !important; }
}

/* Wider desktop: more breathing room */
@media (min-width: 1280px) {
  .scroll-inner { max-width: 1320px; padding: 24px 36px 80px; }
}

