/* Canonical Golden Bridge palette and presentation scale. Public and ERP share this file. */
@font-face {
  font-family: "Readex Pro";
  src: url('/erp/readex-pro.woff2') format('woff2'), url('/readex-pro.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root,
:root[data-gb-erp] :is([data-gb-theme=golden],.desk,.gb-doc-page,.gb-doc) {
  --gb-sidebar: #29251f;
  --gb-sidebar-line: #453d30;
  --gb-sidebar-muted: #aea18a;
  --gb-page: #f3f1ec;
  --gb-canvas: #f6f3ed;
  --gb-surface: #ffffff;
  --gb-soft: #f1ecdf;
  --gb-soft-2: #faf8f4;
  --gb-ink: #3b3428;
  --gb-muted: #6b6254;
  --gb-line: #ded6c8;
  --gb-accent: #8c642e;
  --gb-accent-hover: #765326;
  --gb-gold: #c9a958;
  --gb-gold-soft: #f3e4c2;
  --gb-ok: #2f6b3f;
  --gb-ok-bg: #e7f1e6;
  --gb-warn: #8a5a12;
  --gb-warn-bg: #f8ecd2;
  --gb-bad: #a3352b;
  --gb-bad-bg: #f8e3df;
  --gb-info: var(--gb-accent);
  --gb-info-bg: var(--gb-soft);
  --gb-border: var(--gb-line);
  /* Form-control outline: the muted ink lightened on the surface, about 3.2:1 on white (WCAG 1.4.11). */
  --gb-control-line: color-mix(in srgb, var(--gb-muted) 70%, var(--gb-surface));
  --gb-shadow: 0 2px 6px #29251f05, 0 12px 32px #29251f05;
  /* Menus and popovers that float above the page: the sidebar ink at low strength. */
  --gb-shadow-pop: 0 2px 8px #29251f14, 0 14px 36px #29251f24;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --text-meta: 13px;
  --text-body: 15px;
  --text-title: 18px;
  --text-page: 26px;
  --weight-normal: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --control-h: 44px;
  --gb-font: "Readex Pro", sans-serif;
  /* Motion (D-009). Every duration and easing in the ERP comes from here (tools/check-design-tokens.mjs).
     Curves: out (things that enter or answer a press), move (something moving across the screen both ways),
     sheet (a drawer or a bottom sheet). Durations: instant for what is done all day (navigation, tabs, lists,
     colour and border changes), press 120ms, exit 160ms, menu 180ms, panel and dialog 220ms, the
     changed-value highlight 240ms. The busy loops run only while something is really loading. */
  --gb-ease-out: cubic-bezier(.23, 1, .32, 1);
  --gb-ease-move: cubic-bezier(.77, 0, .175, 1);
  --gb-ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --gb-dur-instant: 0ms;
  --gb-dur-press: 120ms;
  --gb-dur-exit: 160ms;
  --gb-dur-menu: 180ms;
  --gb-dur-panel: 220ms;
  --gb-dur-highlight: 240ms;
  --gb-dur-spin: 600ms;
  --gb-dur-refresh-spin: 800ms;
  --gb-dur-progress: 1000ms;
  --gb-dur-skeleton: 1200ms;
  /* The older names, kept as aliases of the tokens above. */
  --motion-fast: var(--gb-dur-press);
  --motion-base: var(--gb-dur-menu);
  --motion-slow: var(--gb-dur-highlight);
  --ease-out: var(--gb-ease-out);
  --ease-in-out: var(--gb-ease-move);
  /* Button gold: fill, hover, pressed, 1px edge (the control boundary, 3:1 or more on white) and the ink on it.
     Hover, pressed and edge are the fill mixed with a deep bronze at 10%, 20% and 40% or more. */
  --gb-btn: #c99a3b;
  --gb-btn-hover: #be9137;
  --gb-btn-press: #b38833;
  --gb-btn-edge: #9d762b;
  --gb-btn-ink: #231c10;
  --gb-btn-shine: inset 0 1px 0 #ffffff47;
  --gb-btn-tint: color-mix(in srgb, var(--gb-btn) 12%, var(--gb-surface));
  --gb-bad-hover: #8f2f26;
  /* A whole box-shadow value: use it only in box-shadow. Outlines use 2px solid var(--gb-accent), offset 2px. */
  --gb-focus: 0 0 0 3px color-mix(in srgb, var(--gb-btn) 34%, transparent);
  --gb-wordmark-filter: none;
  /* The sign-in stage keeps the dark brand panel whatever the sidebar choice. */
  --gb-stage: #29251f;
  /* Printed documents keep one dark ink whatever the screen appearance. */
  --gb-doc-ink: #29251f;
  /* The QR code of a remittance notice (remittance-qr.js): pure black on white on the screen, in every
     theme, and on paper, for the best contrast a scanner and a thermal printer can get. */
  --gb-qr-ink: #000000;
  --gb-qr-paper: #ffffff;
  /* The shaded (every second) row of a printed statement (20261129190000): one clear step darker than the
     old 32% gold-soft mix, still light enough for a black-and-white printer (lightness 0.87 against white 1.0;
     the opening/closing rows stay darker, 0.85). */
  --gb-doc-row-alt: #f8f0dc;
  --gb-stage-muted: #aea18a;
  /* The account status card (account-status.js, owner's design of 28 Nov 2026). The picture sent to a client
  keeps these fixed colours whatever the screen theme (--gb-share-*); the staff card's boxes and amounts use
  --gb-cover-*, which the dark theme gives its own values. On their own backgrounds: red ink 6.4:1 on the red
  box, green ink 6.9:1 on the green box; on white, red 7.6:1 and green 8.0:1 (dark: 6.6:1 and 7.4:1). */
  --gb-share-page: #faf7f1;
  --gb-share-ink: #241f17;
  --gb-share-muted: #6b6254;
  --gb-share-gold: #c9a24b;
  /* The picture's avatar (the account's type), as the light card draws it: --gb-gold-soft and --gb-accent. */
  --gb-share-gold-soft: #f3e4c2;
  --gb-share-accent: #8c642e;
  --gb-share-line: #e8e1d2;
  --gb-share-rule: #ebe6db;
  --gb-share-surface: #ffffff;
  --gb-share-bad: #9b2c22;
  --gb-share-bad-bg: #fbe7e5;
  --gb-share-bad-line: #efc2bd;
  --gb-share-bad-soft: #8a3a32;
  --gb-share-ok: #2f5a2a;
  --gb-share-ok-bg: #e6f0e4;
  --gb-share-ok-line: #b9d3b4;
  --gb-share-ok-soft: #4a6b45;
  /* A payment («✓ تم الدفع» on the receipt, 1.37.5): blue, apart from the green of money received. */
  --gb-share-pay: #1e4f86;
  --gb-share-pay-bg: #e6eef8;
  --gb-share-pay-line: #b8cce6;
  --gb-share-on-tone: #ffffff;
  --gb-cover-bad: #9b2c22;
  --gb-cover-bad-bg: #fbe7e5;
  --gb-cover-bad-line: #efc2bd;
  --gb-cover-ok: #2f5a2a;
  --gb-cover-ok-bg: #e6f0e4;
  --gb-cover-ok-line: #b9d3b4;
  --gb-cover-scrim: #241f1752;
}

/* ---------------------------------------------------------------------------
   Staff ERP palette (1.7.0). Only documents marked data-gb-erp take it, so the public site,
   which shares this file, keeps the values above. White and gold: a near-white page, pure
   white cards, hairlines, warm dark ink, and gold as the one accent.
   Checked pairs (WCAG): ink 16.4:1 on white; muted 6.0:1 on white, 5.4:1 on soft;
   accent 6.7:1 on white; control line 3.6:1 on white. The side menu has its own tokens (--gb-nav-*, below). */
:root[data-gb-erp],
:root[data-gb-erp] :is([data-gb-theme=golden],.desk,.gb-doc-page,.gb-doc) {
  --gb-page: #fbfaf7;
  --gb-canvas: #fbfaf7;
  --gb-surface: #ffffff;
  --gb-soft: #f6f2e8;
  --gb-soft-2: #fbf9f4;
  --gb-ink: #241f17;
  --gb-muted: #6b6254;
  --gb-line: #ebe6db;
  --gb-accent: #7a5520;
  --gb-accent-hover: #63440f;
  --gb-gold: #c9a24b;
  --gb-gold-soft: #f6ecd2;
  --gb-ok-bg: #eaf3ea;
  --gb-warn-bg: #faf0d8;
  --gb-bad-bg: #fbeae7;
  --gb-control-line: #8f8778;
  --gb-shadow: 0 1px 2px #241f170a;
  --gb-shadow-pop: 0 4px 12px #241f1714, 0 16px 40px #241f171f;
  --gb-sidebar: #ece9e1;
  --gb-sidebar-line: #dcd7cb;
  --gb-sidebar-muted: #625a4c;
  --gb-stage: #1f1b15;
  --gb-stage-muted: #b5aa96;
  /* Table rows (1.9.0): every second row a very light warm yellow, lighter than --gb-gold-soft; the row under
     the pointer a touch stronger; the chosen row the soft gold. Checked on the alternate / hover / chosen row:
     ink 15.4 / 14.4 / 13.9, muted 5.7 / 5.3 / 5.1, red amount 6.4 / 6.0 / 5.8, green amount 6.0 / 5.6 / 5.4. */
  --gb-row-alt: #fdf8ec;
  --gb-row-hover: #f9f0da;
  --gb-row-selected: #f6ecd2;
}
/* The colours of the retired owner-level customiser; index.html fixes the gold and the page tone on <html>. */
:root {
  --gb-swatch-champagne: #e3c98b;
  --gb-swatch-gold: #d8b25a;
  --gb-swatch-honey: #c99a3b;
  --gb-swatch-antique: #b88e3e;
  --gb-swatch-bronze: #8c642e;
  --gb-swatch-dark: #1f1b15;
  --gb-swatch-light: #ffffff;
  --gb-swatch-white: #fbfaf7;
  --gb-swatch-warm: #f7f3ea;
}
/* Button gold, lightest to today's bronze. Ink on fill / hover / pressed, and edge on white:
   champagne 10.4 / 9.0 / 7.8, edge 3.4 · gold 8.4 / 7.4 / 6.4, edge 3.5 · honey 6.6 / 5.9 / 5.2, edge 4.2
   antique 5.6 / 5.1 / 4.5, edge 4.7 · bronze (white ink) 5.3 / 6.9 / 8.1, edge 6.9. */
:root[data-gb-gold=champagne] { --gb-btn: var(--gb-swatch-champagne); --gb-btn-hover: #d5bb7f; --gb-btn-press: #c8ad73; --gb-btn-edge: #a18751; }
:root[data-gb-gold=gold],
:root[data-gb-erp] :is([data-gb-theme=golden],.desk,.gb-doc-page,.gb-doc) { --gb-btn: var(--gb-swatch-gold); --gb-btn-hover: #cba753; --gb-btn-press: #bf9b4c; --gb-btn-edge: #a6843d; }
:root[data-gb-gold=honey] { --gb-btn: var(--gb-swatch-honey); --gb-btn-hover: #be9137; --gb-btn-press: #b38833; --gb-btn-edge: #9d762b; }
:root[data-gb-gold=antique] { --gb-btn: var(--gb-swatch-antique); --gb-btn-hover: #af863a; --gb-btn-press: #a57e35; --gb-btn-edge: #926e2c; }
:root[data-gb-gold=bronze] { --gb-btn: var(--gb-swatch-bronze); --gb-btn-hover: #765326; --gb-btn-press: #694a20; --gb-btn-edge: #765326; --gb-btn-ink: #ffffff; --gb-btn-shine: inset 0 1px 0 #ffffff1f; }
/* The alternate table row follows the button gold, so the two never clash. Muted text stays 5.1:1 or more on each. */
:root[data-gb-erp][data-gb-gold=champagne] { --gb-row-alt: #fdfaf0; --gb-row-hover: #faf3df; }
:root[data-gb-erp][data-gb-gold=gold],
:root[data-gb-erp] :is([data-gb-theme=golden],.desk,.gb-doc-page,.gb-doc) { --gb-row-alt: #fdf9ed; --gb-row-hover: #f9f1dc; }
:root[data-gb-erp][data-gb-gold=honey] { --gb-row-alt: #fdf8ec; --gb-row-hover: #f9f0da; }
:root[data-gb-erp][data-gb-gold=antique] { --gb-row-alt: #fcf7eb; --gb-row-hover: #f8efd9; }
:root[data-gb-erp][data-gb-gold=bronze] { --gb-row-alt: #fbf6ec; --gb-row-hover: #f6eddb; }
/* Page tone: white (default) or a warmer ivory. Muted ink stays 5.4:1 and the control line 3.2:1 on it. */
:root[data-gb-erp][data-gb-tone=warm] { --gb-page: #f7f3ea; --gb-canvas: #f7f3ea; --gb-soft: #f3eddd; --gb-soft-2: #faf7ef; --gb-line: #e8e1d2; }

/* Side menu (sidebar-nav.css): collapsible groups on a light warm stone, a shade deeper than the page,
   with a hairline between the menu and the page. On the menu background: names 13.5:1, entries 9.8:1,
   icons 7.3:1, muted (role, counts) 5.6:1, open group 5.5:1; on the hover row: names 12.4:1, icons 6.7:1,
   muted 5.2:1. The open page is a soft tan pill with dark ink (10.9:1) and a bronze-gold bar on its outer
   edge (4.4:1 on the menu, 3.5:1 on the pill). The wordmark is drawn in dark ink on this light menu. */
:root[data-gb-erp],
:root[data-gb-erp] :is([data-gb-theme=golden],.desk,.gb-doc-page,.gb-doc) {
  --gb-nav-bg: #ece9e1;
  --gb-nav-ink: #241f17;
  --gb-nav-entry: #3d362b;
  --gb-nav-muted: #625a4c;
  --gb-nav-icon: #4f4a3f;
  --gb-nav-line: #dcd7cb;
  --gb-nav-hover: #e4e0d5;
  --gb-nav-open: #7a5520;
  --gb-nav-active: #d9cfb8;
  --gb-nav-active-ink: #241f17;
  --gb-nav-active-edge: #d9cfb8;
  --gb-nav-active-bar: #8c642e;
  --gb-nav-ring: #7a5520;
  --gb-nav-edge: #d8d3c7;
  --gb-nav-scroll: #b5ae9f;
  --gb-wordmark-filter: brightness(0) opacity(.82);
  --gb-nav-weight: 400;
  --gb-nav-weight-group: 500;
  --gb-nav-weight-active: 500;
}

/* ---------------------------------------------------------------------------
   Themes. Each person chooses their own in Account settings (themes.js); the choice is
   one attribute on <html>, data-gb-theme, and a theme is nothing but values for the tokens above.
   No attribute is the Golden Bridge look, exactly as it always was.

   Islands: the sign-in desk and any printed page shown on the screen (.gb-doc-page, .gb-doc) keep the
   Golden Bridge palette whatever the theme, and so does a preview marked data-gb-theme=golden. That is
   why the rules above are also addressed to them. A preview marked with another theme's name takes
   that theme, so the choices in Account settings are drawn with the real tokens.
   Themes are for the screen only: anything printed (Ctrl+P included) is on white paper.
   One exception to the desk island: with a sign-in kept on the device (data-gb-kept, appearance-boot.js and
   signin.js), the desk only says "Restoring your session…" (data-gb-busy) on the way to the workspace, after
   a reload or "Update"; it then takes the person's theme, so a dark workspace never passes through a light
   frame. (Plain attribute selectors only: one selector an old WebView cannot read would drop the whole rule.) */
:root[data-gb-erp] :is(.desk,.gb-doc-page,.gb-doc) { color-scheme: light; }
/* The page itself, under everything, in the theme from the first stylesheet on. */
@media screen { :root[data-gb-erp] { background-color: var(--gb-page); } }
/* Text colour is inherited as a finished value, so the desk takes its ink again from its own tokens. */
:root[data-gb-erp] .desk { color: var(--gb-ink); }
@media screen {
  /* Dark: for long hours. Soft warm charcoal, never pure black; parchment ink; the same gold.
     Palette: charcoal #1e1c19 (page), raised #282521 (cards), hairline #403b33, parchment #ece6da (ink),
     stone #b3a998 (muted), gold #d8b25a (buttons) and #e3c078 (links, focus).
     Every pair is checked by tests/theme-contrast.test.mjs (text 4.5:1, icons, edges and focus 3:1). */
  :root[data-gb-erp][data-gb-theme=dark],
  :root[data-gb-erp] [data-gb-theme=dark],
  :root[data-gb-erp][data-gb-theme=dark][data-gb-kept] .desk[data-gb-busy] {
    color-scheme: dark;
    --gb-page: #1e1c19;
    --gb-canvas: #1e1c19;
    --gb-surface: #282521;
    --gb-soft: #322e29;
    --gb-soft-2: #23211d;
    --gb-ink: #ece6da;
    --gb-muted: #b3a998;
    --gb-line: #403b33;
    --gb-control-line: #8c8374;
    --gb-accent: #e3c078;
    --gb-accent-hover: #efd49b;
    --gb-gold: #d8b25a;
    --gb-gold-soft: #453b26;
    --gb-ok: #8fcf9b;
    --gb-ok-bg: #1f3325;
    --gb-warn: #e6bd6a;
    --gb-warn-bg: #3b3018;
    --gb-bad: #f29c90;
    --gb-bad-bg: #45231f;
    --gb-bad-hover: #f7b5ab;
    --gb-shadow: 0 1px 2px #0000003d;
    --gb-shadow-pop: 0 4px 12px #00000052, 0 16px 40px #00000066;
    --gb-btn-shine: inset 0 1px 0 #ffffff33;
    --gb-focus: 0 0 0 3px color-mix(in srgb, var(--gb-btn) 46%, transparent);
    --gb-row-alt: #2e2b26;
    --gb-row-hover: #37322b;
    --gb-row-selected: #453b26;
    --gb-sidebar: #171512;
    --gb-sidebar-line: #2e2a24;
    --gb-sidebar-muted: #bdb29d;
    --gb-wordmark-filter: none;
    /* The menu: a deeper charcoal than the page, the same parchment names and the gold pill on the open page. */
    --gb-nav-bg: #171512;
    --gb-nav-ink: #f3eee4;
    --gb-nav-entry: #e4dccb;
    --gb-nav-muted: #bdb29d;
    --gb-nav-icon: #bdb29d;
    --gb-nav-line: #2e2a24;
    --gb-nav-hover: #26221d;
    --gb-nav-open: #f0cd7c;
    --gb-nav-active: #e3bd62;
    --gb-nav-active-ink: #1f1b15;
    --gb-nav-active-edge: #e3bd62;
    --gb-nav-active-bar: #e3bd62;
    --gb-nav-ring: #f0cd7c;
    --gb-nav-edge: #2e2a24;
    --gb-nav-scroll: #2e2a24;
    /* Buttons: the gold of the Golden Bridge look, with its dark ink. */
    --gb-btn: #d8b25a;
    --gb-btn-hover: #e2c074;
    --gb-btn-press: #cba753;
    --gb-btn-edge: #a6843d;
    --gb-btn-ink: #231c10;
    /* The account status card on the dark page: the same meaning, readable on charcoal. */
    --gb-cover-bad: #f29c90;
    --gb-cover-bad-bg: #45231f;
    --gb-cover-bad-line: #6b3029;
    --gb-cover-ok: #8fcf9b;
    --gb-cover-ok-bg: #1f3325;
    --gb-cover-ok-line: #2f5a39;
    --gb-cover-scrim: #00000080;
  }
}
