/* THEME: the only file with colors. There is one theme, "actuvista" (<html data-theme="actuvista">), in two modes
   (data-mode="light|dark", set from each user's choice). Chart pairs (--series-1/2) are checked for colour-blind
   separation and contrast against the card colour, light and dark. The stylesheets use these variables only.
   Donut slices use --series-1 and --series-2; "Other" is --muted. --cat-6 colours the Contact Us icon. */
:root {
  color-scheme:light;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --radius:8px;
  --radius-lg:14px;
  --overlay:rgba(10,14,25,.5);
  --shadow:0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --err:#c0392b; --ok:#1e8e4e; --warn:#b26a00;
  --cat-6:#4a8fa8;

  /* TEXT ROLES: size, weight and colour of each kind of text. Colours point at the theme's palette below,
     so every theme gets them; a theme block can set any of these to change just that role. */
  --t-title-size:22px;      --t-title-weight:700;     --t-title-color:var(--ink);        /* page title (h2) */
  --t-heading-size:16px;    --t-heading-weight:700;   --t-heading-color:var(--ink);      /* card and panel heading (h3) */
  --t-subheading-size:15px; --t-subheading-weight:600; --t-subheading-color:var(--ink);  /* groups inside cards (h4) */
  --t-menu-size:15px;       --t-menu-weight:400;      --t-menu-color:var(--ink);         /* menu item */
  --t-menu-active-weight:600; --t-menu-active-color:var(--on-accent);                    /* open menu item */
  --t-tab-size:15px;        --t-tab-weight:600;       --t-tab-color:var(--muted);        /* section tab */
  --t-tab-active-color:var(--accent-text);                                                    /* open tab */
  --t-body-size:15px;       --t-body-weight:400;      --t-body-color:var(--ink);         /* normal text */
  --t-hint-size:15px;       --t-hint-color:var(--muted);                                 /* grey line under titles */
  --t-help-size:12px;       --t-help-color:var(--muted);                                 /* small text under fields */
  --t-label-size:13px;      --t-label-weight:400;     --t-label-color:var(--muted);      /* field label */
  --t-link-weight:600;      --t-link-color:var(--accent-text);                                /* clickable text in text */
  --t-button-size:15px;     --t-button-weight:600;                                       /* button text */
  --t-th-size:13px;         --t-th-weight:600;        --t-th-color:var(--muted);         /* table heading */
  --t-td-size:15px;         --t-td-color:var(--ink);                                     /* table text */
  --t-total-weight:700;     --t-total-color:var(--ink);                                  /* table total (bold) */
  --t-msg-size:15px;                                                                     /* success, warning, error box */

  /* ICON COLOURS: by meaning, used in the menu, tabs, headings, home tiles and KPI cards (buttons keep their text colour). */
  --ic-plan:#0f8a80;     /* reports, dashboard, planning */

  /* BACKGROUNDS: one per area. They point at the palette; a theme can give any area its own colour. */
  --bg-page:var(--bg);            /* main screen */
  --bg-card:var(--card);          /* cards, panels, tables */
  --bg-menu:var(--card);          /* side menu (and the phone menu) */
  --bg-hover:var(--bg);           /* menu and button hover */
  --bg-active:var(--accent);      /* open menu item, primary buttons */
  --bg-input:var(--field);        /* inputs and dropdowns */
  --bg-popup:var(--card);         /* popups */
}
[data-mode="dark"] {
  color-scheme:dark;
  --ic-plan:#3cc3b2;
  --overlay:rgba(0,0,0,.6);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
  --err:#ff7b6b; --ok:#4cc783; --warn:#f0b24a;
  --cat-6:#6fb3cb;
}
/* ACTUVISTA Cobalt (AD1): accent #0047AB, hover #003680, soft #E6EDF8 (light) / #13203A (dark); chart blue on dark #478BEB. --accent-text is the accent as text/icon colour: Cobalt on light, #5594EC on dark (AA, also on the #252D38 grey); fills, buttons and the logo stay --accent. The neutrals are cool greys. */
:root, [data-theme="actuvista"] {
  --bg:#F4F6F9; --card:#FFFFFF; --ink:#141A22; --muted:#5A6472; --line:#DDE2E8;
  --accent:#0047AB; --accent-text:#0047AB; --on-accent:#FFFFFF; --accent-soft:#E6EDF8;
  --series-1:#0047AB; --series-2:#D97706;
  --surface:#EEF1F5; --surface-low:#F4F6F9; --surface-high:#E7EBF0;
  --surface-line:#DDE2E8; --pos:#1E8E4E; --neg:#B42318; --neg-dot:#D92D20;
  --field:#FFF6D4;              /* the fill of text and number inputs and text areas you type in: pale yellow (UX1) */
  --field-line:#E4D184;         /* the border of a field you type in */
  --sel-bg:#EDEFF3; --sel-line:#A9B1BD;   /* selectables (drop-downs, switches, ticks): light grey with a border */
  --on-bg:#CFEBD9; --on-ink:#136A37; --on-line:#8FCBA6;   /* the chosen part of a switch: pale green, dark green bold */
  --txt:#4B5563; --strong:#2B333D;       /* simple text: grey; bold where it matters */
  --special:#1E8E4E; --caution:#B26A00; --fault:#C0392B;   /* special text green, warning orange, error red */
  --warn-bg:#FFF3DE; --warn-line:#F0C98A; --err-bg:#FDEBE8; --err-line:#EFB1A9;
  /* status pills (never blue): Draft yellow, Partly done purple, Final green, Uploaded grey, Local Harddisk orange */
  --pill-draft-bg:#FFE9A6; --pill-draft-ink:#7A5600; --pill-part-bg:#E9DEFA; --pill-part-ink:#5F32AE;
  --pill-final-bg:#D3EFDE; --pill-final-ink:#16703B; --pill-up-bg:#E3E6EB; --pill-up-ink:#4B5563; --pill-local-bg:#FCE8C8; --pill-local-ink:#B26A00;
  /* Factors rows: selected Min / selected Max, CDF and % of ultimate, averages; the Ultimate Selection picks */
  --row-min:#D5EFEA; --row-max:#FBDFCB; --row-cdf:#E6E2F5; --row-avg:#ECEEF2; --pick-min-line:#2E9C8C; --pick-max-line:#D9743A; --pick-one:#D3EFDE; --pick-one-line:#2DA25F;
}
[data-theme="actuvista"][data-mode="dark"] {
  --bg:#0D1117; --card:#151B23; --ink:#E6EBF1; --muted:#9AA4B1; --line:#252D38;
  --accent:#0047AB; --accent-text:#5594EC; --on-accent:#FFFFFF; --accent-soft:#13203A;
  --series-1:#478BEB; --series-2:#E0912A;
  --surface:#0D1117; --surface-low:#11161D; --surface-high:#1C232D;
  --surface-line:#252D38; --pos:#4CC783; --neg:#FF9B8F; --neg-dot:#FF6B5B;
  --field:#3A3320; --field-line:#6B5E2E;
  --sel-bg:#252D38; --sel-line:#4A5564;
  --on-bg:#1F4A33; --on-ink:#8FE0B0; --on-line:#2F7A52;
  --txt:#B7C0CC; --strong:#E6EBF1;
  --special:#4CC783; --caution:#F0B24A; --fault:#FF7B6B;
  --warn-bg:#33290F; --warn-line:#6B5420; --err-bg:#3A1C19; --err-line:#7A3A33;
  --pill-draft-bg:#4A3B0E; --pill-draft-ink:#FFD866; --pill-part-bg:#33265A; --pill-part-ink:#CDB5F5;
  --pill-final-bg:#1F4A33; --pill-final-ink:#8FE0B0; --pill-up-bg:#2B3440; --pill-up-ink:#B7C0CC; --pill-local-bg:#4A3510; --pill-local-ink:#F0B24A;
  --row-min:#1D4A44; --row-max:#55321D; --row-cdf:#2E2A4A; --row-avg:#252D38; --pick-min-line:#4FC0AE; --pick-max-line:#F08A55; --pick-one:#1F4A33; --pick-one-line:#4CC783;
}
/* Dropdown lists follow the theme (the open list is drawn by the browser: color-scheme above, colours here). */
select option { background:var(--sel-bg); color:var(--ink); }
/* Loading overlay (templates/shared/_loader.html, static/shared/loader.js): a light grey screen (dark in dark mode), the ACTUVISTA logo turning left to right. */
.loader { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; background:rgba(244,246,249,.88); perspective:600px; }
[data-mode="dark"] .loader { background:rgba(13,17,23,.88); }
.loader[hidden] { display:none; }
.loader .loadlogo { width:auto; height:80px; backface-visibility:visible; animation:loader-spin 1.4s ease-in-out infinite; }
@media (min-width:900px) {
  .loader .loadlogo { height:120px; }
}
@keyframes loader-spin { from { transform:rotateY(0deg); } to { transform:rotateY(360deg); } }
@keyframes loader-pulse { 0%, 100% { opacity:1; } 50% { opacity:.5; } }
@media (prefers-reduced-motion:reduce) {
  .loader .loadlogo { animation:loader-pulse 1.6s ease-in-out infinite; }
}
