﻿/* ============================
   LAYOUT (app, sidebar, header)
   ============================ */

/* App wrapper (flyttet fra inline style i _Layout) */
.platforma-app {
    display: flex;
    min-height: 100vh;
    background: var(--platforma-gray-50);
}

/* Main område (flyttet fra inline style) */
.platforma-main {
    flex: 1;
    min-width: 0; /* APD-1: a flex item's default min-width:auto = its content
                     min-content width; without this the nowrap header-right
                     controls set the column width and every admin page
                     overflows the mobile viewport. */
    margin-left: 280px; /* samme som sidebar bredde */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* A11Y-02 — the <main> landmark now wraps only the content (breadcrumbs +
   body), below the toolbar header inside the .platforma-main column. It fills
   the remaining column height so .platforma-content keeps flexing. */
.platforma-shell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Content wrapper (flyttet fra inline style) */
.platforma-content {
    flex: 1;
    min-width: 0; /* APD-1: let long content (tables, mono strips) scroll in
                     their own container instead of widening the page. */
    padding: var(--platforma-space-8);
}

/* --- Sidebar --- */

.platforma-sidebar {
    /* PL-3 (2026-09-08, dark-mode audit) — the rail is dark chrome in BOTH themes. It
       paints from the DS-1 chrome-rail roles (tokens.semantic.admin.css: light = slate-900,
       the value the compat shim already rendered here; dark = slate-950, one step below
       the page) and PINS the legacy aliases its descendants consume (logo, version chip,
       captions, tenant card, workspace switcher) to the same rail roles — without the pin,
       --platforma-white / --platforma-gray-900 resolve to surface-raised / text-primary
       and a dark page would invert the whole rail to near-white. */
    --platforma-white:    var(--pf-color-chrome-rail-text);
    --platforma-gray-900: var(--pf-color-chrome-rail);
    --platforma-gray-300: var(--pf-color-chrome-rail-muted);
    --platforma-gray-500: var(--pf-color-chrome-rail-subtle);
    width: 280px;
    background: var(--pf-color-chrome-rail, var(--platforma-gray-900));
    color: var(--pf-color-chrome-rail-text, var(--platforma-white));
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

.platforma-sidebar-brand {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.platforma-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--platforma-white);
}

.platforma-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--platforma-primary-fill), var(--platforma-info));   /* DARK-PRIMARY-1: white glyph on it */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.platforma-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.platforma-version {
    background: rgba(255,255,255,0.1);
    color: var(--platforma-gray-300);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

/* ─── IA.1 (2026-04-26) — Tenant-header card ─── */
/* IA.1 polish (2026-04-26) — tenant-header er fået mere visuel vægt:
   stærkere kort-baggrund, bobble fået tynd ring, plan-pill og surface-badge
   layoutet på egen linje under navnet (i stedet for at konkurrere på samme
   linje). Det undgår at "Fahad Naser ApS PRO Admin" ser ud som inline tekst. */
.platforma-sidebar-tenant {
    padding: 12px 14px 12px;
    margin: 0 12px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.platforma-tenant-row {
    display: flex; align-items: center; gap: 10px;
}
.platforma-tenant-bubble {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--platforma-warm, #C7A55F), #a07414);
    /* DARK-FIX (2026-09-21): the gold gradient does NOT flip, but --platforma-ink-strong flips to near-white in
       dark → washed-out initials. Pin to a fixed dark ink (matches .platforma-surface-badge-admin's dark-on-gold);
       a bare literal here, not a primitive token, to stay within the DS3 component-token ratchet. */
    color: #0B0D16;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Source Serif Pro', Georgia, serif;
    font-weight: 700; font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.18), 0 2px 4px rgba(0, 0, 0, 0.25);
}
.platforma-tenant-name {
    font-family: 'Source Serif Pro', Georgia, serif;
    font-size: 15px; font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}
/* Pills-row under navnet: plan-pill + surface-badge på egen linje, ikke
   crammed sammen med navnet på samme linje. */
.platforma-tenant-pills {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.platforma-tenant-plan {
    font-size: 9px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    line-height: 1.3;
}
.platforma-tenant-plan-pro,
.platforma-tenant-plan-premium {
    background: rgba(199, 165, 95, 0.18);
    color: var(--platforma-warm, #C7A55F);
}
.platforma-tenant-plan-standard {
    background: rgba(46, 92, 138, 0.25);
    color: #6494c4;
}
.platforma-tenant-plan-basic {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}
.platforma-tenant-subtitle {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
    font-family: 'JetBrains Mono', 'Source Code Pro', monospace;
    letter-spacing: 0.04em;
}

/* ─── IA.5 (2026-04-26) — Surface badge ─── */
/* Always-visible cue for which surface the user is on so they don't
   confuse the admin shell on platforma.nu with the public-facing tenant
   site or the resident portal. Three styles:
     -admin   → black chip on amber accent (the management cockpit)
     -portal  → blue accent (resident-facing portal at platforma.nu)
     -public  → green accent (public marketing site at tenant subdomain)
   Rendered next to the tenant-name in the sidebar header for TenantAdmin
   /Staff, and next to the brand-text for SuperAdmin. */
.platforma-surface-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    line-height: 1.3;
}
.platforma-surface-badge-admin {
    background: linear-gradient(135deg, #C7A55F 0%, #B89148 100%);
    color: #0B0D16;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.20) inset;
}
.platforma-surface-badge-portal {
    background: rgba(86, 139, 184, 0.20);
    color: #9DB8D6;
    border: 1px solid rgba(86, 139, 184, 0.35);
}
.platforma-surface-badge-public {
    background: rgba(107, 166, 143, 0.20);
    color: #99C9B0;
    border: 1px solid rgba(107, 166, 143, 0.35);
}

/* When rendered alongside the brand block (SuperAdmin path) the badge
   sits below the logo-text rather than next to it, on its own line. */
.platforma-sidebar-brand .platforma-surface-badge {
    margin-top: 6px;
}

/* ─── IA.1 — Primary nav-items (Forsiden, Indbakke) ─── */
.platforma-nav-primary {
    padding: 6px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 6px;
}
.platforma-nav-item-primary {
    margin-bottom: 2px;
    border-radius: 6px;
}

/* ─── IA.1 — Settings section (below divider) ─── */
.platforma-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 12px 16px 8px;
}
.platforma-nav-settings {
    padding: 0 4px 8px;
}
.platforma-nav-item-settings .platforma-nav-text {
    font-size: 13px;
    opacity: 0.85;
}

/* ─── IA.1 — Badges on nav-items ─── */
.platforma-nav-item {
    position: relative;
}
.platforma-nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}
.platforma-nav-badge-urgent {
    /* PL-3: the ACTION danger fill (red-600 in both themes) — white on the dark
       theme's status-danger (red-400) would measure only 2.9:1. Light value unchanged. */
    background: var(--pf-color-action-danger, var(--platforma-danger, #B23A3A));
    color: #fff;
}
.platforma-nav-badge-attn {
    background: var(--platforma-warm, #C7A55F);
    /* DARK-FIX (2026-09-21): gold bg does NOT flip; --platforma-ink-strong flips to near-white in dark
       (~2.2:1). Pin to a fixed dark ink (matches .platforma-surface-badge-admin's dark-on-gold). */
    color: #0B0D16;
}
.platforma-nav-badge-count {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.85);
}
.platforma-nav-item-active .platforma-nav-badge-count {
    background: rgba(255, 255, 255, 0.18);
}

/* Sidebar overlay til mobil */
.platforma-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 900;
}

/* --- Navigation --- */

.platforma-sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.platforma-nav-section {
    margin-bottom: 1.5rem;
}

.platforma-nav-title {
    color: var(--platforma-gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

/* Collapsible section header — clickable button that looks like the
   original subtle caption but exposes a chevron. */
/* IA.1 polish (2026-04-26) — sektion-headers demoteret, så øjet ser dem som
   labels (forælder) og ikke som items (børn). Mindre font, tungere
   letter-spacing, mere mutet farve, monospace for typografisk afstand fra
   nav-items. Mere "luft" ovenover — tydelig gruppe-start. */
.platforma-nav-title-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    /* WAVE-0 (demo10 parity): sidebar section labels on the sans stack, not mono. */
    font-family: var(--platforma-font-sans);
    text-align: left;
    padding: 4px 1.5rem 4px 1.25rem;
    margin: 18px 0 6px;
    /* PL-3 audit: .40 measured 3.74:1 on the rail (below AA for the 10px caption);
       .50 measures 5.33:1 on slate-950 and 5.23:1 on slate-900 (AA). */
    color: rgba(255, 255, 255, 0.50);
    transition: color 0.15s ease;
}
.platforma-nav-section:first-child .platforma-nav-title-toggle {
    margin-top: 4px;
}
.platforma-nav-title-toggle:hover {
    color: rgba(255, 255, 255, 0.65);
}
.platforma-nav-title-toggle .platforma-nav-title-text {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.platforma-nav-title-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0.7;
}
.platforma-nav-section.is-collapsed .platforma-nav-title-chevron {
    transform: rotate(-90deg);
}

/* Collapsible items container — smooth height animation. IA.1 polish:
   tilføj venstre grupperings-rail (1px) der visuelt fortæller "disse items
   hører til sektion-headeren ovenover". */
.platforma-nav-items {
    overflow: hidden;
    transition: max-height 0.25s ease;
    margin-left: 1.25rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.platforma-nav-section.is-collapsed .platforma-nav-items {
    max-height: 0 !important;
}

/* IA.1 polish — nav-item: mere prominent (større font, fyldt hvid tekst),
   hover-feedback mærkbar (gold-accent + bg-fade), active-state stærk
   (4px gold-border + parchment-overlay). Brand-gold matches surface-badge. */
.platforma-nav-item {
    display: flex;
    align-items: center;
    padding: 9px 1rem 9px 0.75rem;
    margin: 1px 0.5rem 1px 0;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
    gap: 0.7rem;
    font-size: 13.5px;
    font-weight: 500;
}

.platforma-nav-item .platforma-nav-icon {
    opacity: 0.72;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* HF 2026-05-11: hover realigned to brand red (was gold).
   LP-12 (2026-08-31) — SUPERSEDER HF'en: Parchment/Ink-retningen flytter
   nav-affordances til navy. Sidebar er dark chrome (gray-900 #181C32), så
   vi bruger on-dark-varianten (#6E9CC9, 5.80:1 — basen #2E5C8A måler kun
   2.41:1 og fejler non-text 3:1). Tint-alphaer bevaret 1:1 fra rød-æraen
   så emphasis-niveauet er uændret; kun paletten skifter. */
.platforma-nav-item:hover {
    color: #fff;
    background: rgba(110, 156, 201, 0.10);
    box-shadow: inset 2px 0 0 var(--platforma-chrome-action-on-dark, #6E9CC9);
    text-decoration: none;
}
.platforma-nav-item:hover .platforma-nav-icon {
    opacity: 1;
    transform: translateX(1px);
}

/* HF 2026-05-11: active-state realigned to brand red (was Nordic Sand
   gold der kun så rigtig ud for sand-tema-tenants).
   LP-12 (2026-08-31) — SUPERSEDER: aktiv-stribe + ikon + gradient kører nu
   på navy on-dark-varianten (se token-doc i platforma-tokens.css). Samme
   affordance-mønster — venstre stribe + soft gradient + bold — kun palet. */
.platforma-nav-item-active {
    color: #fff;
    background: linear-gradient(90deg,
                                rgba(110, 156, 201, 0.20) 0%,
                                rgba(110, 156, 201, 0.06) 70%,
                                transparent 100%);
    box-shadow: inset 3px 0 0 var(--platforma-chrome-action-on-dark, #6E9CC9);
    font-weight: 600;
}
.platforma-nav-item-active .platforma-nav-icon {
    opacity: 1;
    color: var(--platforma-chrome-action-on-dark, #6E9CC9);
}
/* LP-12: active-hover — samme palet, lidt stærkere tint (alphaer bevaret
   fra rød-æraen). */
.platforma-nav-item-active:hover {
    background: linear-gradient(90deg,
                                rgba(110, 156, 201, 0.28) 0%,
                                rgba(110, 156, 201, 0.10) 70%,
                                transparent 100%);
}

.platforma-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platforma-nav-text {
    font-weight: 500;
    font-size: 0.875rem;
}

/* (Legacy .platforma-nav-badge removed — superseded by IA.1 block above
   that supports -urgent / -attn / -count variants. 2026-04-26.) */

/* --- Header --- */

.platforma-header {
    height: 70px;
    background: var(--platforma-white);
    border-bottom: 1px solid var(--platforma-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--platforma-shadow-sm);
}

/* ─── SH-1 (2026-09-08, ADMIN-DESIGN-SYSTEM-PLAN §B2) — sticky-on-scroll cue ───
   platforma-layout.js adds `is-scrolled` once scrollY > 0 (demo1's
   data-kt-sticky-class idea, clean-room). The resting header above is
   untouched; scrolled, its bottom edge reads as a 1px border-subtle line with
   the sm shadow from the PF scale — the depth cue that content is passing
   beneath. The transition exists only for users who allow motion. */
.platforma-header.is-scrolled {
    border-bottom-color: var(--pf-color-border-subtle);
    box-shadow: var(--pf-shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
    .platforma-header {
        transition: box-shadow var(--platforma-duration-fast, 120ms) var(--platforma-ease-out, ease),
                    border-color var(--platforma-duration-fast, 120ms) var(--platforma-ease-out, ease);
    }
}

.platforma-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--platforma-gray-900);
}

/* Visually hidden but still accessible to screen readers.
   Used on the topbar page-title so it no longer duplicates the
   content h1 but remains as an a11y landmark. */
.platforma-page-title--sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* AUDIT-A11Y-1 — the command-palette trigger. Quiet by default: it is a way IN, not a call to
   action, so it must not compete with the tenant switcher beside it. */
.platforma-header-cmdk {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    appearance: none;
    margin: 0;
    padding: .35rem .6rem;
    cursor: pointer;
    font: inherit;
    font-size: var(--pf-text-2sm);
    line-height: 1;
    color: var(--pf-color-text-secondary);
    background: var(--pf-color-surface-sunken);
    border: 1px solid var(--pf-color-border-subtle);
    border-radius: 6px;
}

.platforma-header-cmdk:hover {
    color: var(--pf-color-text-primary);
    background: var(--pf-color-surface-hover);
}

.platforma-header-cmdk-key {
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--pf-color-text-secondary);
    background: var(--pf-color-surface-raised);
    border: 1px solid var(--pf-color-border-subtle);
}

/* The search glyph leads the trigger; the icon box keeps it aligned with the label. */
.platforma-header-cmdk-icon {
    display: inline-flex;
    align-items: center;
    color: var(--pf-color-text-tertiary);
}
.platforma-header-cmdk-icon svg { display: block; }

/* On a tablet the key hint drops — a bare chord is a puzzle, not a help — but the LABEL stays,
   because there is still room for it and the word is the clearest affordance. The phone tier
   (#1: collapse the label to an icon-only 44px button) lives in the shared 767.98px block below,
   next to the other header rules, so a lone extra @media block cannot break the APD-1 slicer. */
@media (max-width: 900px) {
    .platforma-header-cmdk-key { display: none; }
}

.platforma-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Burger-knap til mobil */
.platforma-header-menu {
    --pf-header-menu-size: 36px;
    display: none;
    position: relative;                 /* anchors the pointer-target extension below */
    margin-right: 0.75rem;
    width: var(--pf-header-menu-size);
    height: var(--pf-header-menu-size);
    border-radius: 8px;
    border: 1px solid var(--platforma-gray-200);
    background: var(--platforma-white);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

/* A11Y-MOBILE-1 — pointer-target extension, symmetric around the visual box.
   The drawn button stays 36px on the design grid and the icon stays 18px; only the
   ACTIVATABLE region grows to --pf-button-hit-target (44px). Both target-size criteria
   measure the target, never the glyph, so inflating the button itself would change a
   frozen design for no accessibility gain.

   Same technique as pf/components/button.css:454-461, which is where --pf-button-hit-target
   is already used. Requires position:relative above, which this rule did not have.

   Worth stating plainly because it was asked as a defect: 36x36 already PASSES
   WCAG 2.5.8 Target Size (Minimum, AA, 24x24). 44 comes from 2.5.5 (Enhanced, AAA), which
   this product has chosen as its bar — tokens.components.css:224 declares it. This is a
   product-standard uplift, not a conformance repair.

   Safe against neighbours: the -4px expansion sits inside the 12px margin-right, so it
   cannot overlap the next control and steal its clicks. */
.platforma-header-menu::before {
    content: "";
    position: absolute;
    inset: calc((var(--pf-header-menu-size) - max(var(--pf-header-menu-size), var(--pf-button-hit-target))) / 2);
}

    .platforma-header-menu svg {
        width: 18px;
        height: 18px;
        color: var(--platforma-gray-700);
    }

/* Tenant Selector */
.platforma-select {
    background: var(--platforma-white);
    border: 1px solid var(--pf-color-border-control, var(--platforma-gray-300));
    border-radius: 8px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--platforma-gray-700);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M3 5L6 8L9 5' stroke='%237E8299' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

    .platforma-select:focus {
        outline: none;
        border-color: var(--platforma-primary);
        box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.1);
    }

/* DS-15 (2026-09-22, design-consolidation) — keep the header tenant switcher but make it discreet +
   compact: tighter padding, a slightly smaller label, and a max-width so a long tenant name never
   sprawls across the clean header. Scoped to the HEADER instance only — the generic .platforma-select
   above is the shared filter control used across many list pages and must not shrink with it. */
.platforma-tenant-selector .platforma-select {
    padding: 0.375rem 1.9rem 0.375rem 0.7rem;
    font-size: 0.8125rem;
    max-width: 200px;
}

    /* the TenantAdmin/Staff read-only variant tracks the same compact metrics. */
    .platforma-tenant-selector .platforma-select-readonly {
        font-size: 0.8125rem;
        max-width: 200px;
    }

/* User Menu */
/* A11Y-MOBILE-1 — this container is a plain <div> holding an avatar, two text lines, a
   link and a form (_LoginPartial.cshtml:19-55). It is NOT a control and never was: no
   button, no aria-expanded, no panel. It nonetheless carried cursor:pointer and a hover
   background, which advertises an interaction that does not exist — and advertises it to
   mouse users only, with no keyboard or assistive-technology equivalent.

   Removed rather than implemented: turning this into a real disclosure is the header-
   declutter slice, which reuses the dropdown behaviour already shipping in
   platforma-ui.js:434-526. Until then the honest rendering is a container that does not
   pretend to be clickable. The link and the button inside it keep their own affordances. */
.platforma-user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
}

/* A11Y-MOBILE-2 — the disclosure variant, behind feature.admin.user-menu.v1. The base rule
   above is untouched so the flag-OFF rendering stays byte-identical; this modifier turns the
   container into a positioning context for the popover and hands the layout, the padding and
   the pointer affordance to the button that actually opens it. */
.platforma-user-menu--disclosure {
    display: block;
    position: relative;
    padding: 0;
}

.platforma-user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--platforma-radius);
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .platforma-user-menu-toggle:hover {
        background: var(--platforma-gray-100);
    }

/* Inside the disclosure these two lines are <span>s, because a <button> may not contain
   block-level flow content. This restores the stack they had as <div>s; in the flag-OFF
   branch they are still <div>s and a flex column renders them identically. */
.platforma-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.platforma-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--platforma-primary-fill), var(--platforma-info));   /* DARK-PRIMARY-1: white glyph on it */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.platforma-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--platforma-gray-900);
}

.platforma-user-role {
    font-size: 0.75rem;
    color: var(--platforma-gray-500);
}

/* ============================
   RESPONSIVE SIDEBAR (MOBILE)
   ============================ */

/* Tablet (768–1024px) — narrower sidebar */
@media (max-width: 1024px) {
    .platforma-sidebar {
        width: 220px;
    }

    .platforma-main {
        margin-left: 220px;
    }

    .platforma-content {
        padding: var(--platforma-space-6);
    }
}

/* Mobile (<768px) — sidebar hidden, slide-out */
@media (max-width: 767.98px) {
    /* MOBILE-FIX (2026-09-21): stop the header account cluster + tenant selector overflowing at ~390px.
       (#6) collapse the unbounded username/language text — the 36px avatar stays the identity cue, and the
       language + sign-out controls keep their labels; (#2) truncate the read-only tenant name with an ellipsis
       (its container already has a definite max-width). The durable consolidation is the disclosure user-menu
       behind feature.admin.user-menu.v1 (operator decision); this keeps the default state usable meanwhile. */
    .platforma-user-menu .platforma-user-info {
        display: none;
    }
    .platforma-user-menu {
        gap: 0.4rem;
        padding: 0.25rem;
    }
    .platforma-tenant-selector .platforma-select-readonly {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .platforma-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: 260px;
    }

        .platforma-sidebar.is-open {
            transform: translateX(0);
        }

    .platforma-main {
        margin-left: 0;
    }

    .platforma-sidebar-backdrop.is-visible {
        display: block;
    }

    .platforma-content {
        padding: var(--platforma-space-4) var(--platforma-space-3);
    }

    .platforma-header {
        padding: 0 var(--platforma-space-3);
    }

    .platforma-header-menu {
        display: inline-flex;
    }

    .platforma-header-right {
        gap: 0.5rem;
        min-width: 0;              /* APD-1: allow the toolbar to shrink */
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    /* MOBILE-FIX 2026-09-21 (#1): on a phone the wordy command-palette label collapses, leaving a
       recognised icon-only search button at a comfortable 44px tap target so the header stops
       overflowing. title + aria-keyshortcuts keep the accessible name once the label is gone. */
    .platforma-header-cmdk-label { display: none; }
    .platforma-header-cmdk {
        gap: 0;
        min-inline-size: var(--pf-button-hit-target, 2.75rem);
        min-block-size: var(--pf-button-hit-target, 2.75rem);
        justify-content: center;
        padding: 0;
    }
    .platforma-header-cmdk-icon { color: var(--pf-color-text-secondary); }

    .platforma-header-left {
        flex: 0 0 auto;
    }

    .platforma-tenant-selector {
        min-width: 0;
        flex: 0 1 auto;
    }

    .platforma-tenant-selector .platforma-select {
        max-width: min(140px, 34vw);   /* keep the tenant picker from pushing the row wide */
    }

    .platforma-page-title {
        font-size: 1rem;
    }

    .platforma-tenant-selector .platforma-select,
    .platforma-tenant-selector .platforma-select-readonly {
        font-size: 0.75rem;
        max-width: 140px;
    }
}

/* ============================
   BREADCRUMBS
   ============================ */

.platforma-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    color: var(--platforma-gray-500);   /* SA-14a: was the disabled role (2.56:1) */
    border-bottom: 1px solid var(--platforma-gray-100);
    background: var(--platforma-white);
}

.platforma-breadcrumb-sep {
    color: var(--platforma-gray-300);
}

.platforma-breadcrumb-link {
    color: var(--platforma-gray-500);
    text-decoration: none;
}

.platforma-breadcrumb-link:hover {
    /* LP-12 (2026-08-31): links/breadcrumbs er chrome-aktioner → navy-aliaset
       (lys flade, basen er AA her; tenant-tema-laget vinder fortsat ovenpå). */
    color: var(--platforma-chrome-action, #2E5C8A);
    text-decoration: underline;
}

.platforma-breadcrumb-current {
    color: var(--platforma-gray-700);
    font-weight: 500;
}

/* ─── Slice HEAD.1-3 (2026-04-26) — Standardiseret admin page-header ─── */
/* Erstatter wp-header-card (gradient hero) og inkonsistente welcome-section
   varianter. Parchment-tone matcher IA.7 hero. Source Serif headline.
   Klart hierarki: title → subtitle → inline-stats venstre, secondary →
   primary (gold) → kebab højre. */

.platforma-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.6rem 1.5rem;
    margin: 0 0 1.5rem;
    /* CONSIST-2 (2026-09-09): flat, chrome-less "Metronic-true" header — the
       title block sits on the page, separated by a single hairline, not a
       tinted card. Was the PL-3 parchment warm-surface gradient + boxed border. */
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--pf-color-border-subtle);
    border-radius: 0;
    flex-wrap: wrap;
}

.platforma-page-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.platforma-page-header-title {
    margin: 0 0 0.3rem;
    /* CONSIST-2: sans page-title (Metronic-true), was a serif headline face. */
    font-family: var(--platforma-font-sans);
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--platforma-ink-strong, #0B0D16);
    letter-spacing: -0.015em;
}

.platforma-page-header-subtitle {
    margin: 0 0 0.4rem;
    font-size: 0.93rem;
    line-height: 1.5;
    color: var(--platforma-ink-muted, #5C5749);
    max-width: 60ch;
}
.platforma-page-header-subtitle strong {
    color: var(--platforma-ink-strong, #0B0D16);
    font-weight: 600;
}

.platforma-page-header-stats {
    margin: 0;
    overflow-wrap: anywhere; /* APD-1: long unbroken stat strings must not widen the header */
    font-size: 0.82rem;
    color: var(--platforma-ink-muted, #5C5749);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

/* Actions container — højre side. */
.platforma-page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.platforma-page-header-form {
    display: inline-flex;
    margin: 0;
}

/* Base action button. */
.platforma-page-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    color: var(--platforma-ink-strong, #0B0D16);
    font-family: inherit;
}

/* Secondary: outline-style, neutral — typisk "Forhåndsvis" / "Eksport". */
.platforma-page-header-action--secondary {
    background: var(--pf-color-surface-raised, #fff);
    color: var(--platforma-ink-strong, #0B0D16);
    border-color: var(--pf-color-border-strong, rgba(11, 13, 22, 0.18));
    box-shadow: 0 1px 2px rgba(11, 13, 22, 0.04);
}
.platforma-page-header-action--secondary:hover {
    border-color: rgba(11, 13, 22, 0.30);
    background: var(--pf-color-surface-warm, #FFFCF4);
    color: var(--platforma-ink-strong, #0B0D16);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(11, 13, 22, 0.08);
}

/* Primary: gold-accent, mest fremtrædende — "+ Ny X". */
.platforma-page-header-action--primary {
    /* WAVE-0 (demo10 parity): primary action = navy accent. Was the editorial
       GOLD gradient — a third accent nobody chose. Flat fill + demo10 micro-shadow;
       tenant themes still win via the --tenant-primary override in admin-themed.css. */
    background: var(--platforma-chrome-action);
    color: #fff;
    border-color: var(--platforma-chrome-action);
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.platforma-page-header-action--primary:hover {
    background: var(--platforma-chrome-action-hover, #1B3D5E);
    border-color: var(--platforma-chrome-action-hover, #1B3D5E);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.platforma-page-header-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}
.platforma-page-header-action-icon svg {
    width: 14px;
    height: 14px;
}

/* Kebab dropdown — tertiære/destruktive handlinger gemt bag ⋯. */
.platforma-page-header-kebab {
    position: relative;
    display: inline-flex;
}

.platforma-page-header-kebab-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--pf-color-surface-raised, #fff);
    color: var(--platforma-ink-muted, #5C5749);
    border: 1px solid var(--pf-color-border-strong, rgba(11, 13, 22, 0.18));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}
.platforma-page-header-kebab-toggle:hover {
    background: var(--pf-color-surface-warm, #FFFCF4);
    color: var(--platforma-ink-strong, #0B0D16);
    border-color: rgba(11, 13, 22, 0.30);
}
.platforma-page-header-kebab[aria-expanded="true"] .platforma-page-header-kebab-toggle {
    background: rgba(199, 165, 95, 0.14);
    border-color: rgba(199, 165, 95, 0.40);
    color: var(--platforma-ink-strong, #0B0D16);
}

.platforma-page-header-kebab-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: var(--pf-color-surface-overlay, #fff);
    border: 1px solid var(--pf-color-border-subtle, rgba(11, 13, 22, 0.12));
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(11, 13, 22, 0.14);
    padding: 6px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.platforma-page-header-kebab-menu[hidden] { display: none; }

.platforma-page-header-kebab-item {
    text-align: left;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    background: transparent;
    color: var(--platforma-ink-strong, #0B0D16);
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
    text-decoration: none;
    display: block;
    font-family: inherit;
    white-space: nowrap;
}
.platforma-page-header-kebab-item:hover {
    background: rgba(199, 165, 95, 0.10);
    color: var(--platforma-ink-strong, #0B0D16);
    text-decoration: none;
}

/* Destruktive items i kebab-menu (rød accent). */
.platforma-page-header-action--destructive {
    color: var(--pf-color-status-danger-fg, #B23A3A) !important;
}
.platforma-page-header-kebab-item.platforma-page-header-action--destructive:hover {
    background: var(--pf-color-status-danger-soft, rgba(178, 58, 58, 0.08));
    color: var(--pf-color-status-danger-fg, #991b1b) !important;
}

/* ─── EXT (2026-09-23) — Hero treatment for the ONE shared header ──────────────
   SuperAdmin header consolidation, decision B: _AdminPageHeader can ALSO render the
   PageBanner "hero" look (a small overline + a 48px icon tile + a variant surface),
   so the ONE header component absorbs the PageBanner ViewComponent. PURELY ADDITIVE
   — these rules only bite when the VM's Variant is set (the partial then adds
   .platforma-page-header--hero + .platforma-page-header--v-{variant}); the no-Variant
   lean render is byte-unchanged and the base .platforma-page-header block above stays
   flat + chrome-less (pinned by AdminPageHeaderIATests.Css_HasFlatChromelessHeader_Consist2,
   which is NOT edited here — this block adds modifiers only, never touches the base).

   NO net-new colour: every value below is REUSED from .platforma-page-banner* in
   platforma-design-system.css. Post-CONSIST-2 the banner is itself flat (transparent
   surface + the shared bottom hairline; warn alone keeps a discreet amber left-rule),
   so faithfully reproducing it means KEEPING the base bottom hairline (removing it
   would make the hero diverge from the PageBanner it reproduces). The only base-chrome
   departure the hero introduces is warn's amber left-rule — scoped HERE under the
   --hero modifier, never in the base block. */

/* Variant surfaces — mirror .platforma-page-banner--{variant} 1:1. */
.platforma-page-header--hero.platforma-page-header--v-platform,
.platforma-page-header--hero.platforma-page-header--v-tenant,
.platforma-page-header--hero.platforma-page-header--v-trust,
.platforma-page-header--hero.platforma-page-header--v-neutral {
    background: transparent;
}
.platforma-page-header--hero.platforma-page-header--v-warn {
    background: transparent;
    border-left: 3px solid var(--pf-color-status-warning);
    padding-left: var(--platforma-space-4);
}

/* Icon tile — mirrors .platforma-page-banner__icon (48px sunken surface). */
.platforma-page-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--platforma-radius-md);
    background: var(--pf-color-surface-sunken);
    color: var(--pf-color-text-secondary);
    margin-bottom: var(--platforma-space-4);
}

/* Overline — mirrors .platforma-page-banner__overline. */
.platforma-page-header-overline {
    display: block;
    font-size: var(--platforma-text-overline);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pf-color-text-tertiary);
    margin-bottom: var(--platforma-space-2);
}

/* ─── HEAD.4 (2026-04-26) — Premium upgrade ───
   Logo + breadcrumb + live-status pulse + visual stats-row + microinteractions.
   Konkurrerer med Webflow/Notion/Linear-tier admin-headers. */

/* Re-strukturér header: top-row (logo + title + actions) + meta-row (live + stats) + statrow */
.platforma-page-header {
    display: block;
    /* CONSIST-2: chrome-less padding — no side inset so the title aligns to the
       page content's left edge; bottom room sits above the hairline. */
    padding: 0.4rem 0 1.15rem;
}

.platforma-page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Tenant-logo bobble. */
.platforma-page-header-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--platforma-warm, #C7A55F), #a07414);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(11, 13, 22, 0.10);
}
.platforma-page-header-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.platforma-page-header-logo-initial {
    font-family: 'Source Serif Pro', Georgia, serif;
    font-weight: 700;
    font-size: 22px;
    color: #0B0D16;
    line-height: 1;
}

/* Breadcrumb-trail under titel. */
.platforma-page-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    color: var(--platforma-ink-muted, #5C5749);
    letter-spacing: 0.02em;
}
.platforma-page-header-breadcrumb-link {
    color: var(--platforma-ink-muted, #5C5749);
    text-decoration: none;
    transition: color 0.12s ease;
}
.platforma-page-header-breadcrumb-link:hover {
    color: var(--platforma-warm, #C7A55F);
    text-decoration: none;
}
.platforma-page-header-breadcrumb-sep {
    color: var(--pf-color-text-tertiary, rgba(11, 13, 22, 0.35)); /* DARK-FIX 2026-09-21: flipping separator */
    font-weight: 500;
}
.platforma-page-header-breadcrumb-current {
    color: var(--platforma-ink-strong, #0B0D16);
    font-weight: 500;
}

/* Microinteraction: hover-lift på primary action med shadow-bloom. */
.platforma-page-header-action--primary {
    position: relative;
    isolation: isolate;
}
.platforma-page-header-action--primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: radial-gradient(closest-side, rgba(46, 92, 138, 0.18), transparent);
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: -1;
    filter: blur(6px);
}
.platforma-page-header-action--primary:hover::after {
    opacity: 1;
}

/* Focus-ring i gold (premium tier accessibility-detail). */
.platforma-page-header-action:focus-visible,
.platforma-page-header-kebab-toggle:focus-visible,
.platforma-page-header-breadcrumb-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(199, 165, 95, 0.40);
    border-radius: 8px;
}

/* ─── Meta row: live-status + inline-stats ─── */
.platforma-page-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(11, 13, 22, 0.08);
}

.platforma-page-header-live {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    color: var(--platforma-ink-strong, #0B0D16);
    font-weight: 500;
}

.platforma-page-header-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.platforma-page-header-live-dot--live {
    background: var(--pf-color-status-success, #16a34a);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
    animation: platformaPulse 2.4s ease-out infinite;
}
.platforma-page-header-live-dot--off {
    background: var(--pf-color-text-disabled, #94a3b8);
}

@keyframes platformaPulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.50); }
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .platforma-page-header-live-dot--live { animation: none; }
    .platforma-page-header-action--primary::after { transition: none; }
}

.platforma-page-header-live-link {
    color: var(--platforma-warm, #C7A55F);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    margin-left: 0.2rem;
    transition: color 0.12s ease;
}
.platforma-page-header-live-link:hover {
    color: var(--pf-color-status-warning-fg, #a07414);
    text-decoration: underline;
}
.platforma-page-header-live-sep {
    color: var(--pf-color-text-tertiary, rgba(11, 13, 22, 0.30)); /* DARK-FIX 2026-09-21: flipping separator */
    font-weight: 600;
}
.platforma-page-header-live-updated {
    font-size: 0.82rem;
    color: var(--platforma-ink-muted, #5C5749);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* ─── Visual stats-row: progress-rings, sparklines, counters, sprogflag ─── */
.platforma-page-header-statrow {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(11, 13, 22, 0.06);
}

.platforma-page-header-stat {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 44px;
}

.platforma-page-header-stat-body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    gap: 2px;
}

.platforma-page-header-stat-value {
    /* CONSIST-2: sans stat numerals (tabular), was Source Serif Pro. */
    font-family: var(--platforma-font-sans);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--platforma-ink-strong, #0B0D16);
    letter-spacing: -0.01em;
    line-height: 1;
}

.platforma-page-header-stat-label {
    font-size: 0.74rem;
    color: var(--platforma-ink-muted, #5C5749);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.platforma-page-header-stat-trend {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    align-self: flex-start;
    margin-top: 1px;
}
.platforma-page-header-stat-trend--up {
    background: rgba(22, 163, 74, 0.14);
    color: var(--pf-color-status-success-fg, #166534);
}
.platforma-page-header-stat-trend--down {
    background: rgba(178, 58, 58, 0.14);
    color: var(--pf-color-status-danger-fg, #991b1b);
}
.platforma-page-header-stat-trend--flat {
    background: rgba(11, 13, 22, 0.08);
    color: var(--platforma-ink-muted, #5C5749);
}

/* Tone variants på stat (driver value-color). */
/* PL-3: the status FOREGROUND roles (light emerald/amber/red-800 on white ≥ 7:1 AAA;
   dark emerald/amber/red-300 on slate-800 ≥ 7.7:1 AAA — badge.css measurements). */
.platforma-page-header-stat--tone-ok    .platforma-page-header-stat-value { color: var(--pf-color-status-success-fg, #166534); }
.platforma-page-header-stat--tone-attn  .platforma-page-header-stat-value { color: var(--pf-color-status-warning-fg, #92400e); }
.platforma-page-header-stat--tone-alert .platforma-page-header-stat-value { color: var(--pf-color-status-danger-fg, #991b1b); }

/* Progress ring — CSS conic-gradient, ingen JS-lib. */
.platforma-progress-ring {
    --progress: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(
        var(--platforma-warm, #C7A55F) calc(var(--progress) * 1%),
        rgba(11, 13, 22, 0.10) 0
    );
    display: grid;
    place-items: center;
    position: relative;
    flex-shrink: 0;
}
.platforma-progress-ring::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(180deg, var(--pf-color-surface-warm, #FFFCF4) 0%, var(--pf-color-surface-warm-deep, #FAF6EE) 100%);
    border-radius: 50%;
    position: absolute;
    inset: 6px;
}
.platforma-progress-ring-text {
    position: relative;
    z-index: 1;
    font-size: 10px;
    font-weight: 700;
    color: var(--platforma-ink-strong, #0B0D16);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    letter-spacing: -0.02em;
}

/* Sparkline — inline SVG. */
.platforma-sparkline {
    color: var(--platforma-warm, #C7A55F);
    flex-shrink: 0;
}
.platforma-page-header-stat--tone-ok    .platforma-sparkline { color: var(--pf-color-status-success, #16a34a); }
.platforma-page-header-stat--tone-attn  .platforma-sparkline { color: var(--pf-color-status-warning, #c89d4d); }
.platforma-page-header-stat--tone-alert .platforma-sparkline { color: var(--pf-color-status-danger, #dc2626); }

/* Sprogflag-row. */
.platforma-page-header-stat-flags {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.platforma-page-header-stat-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 2px 6px;
    background: rgba(199, 165, 95, 0.15);
    color: var(--pf-color-status-warning-fg, #8B6914);
    border: 1px solid rgba(199, 165, 95, 0.30);
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

/* Mobile: stack header vertically. */
@media (max-width: 720px) {
    .platforma-page-header {
        padding: 0.4rem 0 1rem;
    }
    .platforma-page-header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .platforma-page-header-statrow {
        gap: 1rem;
    }
}

/* ─── Tier 3 + 4 (2026-04-26) — Smart-layer + hyper-premium ─── */

/* Smart-suggestion banner OVER header. */
.platforma-suggestion {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    margin: 0 0 0.85rem;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid;
    animation: platformaSlideIn 0.25s ease-out;
}
.platforma-suggestion[hidden] { display: none; }
/* PL-3: the three tones ride the status soft / border / fg trios (measured in badge.css:
   light ≥ 6.8:1, dark ≥ 8.3:1) instead of hand-picked pastels that stayed light under dark. */
.platforma-suggestion--info {
    background: var(--pf-color-status-info-soft, #F0F9FF);
    border-color: var(--pf-color-status-info-border, rgba(37, 99, 235, 0.20));
    color: var(--pf-color-status-info-fg, #1e3a8a);
}
.platforma-suggestion--attn {
    background: var(--pf-color-status-warning-soft, #FFFCF4);
    border-color: var(--pf-color-status-warning-border, rgba(199, 165, 95, 0.40));
    color: var(--pf-color-status-warning-fg, #713f12);
}
.platforma-suggestion--alert {
    background: var(--pf-color-status-danger-soft, #FEF2F2);
    border-color: var(--pf-color-status-danger-border, rgba(178, 58, 58, 0.30));
    color: var(--pf-color-status-danger-fg, #991b1b);
}
.platforma-suggestion-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.platforma-suggestion-text {
    flex: 1 1 auto;
    min-width: 0;
}
.platforma-suggestion-action {
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    /* DARK-FIX (2026-09-21): the pill tint must derive from the (theme-flipping) text colour, not a fixed white —
       a static white wash made the light status-fg CTA text invisible in dark (~1.3:1). */
    background: color-mix(in srgb, currentColor 15%, transparent);
    transition: background 0.12s ease;
}
.platforma-suggestion-action:hover {
    background: color-mix(in srgb, currentColor 28%, transparent); /* DARK-FIX 2026-09-21: hover, theme-safe */
    color: inherit;
    text-decoration: none;
}
.platforma-suggestion-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.12s ease, background 0.12s ease;
}
.platforma-suggestion-dismiss:hover {
    opacity: 1;
    background: rgba(11, 13, 22, 0.06);
}

@keyframes platformaSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tier 4 — Subtle background-noise texture i header (depth uden distraktion). */
.platforma-page-header { position: relative; }
/* CONSIST-2 (2026-09-09): the parchment noise-texture layer is retired with the
   flat chrome-less header — the surface is now transparent, nothing to texture. */

/* Tier 3 — Last-changed display under title. */
.platforma-page-header-lastchanged {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    color: var(--platforma-ink-muted, #5C5749);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}
.platforma-page-header-lastchanged svg { opacity: 0.7; }

/* Tier 3 — Inline-rename: title becomes editable on double-click. */
.platforma-page-header-title--editable {
    cursor: text;
    border-radius: 6px;
    padding: 2px 6px;
    margin-left: -6px;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}
.platforma-page-header-title--editable:hover {
    background: rgba(199, 165, 95, 0.08);
}
.platforma-page-header-title--editable[contenteditable="true"],
.platforma-page-header-title--editable.is-editing {
    background: var(--pf-color-surface-raised, #fff);
    box-shadow: 0 0 0 2px rgba(199, 165, 95, 0.40);
    outline: none;
}

/* Tier 4 — Activity-stream tooltip på progress-ring. */
.platforma-progress-ring {
    cursor: help;
}
.platforma-progress-ring[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    /* PL-3: the DS-1 mono neutral — near-ink in light, near-paper in dark (16.3:1). */
    background: var(--pf-color-mono, #0B0D16);
    color: var(--pf-color-mono-foreground, #fff);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(11, 13, 22, 0.20);
}
.platforma-progress-ring[data-tooltip]:hover::after {
    opacity: 1;
}

/* ─── Tier 3 — Command Palette ⌘K ─── */
.platforma-cmdk {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.platforma-cmdk[hidden] { display: none; }
.platforma-cmdk-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 13, 22, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: platformaFadeIn 0.18s ease-out;
}
.platforma-cmdk-modal {
    position: relative;
    width: min(580px, calc(100vw - 32px));
    max-height: 70vh;
    background: linear-gradient(180deg, var(--pf-color-surface-overlay, #FFFFFF) 0%, var(--pf-color-surface-warm, #FFFCF4) 100%);
    border: 1px solid var(--pf-color-border-subtle, rgba(11, 13, 22, 0.10));
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(11, 13, 22, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: platformaCmdkIn 0.20s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes platformaFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes platformaCmdkIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .platforma-cmdk-backdrop, .platforma-cmdk-modal { animation: none; }
}

.platforma-cmdk-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(11, 13, 22, 0.08);
    color: var(--platforma-ink-muted, #5C5749);
}
.platforma-cmdk-input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--platforma-ink-strong, #0B0D16);
    font-family: inherit;
}
.platforma-cmdk-input::placeholder {
    color: var(--pf-color-text-tertiary, rgba(11, 13, 22, 0.40));
}
.platforma-cmdk-hint {
    background: var(--pf-color-surface-sunken, rgba(11, 13, 22, 0.08));
    color: var(--pf-color-text-secondary, rgba(11, 13, 22, 0.55));
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.platforma-cmdk-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px;
}
.platforma-cmdk-section {
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--platforma-ink-muted, #5C5749);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}
.platforma-cmdk-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--platforma-ink-strong, #0B0D16);
    text-decoration: none;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.10s ease;
}
.platforma-cmdk-item:hover,
.platforma-cmdk-item.is-active {
    background: rgba(199, 165, 95, 0.14);
    text-decoration: none;
    color: var(--platforma-ink-strong, #0B0D16);
}
.platforma-cmdk-item[hidden] { display: none; }
.platforma-cmdk-item-icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.platforma-cmdk-item-label {
    flex: 1 1 auto;
    font-weight: 500;
}
.platforma-cmdk-item-shortcut {
    font-size: 10px;
    /* AUDIT-CONTRAST-1 — text-tertiary on surface-sunken is 4.34:1 in light theme, under 1.4.3.
       This chip is not decoration: platforma-recent-tracker.js renders the item PATH in it, which
       is how two same-named recent items are told apart. text-secondary gives 9.45 / 13.59. */
    color: var(--pf-color-text-secondary, rgba(11, 13, 22, 0.72));
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    background: var(--pf-color-surface-sunken, rgba(11, 13, 22, 0.05));
    padding: 2px 6px;
    border-radius: 4px;
}

.platforma-cmdk-empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.86rem;
    color: var(--platforma-ink-muted, #5C5749);
}

.platforma-cmdk-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 10px 14px;
    border-top: 1px solid rgba(11, 13, 22, 0.08);
    font-size: 0.74rem;
    color: var(--platforma-ink-muted, #5C5749);
    background: rgba(11, 13, 22, 0.02);
    flex-wrap: wrap;
}
.platforma-cmdk-footer kbd {
    background: var(--pf-color-surface-sunken, rgba(11, 13, 22, 0.08));
    color: var(--platforma-ink-strong, #0B0D16);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 2px;
}
.platforma-cmdk-footer span {
    margin-right: 0.85rem;
}

/* ─── CONSIST-2 (2026-09-09): time-of-day header theming retired ───
   The four adaptive-tone gradients (morning/day/evening/night) made the same
   page render a different cream tint by the hour — a non-deterministic look
   that contradicts the "every header is identical" goal. The header is now a
   flat transparent surface; the classes are no longer emitted by the partial. */

/* ─── Phase 1 (2026-04-26) — Editor + Recyclebin shortcuts ─── */

/* Editor action — distinct lilla/cms-tone for at signalere "design-tilstand". */
.platforma-page-header-action--editor {
    background: linear-gradient(180deg, #FAF5FF 0%, #F3E8FF 100%);
    color: #6b21a8;
    border-color: rgba(107, 33, 168, 0.30);
    box-shadow: 0 1px 2px rgba(11, 13, 22, 0.04);
}
.platforma-page-header-action--editor:hover {
    background: linear-gradient(180deg, #F3E8FF 0%, #E9D5FF 100%);
    border-color: rgba(107, 33, 168, 0.55);
    color: #581c87;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(107, 33, 168, 0.15);
}
.platforma-page-header-action--editor::before {
    content: '';
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b21a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='13.5' cy='6.5' r='.5' fill='%236b21a8'/><circle cx='17.5' cy='10.5' r='.5' fill='%236b21a8'/><circle cx='8.5' cy='7.5' r='.5' fill='%236b21a8'/><circle cx='6.5' cy='12.5' r='.5' fill='%236b21a8'/><path d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125 0-.926.746-1.687 1.688-1.687h1.992c3.094 0 5.547-2.453 5.547-5.547C22 6.5 17.5 2 12 2z'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Recyclebin shortcut — lille text-link i meta-row med count. */
.platforma-page-header-recyclebin {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--platforma-ink-muted, #5C5749);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(11, 13, 22, 0.04);
    border: 1px solid transparent;
    transition: all 0.12s ease;
}
.platforma-page-header-recyclebin:hover {
    background: rgba(178, 58, 58, 0.08);
    color: var(--pf-color-status-danger-fg, #991b1b);
    border-color: rgba(178, 58, 58, 0.20);
    text-decoration: none;
}
.platforma-page-header-recyclebin svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.platforma-page-header-recyclebin:hover svg {
    opacity: 1;
}

/* Tier 4 — Magnetic-button effekt: cursor "trækker" knappen lidt mod sig.
   Implementeret med pure CSS hover-transform (light-touch version af
   Apple/Vercel JS-magnetic). */
.platforma-page-header-action--primary {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.18s ease,
                background 0.15s ease;
}
.platforma-page-header-action--primary:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

/* ─── IA.3 / IA.4 (2026-04-26) — Cockpit tabs ─── */
/* Reusable tab-bar pattern shared by Activity-cockpit (Activities/Categories/
   Settings) and Website-cockpit (Pages/Documents/Media/Branding/SEO/Domain).
   Tabs render as a horizontal row of pill-buttons with an underline accent
   on the active tab. Replaces the modules-list "back to X" buttons that
   used to glue separate sidebar items together. */

/* Premium polish (2026-04-26) — UNDERLINE-style tabs ✨
   Switched from segmented-control to underline-tab pattern (browser tabs,
   GitHub, Linear, Vercel) so the strip reads instantly as navigation, not
   as a button-group. Inactive tabs are bare text+icon, active gets a thick
   gold underline anchored to the container's bottom border. Faster scan,
   premium feel, universally understood. */
.platforma-cockpit-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 1.5rem;
    padding: 0 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(11, 13, 22, 0.10);
    box-shadow: none;
    position: relative;
}

.platforma-cockpit-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem 0.85rem;
    border-radius: 0;
    text-decoration: none;
    color: var(--platforma-ink-muted, #5C5749);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px; /* så active-underline overlapper container-borderen */
    line-height: 1.2;
    white-space: nowrap;
    background: transparent;
    position: relative;
}

.platforma-cockpit-tab:hover {
    color: var(--platforma-ink-strong, #0B0D16);
    text-decoration: none;
    border-bottom-color: rgba(11, 13, 22, 0.20);
}

.platforma-cockpit-tab-active {
    color: var(--platforma-ink-strong, #0B0D16);
    font-weight: 600;
    border-bottom: 2.5px solid var(--platforma-warm, #C7A55F);
    background: transparent;
}

.platforma-cockpit-tab-active:hover {
    color: var(--platforma-ink-strong, #0B0D16);
    border-bottom-color: var(--platforma-warm, #C7A55F);
}

.platforma-cockpit-tab-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.platforma-cockpit-tab:hover .platforma-cockpit-tab-icon {
    opacity: 0.85;
}

.platforma-cockpit-tab-active .platforma-cockpit-tab-icon {
    opacity: 1;
    color: var(--platforma-warm, #C7A55F);
}

@media (max-width: 720px) {
    .platforma-cockpit-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }
    .platforma-cockpit-tab {
        padding: 0.6rem 0.75rem 0.75rem;
    }
    .platforma-cockpit-tab-text {
        font-size: 0.82rem;
    }
}
