/*
 * SMACT Platform CI — foundation
 *
 * The canonical design tokens of the SMACT Platform, the bridge that maps Metronic's own
 * variables onto them, and the scoped `ci-*` primitives every redesigned surface is built from.
 * Authority: docs/design/SMACT_PLATFORM_CI.md. Values come from the approved design reference
 * (docs/handover/smact-platform-design/tokens.css + styles.css, and form-refinements.css for the
 * dark theme).
 *
 * Hand-authored and served straight out of public/ — NOT built by Mix — so every reference
 * carries ?v={{ \App\Helpers\AssetVersion::version('css/smact-ci.css') }}.
 *
 * There is no element selector in this file. Legacy screens change only through the variables
 * Metronic already reads (section 2); everything else is opt-in through a `ci-` class.
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root,
[data-bs-theme=light] {
    --ci-font: Nexa, "Segoe UI", system-ui, sans-serif;

    /* One reference pixel at the default 13px root. Type sizes are written as N x this unit, so
       they follow the profile's font-size preference exactly as Metronic's rem-based text does
       (layouts/metronic-8-2-9 pins the root to 11/13/15/18px from that preference). */
    --ci-px: calc(1rem / 13);

    --ci-action: #7450cc;
    --ci-action-hover: #6240b5;
    --ci-action-soft: #f0eafa;
    --ci-action-ink: #6641b5;
    --ci-action-line: #e0d3f4;
    --ci-action-rgb: 116, 80, 204;
    --ci-focus: #9b7ce6;

    --ci-nav: #171722;
    --ci-nav-raised: #22222f;
    --ci-nav-border: #363543;
    --ci-nav-line: #2d2c3a;
    --ci-nav-text: #aaa9be;
    --ci-nav-strong: #f2f0fa;
    --ci-nav-muted: #8e8ca3;
    --ci-nav-icon: #8b849f;
    --ci-nav-hover: #252431;
    --ci-nav-active: #352b49;
    --ci-nav-active-text: #efe7ff;
    --ci-nav-active-mark: #b18be8;
    --ci-nav-count: #292732;

    --ci-canvas: #f5f5f9;
    --ci-surface: #ffffff;
    --ci-surface-subtle: #fbfafc;
    --ci-surface-muted: #f8f7fb;
    --ci-surface-hover: #f6f3fb;
    --ci-ink: #262536;
    --ci-muted: #6b6a7d;
    --ci-subtle: #9291a3;
    --ci-line: #e7e6ef;
    --ci-line-strong: #d9d6e4;
    --ci-track: #efedf4;

    --ci-success: #287562;
    --ci-success-soft: #eaf5ef;
    --ci-attention: #956415;
    --ci-attention-soft: #fcf4e3;
    --ci-danger: #b13e53;
    --ci-danger-soft: #fbeef1;
    --ci-info: #456ca2;
    --ci-info-soft: #edf2fa;
    --ci-neutral: #5f5d70;
    --ci-neutral-soft: #f0f0f5;

    --ci-radius: 14px;
    --ci-radius-md: 10px;
    --ci-radius-control: 7px;
    --ci-radius-avatar: 9px;
    --ci-radius-tag: 5px;
    --ci-shadow: 0 3px 12px rgba(36, 33, 57, .016);
    --ci-shadow-raised: 0 14px 40px rgba(36, 32, 52, .09);
    --ci-overlay: rgba(17, 16, 30, .36);
    --ci-motion: 180ms;

    --ci-sidebar: 238px;
    --ci-topbar: 72px;
    --ci-content-max: 1530px;

    --ci-fs-hero: calc(67 * var(--ci-px));
    --ci-fs-display: clamp(calc(30 * var(--ci-px)), 3vw, calc(43 * var(--ci-px)));
    --ci-fs-drawer-title: calc(25 * var(--ci-px));
    --ci-fs-metric: calc(32 * var(--ci-px));
    --ci-fs-section: calc(19 * var(--ci-px));
    --ci-fs-subsection: calc(16 * var(--ci-px));
    --ci-fs-lead: calc(15 * var(--ci-px));
    --ci-fs-body: calc(14 * var(--ci-px));
    --ci-fs-control: calc(13 * var(--ci-px));
    --ci-fs-small: calc(12 * var(--ci-px));
    --ci-fs-meta: calc(11 * var(--ci-px));
    --ci-fs-eyebrow: calc(11 * var(--ci-px));
    --ci-fs-nav: calc(12.5 * var(--ci-px));
    --ci-fs-nav-label: calc(10 * var(--ci-px));

    /* Semantic roles added with the forms, tables and feedback layer (forms.html, UX guide §15).
       One meaning per token, the same name in both themes. */
    --ci-accent: #7450cc;
    --ci-on-action: #ffffff;
    --ci-danger-fill: #b13e53;
    --ci-danger-fill-hover: #963245;
    --ci-field-line: #aaa9ba;
    --ci-required: #c47a83;
    --ci-check-line: #a9a5b6;
    --ci-check-on: #7450cc;
    --ci-switch-off: #d7d4e0;
    --ci-selected: #f8f3fd;
    --ci-row-hover: #faf8fc;
    --ci-danger-line: #f1cfd6;
    --ci-attention-line: #eedeac;
    --ci-upload-line: #c7bddb;
    --ci-upload-surface: #fcfaff;
    --ci-tooltip-surface: #262130;
    --ci-tooltip-line: #494053;
    --ci-tooltip-ink: #ded5eb;
    --ci-tooltip-title: #ffffff;
    --ci-tooltip-accent: #b597e8;
    --ci-shadow-popup: 0 18px 60px rgba(33, 21, 53, .13);
}

/* Dark: the designed dark theme of the reference (form-refinements.css, UX guide §15 "Hell /
   Dunkel"): the same semantic roles, never an inversion. A primary fill is a light violet carrying
   dark ink, as the reference draws it; every text pair is at least 4.5:1 on its surface. */
[data-bs-theme=dark] {
    --ci-action: #9b76de;
    --ci-action-hover: #b190e9;
    --ci-action-soft: #332641;
    --ci-action-ink: #c5a6ff;
    --ci-action-line: #67517e;
    --ci-action-rgb: 155, 118, 222;
    --ci-focus: #ae8bee;
    --ci-accent: #ae8bee;
    --ci-on-action: #151020;
    --ci-danger-fill: #c24c62;
    --ci-danger-fill-hover: #d05a70;

    --ci-nav: #111017;
    --ci-nav-raised: #1c1a24;
    --ci-nav-border: #2e2a39;
    --ci-nav-line: #26232f;
    --ci-nav-text: #bdb6ce;
    --ci-nav-hover: #1f1c28;
    --ci-nav-active: #2e2441;
    --ci-nav-count: #24212d;

    --ci-canvas: #15141c;
    --ci-surface: #201e29;
    --ci-surface-subtle: #25232f;
    --ci-surface-muted: #2a2735;
    --ci-surface-hover: #2b2838;
    --ci-ink: #efedf5;
    --ci-muted: #b8b2c7;
    --ci-subtle: #9890a9;
    --ci-line: #3b3549;
    --ci-line-strong: #4a4358;
    --ci-track: #332f3f;

    --ci-success: #84cbb4;
    --ci-success-soft: #203a33;
    --ci-attention: #e3bc70;
    --ci-attention-soft: #3e3320;
    --ci-danger: #e99aa6;
    --ci-danger-soft: #422630;
    --ci-info: #9fbfe7;
    --ci-info-soft: #273447;
    --ci-neutral: #c9c2d8;
    --ci-neutral-soft: #322e3d;

    --ci-shadow: 0 3px 12px rgba(0, 0, 0, .13);
    --ci-shadow-raised: 0 14px 40px rgba(0, 0, 0, .45);
    --ci-shadow-popup: 0 18px 60px rgba(0, 0, 0, .45);
    --ci-overlay: rgba(5, 4, 10, .6);

    --ci-field-line: #777084;
    --ci-required: #c47a83;
    --ci-check-line: #8f819f;
    --ci-check-on: #8060bb;
    --ci-switch-off: #4a4458;
    --ci-selected: #2f2540;
    --ci-row-hover: #282532;
    --ci-danger-line: rgba(233, 154, 166, .32);
    --ci-attention-line: rgba(227, 188, 112, .32);
    --ci-upload-line: #5b4d70;
    --ci-upload-surface: #241f2e;
    --ci-tooltip-surface: #302638;
    --ci-tooltip-line: #796087;
    --ci-tooltip-ink: #f7f3ff;
    --ci-tooltip-title: #ffffff;
    --ci-tooltip-accent: #b597e8;
}

/* ==========================================================================
   2. Metronic bridge
   Metronic and Bootstrap read these variables everywhere; pointing them at the CI tokens gives
   every existing screen the SMACT palette without touching its markup. The CI status pairs are
   all >= 4.5:1, which also retires Metronic's 1.6-3.5:1 tinted badges and its 2.6:1 text-muted.
   ========================================================================== */

:root,
[data-bs-theme=light] {
    --bs-font-sans-serif: var(--ci-font);

    --bs-primary: #7450cc;
    --bs-primary-active: #6240b5;
    --bs-primary-light: #f0eafa;
    --bs-primary-inverse: #ffffff;
    --bs-primary-clarity: rgba(116, 80, 204, .2);
    --bs-primary-rgb: 116, 80, 204;
    --bs-primary-bg-subtle: #f0eafa;
    --bs-primary-border-subtle: #d6c8f1;
    --bs-primary-text-emphasis: #4a2f8f;
    --bs-text-primary: #6641b5;
    --bs-link-color: #6641b5;
    --bs-link-color-rgb: 102, 65, 181;
    --bs-link-hover-color: #4f2f97;
    --bs-link-hover-color-rgb: 79, 47, 151;
    --bs-component-active-bg: #7450cc;
    --bs-focus-ring-color: rgba(116, 80, 204, .25);

    --bs-success: #287562;
    --bs-success-active: #1f5f4f;
    --bs-success-light: #eaf5ef;
    --bs-success-clarity: rgba(40, 117, 98, .2);
    --bs-success-rgb: 40, 117, 98;
    --bs-text-success: #287562;

    --bs-warning: #956415;
    --bs-warning-active: #7b520f;
    --bs-warning-light: #fcf4e3;
    --bs-warning-clarity: rgba(149, 100, 21, .2);
    --bs-warning-rgb: 149, 100, 21;
    --bs-text-warning: #956415;

    --bs-danger: #b13e53;
    --bs-danger-active: #963245;
    --bs-danger-light: #fbeef1;
    --bs-danger-clarity: rgba(177, 62, 83, .2);
    --bs-danger-rgb: 177, 62, 83;
    --bs-text-danger: #b13e53;

    --bs-info: #456ca2;
    --bs-info-active: #385a88;
    --bs-info-light: #edf2fa;
    --bs-info-clarity: rgba(69, 108, 162, .2);
    --bs-info-rgb: 69, 108, 162;
    --bs-text-info: #456ca2;

    --bs-app-bg-color: #f5f5f9;
    --bs-body-color: #262536;
    --bs-heading-color: #262536;
    --bs-border-color: #e7e6ef;
    --bs-text-muted: #6b6a7d;
    --bs-root-card-border-color: #e7e6ef;
    --bs-card-border-color: #e7e6ef;

    --bs-gray-100: #f8f7fb;
    --bs-gray-200: #ecebf2;
    --bs-gray-300: #dcd9e5;
    --bs-gray-400: #c3c0d0;
    --bs-gray-500: #9291a3;
    --bs-gray-600: #6b6a7d;
    --bs-gray-700: #4c4b5e;
    --bs-gray-800: #37364a;
    --bs-gray-900: #262536;
    --bs-text-gray-100: #f8f7fb;
    --bs-text-gray-200: #ecebf2;
    --bs-text-gray-300: #dcd9e5;
    --bs-text-gray-400: #c3c0d0;
    --bs-text-gray-500: #9291a3;
    --bs-text-gray-600: #6b6a7d;
    --bs-text-gray-700: #4c4b5e;
    --bs-text-gray-800: #37364a;
    --bs-text-gray-900: #262536;
}

[data-bs-theme=dark] {
    --bs-primary: #9b76de;
    --bs-primary-active: #b190e9;
    --bs-primary-light: #332641;
    --bs-primary-inverse: #151020;
    --bs-primary-clarity: rgba(155, 118, 222, .2);
    --bs-primary-rgb: 155, 118, 222;
    --bs-primary-bg-subtle: #332641;
    --bs-primary-border-subtle: #67517e;
    --bs-primary-text-emphasis: #ddc9ff;
    --bs-text-primary: #c5a6ff;
    --bs-link-color: #c5a6ff;
    --bs-link-color-rgb: 197, 166, 255;
    --bs-link-hover-color: #ddc9ff;
    --bs-link-hover-color-rgb: 221, 201, 255;
    --bs-component-active-bg: #9b76de;
    --bs-component-active-color: #151020;
    --bs-focus-ring-color: rgba(174, 139, 238, .35);

    --bs-success: #2b8068;
    --bs-success-active: #33937a;
    --bs-success-light: #203a33;
    --bs-success-clarity: rgba(132, 203, 180, .2);
    --bs-success-rgb: 43, 128, 104;
    --bs-text-success: #84cbb4;

    --bs-warning: #8f6216;
    --bs-warning-active: #a2711c;
    --bs-warning-light: #3e3320;
    --bs-warning-clarity: rgba(227, 188, 112, .2);
    --bs-warning-rgb: 143, 98, 22;
    --bs-text-warning: #e3bc70;

    --bs-danger: #c24c62;
    --bs-danger-active: #d05a70;
    --bs-danger-light: #422630;
    --bs-danger-clarity: rgba(233, 154, 166, .2);
    --bs-danger-rgb: 194, 76, 98;
    --bs-text-danger: #e99aa6;

    --bs-info: #456ca2;
    --bs-info-active: #557cb3;
    --bs-info-light: #273447;
    --bs-info-clarity: rgba(159, 191, 231, .2);
    --bs-info-rgb: 69, 108, 162;
    --bs-text-info: #9fbfe7;

    --bs-app-bg-color: #15141c;
    --bs-body-bg: #201e29;
    --bs-body-color: #efedf5;
    --bs-heading-color: #efedf5;
    --bs-border-color: #3b3549;
    --bs-text-muted: #b8b2c7;
    --bs-root-card-border-color: #3b3549;
    --bs-card-border-color: #3b3549;

    --bs-gray-100: #25232f;
    --bs-gray-200: #2a2735;
    --bs-gray-300: #3b3549;
    --bs-gray-400: #4a4358;
    --bs-gray-500: #9890a9;
    --bs-gray-600: #a7a1b6;
    --bs-gray-700: #b8b2c7;
    --bs-gray-800: #d6d1e0;
    --bs-gray-900: #efedf5;
    --bs-text-gray-100: #25232f;
    --bs-text-gray-200: #2a2735;
    --bs-text-gray-300: #3b3549;
    --bs-text-gray-400: #4a4358;
    --bs-text-gray-500: #9890a9;
    --bs-text-gray-600: #a7a1b6;
    --bs-text-gray-700: #b8b2c7;
    --bs-text-gray-800: #d6d1e0;
    --bs-text-gray-900: #efedf5;
    /* Metronic's dark #808290 on its #1b1c22 light fill is 4.46:1 on every .btn-light. */
    --bs-light-inverse: #b8b2c7;
}

/* Dark: Metronic draws its tinted badges and light buttons in the FILL tone on a 14% tint, and
   the dark fills above (chosen for white text on solid buttons) put that at 2.3-3.2:1 on every
   legacy screen. Their text takes the light text tone instead: 5.8-7.7:1 on surface and canvas.
   Hover and active states keep Metronic's own white-on-fill (higher specificity). */
[data-bs-theme=dark] .badge-light-primary,
[data-bs-theme=dark] .btn.btn-light-primary,
[data-bs-theme=dark] .btn.btn-light-primary i,
[data-bs-theme=dark] .btn.btn-light-primary .svg-icon { color: var(--bs-text-primary); }
[data-bs-theme=dark] .badge-light-success,
[data-bs-theme=dark] .btn.btn-light-success,
[data-bs-theme=dark] .btn.btn-light-success i,
[data-bs-theme=dark] .btn.btn-light-success .svg-icon { color: var(--bs-text-success); }
[data-bs-theme=dark] .badge-light-warning,
[data-bs-theme=dark] .btn.btn-light-warning,
[data-bs-theme=dark] .btn.btn-light-warning i,
[data-bs-theme=dark] .btn.btn-light-warning .svg-icon { color: var(--bs-text-warning); }
[data-bs-theme=dark] .badge-light-danger,
[data-bs-theme=dark] .btn.btn-light-danger,
[data-bs-theme=dark] .btn.btn-light-danger i,
[data-bs-theme=dark] .btn.btn-light-danger .svg-icon { color: var(--bs-text-danger); }
[data-bs-theme=dark] .badge-light-info,
[data-bs-theme=dark] .btn.btn-light-info,
[data-bs-theme=dark] .btn.btn-light-info i,
[data-bs-theme=dark] .btn.btn-light-info .svg-icon { color: var(--bs-text-info); }

/* ==========================================================================
   3. Primitives — glyphs, text, actions
   ========================================================================== */

.ci-glyph {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.ci-eyebrow {
    margin: 0 0 12px;
    font-family: var(--ci-font);
    font-size: var(--ci-fs-eyebrow);
    font-weight: 700;
    letter-spacing: .15em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--ci-muted);
}

/* A way back inside an eyebrow („Einstellungen / Zeiterfassung"): quiet until it is pointed at. */
.ci-eyebrow a { color: inherit; text-decoration: underline; text-decoration-color: var(--ci-line-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ci-eyebrow a:hover,
.ci-eyebrow a:focus-visible { color: var(--ci-action-ink); text-decoration: underline; text-underline-offset: 3px; }
.ci-eyebrow a:focus-visible { outline: 3px solid var(--ci-focus); outline-offset: 2px; border-radius: 3px; }
@media (pointer: coarse) {
    .ci-eyebrow a { display: inline-block; margin: -14px 0; padding: 14px 0; }
}

.ci-accent { color: var(--ci-action); font-style: normal; }
.ci-muted { color: var(--ci-muted); }
.ci-numeric { font-variant-numeric: tabular-nums; }

.ci-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--ci-line);
    border-radius: var(--ci-radius-control);
    background: var(--ci-surface);
    color: var(--ci-ink);
    font-family: var(--ci-font);
    font-size: var(--ci-fs-control);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--ci-motion), border-color var(--ci-motion), color var(--ci-motion);
}

.ci-btn:hover,
.ci-btn:focus-visible { background: var(--ci-surface-hover); border-color: var(--ci-action-line); color: var(--ci-ink); }
.ci-btn .ci-glyph { width: 17px; height: 17px; }

.ci-btn--primary { background: var(--ci-action); border-color: var(--ci-action); color: var(--ci-on-action); box-shadow: 0 2px 3px rgba(87, 56, 158, .06); }
.ci-btn--primary:hover,
.ci-btn--primary:focus-visible { background: var(--ci-action-hover); border-color: var(--ci-action-hover); color: var(--ci-on-action); }
.ci-btn--soft { background: var(--ci-action-soft); border-color: transparent; color: var(--ci-action-ink); }
.ci-btn--soft:hover,
.ci-btn--soft:focus-visible { background: var(--ci-action-soft); border-color: var(--ci-action-line); color: var(--ci-action-ink); }
.ci-btn--ghost { background: transparent; border-color: transparent; color: var(--ci-muted); }
.ci-btn--ghost:hover,
.ci-btn--ghost:focus-visible { background: var(--ci-action-soft); border-color: transparent; color: var(--ci-action-ink); }
.ci-btn--danger { background: var(--ci-danger-fill); border-color: var(--ci-danger-fill); color: #fff; }
.ci-btn--danger:hover,
.ci-btn--danger:focus-visible { background: var(--ci-danger-fill-hover); border-color: var(--ci-danger-fill-hover); color: #fff; }
.ci-btn--sm { min-height: 33px; padding: 7px 11px; font-size: var(--ci-fs-small); }
.ci-btn--block { width: 100%; }

.ci-btn[disabled],
.ci-btn[aria-disabled=true] { opacity: .65; cursor: not-allowed; }
.ci-btn.is-busy { cursor: progress; }
.ci-btn.is-busy::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ci-spin .65s linear infinite;
}

.ci-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border: 0;
    background: none;
    color: var(--ci-action-ink);
    font-family: var(--ci-font);
    font-size: var(--ci-fs-control);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ci-link:hover,
.ci-link:focus-visible { color: var(--ci-action); text-decoration: underline; text-underline-offset: 3px; }

.ci-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: var(--ci-radius-control);
    background: none;
    color: var(--ci-muted);
    cursor: pointer;
}

.ci-icon-btn:hover,
.ci-icon-btn:focus-visible { background: var(--ci-action-soft); color: var(--ci-action); }
/* A destructive icon action (a trash can): quiet at rest, the danger colour on hover and focus. */
.ci-icon-btn--danger:hover,
.ci-icon-btn--danger:focus-visible { background: var(--ci-danger-soft); color: var(--ci-danger); }
/* A finger needs 44px (TABLES-HANDOFF, WCAG 2.5.5); a mouse keeps the compact 38px. */
@media (pointer: coarse) {
    .ci-icon-btn { width: 44px; height: 44px; }
}

.ci-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.ci-actions--end { justify-content: flex-end; }

.ci-btn:focus-visible,
.ci-link:focus-visible,
.ci-icon-btn:focus-visible,
.ci-row:focus-visible,
.ci-product-card:focus-visible,
.ci-quick-list__item:focus-visible,
.ci-period__option:focus-visible,
.ci-chip:focus-visible {
    outline: 3px solid var(--ci-focus);
    outline-offset: 3px;
}

/* A scripted row that behaves as a link (role=link, tabindex=0 — the global search results) shows
   the platform's focus ring like a real link. */
[role=link][tabindex]:focus-visible {
    border-radius: var(--ci-radius-md);
    outline: 3px solid var(--ci-focus);
    outline-offset: 3px;
}

/* ==========================================================================
   4. Status, identity marks
   ========================================================================== */

.ci-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--ci-radius-tag);
    background: var(--ci-neutral-soft);
    color: var(--ci-neutral);
    font-family: var(--ci-font);
    font-size: var(--ci-fs-meta);
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.ci-tag .ci-glyph { width: 12px; height: 12px; }
.ci-tag--success { background: var(--ci-success-soft); color: var(--ci-success); }
.ci-tag--attention { background: var(--ci-attention-soft); color: var(--ci-attention); }
.ci-tag--danger { background: var(--ci-danger-soft); color: var(--ci-danger); }
.ci-tag--info { background: var(--ci-info-soft); color: var(--ci-info); }
.ci-tag--action { background: var(--ci-action-soft); color: var(--ci-action-ink); }

.ci-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--ci-radius-md);
    background: var(--ci-action-soft);
    color: var(--ci-action);
}

.ci-icon--sm { width: 35px; height: 35px; border-radius: var(--ci-radius-avatar); }
.ci-icon--neutral { background: var(--ci-surface-muted); color: var(--ci-muted); }
.ci-icon--success { background: var(--ci-success-soft); color: var(--ci-success); }
.ci-icon--attention { background: var(--ci-attention-soft); color: var(--ci-attention); }
.ci-icon--danger { background: var(--ci-danger-soft); color: var(--ci-danger); }
.ci-icon--info { background: var(--ci-info-soft); color: var(--ci-info); }
.ci-icon--action { background: var(--ci-action-soft); color: var(--ci-action-ink); }
.ci-icon img { width: 24px; height: 24px; object-fit: contain; }

.ci-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--ci-radius-avatar);
    background: var(--ci-action-soft);
    color: var(--ci-action-ink);
    font-family: var(--ci-font);
    font-size: var(--ci-fs-small);
    font-weight: 700;
    overflow: hidden;
}

.ci-avatar--round { border-radius: 50%; }
.ci-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   5. Page composition
   ========================================================================== */

.ci-page {
    container-type: inline-size;
    max-width: var(--ci-content-max);
    margin: 0 auto;
    font-family: var(--ci-font);
    color: var(--ci-ink);
}

/* An in-page target lands below the fixed topbar, not under it. */
.ci-page [id] { scroll-margin-top: calc(var(--ci-topbar) + 16px); }

.ci-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.ci-page-head__title {
    margin: 0;
    font-family: var(--ci-font);
    font-size: var(--ci-fs-display);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--ci-ink);
    overflow-wrap: anywhere;
}

.ci-page-head__title em { font-style: normal; color: var(--ci-action); }
/* A lead may carry customer content — a Bereich's own description — with a word longer than the line. */
.ci-page-head__lead { margin: 12px 0 0; color: var(--ci-muted); font-size: var(--ci-fs-body); line-height: 1.55; overflow-wrap: anywhere; }
.ci-page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; flex-shrink: 0; }

/* The ghost word (§6): ONE faint decorative word behind a page head's title — the quiet mass the
   dashboard's greeting word introduced, kept as part of the platform's identity. It is never the
   heading: aria-hidden, unselectable, behind the text (the head isolates it), clipped to the head so
   it can neither overflow nor move anything. Opt-in per page with .ci-page-head--ghost. Quieter in
   dark mode than the dashboard's word: spanning a whole head it must not compete with the title. */
.ci-page-head--ghost { position: relative; isolation: isolate; }

.ci-page-head__ghost {
    position: absolute;
    inset: -14px 0 -10px;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.ci-page-head__ghost > span {
    position: absolute;
    left: -.04em;
    top: 50%;
    transform: translateY(-54%);
    font-family: var(--ci-font);
    font-size: clamp(calc(56 * var(--ci-px)), 10cqi, calc(152 * var(--ci-px)));
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ci-ink);
    opacity: .02;
}

[data-bs-theme="dark"] .ci-page-head__ghost > span { opacity: .035; }

@media (forced-colors: active) {
    .ci-page-head__ghost { display: none; }
}

.ci-context-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: -8px 0 22px;
    color: var(--ci-muted);
    font-size: var(--ci-fs-small);
}

.ci-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 29px 0 15px;
}

.ci-section-title h2 {
    margin: 0;
    font-family: var(--ci-font);
    font-size: var(--ci-fs-subsection);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ci-ink);
}

.ci-section-title p { margin: 0; color: var(--ci-muted); font-size: var(--ci-fs-small); }

.ci-grid { display: grid; gap: 20px; align-items: start; }
.ci-grid + .ci-grid,
.ci-grid + .ci-panel,
.ci-panel + .ci-grid { margin-top: 22px; }
.ci-grid--main-aside { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.ci-grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ci-grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ci-grid--stretch { align-items: stretch; }
/* A column of panels inside one grid cell, e.g. the aside of main-aside. */
.ci-stack { display: grid; gap: 20px; align-content: start; min-width: 0; }

@container (max-width: 1020px) {
    .ci-grid--main-aside { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); }
}

@container (max-width: 860px) {
    .ci-grid--main-aside,
    .ci-grid--halves,
    .ci-grid--thirds { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 560px) {
    .ci-page-head { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
    .ci-page-head__title { font-size: calc(32 * var(--ci-px)); }
}

/* ==========================================================================
   6. Panels and their contents
   ========================================================================== */

.ci-panel {
    min-width: 0;
    border: 1px solid var(--ci-line);
    border-radius: var(--ci-radius);
    background: var(--ci-surface);
    box-shadow: var(--ci-shadow);
    overflow: hidden;
}

.ci-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 23px 25px 17px;
}

.ci-panel__title {
    margin: 0;
    font-family: var(--ci-font);
    font-size: var(--ci-fs-section);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: var(--ci-ink);
}

.ci-panel__sub { margin: 4px 0 0; color: var(--ci-muted); font-size: var(--ci-fs-small); line-height: 1.5; }
.ci-panel__body { padding: 0 25px 24px; }
.ci-panel__body--flush { padding: 0; }

.ci-panel__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 13px 25px;
    border-top: 1px solid var(--ci-line);
    color: var(--ci-muted);
    font-size: var(--ci-fs-small);
}

/* Metric strip: Weight C. One bordered band, never four floating cards. */
.ci-metrics {
    display: grid;
    grid-template-columns: repeat(var(--ci-metrics-count, 4), minmax(0, 1fr));
    margin-bottom: 22px;
    padding: 22px 0;
    border: 1px solid var(--ci-line);
    border-radius: var(--ci-radius);
    background: var(--ci-surface);
}

.ci-metric { min-width: 0; padding: 0 24px; border-right: 1px solid var(--ci-line); }
.ci-metric:last-child { border-right: 0; }

.ci-metric__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ci-muted);
    font-size: var(--ci-fs-small);
    line-height: 1.4;
}

.ci-metric__label .ci-glyph { width: 15px; height: 15px; }

.ci-metric__value {
    display: block;
    margin: 7px 0 3px;
    font-size: var(--ci-fs-metric);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: var(--ci-ink);
    overflow-wrap: anywhere;
}

.ci-metric__value a { color: inherit; text-decoration: none; }
.ci-metric__value a:hover,
.ci-metric__value a:focus-visible { color: var(--ci-action); }
.ci-metric__unit { font-size: calc(16 * var(--ci-px)); letter-spacing: 0; }
.ci-metric__note { margin: 0; color: var(--ci-muted); font-size: var(--ci-fs-meta); line-height: 1.45; }
.ci-metric__value--absent { color: var(--ci-subtle); }

/* The reference steps the metric face down to 28px on narrower work areas, so that a seven-digit
   amount and its currency still share a line inside a quarter of the band. */
@container (max-width: 1300px) {
    .ci-metric__value { font-size: calc(28 * var(--ci-px)); }
}

@container (max-width: 860px) {
    .ci-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
    .ci-metric:nth-child(2n) { border-right: 0; }
}

/* A band of amounts stacks earlier: "1.234.567,00 EUR" in half of a phone's band would break inside
   the number, and an amount split across lines is misread. */
@container (max-width: 480px) {
    .ci-metrics--amounts { grid-template-columns: minmax(0, 1fr); }
    .ci-metrics--amounts .ci-metric { border-right: 0; }
}

@container (max-width: 380px) {
    .ci-metric { padding: 0 16px; }
    .ci-metric__value { font-size: calc(26 * var(--ci-px)); }
    /* Half of a 320px band is ~110px: "Lieferantenantworten" does not fit and would widen the page.
       It breaks where the band ends — never at a hyphen only some browsers' dictionaries would place. */
    .ci-metric__label,
    .ci-metric__note { overflow-wrap: anywhere; hyphens: manual; }
}

/* Attention list: Weight A/B rows. A row is a link to where the work happens. */
.ci-rows { padding: 0 25px 8px; }

.ci-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 17px 0;
    border: 0;
    border-bottom: 1px solid var(--ci-line);
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

.ci-row:last-child { border-bottom: 0; }
a.ci-row:hover .ci-row__title,
a.ci-row:focus-visible .ci-row__title { color: var(--ci-action-ink); }
.ci-row__copy { flex: 1; min-width: 0; }
.ci-row__title { font-size: var(--ci-fs-control); font-weight: 700; line-height: 1.4; color: var(--ci-ink); overflow-wrap: anywhere; }
.ci-row__sub { margin-top: 4px; color: var(--ci-muted); font-size: var(--ci-fs-meta); line-height: 1.45; overflow-wrap: anywhere; }
.ci-row__meta { text-align: right; color: var(--ci-muted); font-size: var(--ci-fs-meta); white-space: nowrap; }
.ci-row__meta strong { display: block; margin-bottom: 4px; color: var(--ci-ink); font-size: var(--ci-fs-control); font-variant-numeric: tabular-nums; }
.ci-row > .ci-glyph:last-child { width: 14px; height: 14px; color: var(--ci-subtle); }
.ci-row .ci-icon { width: 35px; height: 35px; border-radius: var(--ci-radius-avatar); }

/* Narrow: identity on the first line, status and date on the second. The whole row is the
   link, so the chevron is redundant here. */
@container (max-width: 560px) {
    .ci-rows { padding: 0 19px 8px; }
    .ci-row { flex-wrap: wrap; row-gap: 8px; }
    .ci-row__copy { min-width: 140px; flex-basis: calc(100% - 49px); }
    .ci-row .ci-tag { order: 3; margin-left: 49px; }
    .ci-row__meta { order: 4; margin-left: auto; text-align: right; }
    .ci-row > .ci-glyph:last-child { display: none; }
}

.ci-callout {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 17px 21px;
    border: 1px solid var(--ci-action-line);
    border-radius: var(--ci-radius-md);
    background: linear-gradient(100deg, var(--ci-action-soft), var(--ci-surface-subtle));
}

.ci-callout__copy { flex: 1; min-width: 0; }
.ci-callout__title { display: block; color: var(--ci-ink); font-size: var(--ci-fs-control); font-weight: 700; }
.ci-callout__text { margin: 3px 0 0; color: var(--ci-muted); font-size: var(--ci-fs-small); }
.ci-callout--attention { border-color: #ecdfc5; background: #fffcf4; }
[data-bs-theme=dark] .ci-callout--attention { border-color: rgba(229, 184, 103, .3); background: rgba(229, 184, 103, .08); }

@container (max-width: 560px) {
    .ci-callout { flex-wrap: wrap; align-items: flex-start; }
    /* The copy keeps a readable measure; the action moves to its own line instead of squeezing it. */
    .ci-callout__copy { flex-basis: 200px; }
}

.ci-notice {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid var(--ci-action-line);
    border-radius: 8px;
    background: var(--ci-action-soft);
    color: var(--ci-action-ink);
    font-size: var(--ci-fs-small);
    line-height: 1.65;
}

.ci-notice--attention { border-color: #eedeac; background: var(--ci-attention-soft); color: var(--ci-attention); }
.ci-notice--danger { border-color: #f1cfd6; background: var(--ci-danger-soft); color: var(--ci-danger); }
[data-bs-theme=dark] .ci-notice--attention { border-color: rgba(229, 184, 103, .3); }
[data-bs-theme=dark] .ci-notice--danger { border-color: rgba(240, 145, 159, .3); }

/* Agenda: today's appointments. */
.ci-agenda { padding: 0 25px 20px; }
.ci-agenda__item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding: 18px 0; color: inherit; text-decoration: none; }
.ci-agenda__item + .ci-agenda__item { border-top: 1px solid var(--ci-line); }
.ci-agenda__time { padding-top: 2px; color: var(--ci-muted); font-size: var(--ci-fs-small); font-variant-numeric: tabular-nums; }
.ci-agenda__content { padding-left: 15px; border-left: 2px solid #bba0e8; }
.ci-agenda__title { display: block; color: var(--ci-ink); font-size: var(--ci-fs-control); font-weight: 700; overflow-wrap: anywhere; }
.ci-agenda__meta { margin: 5px 0 0; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
a.ci-agenda__item:hover .ci-agenda__title,
a.ci-agenda__item:focus-visible .ci-agenda__title { color: var(--ci-action-ink); }

/* Product cards: the four products as one family on the platform overview. */
.ci-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }

@container (max-width: 1100px) {
    .ci-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 420px) {
    .ci-product-grid { grid-template-columns: minmax(0, 1fr); }
}

.ci-product-card {
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--ci-line);
    border-radius: 12px;
    background: var(--ci-surface);
    color: inherit;
    text-align: left;
    text-decoration: none;
    transition: transform var(--ci-motion), border-color var(--ci-motion);
}

a.ci-product-card:hover,
a.ci-product-card:focus-visible { transform: translateY(-2px); border-color: #bca7df; color: inherit; }
.ci-product-card__name { display: block; margin: 2px 0 5px; color: var(--ci-ink); font-size: calc(15 * var(--ci-px)); font-weight: 700; }
.ci-product-card__descriptor { margin: 0; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
.ci-product-card__metric { margin: 16px 0 0; color: var(--ci-action-ink); font-size: var(--ci-fs-small); font-variant-numeric: tabular-nums; }
.ci-product-card__metric--quiet { color: var(--ci-muted); }

/* Timeline: Weight D, recent activity. */
.ci-timeline { padding: 3px 25px 20px; }
.ci-timeline__row { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; font-size: var(--ci-fs-small); }
.ci-timeline__row:not(:last-child)::before { content: ""; position: absolute; top: 33px; bottom: -11px; left: 9px; width: 1px; background: var(--ci-line); }
.ci-timeline__mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ci-success-soft); color: var(--ci-success); }
.ci-timeline__mark--neutral { background: var(--ci-surface-muted); color: var(--ci-muted); }
.ci-timeline__mark .ci-glyph { width: 11px; height: 11px; }
.ci-timeline__title { display: block; color: var(--ci-ink); font-weight: 700; overflow-wrap: anywhere; }
.ci-timeline__text { margin: 3px 0 0; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
.ci-timeline__time { color: var(--ci-muted); font-size: calc(10.5 * var(--ci-px)); white-space: nowrap; }

/* Context card and quick list. */
.ci-context-card {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--ci-line);
    border-radius: var(--ci-radius-md);
}

.ci-context-card strong { color: var(--ci-ink); font-size: var(--ci-fs-body); }
.ci-context-card small { display: block; margin-top: 4px; color: var(--ci-muted); font-size: var(--ci-fs-meta); }

.ci-quick-list { padding: 0 25px 15px; }

.ci-quick-list__item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--ci-line);
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

.ci-quick-list__item:last-child { border-bottom: 0; }
.ci-quick-list__item .ci-icon { width: 34px; height: 34px; border-radius: var(--ci-radius-avatar); }
.ci-quick-list__copy { flex: 1; min-width: 0; }
.ci-quick-list__copy strong { color: var(--ci-ink); font-size: var(--ci-fs-control); }
.ci-quick-list__copy small { display: block; margin-top: 3px; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
a.ci-quick-list__item:hover strong,
a.ci-quick-list__item:focus-visible strong { color: var(--ci-action-ink); }
.ci-quick-list__item > .ci-glyph:last-child { width: 14px; height: 14px; color: var(--ci-subtle); }

/* Proportion bars (share of a whole, never a fabricated score). */
.ci-bar { margin: 16px 0; }
.ci-bar__label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: var(--ci-fs-small); }
.ci-bar__track { height: 5px; border-radius: 4px; background: var(--ci-track); overflow: hidden; }
.ci-bar__fill { display: block; height: 100%; border-radius: 4px; background: #aa90d8; }
.ci-bar__fill--success { background: #60a791; }

.ci-insight { margin-top: 20px; padding: 15px; border-radius: 9px; background: var(--ci-surface-muted); color: var(--ci-muted); font-size: var(--ci-fs-small); line-height: 1.6; }
.ci-insight strong { color: var(--ci-ink); }

/* Stage strip (DealStream pipeline): each stage a cell, one shared proportion track. */
.ci-stages { display: grid; grid-template-columns: repeat(var(--ci-stage-count, 4), minmax(0, 1fr)); gap: 12px; padding: 0 24px 24px; }

.ci-stage {
    min-width: 0;
    padding: 15px 14px;
    border-top: 3px solid #d9cbea;
    border-radius: 8px;
    background: var(--ci-surface-muted);
    color: inherit;
    text-decoration: none;
}

.ci-stage--tone-2 { border-top-color: #b599dd; }
.ci-stage--tone-3 { border-top-color: #8d6bc5; }
.ci-stage--tone-4 { border-top-color: #69a48f; }
.ci-stage__name { display: block; color: var(--ci-muted); font-size: calc(10.5 * var(--ci-px)); line-height: 1.4; overflow-wrap: anywhere; }
.ci-stage__value { display: block; margin: 11px 0; color: var(--ci-ink); font-size: calc(21 * var(--ci-px)); font-weight: 400; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ci-stage__count { color: var(--ci-muted); font-size: var(--ci-fs-meta); }
a.ci-stage:hover,
a.ci-stage:focus-visible { background: var(--ci-action-soft); }

.ci-stage-track { display: flex; gap: 4px; height: 6px; margin: 0 24px 25px; }
.ci-stage-track span { min-width: 4px; border-radius: 3px; background: #d9cbea; }
.ci-stage-track span:nth-child(4n+2) { background: #b599dd; }
.ci-stage-track span:nth-child(4n+3) { background: #8d6bc5; }
.ci-stage-track span:nth-child(4n+4) { background: #69a48f; }

@container (max-width: 760px) {
    .ci-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 19px 20px; }
}

/* Journey: a process with ordered phases (Balance's guided creation today; the CRM import assistant is to follow).
   Node, label and hint share one centre line, and the connector runs at the middle of the nodes with the
   same gap to both, at every width, because every length is one of the four tokens below (a consumer
   changes a token, never a rule). The `span` rule makes every span of a step a block, the node too, so
   the node is laid out as the grid it is meant to be and its number or tick sits in its middle. */
.ci-journey {
    --ci-journey-node: 34px;
    --ci-journey-node-top: 8px;
    --ci-journey-link-gap: 8px;
    --ci-journey-step-gap: 12px;
    display: grid;
    grid-template-columns: repeat(var(--ci-journey-count, 4), minmax(0, 1fr));
    gap: 12px var(--ci-journey-step-gap);
    padding: 5px 24px 25px;
}
.ci-journey__step { position: relative; min-width: 0; padding: var(--ci-journey-node-top) 0 0; text-align: center; color: inherit; text-decoration: none; }
.ci-journey__step::after {
    content: "";
    position: absolute;
    top: calc(var(--ci-journey-node-top) + var(--ci-journey-node) / 2);
    left: calc(50% + var(--ci-journey-node) / 2 + var(--ci-journey-link-gap));
    right: calc(-50% - var(--ci-journey-step-gap) + var(--ci-journey-node) / 2 + var(--ci-journey-link-gap));
    height: 1px;
    background: var(--ci-line);
}
.ci-journey__step:last-child::after { display: none; }
.ci-journey__step .ci-icon {
    display: grid;
    place-items: center;
    width: var(--ci-journey-node);
    height: var(--ci-journey-node);
    margin: 0 auto 10px;
    background: var(--ci-surface-muted);
    color: var(--ci-muted);
    font-size: var(--ci-fs-small);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ci-journey__step .ci-icon .ci-glyph { width: 16px; height: 16px; }
.ci-journey__step strong { display: block; color: var(--ci-ink); font-size: var(--ci-fs-small); }
.ci-journey__step span { display: block; margin-top: 5px; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
/* Done, current, still to come: a tick on green and a green line after it; the current node filled in
   the action colour; the steps ahead quiet. */
.ci-journey__step--active .ci-icon { background: var(--ci-action); color: var(--ci-on-action); }
.ci-journey__step--done .ci-icon { background: var(--ci-success-soft); color: var(--ci-success); }
.ci-journey__step--done::after { background: var(--ci-success); opacity: .5; }
.ci-journey__step--active strong { color: var(--ci-action-ink); }
.ci-journey__step:not(.ci-journey__step--done):not(.ci-journey__step--active) strong { color: var(--ci-muted); font-weight: 400; }
a.ci-journey__step:hover strong,
a.ci-journey__step:focus-visible strong { color: var(--ci-action-ink); }

@container (max-width: 640px) {
    .ci-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--ci-journey-step-gap); }
    .ci-journey__step:nth-child(2n)::after { display: none; }
}

/* Below five whole words side by side only the current step names itself under its node; the others keep
   their names for assistive technology, and their nodes say done or still to come. */
@container (max-width: 299px) {
    .ci-journey__step:not(.ci-journey__step--active) strong {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

/* Summary band: one dark, quiet statement of a stock value (Balance receivables). */
.ci-summary-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 22px 45px;
    margin-bottom: 22px;
    padding: 23px 25px;
    border-radius: var(--ci-radius);
    background: linear-gradient(115deg, #2b2340, #42315f);
    color: #fff;
}

.ci-summary-band .ci-eyebrow { margin-bottom: 8px; color: #d2c6e6; font-size: calc(10.5 * var(--ci-px)); }
.ci-summary-band__value { display: block; font-size: calc(34 * var(--ci-px)); font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ci-summary-band__note { margin: 7px 0 0; color: #d6cce4; font-size: var(--ci-fs-small); }
.ci-summary-band__figures { display: flex; flex-wrap: wrap; gap: 22px 45px; }
.ci-summary-band__figures small { display: block; margin-bottom: 6px; color: #d6cce4; font-size: var(--ci-fs-meta); }
.ci-summary-band__figures strong { font-size: calc(22 * var(--ci-px)); font-weight: 400; font-variant-numeric: tabular-nums; }
.ci-summary-band a { color: #fff; }

/* Period selector (segmented, a real form control or a set of links). */
.ci-period { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--ci-line); border-radius: var(--ci-radius-control); background: var(--ci-surface); }
.ci-period__option { padding: 5px 11px; border: 0; border-radius: 4px; background: none; color: var(--ci-muted); font-family: var(--ci-font); font-size: var(--ci-fs-meta); text-decoration: none; cursor: pointer; }
.ci-period__option[aria-current=true],
.ci-period__option[aria-pressed=true] { background: var(--ci-action-soft); color: var(--ci-action-ink); font-weight: 700; }

.ci-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid transparent; border-radius: var(--ci-radius-control); background: var(--ci-action-soft); color: var(--ci-action-ink); font-size: var(--ci-fs-small); font-weight: 700; text-decoration: none; }
a.ci-chip:hover,
a.ci-chip:focus-visible { border-color: var(--ci-action-line); color: var(--ci-action-ink); }

/* Facts: a record's label → value pairs as one definition list (the platform operations pages,
   record details). Two columns while the work area has room, one below 560px. */
.ci-facts { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 10px 28px; margin: 0; }
.ci-facts > dt,
.ci-facts > div > dt { margin: 0; color: var(--ci-muted); font-size: var(--ci-fs-small); font-weight: 400; line-height: 1.55; }
.ci-facts > dd,
.ci-facts > div > dd { min-width: 0; margin: 0; color: var(--ci-ink); font-size: var(--ci-fs-control); line-height: 1.55; overflow-wrap: anywhere; }
.ci-facts > div { display: contents; }
.ci-mono { font-family: var(--bs-font-monospace, ui-monospace, monospace); font-size: .92em; overflow-wrap: anywhere; }
/* In a table a key widens its column (the wrapper scrolls) instead of breaking inside a word:
   „default" in a narrow queue column read „defaul / t". */
.ci-table .ci-mono { overflow-wrap: normal; }

@container (max-width: 560px) {
    .ci-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .ci-facts > dd,
    .ci-facts > div > dd { margin-bottom: 10px; }
}

/* ==========================================================================
   7. Tables
   ========================================================================== */

/* position: relative keeps an absolutely positioned visually-hidden label inside the scroll box;
   without it the label escapes and widens the whole page. */
.ci-table-wrap { position: relative; overflow-x: auto; }
.ci-table { width: 100%; border-collapse: collapse; text-align: left; font-family: var(--ci-font); }
.ci-table thead { background: var(--ci-surface-subtle); }
.ci-table th { padding: 12px 24px; border-top: 1px solid var(--ci-line); border-bottom: 1px solid var(--ci-line); color: var(--ci-muted); font-size: calc(10.5 * var(--ci-px)); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ci-table td { padding: 15px 24px; border-bottom: 1px solid var(--ci-line); color: var(--ci-ink); font-size: var(--ci-fs-small); vertical-align: middle; }
.ci-table tr:last-child td { border-bottom: 0; }
.ci-table tbody th { padding: 15px 24px; border-top: 0; color: var(--ci-ink); font-size: var(--ci-fs-small); font-weight: 400; letter-spacing: 0; text-transform: none; white-space: normal; vertical-align: middle; }
.ci-table tr:last-child th { border-bottom: 0; }
.ci-table td strong { font-size: var(--ci-fs-control); }
.ci-table td small { display: block; margin-top: 3px; color: var(--ci-muted); font-size: var(--ci-fs-meta); }
.ci-table .ci-numeric,
.ci-table .ci-col-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ci-table a { color: inherit; text-decoration: none; }
.ci-table a:hover,
.ci-table a:focus-visible { color: var(--ci-action-ink); }

@container (max-width: 560px) {
    .ci-table th,
    .ci-table td { padding-left: 19px; padding-right: 19px; white-space: nowrap; }
}

/* ==========================================================================
   8. States — empty, loading, error, locked
   ========================================================================== */

.ci-state { padding: 38px 25px; text-align: center; }
.ci-state .ci-icon { margin: 0 auto 16px; }
.ci-state__title { margin: 0; color: var(--ci-ink); font-size: calc(17 * var(--ci-px)); font-weight: 400; }
.ci-state__text { max-width: 360px; margin: 9px auto 0; color: var(--ci-muted); font-size: var(--ci-fs-control); line-height: 1.65; }
.ci-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 18px; }
.ci-state--compact { padding: 22px 25px; }
.ci-state--locked .ci-icon { width: 55px; height: 55px; border-radius: 15px; background: var(--ci-surface-muted); color: var(--ci-muted); }

.ci-skeleton { display: block; height: 15px; margin: 13px 0; border-radius: 5px; background: linear-gradient(90deg, var(--ci-track), var(--ci-surface-muted), var(--ci-track)); background-size: 200% 100%; animation: ci-shimmer 1.7s infinite; }
.ci-skeleton:nth-child(2) { width: 70%; }
.ci-skeleton:nth-child(3) { width: 85%; }

/* ==========================================================================
   9. Form messages
   The field language itself — underline fields, floating titles, the SMACT dropdown, numbers,
   checks and switches — is public/css/smact-ci-forms.css (docs/design/SMACT_PLATFORM_CI.md §9).
   ========================================================================== */

.ci-form-error { margin-bottom: 18px; padding: 12px 14px; border-radius: var(--ci-radius-control); background: var(--ci-danger-soft); color: var(--ci-danger); font-size: var(--ci-fs-small); line-height: 1.55; }
.ci-form-status { margin-bottom: 18px; padding: 12px 14px; border-radius: var(--ci-radius-control); background: var(--ci-success-soft); color: var(--ci-success); font-size: var(--ci-fs-small); line-height: 1.55; }
.ci-form-error ul,
.ci-form-status ul { margin: 0; padding-left: 18px; }

.ci-check { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; color: var(--ci-muted); font-size: var(--ci-fs-small); cursor: pointer; }
.ci-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ci-action); }

@media (max-width: 760px) {
    .ci-btn,
    .ci-icon-btn,
    .ci-chip,
    .ci-link { min-height: 44px; }
    .ci-icon-btn { min-width: 44px; }
}

/* ==========================================================================
   10. SweetAlert2 skin
   Appearance only, for every existing dialog. Button ORDER, focus and outside-click rules are
   behaviour and live in the adapter (public/js/smact-confirm.js), which call sites opt into.
   ========================================================================== */

/* Dialogs only: SweetAlert2 also marks a toast's container `swal2-backdrop-show`, and a toast must
   stay a small, unblurred notice (FlexList, Kalender). */
body:not(.swal2-toast-shown) .swal2-container.swal2-backdrop-show { background: var(--ci-overlay) !important; backdrop-filter: blur(4px); }
.swal2-popup:not(.swal2-toast) { padding: 29px !important; border: 1px solid var(--ci-line); border-radius: 16px !important; background: var(--ci-surface) !important; color: var(--ci-ink) !important; font-family: var(--ci-font) !important; box-shadow: 0 30px 100px rgba(24, 19, 38, .19); }
.swal2-popup:not(.swal2-toast) .swal2-title { padding: 0 !important; color: var(--ci-ink) !important; font-size: calc(23 * var(--ci-px)) !important; font-weight: 400 !important; line-height: 1.3 !important; }
.swal2-popup:not(.swal2-toast) .swal2-html-container { margin: 12px 0 0 !important; padding: 0 !important; color: var(--ci-muted) !important; font-size: var(--ci-fs-control) !important; line-height: 1.7 !important; }
.swal2-popup:not(.swal2-toast) .swal2-actions { gap: 9px; margin-top: 25px !important; }
.swal2-popup.swal2-toast { font-family: var(--ci-font) !important; }

/* ==========================================================================
   11. Motion
   ========================================================================== */

@keyframes ci-spin { to { transform: rotate(360deg); } }
@keyframes ci-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .ci-btn,
    .ci-product-card { transition: none; }
    a.ci-product-card:hover,
    a.ci-product-card:focus-visible { transform: none; }
    .ci-skeleton,
    .ci-btn.is-busy::before { animation: none; }
}
