/* ================================================================
   Biashara Sauti - design tokens (REDESIGN-PLAN.md section 2.1)
   Every colour, size and curve the app pages use, in one place.
   Loaded before style.css on every page that uses it. Dark mode
   overrides the same names on body[data-theme="dark"].

   The font is self-hosted so the offline Android app, which has no
   internet, shows it too. Manrope, SIL Open Font License, see
   fonts/Manrope-OFL.txt.
   ================================================================ */
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/Manrope-latin-var.woff2") format("woff2");
    unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Text and surfaces */
    --ink: #1a1a1c;
    --ink-soft: #3a3b40;
    --muted: #5f6168;
    --line: #dfe4eb;
    --line-soft: #eceff4;
    --bg: #f0f2f6;
    --surface: #f4f5f8;
    --card: #fcfcfd;
    --input-bg: #fcfcfd;
    --input-text: #1a1a1c;
    --button-outline-bg: #fcfcfd;
    --button-outline-text: #1a1a1c;
    --product-tile-bg: #fcfcfd;
    --solid: #1a1a1c;           /* ink circles: monogram, ticks */
    --on-solid: #fff;
    --seg-track: #e9ecf1;       /* segmented controls (page tabs, periods) */
    --seg-active: #fcfcfd;

    /* Actions and "you are here". --brand-ink is the accent for text (higher contrast). */
    --brand: #864ffe;
    --brand-hover: #7c31f6;
    --brand-ink: #6d28d9;
    --brand-soft: #ece8ff;
    --focus: #864ffe;
    /* The dark sales card / login panel, and the lime used on it. */
    --brand-deep: #1a1a1c;
    --gold: #c6f56f;
    --hero-muted: rgba(252, 252, 252, 0.62);

    /* Money: green = money in, red = money out, amber = needs a look */
    --green: #0f7a4e;
    --green-dark: #0b5e3c;
    --green-bg: #e3f6ec;
    --red: #c0294a;
    --red-dark: #9b1c3a;
    --red-bg: #fdeef1;
    --warn: #b45309;
    --warn-dark: #8a4a06;
    --warn-bg: #fff4e0;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-bg: #eaf1fd;

    /* Pastel highlights: icon circles, chips */
    --yellow: #f9eb57;
    --yellow-soft: #fdf7bc;
    --cyan: #83e7ee;
    --cyan-soft: #d9f7f9;
    --peach: #ffb9a2;
    --peach-soft: #ffe8df;
    --lime: #c6f56f;
    --lime-soft: #e8fbc6;

    /* Charts: payment pockets (a fixed categorical order), report grid, expense bars */
    --pocket-1: #2a78d6;
    --pocket-2: #eb6834;
    --pocket-3: #1baf7a;
    --pocket-4: #eda100;
    --pocket-5: #e87ba4;
    --pocket-6: #008300;
    --pocket-7: #6250d6;
    --pocket-8: #e34948;
    --pv-grid: rgba(15, 23, 42, 0.07);
    --ex-bar: #e8590c;
    --ex-bar-soft: #f4a77a;
    --ex-tint: #ffe8df;

    /* Shape and depth */
    --radius: 20px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-lift: 0 18px 48px -16px rgba(28, 34, 43, 0.18);

    /* ---- Scales for the redesign (phase 1 onwards) ---- */
    --r-sm: 8px;                /* chips */
    --r-md: 12px;               /* inputs, small cards */
    --r-lg: 16px;               /* cards */
    --r-xl: 24px;               /* sheets, hero cards */
    --r-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;
    --text-3xl: 38px;

    /* Motion: strong curves (the built-in ones feel sluggish), UI motion under 300ms */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);         /* things entering, press feedback */
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);     /* things moving on screen */
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);      /* bottom sheets */
    --dur-press: 120ms;
    --dur-fast: 160ms;
    --dur-base: 200ms;
    --dur-sheet: 280ms;
}

body[data-theme="dark"] {
    --ink: #fcfcfc;
    --ink-soft: #d6d8de;
    --muted: #9ba1ab;
    --line: #2a333e;
    --line-soft: #202731;
    --bg: #0f1217;
    --surface: #13171e;
    --card: #181d26;
    --input-bg: #13171e;
    --input-text: #fcfcfc;
    --button-outline-bg: #181d26;
    --button-outline-text: #fcfcfc;
    --product-tile-bg: #181d26;
    --solid: #fcfcfc;
    --on-solid: #1a1a1c;
    --seg-track: #13171e;
    --seg-active: #2a333e;

    --brand: #864ffe;
    --brand-hover: #9566ff;
    --brand-ink: #c3b1ff;
    --brand-soft: rgba(165, 133, 255, 0.14);
    --brand-deep: #070b10;

    --green: #4ade9a;
    --green-dark: #86efbc;
    --green-bg: rgba(74, 222, 154, 0.12);
    --red: #fb7185;
    --red-dark: #fda4af;
    --red-bg: rgba(251, 113, 133, 0.12);
    --warn: #fbbf24;
    --warn-dark: #fcd34d;
    --warn-bg: rgba(251, 191, 36, 0.12);
    --blue: #60a5fa;
    --blue-dark: #bfdbfe;
    --blue-bg: rgba(59, 130, 246, 0.16);

    --yellow-soft: rgba(249, 235, 87, 0.12);
    --cyan-soft: rgba(131, 231, 238, 0.12);
    --peach-soft: rgba(255, 185, 162, 0.12);
    --lime-soft: rgba(198, 245, 111, 0.12);

    --pocket-1: #3987e5;
    --pocket-2: #d95926;
    --pocket-3: #199e70;
    --pocket-4: #c98500;
    --pocket-5: #d55181;
    --pocket-6: #008300;
    --pocket-7: #9085e9;
    --pocket-8: #e66767;
    --pv-grid: rgba(255, 255, 255, 0.07);
    --ex-bar: #fb8a4c;
    --ex-bar-soft: #9a4a22;
    --ex-tint: rgba(255, 185, 162, 0.12);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 18px 48px -16px rgba(0, 0, 0, 0.7);
}
