html, body {
    font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1:focus {
    outline: none;
}

/* Preformatted customer-message block (Anfrage detail). */
.cb-copy-box {
    margin: 0;
    padding: .75rem;
    border: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    border-radius: 4px;
    background: var(--mud-palette-background-grey, #f5f5f5);
    font-family: inherit;
    font-size: .9rem;
    white-space: pre-wrap;
}

/* ============================================================================
   Back-office shell — bespoke dark sidebar + warm-paper canvas (Backoffice mockup).
   MudBlazor still powers the page bodies; the warm Mud surface palette is scoped to
   .admin-shell via --mud-palette-* overrides so the public side is untouched.
   ========================================================================= */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background: #ede4d1;
    color: #20271f;
    /* Warm Mud palette — scoped to admin only. */
    --mud-palette-background: #ede4d1;
    --mud-palette-background-grey: #fbf7ee;
    --mud-palette-surface: #fbf7ee;
    --mud-palette-text-primary: #20271f;
    --mud-palette-text-secondary: #6b746a;
    --mud-palette-lines-default: #e7ddc8;
    --mud-palette-lines-inputs: #e0d6c2;
    --mud-palette-table-lines: #f2ebdc;
    --mud-palette-table-striped: rgba(45, 74, 56, 0.025);
    --mud-palette-table-hover: #f2ebdc;
    --mud-palette-action-default-hover: rgba(45, 74, 56, 0.06);
    /* MudBlazor derives portal-surface radii (dialogs, popovers, snackbars, menus, tooltips)
       from this variable — one scoped override re-skins them all at the input scale; the
       explicit 16px card/dialog and 10px button rules below stay the deliberate exceptions. */
    --mud-default-borderradius: 11px;
}

/* ---- sidebar ---- */
.admin-sidebar {
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    background: #20271f;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    overflow-y: auto;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 26px; }
.admin-brand-mark { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: #2d4a38; display: flex; align-items: center; justify-content: center; font-family: "Newsreader", serif; font-weight: 600; font-size: 19px; color: #f4eee2; }
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.admin-brand-name { font-weight: 700; font-size: 16px; color: #f4eee2; }
.admin-brand-sub { font-size: 11.5px; color: #8e988a; letter-spacing: 0.04em; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-group { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5e685a; padding: 16px 14px 6px; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    color: #a6b0a2;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.admin-nav-link:hover { background-color: rgba(255, 255, 255, 0.04); color: #c8d0c3; }
.admin-nav-link.active { background: #2d4a38; color: #f4eee2; }
.admin-nav-link.active:hover { background: #2d4a38; color: #f4eee2; }
.admin-nav-icon { flex-shrink: 0; }
.admin-nav-link span { flex: 1; }
.admin-nav-link:focus-visible { outline: 2px solid #6f8a78; outline-offset: 2px; }

.admin-foot { margin-top: auto; border-top: 1px solid #2f392e; padding-top: 16px; }
.admin-userbar { display: flex; align-items: center; gap: 12px; }
.admin-user-avatar { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: #2d4a38; display: flex; align-items: center; justify-content: center; font-family: "Newsreader", serif; font-weight: 500; font-size: 19px; color: #f4eee2; }
.admin-user-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 14px; color: #f4eee2; }
.admin-user-role { font-size: 12px; color: #8e988a; }
.admin-logout { display: flex; }
.admin-user-action { color: #8e988a; display: flex; background: none; border: 0; padding: 0; cursor: pointer; }
.admin-user-action:hover { color: #f4eee2; }
.admin-user-action:focus-visible { outline: 2px solid #6f8a78; outline-offset: 2px; border-radius: 6px; }
.admin-version { font-size: 11px; color: #5e685a; padding: 12px 4px 0; }

/* ---- main canvas ---- */
.admin-main { flex: 1; min-width: 0; }
.admin-main-inner { max-width: 1080px; margin: 0 auto; padding: 36px 44px 80px; }

/* Settings header intro: the long description must wrap instead of crushing the save button. */
.ad-settings-intro { max-width: 720px; }

/* Admin page titles → Newsreader serif (mockup). MudText Typo.h4 is the page-title role. */
.admin-main-inner .mud-typography-h4 {
    font-family: "Newsreader", serif;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: #20271f;
}

/* Round the MudBlazor surfaces to the mockup (defaults are ~4px): 16px cream cards/grids,
   11px input boxes, 10px buttons. Scoped to admin so the public side is untouched. */
.admin-shell .mud-paper { border-radius: 16px; }
/* Popovers DO carry .mud-paper, so this must stay AFTER the paper rule (equal specificity,
   source order wins): dropdowns/menus are input-scale controls, not 16px cards. */
.admin-shell .mud-popover { border-radius: 11px; }
/* Dialogs carry no .mud-paper class and read as cards, not input-scale controls — lift them
   above the --mud-default-borderradius portal baseline to the 16px card radius. */
.admin-shell .mud-dialog { border-radius: 16px; }
.admin-shell .mud-table { border-radius: 16px; overflow: hidden; }
.admin-shell .mud-input-control .mud-input.mud-input-outlined .mud-input-outlined-border { border-radius: 11px; }
.admin-shell .mud-button-root { border-radius: 10px; }
/* Grid header cells inherit no rounding now that the table clips; keep the toolbar/header flush. */
.admin-shell .cb-admin-grid .mud-table-toolbar { border-top-left-radius: 16px; border-top-right-radius: 16px; }

/* ---- dashboard (Übersicht) ---- */
.ad-head { margin-bottom: 30px; }
.ad-greeting { font-family: "Newsreader", serif; font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 5px; color: #20271f; }
.ad-date { font-size: 15px; color: #6b746a; margin: 0; }

.ad-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.ad-kpi { background: #fbf7ee; border: 1px solid #e7ddc8; box-shadow: 0 1px 2px rgba(45, 42, 32, 0.05); border-radius: 16px; padding: 20px 22px; }
.ad-kpi-label { font-size: 13px; font-weight: 600; color: #8a9085; margin-bottom: 10px; }
.ad-kpi-value { font-family: "Newsreader", serif; font-weight: 600; font-size: 30px; letter-spacing: -0.01em; color: #20271f; line-height: 1; }
.ad-kpi-value-warn { color: #b97a14; }

.ad-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ad-queue { background: #fbf7ee; border: 1px solid #e7ddc8; box-shadow: 0 1px 2px rgba(45, 42, 32, 0.05); border-radius: 18px; padding: 24px; }
.ad-queue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ad-queue-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.ad-queue-icon-amber { background: #fbf0da; color: #b97a14; }
.ad-queue-icon-green { background: #e3eae0; color: #2d4a38; }
.ad-queue-title { font-size: 16px; font-weight: 700; margin: 0; flex: 1; color: #20271f; }
.ad-queue-tag { font-size: 13px; font-weight: 600; color: #8a9085; }
.ad-queue-link { font-size: 13px; font-weight: 600; color: #3c6b52; text-decoration: none; }
.ad-queue-link:hover { color: #2d4a38; }
.ad-queue-empty { padding: 22px 12px; text-align: center; color: #8a9085; font-size: 14px; }
.ad-queue-list { display: flex; flex-direction: column; gap: 10px; }
.ad-queue-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #eae0cc; border-radius: 13px; background: #fff; text-decoration: none; color: inherit; transition: border-color 0.12s ease, background-color 0.12s ease; }
.ad-queue-row:hover { border-color: #d8cbb3; background: #fffdf8; }
.ad-queue-body { flex: 1; min-width: 0; line-height: 1.3; display: flex; flex-direction: column; }
.ad-queue-id { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; color: #20271f; }
.ad-queue-email { font-size: 12.5px; color: #8a9085; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-queue-amount { font-weight: 600; font-size: 13.5px; white-space: nowrap; color: #20271f; }
.ad-queue-go { display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 9px; background: #2d4a38; color: #f4eee2; font-weight: 600; font-size: 12.5px; white-space: nowrap; }

/* status pills (dashboard + list pages) */
.ad-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ad-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ad-pill-pending { background: #fbf0da; color: #9a6a16; }
.ad-pill-paid { background: #e3eae0; color: #2d4a38; }
.ad-pill-done { background: #2d4a38; color: #eaf0e6; }
.ad-pill-muted { background: #efe7d6; color: #8a8170; }
/* Failed = needs attention, not benign-terminal grey (hexes = the public --error-bg/-ink pair). */
.ad-pill-failed { background: #fbe9e7; color: #8c3a2c; }

/* hints strip */
.ad-hints { margin-top: 22px; background: #fbf7ee; border: 1px solid #e7ddc8; border-radius: 16px; padding: 18px 22px; }
.ad-hints-head { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #dd9a3c; margin-bottom: 10px; }
.ad-hint { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f2ebdc; text-decoration: none; }
.ad-hint:first-of-type { border-top: none; }
.ad-hint-icon { flex-shrink: 0; color: #b97a14; display: flex; }
.ad-hint-label { flex: 1; font-size: 14px; font-weight: 600; color: #5a645b; }
.ad-hint-value { font-size: 13px; font-weight: 700; color: #b97a14; }

/* ---- order/request detail (Bestellung) ---- */
.adt-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #3c6b52; text-decoration: none; margin-bottom: 22px; }
.adt-back:hover { color: #2d4a38; }
.adt-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.adt-h1 { font-family: "Newsreader", serif; font-weight: 500; font-size: 32px; line-height: 1.05; letter-spacing: -0.015em; margin: 0; font-variant-numeric: tabular-nums; color: #20271f; }

.adt-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.adt-col { display: flex; flex-direction: column; gap: 18px; }
.adt-card { background: #fbf7ee; border: 1px solid #e7ddc8; box-shadow: 0 1px 2px rgba(45, 42, 32, 0.05); border-radius: 16px; padding: 24px; }
.adt-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #dd9a3c; margin-bottom: 16px; }
.adt-lead { font-size: 14.5px; line-height: 1.55; color: #5a645b; margin: 0 0 16px; }
.adt-lead strong { color: #20271f; font-weight: 700; }
.adt-lead:last-child { margin-bottom: 0; }

.adt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 11px; font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; border: none; text-decoration: none; transition: background-color 0.12s ease, border-color 0.12s ease; }
.adt-btn-primary { background: #2d4a38; color: #f4eee2; }
.adt-btn-primary:hover { background: #243c2d; }
.adt-btn-primary:disabled { opacity: 0.6; cursor: default; }
.adt-btn-outline { background: transparent; border: 1.5px solid #d4c7ae; color: #2d4a38; }
.adt-btn-outline:hover { background: #fbf7ee; border-color: #2d4a38; }
.adt-btn-outline:disabled { opacity: 0.6; cursor: default; }
.adt-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.adt-bridge { margin: 12px 0 0; font-size: 13px; }

.adt-done { display: flex; align-items: flex-start; gap: 13px; }
.adt-done-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; background: #e3eae0; color: #2d4a38; display: flex; align-items: center; justify-content: center; }

.adt-timeline { display: flex; flex-direction: column; gap: 16px; }
.adt-step { display: flex; gap: 13px; align-items: flex-start; }
.adt-dot { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.adt-dot-done { background: #2d4a38; color: #f4eee2; }
/* Terminal-but-not-success steps (Storniert) — matches the muted pill tier. */
.adt-dot-muted { background: #efe7d6; color: #8a8170; }
.adt-step-title { font-weight: 600; font-size: 14.5px; color: #20271f; }
.adt-step-time { font-size: 13px; color: #8a9085; }

.adt-rows { display: flex; flex-direction: column; }
.adt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f2ebdc; }
.adt-row:last-child { border-bottom: none; }
.adt-row-label { font-size: 13.5px; color: #8a9085; }
.adt-row-value { font-size: 14px; font-weight: 600; color: #20271f; text-align: right; }
.adt-note { margin: 2px 0 10px; padding: 10px 12px; border-radius: 8px; background: #fbf6ea; color: #5f665b; font-size: 13px; line-height: 1.45; }
.adt-mono { font-variant-numeric: tabular-nums; }

.adt-customer-name { font-size: 15px; font-weight: 600; color: #20271f; margin-bottom: 2px; }
.adt-customer-mail { font-size: 14px; color: #20271f; word-break: break-all; margin-bottom: 2px; }
.adt-customer-addr { font-size: 13px; color: #8a9085; margin-bottom: 12px; }
.adt-link { font-size: 13.5px; font-weight: 600; color: #3c6b52; text-decoration: none; }
.adt-link:hover { color: #2d4a38; }

.adt-total { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 0 2px; }
.adt-total-label { font-size: 14.5px; font-weight: 700; color: #20271f; }
.adt-total-value { font-family: "Newsreader", serif; font-weight: 600; font-size: 22px; color: #20271f; }
.adt-tax { font-size: 12px; color: #9a917f; margin: 8px 0 0; }
.adt-muted { font-size: 14px; color: #8a9085; margin: 0; }
.adt-invoice { margin-bottom: 14px; }
.adt-invoice-no { font-weight: 700; font-size: 15px; color: #20271f; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
    .ad-kpis { grid-template-columns: repeat(2, 1fr); }
    .ad-cols { grid-template-columns: 1fr; }
    .adt-grid { grid-template-columns: 1fr; }
}

/* Admin list-grid toolbar — one deliberate layout so the search/filter row is consistent and
   aligned on every page. Layout lives here (not per-field inline classes) as the single source
   of truth. Direct-child selectors distinguish the three control types: search is a
   .mud-input-control, filters are .mud-select, the action button is .mud-button-root. */
.cb-admin-grid .mud-table-toolbar {
    gap: 8px;
}

/* Column headers recede to secondary grey so the data (cells) reads as primary (Carbon/NN-g).
   Keeps the existing 12px/600 weight + 1px bottom border. */
.cb-admin-grid .mud-table-head th {
    color: var(--mud-palette-text-secondary) !important;
}

/* Secondary cell sub-lines (date/email captions) a touch larger than the 12px caption default
   so they stay readable under the 14px primary text. */
.cb-admin-grid .mud-table-body .mud-typography-caption {
    font-size: .8125rem;
}

/* Uniform row height across all admin grids. Most grids have two-line cells (~53px rows);
   grids with single-line rows would otherwise read as cramped. `height` on a table cell acts
   as a minimum, so two-line rows are unaffected and single-line rows grow to match. */
.cb-admin-grid .mud-table-body td {
    height: 53px;
}

/* Search: flexible but capped, so it's wider than the filters yet identical across pages. */
.cb-admin-grid .mud-table-toolbar > .mud-input-control {
    flex: 1 1 240px;
    max-width: 360px;
}

/* Filters: fixed width, identical on every page (the inline max-width never bound the flex
   child, so widths were flex-distributed and differed per page). */
.cb-admin-grid .mud-table-toolbar > .mud-select {
    flex: 0 0 180px;
    width: 180px;
    height: 40px;
}

/* One 40px height, vertically centred. MudBlazor's dense fields add 4px top + 4px bottom
   margin (top was previously zeroed by the now-removed `mt-0` class; bottom reserves empty
   helper-text space and made the outer .mud-select 48px). Zero both so the search field and
   the selects share one baseline. */
.cb-admin-grid .mud-table-toolbar .mud-input-control {
    height: 40px;
    margin-top: 0;
    margin-bottom: 0;
}

/* Value + placeholder text at the 14px grid size (MudBlazor tags toolbar inputs as
   mud-typography-subtitle1 / 1rem; the <input> IS .mud-input-slot, target it directly). */
.cb-admin-grid .mud-table-toolbar input,
.cb-admin-grid .mud-table-toolbar input::placeholder {
    font-size: .875rem;
}

/* Action button → far right, matched to the 40px fields, flat (no elevation shadow) to match
   the shadow-free admin design (Carbon/Fluent dense UI). */
.cb-admin-grid .mud-table-toolbar > .mud-button-root,
.cb-admin-grid .mud-table-toolbar > .mud-button-root:hover,
.cb-admin-grid .mud-table-toolbar > .mud-button-root:focus,
.cb-admin-grid .mud-table-toolbar > .mud-button-root:active {
    margin-left: auto;
    height: 40px;
    min-height: 40px;
    box-shadow: none;
}

/* Editor control rows (e.g. the guide editor's per-edition slots): ONE mechanism for the
   shared 40px baseline, mirroring the .cb-admin-grid toolbar normalization above. Dense fields
   carry 4px default margins, MudButton defaults to ~36px (something in the file-upload style
   stack even clamps a plain inline height — hence min-height), and the MudFileUpload wrapper
   gains 4px from its hidden <input type=file>. Scoped to the row class so other upload styles
   (e.g. a future drop zone) stay untouched. */
.admin-shell .cb-control-row .mud-input-control {
    height: 40px;
    margin: 0;
}

.admin-shell .cb-control-row .mud-button-root {
    height: 40px;
    min-height: 40px;
}

.admin-shell .cb-control-row .mud-file-upload {
    height: 40px;
    margin: 0;
}

/* Blazor error UI (host-level, referenced from layouts). */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
