/* FloGuard CRM design tokens.
 * Light theme is the default; dark applies with prefers-color-scheme unless the user
 * picked a theme (html[data-theme="light"|"dark"], set by js/00-theme.js).
 * Rule of thumb: brand orange is the ONLY action colour (primary buttons, active nav,
 * selection). Blue is information (links, info notes, terrain meters). Never mix them up.
 */

@font-face{
  font-family:'Inter FG';font-style:normal;font-display:swap;font-weight:100 900;
  src:url(../fonts/InterVariable-latin.woff2) format('woff2-variations'),url(../fonts/InterVariable-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Inter FG';font-style:normal;font-display:swap;font-weight:100 900;
  src:url(../fonts/InterVariable-latin-ext.woff2) format('woff2-variations'),url(../fonts/InterVariable-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root{
  color-scheme:light;
  /* ---- brand ---- */
  --brand-orange:#F57C1F;
  --brand-blue:#1E88C7;
  --brand-ink:#0B0F1A;

  /* ---- neutral ramp (cool slate, light) ---- */
  --n-0:#FFFFFF;
  --n-25:#FAFBFC;
  --n-50:#F5F6F8;
  --n-100:#EEF0F3;
  --n-150:#E6E9ED;
  --n-200:#DDE1E7;
  --n-300:#C9CFD8;
  --n-400:#9BA5B3;
  --n-500:#606B7C;
  --n-600:#566173;   /* 6.2:1 on white */
  --n-700:#3B4555;
  --n-800:#232B38;
  --n-900:#0E1726;

  /* ---- semantic surfaces & text ---- */
  --bg:var(--n-50);
  --surface:var(--n-0);
  --surface-2:var(--n-25);
  --surface-sunken:var(--n-100);
  --surface-hover:var(--n-50);
  --line:var(--n-150);
  --line-strong:var(--n-200);
  --input-border:var(--n-300);
  --text:var(--n-900);
  --text-2:var(--n-600);
  --text-3:var(--n-500);      /* 5.0:1 on --bg, 4.7:1 on --surface-sunken */
  --text-inverse:#FFFFFF;

  /* ---- action (orange, ink text: 6.7:1) ---- */
  --action:#F57C1F;
  --action-hover:#FF8A33;
  --action-press:#E26C10;
  --action-ink:#0E1726;
  --action-soft:#FFF1E5;
  --action-soft-line:#F9C99F;
  --action-text:#A9480A;      /* orange as text on light: 5.6:1 */
  --focus:#F57C1F;
  --focus-ring:0 0 0 2px var(--surface),0 0 0 4px var(--focus);

  /* ---- info (blue) ---- */
  --info:#1670A6;             /* 5.4:1 on white */
  --info-fill:#1E88C7;
  --info-soft:#EAF4FB;
  --info-line:#B9DAF0;

  /* ---- status ---- */
  --success:#067647; --success-soft:#ECFDF3; --success-line:#ABEFC6;
  --warn:#B54708;    --warn-soft:#FFFAEB;    --warn-line:#FEDF89;
  --danger:#B42318;  --danger-soft:#FEF3F2;  --danger-line:#FECDCA;
  --teal:#0B7468;    --teal-soft:#EAF6F4;    --teal-line:#B5DFD8;
  --violet:#5B3FBF;  --violet-soft:#F3F0FC;  --violet-line:#D3C8F2;
  --clay:#8A5A2B;    --clay-soft:#F7F0E8;    --clay-line:#E2C9A8;
  --rose:#A83A72;    --rose-soft:#FBEEF5;    --rose-line:#EFB7D4;

  /* ---- shell ---- */
  --sidebar-bg:#0B0F1A;
  --sidebar-text:#B7C0CD;
  --sidebar-text-strong:#F3F5F8;
  --sidebar-muted:#7F8A9B;
  --sidebar-hover:rgba(255,255,255,.06);
  --sidebar-active:rgba(245,124,31,.14);
  --sidebar-line:rgba(255,255,255,.08);
  --sidebar-w:236px;
  --sidebar-w-collapsed:64px;
  --topbar-h:56px;
  --tabbar-h:60px;
  /* Layering (R2): one scale for every overlay so drawer, modal, sheet, map popups and toasts never fight. */
  --z-sticky:20;--z-topbar:50;--z-scrim:55;--z-sheet:57;--z-tabbar:58;--z-sidebar:60;--z-menu:70;--z-drawer:80;--z-modal:120;--z-toast:300;
  --scrim:rgba(11,15,26,.48);

  /* ---- spacing (4px grid) ---- */
  --s-0:0; --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px; --s-8:32px; --s-10:40px; --s-12:48px;

  /* ---- radii ---- */
  --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:12px; --r-xl:16px; --r-pill:999px;

  /* ---- shadows ---- */
  --sh-1:0 1px 2px rgba(14,23,38,.06);
  --sh-2:0 1px 3px rgba(14,23,38,.08),0 1px 2px rgba(14,23,38,.04);
  --sh-3:0 8px 24px -6px rgba(14,23,38,.16),0 2px 6px rgba(14,23,38,.06);
  --sh-4:0 24px 48px -12px rgba(14,23,38,.28);

  /* ---- type ---- */
  --font:'Inter FG','Inter',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --font-mono:ui-monospace,'SF Mono','Cascadia Mono',Menlo,Consolas,monospace;
  --fs-11:11px; --fs-12:12px; --fs-13:13px; --fs-14:14px; --fs-15:15px; --fs-16:16px; --fs-18:18px; --fs-20:20px; --fs-24:24px;
  --lh-tight:1.25; --lh:1.5;
  --fw-regular:420; --fw-medium:520; --fw-semibold:600; --fw-bold:680;

  /* ---- motion ---- */
  --ease:cubic-bezier(.2,.7,.2,1);
  --t-fast:120ms; --t:160ms; --t-slow:200ms;

  /* ---- legacy aliases (old inline styles in JS still reference these) ---- */
  --ink:var(--text);
  --muted:var(--text-2);
  --accent:var(--action);
  --accent2:var(--info-fill);
  --band:var(--sidebar-bg);
  --pad-x:22px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  --safe-l:env(safe-area-inset-left,0px);
  --safe-r:env(safe-area-inset-right,0px);
}

/* ---- dark theme ---- */
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0B0F1A;
  --surface:#111725;
  --surface-2:#141B2A;
  --surface-sunken:#0E1320;
  --surface-hover:#172033;
  --line:#1F2838;
  --line-strong:#2A3446;
  --input-border:#33405A;
  --text:#E8ECF2;
  --text-2:#A3AEBE;
  --text-3:#8692A4;
  --text-inverse:#0E1726;
  --action-soft:rgba(245,124,31,.14);
  --action-soft-line:rgba(245,124,31,.45);
  --action-text:#F9A25C;
  --info:#6BB8EA;
  --info-soft:rgba(30,136,199,.16);
  --info-line:rgba(107,184,234,.4);
  --success:#47CD89; --success-soft:rgba(71,205,137,.12); --success-line:rgba(71,205,137,.35);
  --warn:#FDB022;    --warn-soft:rgba(253,176,34,.12);    --warn-line:rgba(253,176,34,.35);
  --danger:#F97066;  --danger-soft:rgba(249,112,102,.12); --danger-line:rgba(249,112,102,.4);
  --teal:#4FD1BF;    --teal-soft:rgba(79,209,191,.12);    --teal-line:rgba(79,209,191,.35);
  --violet:#B3A2F5;  --violet-soft:rgba(179,162,245,.12); --violet-line:rgba(179,162,245,.35);
  --clay:#E2B98A;    --clay-soft:rgba(226,185,138,.12);   --clay-line:rgba(226,185,138,.35);
  --rose:#F29BC6;    --rose-soft:rgba(242,155,198,.12);   --rose-line:rgba(242,155,198,.35);
  --sidebar-bg:#070A12;
  --sidebar-line:rgba(255,255,255,.06);
  --sh-1:0 1px 2px rgba(0,0,0,.4);
  --sh-2:0 1px 3px rgba(0,0,0,.5);
  --sh-3:0 10px 28px -6px rgba(0,0,0,.6),0 2px 6px rgba(0,0,0,.4);
  --sh-4:0 24px 56px -12px rgba(0,0,0,.7);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0B0F1A;
    --surface:#111725;
    --surface-2:#141B2A;
    --surface-sunken:#0E1320;
    --surface-hover:#172033;
    --line:#1F2838;
    --line-strong:#2A3446;
    --input-border:#33405A;
    --text:#E8ECF2;
    --text-2:#A3AEBE;
    --text-3:#8692A4;
    --text-inverse:#0E1726;
    --action-soft:rgba(245,124,31,.14);
    --action-soft-line:rgba(245,124,31,.45);
    --action-text:#F9A25C;
    --info:#6BB8EA;
    --info-soft:rgba(30,136,199,.16);
    --info-line:rgba(107,184,234,.4);
    --success:#47CD89; --success-soft:rgba(71,205,137,.12); --success-line:rgba(71,205,137,.35);
    --warn:#FDB022;    --warn-soft:rgba(253,176,34,.12);    --warn-line:rgba(253,176,34,.35);
    --danger:#F97066;  --danger-soft:rgba(249,112,102,.12); --danger-line:rgba(249,112,102,.4);
    --teal:#4FD1BF;    --teal-soft:rgba(79,209,191,.12);    --teal-line:rgba(79,209,191,.35);
    --violet:#B3A2F5;  --violet-soft:rgba(179,162,245,.12); --violet-line:rgba(179,162,245,.35);
    --clay:#E2B98A;    --clay-soft:rgba(226,185,138,.12);   --clay-line:rgba(226,185,138,.35);
    --rose:#F29BC6;    --rose-soft:rgba(242,155,198,.12);   --rose-line:rgba(242,155,198,.35);
    --sidebar-bg:#070A12;
    --sidebar-line:rgba(255,255,255,.06);
    --sh-1:0 1px 2px rgba(0,0,0,.4);
    --sh-2:0 1px 3px rgba(0,0,0,.5);
    --sh-3:0 10px 28px -6px rgba(0,0,0,.6),0 2px 6px rgba(0,0,0,.4);
    --sh-4:0 24px 56px -12px rgba(0,0,0,.7);
  }
}
