/* Mazra design system v1. Every template uses these tokens and nothing else.
   Colors: change them here only. Dark mode is redefined below for system
   preference and for an explicit data-theme="dark" on <html>. */

:root {
  /* color */
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #1C1C1A;          /* primary text, >= 7:1 on bg */
  --ink-2: #4A4A45;        /* secondary text */
  --line: #E3E1DA;         /* borders, dividers */
  --accent: #2F6B3A;       /* primary buttons, links, active tab, progress */
  --accent-ink: #FFFFFF;   /* text on accent */
  --accent-soft: #E7F3E8;  /* selected states, success chips */
  --warn: #8A5A00;         /* warnings, "needs you" (text on warn-bg) */
  --warn-bg: #FFF4D6;
  --danger: #B3261E;       /* destructive actions, recording dot (text on danger-bg) */
  --danger-bg: #FCE8E6;
  --info: #1F4E79;         /* neutral notices, sparingly (text on info-bg) */
  --info-bg: #E7F1FB;

  /* type scale: 5 steps, the only font sizes in use */
  --fs-display: 28px; --lh-display: 34px;  /* page titles, big numbers, bold */
  --fs-title: 22px;   --lh-title: 28px;    /* card and sheet titles, bold */
  --fs-body: 18px;    --lh-body: 26px;     /* default member text */
  --fs-label: 16px;   --lh-label: 22px;    /* field labels, chips, tabs, semibold */
  --fs-small: 16px;   --lh-small: 22px;    /* metadata; the minimum on member screens */
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-semi: 600;

  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;

  /* shape */
  --radius: 12px;          /* cards, buttons, fields */
  --radius-pill: 999px;    /* chips */
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);

  /* layout */
  --content-member: 640px;
  --content-admin: 1200px;
  --topbar-h: 56px;
  --status-h: 32px;
  --tabs-h: 64px;
  --rail-w: 220px;
}

/* farmer mode: bigger text and bigger primary buttons */
body.farmer {
  --fs-body: 22px; --lh-body: 30px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141613;
    --surface: #1D201C;
    --ink: #ECEBE6;
    --ink-2: #B9BDB3;
    --line: #33372F;
    --accent: #5AA566;
    --accent-ink: #0D140E;
    --accent-soft: #18301B;
    --warn: #F0C25C;
    --warn-bg: #3A3017;
    --danger: #F08A76;
    --danger-bg: #3A1E18;
    --info: #8FB6F2;
    --info-bg: #18263B;
  }
}

:root[data-theme="dark"] {
  --bg: #141613;
  --surface: #1D201C;
  --ink: #ECEBE6;
  --ink-2: #B9BDB3;
  --line: #33372F;
  --accent: #5AA566;
  --accent-ink: #0D140E;
  --accent-soft: #18301B;
  --warn: #F0C25C;
  --warn-bg: #3A3017;
  --danger: #F08A76;
  --danger-bg: #3A1E18;
  --info: #8FB6F2;
  --info-bg: #18263B;
}

/* Legacy names still referenced inline by some templates: aliases to the v1 tokens. */
:root {
  --brand: var(--accent); --brand-ink: var(--accent-ink); --card: var(--surface); --muted: var(--ink-2);
  --want: var(--info); --want-bg: var(--info-bg); --warn-line: var(--warn); --bad: var(--danger); --bad-bg: var(--danger-bg);
  --ok-bg: var(--accent-soft); --ok-line: var(--accent);
}
