/* Farm Manager — Design tokens
 * Single source of truth for colours, spacing, radii, motion.
 * Consumed by src/design/app.css and any inline styles.
 * Never redefine these values elsewhere.
 */

:root {
    /* ---------- Colour ---------- */
    /* Neutrals (slate) */
    --neutral-0:  #ffffff;
    --neutral-50: #f8fafc;
    --neutral-100:#f1f5f9;
    --neutral-200:#e2e8f0;
    --neutral-300:#cbd5e1;
    --neutral-400:#94a3b8;
    --neutral-500:#64748b;
    --neutral-600:#475569;
    --neutral-700:#334155;
    --neutral-800:#1e293b;
    --neutral-900:#0f172a;

    /* Purpose palette (accents) */
    --accent-primary:      #059669; /* Green — Farm / Spray / Plans */
    --accent-primary-soft: #ecfdf5;
    --accent-primary-ink:  #065f46;
    --accent-warn:         #f59e0b; /* Amber — Overdue / Expense */
    --accent-warn-soft:    #fffbeb;
    --accent-warn-ink:     #92400e;
    --accent-danger:       #ef4444; /* Red — Delete / Critical */
    --accent-danger-soft:  #fef2f2;
    --accent-danger-ink:   #991b1b;
    --accent-info:         #0ea5e9; /* Sky — Plan / Info */
    --accent-info-soft:    #f0f9ff;
    --accent-info-ink:     #075985;
    --accent-income:       #10b981; /* Emerald — Sales / Income */
    --accent-income-soft:  #d1fae5;
    --accent-labour:       #8b5cf6; /* Violet — Labour */
    --accent-labour-soft:  #f5f3ff;
    --accent-loan:         #ec4899; /* Rose — Loan */
    --accent-loan-soft:    #fdf2f8;

    /* Semantic surfaces */
    --bg-page:        #f6f8f6;
    --bg-surface:     var(--neutral-0);
    --bg-elevated:    var(--neutral-0);
    --bg-inset:       var(--neutral-50);
    --bg-scrim:       rgba(15, 23, 42, 0.55);

    /* Semantic text */
    --fg-strong:      var(--neutral-900);
    --fg-default:     var(--neutral-700);
    --fg-muted:       var(--neutral-500);
    --fg-subtle:      var(--neutral-400);
    --fg-inverse:     var(--neutral-0);
    --fg-brand:       var(--accent-primary);

    /* Semantic borders */
    --border-subtle:  var(--neutral-200);
    --border-strong:  var(--neutral-300);
    --border-brand:   var(--accent-primary);

    /* ---------- Spacing ---------- */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ---------- Radii ---------- */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 999px;

    /* ---------- Shadow ---------- */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-focus: 0 0 0 3px rgba(5, 150, 105, 0.25);

    /* ---------- Typography ---------- */
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body:    'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;

    --text-xs:  0.75rem;    /* 12 */
    --text-sm:  0.875rem;   /* 14 */
    --text-md:  1rem;       /* 16 */
    --text-lg:  1.125rem;   /* 18 */
    --text-xl:  1.25rem;    /* 20 */
    --text-2xl: 1.5rem;     /* 24 */
    --text-3xl: 1.875rem;   /* 30 */
    --text-4xl: 2.25rem;    /* 36 */

    --leading-tight:  1.2;
    --leading-snug:   1.35;
    --leading-normal: 1.55;

    --weight-normal:  400;
    --weight-medium:  500;
    --weight-semi:    600;
    --weight-bold:    700;
    --weight-heavy:   800;

    /* ---------- Motion ---------- */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --duration-instant: 80ms;
    --duration-fast:    160ms;
    --duration-base:    240ms;
    --duration-slow:    360ms;
    --duration-slower:  480ms;

    /* ---------- Layout ---------- */
    --shell-max: 1200px;
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 76px;
    --bottom-nav-h: 68px;
    --header-h: 64px;
    --sheet-max-w: 520px;
    --content-gutter: var(--space-4);

    /* ---------- Z-index scale ---------- */
    --z-base:      1;
    --z-sticky:    50;
    --z-nav:       100;
    --z-fab:       200;
    --z-scrim:     900;
    --z-sheet:     1000;
    --z-toast:     9999;
    --z-spinner:   10000;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-instant: 0ms;
        --duration-fast:    0ms;
        --duration-base:    0ms;
        --duration-slow:    0ms;
        --duration-slower:  0ms;
    }
}
