/* Admin design tokens: the one place for colours, fonts and sizes of the admin (SPT design manual 1.3, SPT.ECO).
   Everything else (AdminLayout.razor.css, admin.css, the components' .razor.css) only uses var(--admin-*).
   Tag (day) is the default; Nacht (night) is switched by data-admin-theme on <html>
   (static/js/admin-theme.js, AdminThemeSwitch). Linked in _Host.cshtml before admin.css. */

/* Fonts of the SPT design manual: the .ttf files it names (Archivo 400/600/700/800, IBM Plex Mono 500/600),
   SIL OFL 1.1, licence files next to them. Hosted locally, no connection to Google. */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/Archivo-Regular.ttf") format("truetype");
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/Archivo-SemiBold.ttf") format("truetype");
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/Archivo-Bold.ttf") format("truetype");
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/Archivo-ExtraBold.ttf") format("truetype");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/IBMPlexMono-Medium.ttf") format("truetype");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
}

/* ---------- Tag ---------- */

.admin-shell {
    /* SPT design manual 1.3, day mode (Tag), lead colour SPT.ECO (Triebgrün).
       --admin-primary is the text variant of the lead colour (text, borders, outlines on light ground);
       --admin-primary-fill is the colour itself, for filled areas only, always with --admin-on-primary on it. */
    --admin-bg: #F6F7F5;            /* bg-000 */
    --admin-surface: #FFFFFF;       /* bg-100 */
    --admin-sunken: #ECEEEA;        /* bg-200 */
    --admin-border: #D9DDD8;        /* line-100 */
    --admin-border-strong: #8A949D; /* line-200 */
    --admin-text: #0C1218;          /* ink */
    --admin-muted: #4D5863;         /* ink-muted */
    --admin-muted-soft: var(--admin-sunken);
    --admin-primary: #4C7D0F;       /* --spt-eco-text (Tag) */
    --admin-primary-hover: color-mix(in srgb, #4C7D0F 80%, #0C1218);
    --admin-primary-soft: #E2F6D4;  /* --spt-eco-tint (Tag) */
    --admin-primary-border: #8FD14F;
    --admin-primary-fill: #8FD14F;  /* --spt-eco */
    --admin-primary-fill-hover: color-mix(in srgb, #8FD14F 88%, #0C1218);
    --admin-on-primary: #0C1218;    /* --spt-eco-on */
    /* "Erweitert" has no colour of its own: a lowered neutral area. */
    --admin-advanced-soft: var(--admin-sunken);
    --admin-advanced-border: var(--admin-border);
    /* Status colours (Tag). Always shown with a symbol or word, never by colour alone. */
    --admin-danger: #B42318;
    --admin-danger-hover: color-mix(in srgb, #B42318 82%, #0C1218);
    --admin-danger-soft: color-mix(in srgb, #B42318 8%, #FFFFFF);
    --admin-danger-border: color-mix(in srgb, #B42318 35%, #FFFFFF);
    --admin-on-danger: #FFFFFF;
    --admin-warning: #B54708;
    --admin-warning-soft: color-mix(in srgb, #B54708 8%, #FFFFFF);
    --admin-warning-border: color-mix(in srgb, #B54708 35%, #FFFFFF);
    --admin-success: #067647;
    --admin-success-soft: color-mix(in srgb, #067647 8%, #FFFFFF);
    --admin-star: var(--admin-primary);
    /* Fonts */
    --admin-font: "Archivo", Arial, Helvetica, sans-serif;
    --admin-font-mono: "IBM Plex Mono", Consolas, monospace;
    /* Sizes */
    --admin-radius-sm: 6px;         /* chips, small fields */
    --admin-radius-md: 8px;         /* buttons, fields, list items */
    --admin-radius-lg: 10px;        /* icon buttons, alerts */
    --admin-radius: 12px;           /* cards */
    --admin-radius-pill: 999px;     /* badges, counts */
    --admin-control-height: 44px;   /* buttons, fields, icon buttons */
    --admin-control-height-md: 40px;
    --admin-control-height-sm: 36px; /* avatars, small icon buttons */
    --admin-focus-ring: 0 0 0 3px var(--admin-primary-soft);
    --admin-shadow-popover: 0 8px 24px rgba(12, 18, 24, 0.12); /* menus, language list */
    --admin-shadow-dialog: 0 12px 40px rgba(12, 18, 24, 0.2);  /* dialogs, busy box */
    --admin-overlay: rgba(12, 18, 24, 0.35);                   /* behind dialogs */
    --admin-fs-micro: 0.7rem;      /* eyebrow next to the logo, info dot */
    --admin-fs-caption: 0.75rem;
    --admin-fs-small: 0.85rem;
    --admin-fs-body: 0.9rem;
    --admin-fs-title: 1.75rem;     /* page title (H1, smaller than the website) */
    --admin-fs-subtitle: 1.25rem;  /* H3 of the design manual (20 px), Archivo 700 */
    --admin-head-height: 64px;
    --admin-body-top: 20px;

    /* Bootstrap's muted text (.text-muted) and link buttons (.btn-link) use the admin palette, not the tenant theme.
       Fields, tables and dialogs too (they read --bs-body-bg / --bs-body-color / --bs-border-color), so they follow Tag/Nacht. */
    --bs-body-bg: var(--admin-surface);
    --bs-body-color: var(--admin-text);
    --bs-emphasis-color: var(--admin-text);
    --bs-emphasis-color-rgb: 12, 18, 24;
    --bs-heading-color: inherit;
    --bs-border-color: var(--admin-border);
    --bs-border-color-translucent: var(--admin-border);
    --bs-secondary-bg: var(--admin-sunken);
    --bs-tertiary-bg: var(--admin-sunken);
    --bs-secondary-color: var(--admin-muted);
    --bs-link-color: var(--admin-primary);
    --bs-link-hover-color: var(--admin-primary-hover);
    color-scheme: light;
}

/* ---------- Nacht ---------- */

/* Nacht (night) mode of the design manual: Zellschwarz ground, light text, text and tint variants of SPT.ECO
   for night. Lead colour areas stay the same in both modes. Switched by data-admin-theme on <html>
   (static/js/admin-theme.js, AdminThemeSwitch). */
html[data-admin-theme="dark"] .admin-shell {
    --admin-bg: #0C1218;            /* bg-000 Nacht */
    --admin-surface: #141C24;       /* bg-100 */
    --admin-sunken: #1C2630;        /* bg-200 */
    --admin-border: #2A3540;        /* line-100 */
    --admin-border-strong: #617080; /* line-200 */
    --admin-text: #EEF1EE;          /* ink */
    --admin-muted: #9AA6B1;         /* ink-muted */
    --admin-primary: #93CF5C;       /* --spt-eco-text (Nacht) */
    --admin-primary-hover: color-mix(in srgb, #93CF5C 80%, #EEF1EE);
    --admin-primary-soft: #192D03;  /* --spt-eco-tint (Nacht) */
    --admin-primary-border: #4C7D0F;
    --admin-primary-fill-hover: color-mix(in srgb, #8FD14F 85%, #EEF1EE);
    --admin-danger: #F97066;
    --admin-danger-hover: color-mix(in srgb, #F97066 85%, #EEF1EE);
    --admin-danger-soft: color-mix(in srgb, #F97066 12%, #141C24);
    --admin-danger-border: color-mix(in srgb, #F97066 40%, #141C24);
    --admin-on-danger: #0C1218;
    --admin-warning: #FDB022;
    --admin-warning-soft: color-mix(in srgb, #FDB022 10%, #141C24);
    --admin-warning-border: color-mix(in srgb, #FDB022 40%, #141C24);
    --admin-success: #47CD89;
    --admin-success-soft: color-mix(in srgb, #47CD89 12%, #141C24);
    --bs-emphasis-color-rgb: 238, 241, 238;
    --admin-shadow-popover: 0 8px 24px rgba(0, 0, 0, 0.45);
    --admin-shadow-dialog: 0 12px 40px rgba(0, 0, 0, 0.55);
    --admin-overlay: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

/* The document behind the admin, so overscroll and short pages show the right ground. */
html:has(.admin-shell) {
    background: #F6F7F5;
}

html[data-admin-theme="dark"]:has(.admin-shell) {
    background: #0C1218;
}
