/*
 * EatSmart admin: design tokens (docs/ADMIN-UI.md §2). The colours come from the app's
 * Shared/Theme.swift, so the admin reads as part of the same product: paper, sage, serif numbers.
 *
 * Filament 5 keeps its styles in cascade layers; everything here is unlayered and wins without
 * !important. Only Filament's anchor classes (fi-*) and variables are targeted.
 */

:root {
    /* Surfaces: page < surface < raised, separated by colour and hairlines instead of shadows. */
    --es-page: #EDE6DA;
    --es-surface: #F6F1E7;
    --es-raised: #FBF8F2;
    --es-text: #2B2620;
    /* Darker than Theme.secondary (#7A7062): that one gives 3.9:1 on the page, too little for 12px text. */
    --es-muted: #6B6256;
    --es-hairline: #DCD3C4;
    --es-track: #E2DACC;

    /* Accent for bars, dots and icons; the «ink» variants are for text and fills (4.5:1 and up). */
    --es-accent: #6F8F72;
    --es-accent-ink: #4F6E53;
    --es-accent-fill: #4F6E53;
    --es-on-accent: #FFFFFF;
    --es-over: #B5654A;
    --es-over-ink: #9C4F36;
    --es-warn: #B8975A;
    --es-warn-ink: #7F6127;
    /* Tinted backgrounds for the few things that deviate (error, attention). */
    --es-over-wash: #F3DDD3;
    --es-warn-wash: #F0E4C6;
    --es-accent-wash: #DFE8E0;

    --es-shadow-float: 0 10px 30px -12px rgb(43 38 32 / 0.28), 0 2px 6px -2px rgb(43 38 32 / 0.12);

    --es-radius-block: 14px;   /* Theme.innerCorner: sections, tables, cards */
    --es-radius-control: 10px; /* fields and buttons */

    --es-font-text: ui-sans-serif, -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    --es-font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
    --es-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    color-scheme: light;
}

html.dark {
    --es-page: #1C1B19;
    --es-surface: #262421;
    --es-raised: #2F2C28;
    --es-text: #ECE6DA;
    --es-muted: #9A9184;
    --es-hairline: #3A3631;
    --es-track: #34312C;

    --es-accent: #8FB093;
    --es-accent-ink: #8FB093;
    --es-accent-fill: #8FB093;
    /* Light sage takes dark text: white on it is 2.3:1. */
    --es-on-accent: #1C1B19;
    --es-over: #D08A6E;
    --es-over-ink: #D08A6E;
    --es-warn: #D2B27A;
    --es-warn-ink: #D2B27A;
    --es-over-wash: #3A2A23;
    --es-warn-wash: #3A3222;
    --es-accent-wash: #2C352D;

    --es-shadow-float: 0 12px 32px -12px rgb(0 0 0 / 0.6), 0 2px 6px -2px rgb(0 0 0 / 0.4);

    color-scheme: dark;
}

/*
 * Fonts. Filament prints `--font-family: '<one name>'` in an inline <style> on :root after our
 * stylesheet, so a stack cannot go through the panel config. `html:root` is one step more
 * specific and wins. System fonts: on Apple devices these are exactly the app's SF Pro and New York.
 */
html:root {
    --font-family: var(--es-font-text);
    --font-family-serif: var(--es-font-serif);
    --font-family-mono: var(--es-font-mono);
}
