/* tokens.css — Design Tokens. Source of truth = the LIVE machine.
 *
 * These starter values are common DSM/DSM-Enterprise tokens. After the first
 * page, run scripts/extract-tokens.mjs and CURATE its observed-*.css output into
 * this file (cross-reference Figma get_variable_defs for the semantic names).
 *
 * Naming mirrors Synology's own variable language (tier1/tier2…) so it matches
 * how the design system is documented.
 */
:root {
  /* ——— Brand / accent ——— */
  --main-tier1: #057FEB;            /* primary blue (buttons, selected, links) */
  /* Live v-btn-blue / v-btn-main hover+active, re-measured on pas80 2026-08-20
   * (qa/buttons.pas80.json, 5 primary buttons across Global Settings, Login
   * Portal, Notification, External Access, Security — all five agree).
   * --main-tier1-hover WAS #0571D4, a value with no provenance anywhere in the
   * repo; every page that had actually measured a live primary (SAN iSCSI, SAN
   * Host Group, CAM Failover, .tb-btn-primary) had already overridden it back to
   * #0075DB page-side. The border is NOT the fill: live darkens the rim one
   * further step in both states, which the replica never reproduced. */
  --main-tier1-hover: #0075DB;             /* live rgb(0, 117, 219) */
  --main-tier1-hover-border: #0062B8;      /* live rgb(0, 98, 184)  */
  --main-tier1-active-border: #005299;     /* live rgb(0, 82, 153)  */

  /* ——— Danger / destructive button (live syno-ux-button-red) ————————————
   * Measured on pas80 2026-08-20 WITHOUT clicking anything destructive: the
   * "Erase All Data" button in Control Panel > Update & Restore > System Reset
   * is merely DISPLAYED there, so navigating the tab (which the read-only guard
   * explicitly allows) and forcing the pseudo-classes through CDP reads all four
   * states while the button is never pressed. Same ladder shape as the blue
   * primary: the rim darkens a step past the fill in both hover and active, and
   * focus computes identical to rest. The base also matches live's own token
   * (--v-color-red / --v-color-error = #E64040), which the repo had been using
   * unattributed all along; the hover was NOT right — it read #CF3A3A. */
  --red-tier1: #E64040;                    /* live rgb(230, 64, 64) = --v-color-red / --v-color-error.
                                              NOT button-only: the same red paints error text, invalid
                                              field borders and status dots. ⚠ distinct from the older
                                              --status-error #E8462E below, which does NOT match live. */
  --danger-hover: #D12E2E;                 /* live rgb(209, 46, 46) */
  --danger-hover-border: #A81B1B;          /* live rgb(168, 27, 27) */
  --danger-active: #BD1E1E;                /* live rgb(189, 30, 30) */
  --danger-active-border: #991818;         /* live rgb(153, 24, 24) */
  --main-tier1-dark: #006DCC;       /* primary blue one step darker — link:hover, v-btn PRESSED fill, th .head-cell:active (live rgb(0, 109, 204), confirmed pas80 2026-08-20) */
  --main-light: rgba(5, 127, 235, 0.1); /* selected module item background (live) */
  --main-hover: rgba(5, 127, 235, 0.04); /* module item hover background (live, probed) */
  --row-selected: #EBF4FD;          /* selected table row */
  --note-teal: #00A6A6;
  --note-teal-disabled: rgba(0, 166, 166, 0.45);

  /* ——— Text ——— */
  --font-grey-tier1: #414B55;       /* primary text */
  --font-grey-tier2: rgba(65, 75, 85, 0.6); /* secondary / table headers */
  --font-grey-tier3: rgba(65, 75, 85, 0.4); /* placeholder / disabled */
  --font-white-tier1: #FFFFFF;

  /* ——— Surfaces ——— */
  --white: #FFFFFF;
  --bg-content: #F4F8FA;            /* app content background */
  --bg-overview: #F4F8FA;

  /* ——— Icon ——— */
  --icon-dark-grey-tier1: #505A64;

  /* ——— Borders / dividers ——— */
  --border-tier2: rgba(198, 212, 224, 0.4);
  --border-tier3: rgba(198, 212, 224, 0.7);
  --border-control: rgba(198, 212, 224, 0.75);
  --border-control-hover: rgba(198, 212, 224, 1);
  --border-transparent: rgba(198, 212, 224, 0);
  --border-quaternary: rgba(0, 0, 0, 0.08);
  /* ——— Grey text button (live v-btn-grey / syno-ux-button) ————————————————
   * THE one grey for every text button on the site — toolbar, in-content,
   * dialog footer, settings footbar, rect (3px) or pill (100px). Re-measured on
   * pas80 2026-08-20 (qa/buttons.pas80.json): 30 enabled + 21 disabled grey
   * buttons across 16 live screens, and every single one reports these exact
   * four states. Vue `v-btn-grey` and ExtJS `syno-ux-button` (Log Center) are
   * IDENTICAL here — only their radius differs — so there is one group, not two.
   *
   *   rest    bg .4   border rgba(198,212,224,0)     (transparent, reserves 1px)
   *   hover   bg .4   border rgba(124,138,152,.4)    ← ONLY the border moves
   *   active  bg .6   border rgba(124,138,152,.5)    ← the fill darkens here
   *   focus   = rest, and live paints NO focus ring
   *   disabled = rest in all four states; only the label fades to 40%
   *
   * The fill is an ALPHA, deliberately: live composites it over whatever is
   * behind (white content, #F4F8FA shell, a dialog body), so an opaque stand-in
   * is only ever right on one backdrop. That is exactly how --btn-rect-bg
   * #EDF3F8 came to read too bright — see its deprecation note below. */
  --btn-grey-bg: rgba(198, 212, 224, 0.4);
  --btn-grey-bg-active: rgba(198, 212, 224, 0.6);
  --btn-grey-border: rgba(198, 212, 224, 0);
  --btn-grey-border-hover: rgba(124, 138, 152, 0.4);
  --btn-grey-border-active: rgba(124, 138, 152, 0.5);
  /* DEPRECATED — do NOT use on a text button. #EDF3F8 was an invented opaque
   * approximation of the alpha grey above; on live it does not exist. It is
   * ~5/255 brighter than the real fill on white and further off on the grey
   * shell, which is what read as "the buttons look brighter than the machine".
   * Retired from every text button 2026-08-20; the only remaining consumers are
   * two ICON-only controls (.cp-nav-home, .cp-sort) that were never measured in
   * this pass and are therefore left exactly as they were. */
  --btn-rect-bg: #EDF3F8;
  --btn-rect-bg-hover: #E3EDF5;

  /* ——— Status ——— */
  --status-warning: #FF9500;
  --status-error: #E8462E;
  --status-ok: #5FB336;
  --status-healthy-banner: #14B41A; /* live Storage Dashboard health badge, sampled 2026-06-30 */
  --status-green-text: #009E05;       /* live SVC `.green-status` table text, rgb(0,158,5) /400 (pas80 SM Drives 2026-10-03) */
  --alert-orange: #F58414;            /* live v-alert-bar-orange icon + text (rgb 245,132,20) */
  --alert-orange-bg: rgba(245, 132, 20, 0.1); /* its 10% wash background */

  /* ——— Type ——— */
  --font-family-base: Verdana, Geneva, Tahoma, sans-serif;
  --font-size-body-l: 14px;
  --font-size-body-s: 12px;
  --font-size-table: 13px;
  --font-size-fieldset-title: 15px;
  --line-height-body: 20px;
  --font-weight-regular: 400;
  --font-weight-bold: 700;

  /* ——— Radii ——— */
  /* App window radius — live .x-window / .v-window root is 3px (SVC authored
   * --v-window-border-radius: var(--v-border-radius-100) = 3px; measured on
   * pas80 2026-08-18, ExtJS and Vue windows agree). The root also clips
   * (overflow:hidden), so it alone paints all four corners. */
  --radius-window: 3px;
  /* Dialog/wizard radius — was sharing --radius-window's 6px. Live authors
   * dialogs SEPARATELY at 8px (.sds-window-v5.x-window-dlg / the welcome
   * .v-window, stylesheet-read on pas80 2026-08-18) with a lighter shadow
   * (0 4px 15px 0 rgba(0,0,0,.3)) — i.e. the old shared 6px was almost
   * exactly the average of the two real values. Held at 6px on purpose
   * (user directive 2026-08-18): this round only re-measures the APP
   * WINDOW, so no dialog changes its look. Move to 8px when asked. */
  --radius-dialog: 6px;
  --radius-module: 5px;   /* live module item radius (probed 2026-06-15) */
  --radius-input: 4px;
  --radius-btn: 3px;
  --radius-pill: 100px;

  /* ——— Form controls / settings screens ——— */
  --control-checkbox-size: 20px;
  --control-radio-size: 20px;       /* exact Figma "Radio" container (node 28396:8791), 20px */
  --control-row-gap: 10px;
  --control-radio-group-gap: 12px;
  --checkbox-icon-normal: url("../assets/icons/checkbox-svc.svg");
  --checkbox-icon-checked: url("../assets/icons/checkbox-svc-checked.svg");
  /* Rendered as a background-image (not CSS border + radial-gradient) so the
     checked dot is a crisp vector circle instead of a blurry gradient edge —
     these are the exact Figma-exported SVGs (20x20, ring r=9/8.5, dot r=5). */
  --radio-icon-normal: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='9' fill='white'/%3E%3Ccircle cx='10' cy='10' r='8.5' fill='none' stroke='%23C6D4E0' stroke-opacity='0.7'/%3E%3C/svg%3E");
  --radio-icon-checked: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='9' fill='white'/%3E%3Ccircle cx='10' cy='10' r='8.5' fill='none' stroke='%23C6D4E0' stroke-opacity='0.7'/%3E%3Ccircle cx='10' cy='10' r='5' fill='%23057FEB'/%3E%3C/svg%3E");
  --fieldset-title-color: var(--main-tier1);
  --fieldset-title-hover: var(--main-tier1-dark);  /* collapsible title (+chevron) hover, live-measured */
  --fieldset-divider-color: var(--border-tier3);
  --fieldset-divider-style: dashed;

  /* ——— Dropdown: form variant (in-dialog/wizard selects, e.g. RAID type) ———
   * Distinct from the default toolbar "filter" dropdown (Show All), which turns
   * blue text+border on hover. The form variant keeps the LABEL text dark in
   * every state; only the border (and arrow when open) change colour:
   *   default → light grey border · hover → live soft-grey border · open → blue. */
  --dropdown-form-text: var(--font-grey-tier1);            /* label always dark */
  --dropdown-form-border: var(--border-tier3);             /* default light grey-blue */
  --dropdown-form-border-hover: rgba(124, 138, 152, 0.5);  /* live hover border */
  --dropdown-form-border-active: var(--main-tier1);        /* open: blue */
  --dropdown-form-arrow: var(--icon-dark-grey-tier1);      /* arrow grey by default/hover */
  --dropdown-form-arrow-active: var(--main-tier1);         /* arrow blue when open */
  --dropdown-form-option-selected: var(--main-light);      /* selected/hover row bg (rgba blue .1) */

  /* ——— Disabled select — BOTH live families (v-select2 + ExtJS combobox) ———
   * Measured on PAS7700_POC 172.21.3.80, 2026-10-03, on real disabled instances: the
   * whole control is ONE pale surface painted once, a .7 border, .4 text, and the arrow
   * #505A64 at 40%; hover changes nothing. Used by the "Disabled select" block in
   * components.css — pages never restate these. */
  --select-bg-disabled: rgba(198, 212, 224, 0.2);          /* live --v-select-bkg-color--disabled; painted ONCE (renders #F4F6F9 on white) */
  --select-border-disabled: var(--border-tier3);           /* live --v-select-border-color--disabled */
  --select-text-disabled: var(--font-grey-tier3);          /* live --v-select-color--disabled */
  --select-icon-disabled: var(--icon-dark-grey-tier1);     /* the arrow keeps #505A64 … */
  --select-icon-opacity-disabled: 0.4;                     /* … at 40% (live --v-select-opacity__icon--disabled; renders #B2B7BD) */
  --select-sprite-pos-disabled: 0 -47px;                   /* ExtJS combo_trigger.png disabled cell (#505A64 at alpha .4) */

  /* ——— White info tooltip ("whitetip") — live: borderless, 8px radius, soft shadow ——— */
  --whitetip-bg: var(--white);
  --whitetip-text: var(--font-grey-tier1);
  --whitetip-radius: 8px;
  --whitetip-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  /* ——— Scrollbar (ONE shared look — live SVC ".y-bar bar", #0000001F) ———
   * The single source of truth for every scrollbar in the app. Native scrollers
   * use the .svc-scroll utility class; synthetic overlay bars (tables with a
   * frozen header, the collapsing-hero wizard) reference the same tokens so they
   * look identical. See .svc-scroll in components.css. */
  --scrollbar-size: 8px;                    /* visible thumb width */
  --scrollbar-inset: 2px;                   /* gap from the right edge (live right:2px) */
  --scrollbar-radius: 6px;
  --scrollbar-thumb: rgba(0, 0, 0, 0.12);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.42);  /* live --v-scrollbar-bkg-color--hover (rail:hover .bar) */
  --scrollbar-thumb-min-height: 48px;

  /* ——— Data Table (C.dataTable — live SVC DataTable `.v-table`) ———————————
   * Only the values no older token carries; colours reuse --border-tier2/3,
   * --font-grey-tier1/2/3, --main-tier1(-dark), --main-hover / --main-light,
   * --icon-dark-grey-tier1. Source: docs/research/data-table/svc-data-table.md §1
   * (resolved theme vars) + live-pas80.md "Resolved SVC v-table tokens". */
  --data-table-row-height: 29px;            /* --v-table-cell-height 28 + 1px td divider (head + body) */
  --data-table-cell-pad-x: 8px;             /* --v-table-cell-padding-lr / head-cell padding 0 8px */
  --data-table-last-cell-pad-right: 25px;   /* --v-table-padding-right__last-th / __last-cell (room for ⋮) */
  --data-table-sorter-opacity: 0.6;         /* svg set16 --fill-opacity normal (hover/active 1) */
  --data-table-group-title-color: rgba(65, 75, 85, 0.5);  /* --v-table-cell-color__group-title */
  --data-table-group-indent: 32px;          /* --v-table-cell-padding-left__group-node */
  --data-table-empty-min-height: 140px;     /* wizard empty body: 140px in a 170px table (no live default) */
  --data-table-checkbox-sprite: url("../assets/icons/checkbox.svg");  /* SVC checkbox.svg states 0..-160 */
  --data-table-ghost-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);           /* --v-table-dd-ghost-box-shadow */
  --data-table-pager-height: 30px;          /* table footer div.v-pagination */

  /* ——— Wizard scroll / collapsed hero behavior ——— */
  --wizard-scrollbar-size: var(--scrollbar-size);
  --wizard-scrollbar-thumb: var(--scrollbar-thumb);
  --wizard-scrollbar-thumb-hover: var(--scrollbar-thumb-hover);
  --wizard-scrollbar-thumb-min-height: var(--scrollbar-thumb-min-height);
  --wizard-title-collapse-distance: 24px;
  --wizard-hero-collapsed-title-color: rgba(255, 255, 255, 0.92);

  /* ——— Icon interaction scale (SVG fill-opacity) ———————————————————————
   * Live states its icon states as `fill-opacity`, NOT as a colour swap: SVC
   * declares --fill-opacity--normal / --hover / --active per icon set on
   * `.v-icon.icon-setNN`, and every one of them resolves to the same ladder
   * (measured on pas80 2026-08-19 on the wizard close tool, `icon-set23`).
   * It is library-wide — buttons, table sorters and date pickers use the same
   * three tokens. The icon's own `color` never changes; only how opaque the
   * fill is, which is why a white icon on blue reads grey until you hover it. */
  --icon-fill-opacity: 0.7;           /* live --fill-opacity--normal */
  --icon-fill-opacity-hover: 0.85;    /* live --fill-opacity--hover */
  --icon-fill-opacity-active: 1;      /* live --fill-opacity--active */

  /* ——— Shadows ———
   * Modal layer re-measured 2026-08-18 on pas80 (172.21.3.80) two ways: a
   * per-element provenance walk (open the modal, then walk its ancestor chain to
   * <body> reading box-shadow + ::before + ::after + filter on every node) and a
   * CSSOM scan of every rule declaring a box-shadow on a window/dialog/wizard
   * selector. Both of live's widget stacks declare the SAME numbers:
   *
   *   standard window / wizard / modal dialog
   *     Vue    --v-window-box-shadow  @ .v-window          = 0 4px 16px 0 rgba(0,0,0,.6)
   *     ExtJS  .sds-window-v5                             = 0 4px 16px 0 rgba(0,0,0,.6)
   *   message box / confirm (the small alert dialog)
   *     Vue    --v-message-box-window-box-shadow
   *              @ .v-window.v-message-box-window          = 0 4px 16px 0 rgba(0,0,0,.3)
   *     ExtJS  .sds-window-v5.x-window-dlg                 = 0 4px 15px 0 rgba(0,0,0,.3)
   *
   * It is ONE layer, painted by the window's own root node — no ancestor, no
   * pseudo-element and no `filter` contributes anything (verified on the Vue
   * wizard, the Vue modal dialog, the Vue app window and the ExtJS app window).
   * So a modal shadow here must never be built as stacked layers.
   *
   * Live also has two states we deliberately do NOT model: an inactive window
   * (.sds-window-v5.deactive-win = 0 4px 10px 0 rgba(0,0,0,.2)) and the
   * no-shadow opt-out (.sds-window-v5-no-shadow, .v-about-window-v2 = none).
   * --shadow-window (the app-window layer) was initially left out of that pass,
   * then measured in the App Window chrome round later the same day: the app
   * window carries the very same single dark layer as the standard dialog above
   * (.x-window / .v-window computed box-shadow = 0 4px 16px 0 rgba(0,0,0,.6),
   * SVC --v-window-box-shadow), replacing a 3-layer material stack that was
   * never measured. Two independent measurements of the same live value.
   * See qa/appwin-resize-dblclick.md. */
  --shadow-window: 0px 4px 16px 0px rgba(0, 0, 0, 0.6);
  --shadow-dialog: 0 4px 16px 0 rgba(0, 0, 0, 0.6);  /* standard window / wizard / modal dialog — live .v-window (--v-window-box-shadow) and ExtJS .sds-window-v5, one layer on the modal root */
  --shadow-msgbox: 0 4px 16px 0 rgba(0, 0, 0, 0.3);  /* message box / confirm tier — live .v-message-box-window, half the window alpha */

  /* ——— Layout ——— */
  --taskbar-height: 39px;  /* live taskbar-wrapper height */
  --module-list-width: 240px;
  --app-header-height: 40px;
}
