/* ==========================================================================
   tokens.css — NewPOS design tokens
   Source of truth: docs/redesign/DESIGN-SPEC.md §1 and the inline style
   objects of docs/redesign/design-source/*.dc.html. Nothing in the app may
   invent a colour, radius or shadow that is not here.
   ========================================================================== */

:root {
  /* ---- colour ---------------------------------------------------------- */
  --np-ink: #16130F;              /* text, top bar, primary action           */
  --np-ink-hover: #2A241C;
  --np-ink-press: #000000;
  --np-cream: #F7F1E8;            /* page background; text on ink            */
  --np-surface: #FFFFFF;          /* cards, rows, sheets, rail               */
  --np-surface-alt: #FCF9F4;      /* cart column, table headers, save bars   */
  --np-soft: #F1EBE0;             /* soft fills, segmented track, qty badge  */
  --np-line: #E4DCCD;             /* borders, separators                     */
  --np-line-input: #E0D8C8;       /* input / secondary button border         */
  --np-divider: #F0EAE0;          /* hairline inside a card                  */
  --np-mid: #6B6255;              /* secondary text            5.4:1 on cream */
  /* DESIGN-SPEC §1.1 gives #9A9081 for labels. On cream that is 2.8:1 — below
     the AA 4.5:1 the acceptance contract asks for (inventory Q3), and these are
     the smallest texts in the interface (10-12.5 px eyebrows, counts, badges).
     The token is darkened to the first value in the same warm-grey family that
     clears AA on BOTH cream and white; the original stays available for purely
     decorative fills. See DECISIONS.md D-24. */
  --np-dim: #74695A;              /* labels, placeholders      4.8:1 on cream */
  --np-dim-decor: #9A9081;        /* the spec value, non-text use only        */
  --np-muted-line: #C9C0AF;       /* dashed empty state, scrollbar thumb     */
  --np-muted-line-2: #CFC7B8;     /* PIN dot border, dashed square           */

  --np-lav: #7C6CD1;              /* selection, focus, discount              */
  /* White text on --np-lav is 4.3:1 — just under AA for the 11.5 px role
     badge. This is the same hue, dark enough to clear it (5.1:1). */
  --np-lav-strong: #6E5EC6;
  --np-lav-soft: #EDE7FA;
  --np-lav-hover: #E2DAF7;
  --np-lav-ink: #4A3C93;

  --np-red: #B3352F;              /* destructive, signature marker           */
  --np-red-soft: #FDF2F1;
  --np-red-line: #F0D6D4;
  --np-red-line-hover: #E8BFBC;

  --np-green: #1E6B52;            /* envoyé, positive balance                */
  --np-green-soft: #DCF0E6;

  --np-amber: #B5791A;            /* to-go, network warning                  */
  --np-amber-soft: #FBEAD2;
  --np-amber-ink: #8A5A12;
  --np-amber-line: #E8CFA4;
  --np-amber-banner-ink: #6B4A12;

  --np-waiter-soft: #E4F1E5;      /* waiter avatar / role badge              */
  --np-waiter-ink: #2E6B39;
  --np-waiter-badge: #3FA34D;     /* decorative fill (no text on it)          */
  --np-waiter-badge-text: #2E7D39;/* the same green, AA with white text        */
  --np-amber-badge-text: #8A5A12; /* ditto for the vendor / cashier badge      */

  /* disabled surfaces */
  --np-disabled-bg: #DDD5C6;
  --np-disabled-ink: #C9C0AF;
  --np-disabled-line: #EFE9DF;
  --np-locked-line: #EAE3D6;

  /* on the ink top bar */
  --np-onink-1: #D8CFC0;
  --np-onink-2: #B9AE9C;
  --np-onink-fill: rgba(247, 241, 232, 0.12);
  --np-onink-fill-soft: rgba(247, 241, 232, 0.08);
  --np-onink-border: rgba(247, 241, 232, 0.22);
  --np-onink-sep: rgba(247, 241, 232, 0.15);

  /* network pill */
  --np-net-ok-bg: rgba(143, 211, 180, 0.18);
  --np-net-ok-ink: #9FDCC1;
  --np-net-ok-dot: #8FD3B4;
  --np-net-off-bg: rgba(224, 163, 60, 0.22);
  --np-net-off-ink: #E8C07A;
  --np-net-off-dot: #E0A33C;

  /* default zone (floor) palette — the real colour comes from floors.color */
  --np-zone-1: #E08A24;
  --np-zone-2: #2277E0;
  --np-zone-3: #3FA34D;
  --np-zone-4: #16130F;
  --np-zone-5: #6A2FD0;
  --np-zone-6: #9AA0A6;

  /* ---- typography ------------------------------------------------------ */
  --np-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --np-font-title: Georgia, "Times New Roman", serif;
  --np-font-mono: "Courier New", monospace;

  --np-fs-display: 38px;   /* cart total                                    */
  --np-fs-kpi: 34px;
  --np-fs-cart-total: 26px;
  --np-fs-page-title: 22px;
  --np-fs-sheet-title: 19px;
  --np-fs-price: 19px;
  --np-fs-product: 15.5px;
  --np-fs-body: 14px;
  --np-fs-line: 14px;
  --np-fs-secondary: 12.5px;
  --np-fs-label: 11px;
  --np-fs-badge: 11px;

  /* ---- spacing (4-px grid) --------------------------------------------- */
  --np-s1: 4px;
  --np-s2: 8px;
  --np-s3: 12px;
  --np-s4: 16px;
  --np-s6: 24px;
  --np-s8: 32px;

  /* ---- radii ----------------------------------------------------------- */
  --np-r-badge: 7px;
  --np-r-xs: 8px;
  --np-r-sm: 9px;
  --np-r-btn: 10px;
  --np-r-input: 11px;
  --np-r-line: 12px;
  --np-r-card: 13px;
  --np-r-panel: 14px;
  --np-r-sheet: 18px;
  --np-r-pill: 999px;

  /* ---- elevation ------------------------------------------------------- */
  --np-sh-card: 0 1px 2px rgba(22, 19, 15, 0.05);
  --np-sh-btn: 0 1px 2px rgba(22, 19, 15, 0.12);
  --np-sh-seg: 0 1px 3px rgba(22, 19, 15, 0.12);
  --np-sh-ring: 0 0 0 3px rgba(124, 108, 209, 0.16);
  /* The keyboard-focus ring is the ONLY cue a Tab user gets, so it has to
     clear the 3:1 non-text minimum on every surface it can land on. At 40 %
     alpha it blended to ~1.6:1 on cream and was, in practice, invisible
     (F038) — measured 1.69:1 on the ink top bar. Solid --np-lav clears the bar
     on every surface it can land on: 3.80:1 on cream, 4.27:1 on white, 4.34:1
     on the ink top bar, 3.49:1 on --np-lav-soft. The 1 px cream halo keeps the
     ring readable when the focused control is itself lavender. */
  --np-sh-focus: 0 0 0 1px var(--np-cream), 0 0 0 4px var(--np-lav);
  --np-sh-sheet-side: 10px 0 34px rgba(22, 19, 15, 0.13);
  --np-sh-sheet-side-end: -10px 0 34px rgba(22, 19, 15, 0.13);
  --np-sh-sheet-bottom: 0 -12px 34px rgba(22, 19, 15, 0.22);
  --np-sh-cart-sheet: 0 -10px 30px rgba(22, 19, 15, 0.15);
  --np-sh-drawer: 10px 0 34px rgba(22, 19, 15, 0.18);
  /* Mirrored drawer shadow for dir="rtl": the drawer slides in from the right
     there, so the shadow has to fall to its left (F010) — the same pair the
     side sheets already have. */
  --np-sh-drawer-end: -10px 0 34px rgba(22, 19, 15, 0.18);
  --np-sh-toast: 0 10px 24px rgba(22, 19, 15, 0.24);

  --np-backdrop: rgba(22, 19, 15, 0.32);
  --np-backdrop-drawer: rgba(22, 19, 15, 0.42);

  /* ---- geometry -------------------------------------------------------- */
  --np-topbar-h: 56px;
  --np-rail-w: 78px;
  --np-catrail-w: 186px;
  --np-cart-w: 348px;           /* PC 1366; overridden per breakpoint       */
  --np-drawer-w: 290px;
  --np-sheet-w: 420px;          /* admin side sheet on PC                   */
  --np-settings-nav-w: 240px;
  --np-menu-pane-w: 320px;
  --np-donut-pane-w: 300px;

  /* ---- touch target ---------------------------------------------------- */
  /* 40 px at the PC counter (mouse + touchscreen), 48 px on glass. */
  --np-touch: 40px;
  --np-grid-cols: 3;
}

/* Tablet landscape ---------------------------------------------------------*/
@media (max-width: 1279px) {
  :root {
    --np-touch: 48px;
    --np-cart-w: 316px;
    --np-sheet-w: 380px;
    --np-settings-nav-w: 220px;
    --np-menu-pane-w: 280px;
    --np-donut-pane-w: 270px;
  }
}

/* Tablet portrait and phone ------------------------------------------------*/
@media (max-width: 899px) {
  :root { --np-touch: 48px; }
}

/* Phone --------------------------------------------------------------------*/
@media (max-width: 599px) {
  :root {
    --np-fs-product: 14px;
    --np-fs-price: 17px;
    --np-drawer-w: 250px;
    --np-grid-cols: 2;
  }
}

/* Wide desktop -------------------------------------------------------------*/
@media (min-width: 1800px) {
  :root {
    --np-cart-w: 420px;
    --np-grid-cols: 4;
  }
}
