/* Shared dark workspace backdrop. Artwork stays behind opaque working surfaces. */
:root {
  --astrid-backdrop-art: url('/assets/sales/red-nebula.webp');
  --astrid-backdrop-shade: radial-gradient(ellipse at 82% 0%, rgb(5 5 5 / 18%) 0%, rgb(5 5 5 / 52%) 42%, rgb(5 5 5 / 82%) 100%);
}

:root[data-theme="dark"] body,
body.quote-v3-standalone {
  --page-bg: #080808;
  --sidebar-bg: #090909;
  --panel: rgba(11, 11, 11, .96);
  --panel-strong: rgba(10, 10, 10, .98);
  --soft: #191919;
  --input-bg: #141414;
  --line: #2c2c2c;
  --muted: #b5b5b5;
  --card: rgba(11, 11, 11, .96);
  --input: #141414;
  background-color: var(--page-bg);
  background-image: var(--astrid-backdrop-shade), var(--astrid-backdrop-art);
  background-position: right top;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

:root[data-theme="dark"] :is(.main, #salesView, #inventoryView, #explorerView, .auth-shell) {
  background: transparent;
}

/* Navigation keeps its quieter, solid black foundation. */
:root[data-theme="dark"] .sidebar {
  --panel: #111111;
  --panel-strong: #0d0d0d;
  --soft: #191919;
  --input-bg: #111111;
  --line: #292929;
  --muted: #aeaeae;
  --card: #111111;
  --input: #111111;
}

/* Feature-owned tokens continue to control their dense tables and controls. */
:root[data-theme="dark"] #inventoryView {
  --iv-bg: var(--page-bg);
  --iv-surface: var(--panel);
  --iv-raised: var(--soft);
  --iv-line: var(--line);
}
:root[data-theme="dark"] #explorerView {
  --cat-bg: var(--page-bg);
  --cat-surface: var(--panel);
  --cat-raised: var(--soft);
  --cat-line: var(--line);
}

/* Authentication keeps the same artwork with a quieter exposure. */
:root[data-theme="dark"] body:has(.auth-shell) {
  --astrid-backdrop-shade: linear-gradient(110deg, #050505c9, #05050570);
}
:root[data-theme="dark"] .auth-shell::before,
:root[data-theme="dark"] .auth-shell::after { content: none; }

@media (max-width: 800px) {
  :root[data-theme="dark"] body,
  body.quote-v3-standalone {
    background-size: auto 100dvh;
    background-position: 75% top;
    background-attachment: scroll;
  }
}

@media print, (forced-colors: active) {
  :root[data-theme="dark"] body,
  body.quote-v3-standalone { background-image: none; }
}
