/* Flousna design tokens: every colour, size and timing in one place.
   Light is the default; dark follows the phone's setting unless the person picks one in Settings. */

:root {
  color-scheme: light;

  /* Surfaces and lines */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --scrim: rgba(16, 24, 40, 0.42);

  /* Text */
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;
  --on-accent: #ffffff;

  /* Brand */
  --accent: #ea580c;          /* icons, highlights */
  --accent-strong: #c2410c;   /* buttons and links (readable with white text) */
  --accent-soft: #fff1e8;
  --focus: #2e90fa;

  /* Money meaning */
  --positive: #067647;
  --positive-soft: #ecfdf3;
  --negative: #b42318;
  --negative-soft: #fef3f2;

  /* What kind of entry (the same meaning as in the original dashboard) */
  --k-expense: #d92d20;
  --k-bill: #1570ef;
  --k-income: #079455;
  --k-khair: #b54708;
  --k-save: #e04f16;
  --k-personal: #7f56d9;
  --k-debt: #0e7090;
  --k-cash: #475467;

  /* Status (budgets): never shown by colour alone, always with an icon and a word */
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --track: #eaecf0;

  /* Charts (validated colour-blind safe on these surfaces) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #eaecf0;
  --axis: #c3c2b7;

  /* Shape and depth */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-3: 0 20px 48px rgba(16, 24, 40, 0.18);

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --fs-hero: clamp(34px, 9vw, 46px);

  /* Spacing */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --gutter: 16px;

  /* Layout */
  --topbar-h: 56px;
  --bottomnav-h: 64px;
  --rail-w: 84px;
  --sidebar-w: 248px;
  --content-max: 1180px;
  --tap: 44px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 120ms;
  --med: 220ms;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0b0e13;
    --surface: #151a21;
    --surface-2: #1b212a;
    --surface-3: #232a35;
    --line: #262e3a;
    --line-strong: #344054;
    --scrim: rgba(0, 0, 0, 0.6);
    --text: #f2f4f7;
    --text-2: #c0c7d2;
    --muted: #8b95a5;
    --on-accent: #1a0f07;
    --accent: #fb8a3c;
    --accent-strong: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.14);
    --focus: #53b1fd;
    --positive: #47cd89;
    --positive-soft: rgba(71, 205, 137, 0.12);
    --negative: #f97066;
    --negative-soft: rgba(249, 112, 102, 0.12);
    --k-expense: #f97066;
    --k-bill: #53b1fd;
    --k-income: #47cd89;
    --k-khair: #fdb022;
    --k-save: #ff9c66;
    --k-personal: #b692f6;
    --k-debt: #22ccee;
    --k-cash: #98a2b3;
    --track: #2a313c;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --grid: #232a35;
    --axis: #384250;
    --shadow-1: none;
    --shadow-2: 0 4px 18px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e13;
  --surface: #151a21;
  --surface-2: #1b212a;
  --surface-3: #232a35;
  --line: #262e3a;
  --line-strong: #344054;
  --scrim: rgba(0, 0, 0, 0.6);
  --text: #f2f4f7;
  --text-2: #c0c7d2;
  --muted: #8b95a5;
  --on-accent: #1a0f07;
  --accent: #fb8a3c;
  --accent-strong: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --focus: #53b1fd;
  --positive: #47cd89;
  --positive-soft: rgba(71, 205, 137, 0.12);
  --negative: #f97066;
  --negative-soft: rgba(249, 112, 102, 0.12);
  --k-expense: #f97066;
  --k-bill: #53b1fd;
  --k-income: #47cd89;
  --k-khair: #fdb022;
  --k-save: #ff9c66;
  --k-personal: #b692f6;
  --k-debt: #22ccee;
  --k-cash: #98a2b3;
  --track: #2a313c;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --grid: #232a35;
  --axis: #384250;
  --shadow-1: none;
  --shadow-2: 0 4px 18px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.6);
}
