/**
 * HamlyERP
 * Copyright (c) 2026 Nolwa Private Limited. All rights reserved.
 * Proprietary and confidential. Unauthorised copying, modification or distribution of this file is prohibited.
 */
/* THE design tokens of the v2 page kit (owner rule 13 Oct 2026: the approved prototype is the spec, exact values).
   Section 1 and the prototype part of 5 and 6 are copied from docs/redesign/prototype/assets (doc-form.css and app.css
   :root, dark.css Midnight and Warm): never edit one of them here alone; KIT-TOK-001 fails when a value differs from
   the prototype. Loaded after doc-form.css and app-v2.css on every v2 page (and on the POS with ui_v2), so these values
   win; kit.css and pos.css use only var(--…) from this file (KIT-TOK-002).
   1 prototype tokens · 2 kit layers (z-index, +1000 above today's AdminLTE layers: the one deliberate deviation)
   3 kit additions (not in the prototype: buttons, overlays, skeletons…) · 4 named scales for the prototype's plain values
   (weights, line heights, letter spacing, spacing, icon sizes, borders, motion) · 7 app icons (M5) · 5 Midnight · 6 Warm. */

.df-v2, :root.df-app {
  /* 1 prototype tokens (light) */
  --fs-2xs: 12px; /* nothing under 12px */
  --fs-xs: 12px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 24px;
  --fs-4xl: 28px;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-2xl: 14px;
  --r-3xl: 18px;
  --r-pill: 999px;
  --ui-brand: #184d2c;
  --ui-brand-dark: #192f23;
  --ui-brand-soft: #eaf2ed;
  --ui-heading: #0d2b1a;      /* D-56 R2 (owner 5 Nov): the standard light heading; Warm keeps #192f23 (theme-warm.css) */
  --ui-brand-ink: #184d2c;
  --ui-surface: #fff;
  --ui-brand-ring: rgba(27, 122, 80, .18);
  --ui-gold: #c9a84c;
  --ui-gold-dark: #a8873a;
  --ui-gold-wash: #f7efd8;
  --ui-gold-ink: #6f5718;
  --ui-ink: #1f2937;
  --ui-muted: #5b6270;
  --ui-icon: #9aa1ab;
  --ui-placeholder: #656c79;   /* placeholder text: >= 4.5:1 on surface, page and read-only fields (rule 7; --ui-icon is 2.6:1, U2 K1) */
  --ui-scrim: rgba(13, 43, 26, .35);
  --ui-line: #e6e8eb;
  --ui-line-strong: #c9cfcc;
  --ui-line-soft: #cfe0d5;
  --ui-bg: #f6f7f8;
  --ui-shell: #eef2f6;        /* D-56 R2: the standard light page behind white cards (was the cream now only in Warm) */
  --ui-info: #2f7d4f;
  --ui-error: #c62828;
  --ui-error-wash: #fdeceb;
  --ui-warn-wash: #fff8e1;
  --ui-warn-ink: #8a5a00;
  --ui-row-active: #fff7d6;
  --ui-radius: 8px;
  --ui-radius-group: 10px;
  --ui-radius-card: 14px;
  --ui-field-h: 32px;
  --ui-cell-h: 32px;
  --df-font: "Inter", "Segoe UI", Arial, sans-serif;
  --df-font-ar: "Inter", "IBM Plex Sans Arabic", "Almarai", "Segoe UI", Tahoma, sans-serif;
  --df-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --ui-blue: #2563eb;
  --ui-blue-wash: #e8f0fe;
  --ui-violet: #6d28d9;
  --ui-violet-wash: #f1ebfd;
  --ui-orange: #c2410c;
  --ui-orange-wash: #fff1e6;
  --ui-ok: #12692f;
  --ui-ok-wash: #e7f6ec;
  --ui-shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --ui-shadow-2: 0 8px 24px rgba(16, 24, 40, .08);
  --sb-h: 64px;
  /* 2 kit layers */
  --z-sticky: 1020;
  --z-topbar: 1030;
  --z-savebar: 1040;
  --z-nav-backdrop: 1044;
  --z-nav: 1045;
  --z-scrim: 1046;
  --z-drawer: 1047;
  --z-menu: 1048;
  --z-dropdown: 1060;
  --z-popover: 1070;
  --z-modal: 1080;
  --z-floating: 1120;
  --z-tooltip: 1130;
  --z-picker: 1140;
  /* 3 kit additions (light) */
  --ui-surface-2: #fbfbfc;
  --ui-hover: #f7faf8;
  --ui-hl: #f1f4f2;
  --ui-ro: #f3f4f5;
  --ui-flash: #e3f3e8;
  --ui-on-brand: #fff;
  --ui-on-brand-soft: rgba(255, 255, 255, .5);
  --ui-on-brand-wash: rgba(255, 255, 255, .15);   /* key hint on a primary button (prototype app.css:92) */
  --ui-on-brand-line: rgba(255, 255, 255, .3);
  --ui-on-gold-wash: rgba(255, 255, 255, .55);
  --ui-on-gold: #192f23;   /* glyph on a gold fill (the phone bar "+", 6.3:1); the gold fill is the same in every theme */
  --ui-primary: #0d2b1a;
  --ui-primary-hover: #184d2c;
  --ui-primary-disabled: #0d2b1a;
  --ui-switch-track: #d5dbd8;
  --ui-switch-knob: #fff;
  --ui-overlay: rgba(13, 43, 26, .35);
  --ui-overlay-2: rgba(13, 43, 26, .2);
  --ui-shadow-pop: 0 10px 25px rgba(0, 0, 0, .12);
  --ui-shadow-modal: 0 24px 60px rgba(0, 0, 0, .25);
  --ui-shadow-bar: 0 -6px 18px rgba(16, 24, 40, .05);
  --ui-shadow-toast: 0 10px 30px rgba(17, 17, 26, .2);
  --ui-shadow-pick: 0 16px 40px rgba(13, 43, 26, .18);
  --ui-shadow-knob: 0 1px 3px rgba(15, 23, 42, .3);
  --ui-scroll-thumb: #cdd5d0;
  --ui-scroll-thumb-hover: #a9b4ae;
  --ui-skel-a: #eef1f0;
  --ui-skel-b: #e3e8e5;
  /* the chart palette's sage (prototype charts.js PAL / funnel, same in both dark styles), for Lane C's donut */
  --ui-sage: #8fb59d;
  --ui-on-danger: #fff;
  --kit-row-h: 44px;
  --kit-kpi-spark-h: 26px; /* the KPI card's sparkline row, the same on every card (owner 3 Nov) */
  --kit-head-h: 38px;
  /* the detail table (<x-ui.detail-table>, prototype .df-table): header background and row hover */
  --kit-detail-th: #fbfbfc;
  --kit-detail-hover: #f7faf8;
  /* the selected search result's start line and the open category's border on narrow pages (prototype settings.css / dark.css) */
  --kit-sel-line: #184d2c;
  /* 4 scales */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 600; /* weights are 400 / 500 / 600 only (owner rule, 29 Oct) */
  --fw-heavy: 600;
  --lh-none: 1;
  --lh-115: 1.15;
  --lh-120: 1.2;
  --lh-125: 1.25;
  --lh-130: 1.3;
  --lh-135: 1.35;
  --lh-140: 1.4;
  --lh-145: 1.45;
  --lh-150: 1.5;
  --lh-155: 1.55;
  --ls-n4: -.4px;
  --ls-n3: -.3px;
  --ls-n2: -.2px;
  --ls-0: 0;
  --ls-2: .2px;
  --ls-3: .3px;
  --ls-4: .4px;
  --ls-5: .5px;
  --sp-1: 1px;
  --sp-2: 2px;
  --sp-3: 3px;
  --sp-4: 4px;
  --sp-5: 5px;
  --sp-6: 6px;
  --sp-7: 7px;
  --sp-8: 8px;
  --sp-9: 9px;
  --sp-10: 10px;
  --sp-11: 11px;
  --sp-12: 12px;
  --sp-14: 14px;
  --sp-16: 16px;
  --sp-18: 18px;
  --sp-20: 20px;
  --sp-22: 22px;
  --sp-24: 24px;
  --sp-28: 28px;
  --sp-32: 32px;
  --sp-34: 34px;
  --sp-36: 36px;
  --sp-40: 40px;
  --ic-12: 12px;
  --ic-13: 13px;
  --ic-14: 14px;
  --ic-15: 15px;
  --ic-16: 16px;
  --ic-17: 17px;
  --ic-18: 18px;
  --ic-20: 20px;
  --ic-22: 22px;
  --ic-28: 28px;
  --ic-36: 36px;
  --bw: 1px;
  --bw-strong: 1.5px;
  --bw-2: 2px;
  --bw-accent: 3px;
  --r-round: 50%;
  --spot-spread: 9999px;
  --dur-fast: .12s;
  --dur: .15s;
  --dur-slow: .2s;
  --dur-delay: .1s;
  --dur-flash: 2.2s;   /* a found setting's gold flash (prototype settings.css df-set-flash) */
  --ease: ease;
  --focus-ring: 0 0 0 3px var(--ui-brand-ring);
  --tt-label: none;   /* rule 4 (owner 2 Nov): no uppercase on labels or titles; was uppercase */
  /* 7 app icons (M5, enhancement spec R4: one family, 24-grid line glyphs at 1.75 stroke in a rounded square, Hamly
     green gradient, white glyph, fine top highlight, soft shadow; light rail: inactive = white square, green glyph) */
  --app-icon-size: 40px;
  --app-icon-radius: 28%;
  --app-icon-glyph-size: 55%;
  --app-icon-stroke: 1.75;
  --app-icon-bg: linear-gradient(180deg, #2a6b45 0%, #184d2c 55%, #0d2b1a 100%);
  --app-icon-glyph: #fff;
  --app-icon-outline: transparent;
  --app-icon-highlight: inset 0 1px 0 rgba(255, 255, 255, .22);
  --app-icon-shadow: 0 2px 6px rgba(13, 43, 26, .22);
  --app-icon-plain-bg: #fff;
  --app-icon-plain-glyph: #184d2c;
  --app-icon-plain-line: #e4e7e5;
  --app-icon-on-bg: var(--app-icon-bg);
  --app-icon-on-glyph: #fff;
  --app-rail-bg: #f5f7f6;
  --ui-chrome: #ffffff;   /* FRAME (owner 28 Oct): top bar = sidebar = form save bar = app footer, one colour; the page (--ui-shell) always differs */
}

/* 5 Dark: Midnight (prototype dark.css style 1) */
:root[data-theme="dark"] .df-v2, :root.df-app[data-theme="dark"] {
  --ui-brand-soft: #141715;
  --ui-brand-ring: rgba(95, 190, 130, .28);
  --ui-gold-wash: #3a3117;
  --ui-gold-ink: #e6cc7c;
  --ui-ink: #e7e9e8;
  --ui-muted: #9ca8a2;
  --ui-icon: #7e8a84;
  --ui-placeholder: #9ca8a2;
  --ui-scrim: rgba(0, 0, 0, .6);
  --ui-line: #191d1b;
  --ui-line-strong: #303632;
  --ui-line-soft: #292e2b;
  --ui-bg: #101110;
  --ui-shell: #0a0c0b;
  --ui-info: #2f8a55;
  --ui-error: #f2766d;
  --ui-error-wash: #161918;
  --ui-warn-wash: #3a2f13;
  --ui-warn-ink: #f1c462;
  --ui-row-active: #3a3215;
  --ui-blue-wash: #1b2a45;
  --ui-blue: #7fa9ff;
  --ui-ok-wash: #173a25;
  --ui-ok: #6fd394;
  --ui-orange-wash: #3d2516;
  --ui-orange: #ff9a5c;
  --ui-violet-wash: #242926;
  --ui-violet: #b79cff;
  --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --ui-shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
  --dk-surface: #131615;
  --dk-brand-text: #8fd3a8;
  --dk-heading: #f2f4f3;
  --ui-heading: #f2f4f3;
  --ui-brand-ink: #8fd3a8;
  --ui-surface: #161817;
  --dk-brand-line: #4f9d6d;
  /* kit additions (Midnight) */
  --ui-skel-a: #1c201e;
  --ui-skel-b: #252a27;
  --ui-on-danger: #1d1110;
  --ui-ro: #1f2321;
  --ui-surface-2: #1c2420;
  --ui-hover: #1a201d;
  --ui-hl: #1f2522;
  --kit-detail-th: #151716;
  --kit-detail-hover: #141615;
  --kit-sel-line: #4f9d6d;
  --ui-flash: #1f3b2b;
  --ui-on-brand-soft: rgba(0, 0, 0, .35);
  --ui-on-brand-wash: var(--ui-on-brand-soft);
  --ui-on-brand-line: var(--ui-on-brand-soft);
  --ui-on-gold-wash: rgba(0, 0, 0, .25);
  --ui-primary: #2b7a4b;
  --ui-primary-hover: #33905a;
  --ui-primary-disabled: #2a3530;
  --ui-switch-track: #3b4540;
  --ui-switch-knob: #e7ece9;
  --ui-overlay: rgba(0, 0, 0, .6);
  --ui-overlay-2: rgba(0, 0, 0, .36);
  --ui-shadow-pop: 0 10px 25px rgba(0, 0, 0, .22);
  --ui-shadow-modal: 0 24px 60px rgba(0, 0, 0, .45);
  --ui-shadow-bar: 0 -6px 18px rgba(0, 0, 0, .3);
  --ui-shadow-toast: 0 10px 30px rgba(0, 0, 0, .45);
  --ui-shadow-pick: 0 16px 40px rgba(0, 0, 0, .45);
  --ui-shadow-knob: 0 1px 3px rgba(0, 0, 0, .5);
  --ui-scroll-thumb: #303632;
  --ui-scroll-thumb-hover: #4c4a47;
  /* app icons (R4 dark modes: same green, thin pale-green outline, glyph #e8f3ec; selected = gold, dark glyph) */
  --app-icon-glyph: #e8f3ec;
  --app-icon-outline: rgba(143, 211, 168, .35);
  --app-icon-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  --app-icon-plain-bg: var(--app-icon-bg);
  --app-icon-plain-glyph: #e8f3ec;
  --app-icon-plain-line: rgba(143, 211, 168, .35);
  --app-icon-on-bg: var(--ui-gold);
  --app-icon-on-glyph: #0d2b1a;
  --app-rail-bg: #0d0f0e;
  --ui-chrome: #0d0f0e;
}

/* 6 Dark: Warm (prototype dark.css style 2) */
:root[data-theme="dark"][data-dark="warm"] .df-v2, :root.df-app[data-theme="dark"][data-dark="warm"] {
  --ui-chrome: #201f1e;
  --ui-brand-soft: #2e2d2b;
  --ui-brand-ring: rgba(95, 190, 130, .28);
  --ui-gold-wash: #3a3117;
  --ui-gold-ink: #e6cc7c;
  --ui-ink: #eae9e6;
  --ui-muted: #aba699;
  --ui-icon: #7e8a84;
  --ui-placeholder: #aba699;
  --ui-line: #393735;
  --ui-line-strong: #4c4a47;
  --ui-line-soft: #41403d;
  --ui-bg: #252422;
  --ui-shell: #1b1a19;
  --ui-info: #2f8a55;
  --ui-error: #f2766d;
  --ui-error-wash: #33322f;
  --ui-warn-wash: #3a2f13;
  --ui-warn-ink: #f1c462;
  --ui-row-active: #3a3215;
  --ui-blue-wash: #1b2a45;
  --ui-blue: #7fa9ff;
  --ui-ok-wash: #173a25;
  --ui-ok: #6fd394;
  --ui-orange-wash: #3d2516;
  --ui-orange: #ff9a5c;
  --ui-violet-wash: #3b3a37;
  --ui-violet: #b79cff;
  --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --ui-shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
  --dk-surface: #2d2c2a;
  --dk-brand-text: #8fd3a8;
  --dk-heading: #f4f4f2;
  --ui-heading: #f4f4f2;
  --ui-brand-ink: #8fd3a8;
  --ui-surface: #31302e;
  --dk-brand-line: #4f9d6d;
  /* kit additions (Warm) */
  --ui-skel-a: #383634;
  --ui-skel-b: #42403d;
  --ui-ro: #3b3a37;
  --ui-surface-2: #2d2c2a;
  --ui-hover: #383634;
  --ui-hl: #3b3a37;
  --kit-detail-th: #2f2e2c;
  --kit-detail-hover: #2d2c2a;
  --kit-sel-line: #4f9d6d;
  --ui-flash: #2d3a2f;
  --app-rail-bg: #201f1e;
}

/* the prototype's phone save bar (app.css :root at 640 px, as doc-form.css .df-v2): after the blocks above, which would
   otherwise put 64 px back */
/* 8 Dark: Green & Gold (prototype dark.css, data-dark="greengold"; owner 28 Oct). Chrome #0f2218 sits on the page #132a1f. */
:root[data-theme="dark"][data-dark="greengold"] .df-v2, :root.df-app[data-theme="dark"][data-dark="greengold"] {
  --ui-chrome: #0f2218;
  --ui-brand-soft: #143123;
  --ui-brand-ring: rgba(95, 190, 130, .28);
  --ui-gold-wash: #3a3117;
  --ui-gold-ink: #e6cc7c;
  --ui-ink: #e4ece7;
  --ui-muted: #93b19d;
  --ui-icon: #7e8a84;
  --ui-placeholder: #93b19d;
  --ui-line: #2a4535;
  --ui-line-strong: #234535;
  --ui-line-soft: #1c4430;
  --ui-bg: #192f23;
  --ui-shell: #132a1f;
  --ui-info: #2f8a55;
  --ui-error: #f2766d;
  --ui-error-wash: #153426;
  --ui-warn-wash: #3a2f13;
  --ui-warn-ink: #f1c462;
  --ui-row-active: #3a3215;
  --ui-blue-wash: #1b2a45;
  --ui-blue: #7fa9ff;
  --ui-ok-wash: #173a25;
  --ui-ok: #6fd394;
  --ui-orange-wash: #3d2516;
  --ui-orange: #ff9a5c;
  --ui-violet-wash: #1a3f2d;
  --ui-violet: #b79cff;
  --ui-surface: #192f23;
  --ui-heading: #f1f5f2;
  --ui-brand-ink: #8fd3a8;
}

@media (max-width: 640px) {
  .df-v2, :root.df-app { --sb-h: 58px; }
}
