/*
 * The dashboard's styles: plain CSS, served by Propshaft as written, with no build step.
 * The layouts link every file in this directory (stylesheet_link_tag :app), in no promised
 * order, so the order of the cascade is set by layers instead: every file starts with the
 * @layer line below and puts its rules in one of the layers. A later layer wins over an earlier
 * one whatever the selectors are.
 *
 *   tokens      colours, type and spacing as custom properties, light and dark  (this file)
 *   base        what a bare element looks like: text, fields, buttons, tables   (base.css)
 *   layout      the page shells: dashboard, back office, focused                (layout.css)
 *   components  pieces a screen is made of: card, badge, steps, flash           (components.css)
 *   screens     what only one screen needs; a file per screen, such as builder.css
 *
 * docs/DASHBOARD.md describes how a screen is put together from these.
 */
@layer tokens, base, layout, components, screens;

@layer tokens {
  :root {
    color-scheme: light dark;

    /* Surfaces and text. */
    --paper: #f5f4f0;
    --surface: #ffffff;
    --sunken: #ebe9e3;
    --ink: #1b1a17;
    --ink-soft: #57534b;
    --line: #dad6cc;
    --line-strong: #8c877a;

    /* The accent: actions, links, the current page. */
    --accent: #0d5c50;
    --accent-strong: #083f37;
    --accent-ink: #ffffff;
    --accent-soft: #dcefea;
    --focus: #1668d6;

    /* States: fine, needs attention, wrong. Text on its soft background. */
    --ok: #17512b;
    --ok-soft: #dcf0e1;
    --warn: #6a4500;
    --warn-soft: #fbeac3;
    --danger: #8d2015;
    --danger-soft: #f9dfdb;

    /* The back office's bar, so nobody mistakes it for a merchant's dashboard. */
    --staff: #4a2f00;
    --staff-ink: #ffe9b3;
    --staff-edge: #e0a020;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --text-sm: 0.875rem;
    --text-xs: 0.75rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    --radius: 0.5rem;
    --radius-lg: 0.875rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #131311;
      --surface: #1c1c19;
      --sunken: #272723;
      --ink: #edebe5;
      --ink-soft: #aba79d;
      --line: #35342f;
      --line-strong: #7a776d;

      --accent: #62cdb8;
      --accent-strong: #8fe0d0;
      --accent-ink: #062923;
      --accent-soft: #12332d;
      --focus: #8ab8ff;

      --ok: #9bdcae;
      --ok-soft: #15301f;
      --warn: #f0cd7a;
      --warn-soft: #382a06;
      --danger: #f4a89e;
      --danger-soft: #401a15;

      --staff: #f0c060;
      --staff-ink: #2b1c00;
      --staff-edge: #8a5a00;
    }
  }
}
