/* ERPeace design tokens. Every colour, font, radius and shadow of the platform lives here, and only here.
   The palette is "midnight", chosen by the owner on 2026-10-31 for the front page and then for every page.
   Two of its colours are too light for text on white, so each has a darker partner (checked to WCAG AA, 4.5 : 1):
     Sky   #5BC0DE (2.1 : 1) -> accents, icons, dark-mode links;  Sky for links  #1E6E8C (5.7 : 1) -> links
     Amber #D97706 (3.2 : 1) -> dark-mode buttons, details;       Amber for buttons #AD5008 (5.4 : 1) -> buttons, text
   Peach #F4D6B0 is for text and details on midnight only.
   Dark mode follows the device, unless the person chose light or dark (html[data-theme]).
   The shapes are "Glow", chosen by the owner on 2026-10-31: glass cards with a thin sky edge, soft amber and sky
   light in the page corners, round 14px buttons with an amber gradient and a soft glow. */

/* Inter (English, German) and IBM Plex Sans Arabic (Arabic), both SIL Open Font License, kept on this server. */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  /* The palette */
  --midnight: #0B132B; --navy: #1C2541; --slate: #3A506B; --sky: #5BC0DE; --sky-ui: #1E6E8C;
  --peach: #F4D6B0; --amber: #D97706; --amber-ui: #AD5008;
  --warm-white: #FBF8F3; --grey-blue: #EEF1F6; --white: #FFFFFF;

  /* What the parts use */
  --bg: var(--warm-white); --card: var(--white); --surface-2: var(--grey-blue); --line: #DDE2EA; --line-strong: #C3CCD9;
  --text: var(--navy); --heading: var(--midnight); --muted: #4A5B73;
  --brand: var(--amber-ui); --on-brand: #FFFFFF; --brand-soft: #FCEBD5; --accent: var(--sky); --info: var(--sky);
  --link: var(--sky-ui); --focus: var(--amber);
  --nav: var(--midnight); --on-nav: #FFFFFF; --nav-muted: #C9D3E3; --nav-hover: rgba(255, 255, 255, .08); --nav-on: rgba(91, 192, 222, .18);
  --bar: var(--midnight); --on-bar: #FFFFFF; --bar-hover: rgba(255, 255, 255, .12);
  --ok: #1F6B45; --ok-soft: #E3F2E9; --warn: #7A5000; --warn-soft: #FBF0D9; --danger: #B3362B; --danger-soft: #FBEAE7;
  --info-text: #1E6E8C; --info-soft: #E3F4FA;

  /* Glow: the light in the page corners, glass cards, glowing buttons */
  --glow-warm: rgba(217, 119, 6, .13); --glow-cool: rgba(91, 192, 222, .18);
  --glass: rgba(255, 255, 255, .78); --glass-line: rgba(30, 110, 140, .16); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --brand-grad: linear-gradient(135deg, #BC5A0A, #A04A06); --brand-glow: 0 4px 18px rgba(173, 80, 8, .28);
  --nav-on-bg: linear-gradient(90deg, rgba(217, 119, 6, .28), rgba(91, 192, 222, .14));
  --focus-ring: 0 0 0 4px rgba(91, 192, 222, .28);

  /* Shape, depth, space */
  --radius: 20px; --radius-lg: 24px; --radius-btn: 14px; --radius-icon: 14px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(11, 19, 43, .04), 0 8px 24px rgba(11, 19, 43, .06);
  --shadow-hover: 0 10px 30px rgba(30, 110, 140, .16);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem;
  --side-w: 16.5rem;

  /* Type */
  --font: Inter, 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', Tahoma, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', Inter, system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;
  --font-head: Montserrat, Inter, 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-small: .875rem; --fs-body: 1rem; --fs-h3: 1.05rem; --fs-h2: 1.2rem; --fs-h1: 1.65rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--midnight); --card: var(--navy); --surface-2: #243052; --line: #2A3658; --line-strong: var(--slate);
    --text: #EAEFF7; --heading: var(--peach); --muted: #B4C0D3;
    --brand: #E58A1F; --on-brand: var(--midnight); --brand-soft: #3A2A14; --accent: var(--sky); --info: var(--sky);
    --link: #8FD3EA; --focus: var(--sky);
    --nav: #070D1F; --on-nav: #FFFFFF; --nav-muted: #B4C0D3; --nav-hover: rgba(255, 255, 255, .06); --nav-on: rgba(91, 192, 222, .16);
    --bar: #070D1F; --on-bar: #FFFFFF; --bar-hover: rgba(255, 255, 255, .10);
    --ok: #8FD6A8; --ok-soft: #1C3326; --warn: #F0C46C; --warn-soft: #3A2F17; --danger: #F19A90; --danger-soft: #3D201D;
    --info-text: #8FD3EA; --info-soft: #17324A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-hover: 0 0 0 1px rgba(91, 192, 222, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --glow-warm: rgba(232, 150, 60, .20); --glow-cool: rgba(91, 192, 222, .20);
    --glass: rgba(28, 37, 65, .62); --glass-line: rgba(91, 192, 222, .18); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
    --brand-grad: linear-gradient(135deg, #F0A040, #E58A1F); --brand-glow: 0 0 24px rgba(217, 119, 6, .45);
    --nav-on-bg: linear-gradient(90deg, rgba(217, 119, 6, .25), rgba(91, 192, 222, .12));
    --focus-ring: 0 0 0 4px rgba(91, 192, 222, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--midnight); --card: var(--navy); --surface-2: #243052; --line: #2A3658; --line-strong: var(--slate);
  --text: #EAEFF7; --heading: var(--peach); --muted: #B4C0D3;
  --brand: #E58A1F; --on-brand: var(--midnight); --brand-soft: #3A2A14; --accent: var(--sky); --info: var(--sky);
  --link: #8FD3EA; --focus: var(--sky);
  --nav: #070D1F; --on-nav: #FFFFFF; --nav-muted: #B4C0D3; --nav-hover: rgba(255, 255, 255, .06); --nav-on: rgba(91, 192, 222, .16);
  --bar: #070D1F; --on-bar: #FFFFFF; --bar-hover: rgba(255, 255, 255, .10);
  --ok: #8FD6A8; --ok-soft: #1C3326; --warn: #F0C46C; --warn-soft: #3A2F17; --danger: #F19A90; --danger-soft: #3D201D;
  --info-text: #8FD3EA; --info-soft: #17324A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-hover: 0 0 0 1px rgba(91, 192, 222, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --glow-warm: rgba(232, 150, 60, .20); --glow-cool: rgba(91, 192, 222, .20);
  --glass: rgba(28, 37, 65, .62); --glass-line: rgba(91, 192, 222, .18); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --brand-grad: linear-gradient(135deg, #F0A040, #E58A1F); --brand-glow: 0 0 24px rgba(217, 119, 6, .45);
  --nav-on-bg: linear-gradient(90deg, rgba(217, 119, 6, .25), rgba(91, 192, 222, .12));
  --focus-ring: 0 0 0 4px rgba(91, 192, 222, .22);
  color-scheme: dark;
}

/* The sign-in page's welcome side (views/login.ejs, the first screen): the "midnight" look chosen on 2026-10-31. Always dark,
   whatever light or dark look a signed-in person chose, so these do not change with the theme.
   Text pairs checked for WCAG AA: peach on midnight 13.2:1, peach on slate 5.9:1, midnight on amber 5.8:1,
   midnight on sky 8.8:1, sky on midnight 8.8:1, sky on navy 7.2:1, soft on navy 9.7:1, amber on midnight 5.8:1. */
@font-face { font-family: Montserrat; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/montserrat-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/montserrat-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --front-midnight: var(--midnight); --front-navy: var(--navy); --front-slate: var(--slate); --front-sky: var(--sky);
  --front-peach: var(--peach); --front-amber: var(--amber);
  --front-deepest: #111A33; --front-line: #2A3658; --front-soft: #D9CDBE;
  --front-glow-warm: rgba(232, 150, 60, .55); --front-glow-cool: rgba(91, 192, 222, .45); --front-glow-top: rgba(58, 80, 107, .6);
  --front-band-warm: rgba(232, 150, 60, .35); --front-band-cool: rgba(91, 192, 222, .30);
  --front-shadow: 0 -14px 40px rgba(0, 0, 0, .45);
  /* Glow on the front page: glass cards, glowing buttons and marks (2026-10-31). Midnight on the sky gradient's dark end #3E93AE is 5.2:1. */
  --front-glass: rgba(28, 37, 65, .62); --front-glass-line: rgba(91, 192, 222, .18); --front-glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --front-glass-btn: rgba(255, 255, 255, .06); --front-glass-btn-line: rgba(91, 192, 222, .55); --front-glass-btn-hover: rgba(91, 192, 222, .14);
  --front-amber-grad: linear-gradient(135deg, #F0A040, #D97706); --front-sky-grad: linear-gradient(135deg, #5BC0DE, #3E93AE);
  --front-amber-glow: 0 0 24px rgba(217, 119, 6, .45); --front-amber-glow-big: 0 0 40px rgba(217, 119, 6, .45);
  --front-sky-glow: 0 0 20px rgba(91, 192, 222, .42); --front-peach-glow: 0 0 20px rgba(244, 214, 176, .35);
  --front-glow-warm-soft: rgba(232, 150, 60, .14); --front-glow-cool-soft: rgba(91, 192, 222, .14);
  --front-font: Montserrat, 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
