/*
 * Design tokens. The only place where colours, sizes, radii, shadows and z-index values are defined.
 * Brand values are overridden per deploy in templates/base.html from styles_context (STYLES_* env vars).
 * Breakpoints can't be variables in media queries; use 640px, 1024px and 1440px only.
 */
:root {
    /* Brand (per tenant) */
    --brand: #E23C5E;
    --brand-2: #E67E22;
    --brand-hover: #c62828;
    --brand-strong: #2c3e50;
    --on-brand: #ffffff;
    --on-brand-strong: #ffffff;
    --sidebar-hover: #34495e;
    --brand-tint: color-mix(in srgb, var(--brand) 12%, #ffffff);
    --brand-ring: color-mix(in srgb, var(--brand) 35%, transparent);

    /* Neutrals (same for every tenant) */
    --bg: #f4f6f5;
    --surface: #ffffff;
    --surface-2: #eef1f0;
    --border: #d9dfdc;
    --border-strong: #b9c2be;
    --fg: #1b2420;
    --fg-muted: #56625d;
    --fg-subtle: #7d8984;

    /* Status (same for every tenant, never the brand colour) */
    --ok: #1e7f4f;
    --ok-bg: #e3f3ea;
    --warn: #9a6200;
    --warn-bg: #fdf1d8;
    --err: #b42318;
    --err-bg: #fde7e4;
    --info: #1d5fa8;
    --info-bg: #e3eefa;

    /* Water stress scale for maps and charts, from none to severe */
    --stress-0: #2f8f6b;
    --stress-1: #9cc75b;
    --stress-2: #e9c33f;
    --stress-3: #e07b2e;
    --stress-4: #c0392b;

    /* Map lines on satellite imagery (same for every tenant); read by the map JS */
    --map-halo: rgba(16, 24, 20, .65);
    --map-parcel: rgba(255, 255, 255, .95);
    --map-landparcel: #e9c46a;
    --map-farm: #cdb4f0;
    --map-selection: #ff6b3d;
    --map-ground: #55663a; /* stands in for imagery behind line samples */

    /* Typography */
    --font-ui: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 30px;
    --leading: 1.5;
    --leading-tight: 1.2;

    /* Spacing (4px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    /* Shape */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 20, .08);
    --shadow-md: 0 4px 12px rgba(16, 24, 20, .10);
    --shadow-lg: 0 12px 32px rgba(16, 24, 20, .18);

    /* Layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-map-controls: 300;
    --z-drawer: 400;
    --z-modal: 500;
    --z-toast: 2000;
    --z-tooltip: 2100;

    /* Layout */
    --shell-sidebar-width: 240px;
    --shell-sidebar-collapsed: 60px;
    --topbar-height: 48px;
    --drawer-width: 340px;
    --control-height: 34px;
    --control-height-sm: 28px;

    /* Motion */
    --dur: 160ms;
    --dur-slow: 300ms;
    --ease: cubic-bezier(.2, .6, .2, 1);
}
