
:root {
    /* Surfaces */
    --stela-surface-base: #f8f9fa;
    --stela-surface-raised: #ffffff;
    --stela-surface-soft: rgba(var(--stela-ink-rgb), 0.02);
    --stela-surface-muted: rgba(var(--stela-ink-rgb), 0.04);
    --stela-surface-glass: rgba(255, 255, 255, 0.9);
    --stela-surface-tint: rgba(248, 249, 252, 0.6);
    --stela-overlay-strong: rgba(var(--stela-ink-rgb), 0.45);
    --stela-page-gradient-start: rgba(var(--stela-ink-rgb), 0.04);
    --stela-page-gradient-end: rgba(var(--stela-ink-rgb), 0.06);

    /* Borders */
    --stela-border-subtle: rgba(var(--stela-ink-rgb), 0.06);
    --stela-border-strong: rgba(var(--stela-ink-rgb), 0.12);
    --stela-border-muted: rgba(148, 163, 184, 0.18);
    --stela-info-border: rgba(37, 99, 235, 0.42);
    --stela-neutral-soft: rgba(var(--stela-ink-rgb), 0.14);

    /* Shadows */
    --stela-shadow-soft: rgba(var(--stela-ink-rgb), 0.08);
    --stela-shadow-strong: rgba(var(--stela-ink-rgb), 0.18);

    /* Typography */
    --stela-text-primary: #0f172a;
    --stela-text-secondary: #475569;
    --stela-text-muted: #6c757d;
    --stela-text-inverse: #ffffff;
    --stela-ink-rgb: 15, 23, 42;
    --stela-field-placeholder: rgba(var(--stela-ink-rgb), 0.38);

    /* Brand & Status */
    --stela-brand-primary: #61B36B;
    --stela-brand-primary-rgb: 97, 179, 107;
    --stela-brand-secondary: #55e6aa;
    --stela-brand-secondary-rgb: 85, 110, 230;
    --stela-info-accent: #43affc;
    --stela-info-soft: rgba(37, 99, 235, 0.12);
    --stela-success-soft: rgba(var(--stela-brand-primary-rgb), 0.08);
    --stela-success-ring: rgba(var(--stela-brand-primary-rgb), 0.3);
    --stela-success-border: rgba(var(--stela-brand-primary-rgb), 0.45);
    --stela-success-strong: #34C38F;
    --stela-success-strong-rgb: 52, 195, 143;
    --stela-success-highlight: rgba(var(--stela-success-strong-rgb), 0.16);
    --stela-danger-strong: #dc2626;
    --stela-danger-strong-rgb: 220, 38, 38;
    --stela-danger-highlight: rgba(var(--stela-danger-strong-rgb), 0.15);
    --stela-warning-strong: #f1b44c;
    --stela-warning-strong-rgb: 241, 180, 76;

    /* Chrome */
    --stela-scrollbar-thumb: rgba(148, 163, 184, 0.65);
    --stela-scrollbar-track: rgba(148, 163, 184, 0.2);

    /* Heatmap (light) */
    --stela-heatmap-1: #ffb3ba;
    --stela-heatmap-2: #ffdfba;
    --stela-heatmap-3: #ffffba;
    --stela-heatmap-4: #baffc9;
    --stela-heatmap-5: #bae1ff;
    --stela-heatmap-6: #d4bfff;
    --stela-heatmap-7: #ffb3f0;

    /* Dashboard Theme */
    --stela-dashboard-shell-bg: linear-gradient(135deg, rgba(238, 241, 255, 0.95) 0%, rgba(244, 250, 255, 0.95) 55%, rgba(255, 255, 255, 0.9) 100%);
    --stela-dashboard-shell-blob-primary: radial-gradient(circle at center, rgba(var(--stela-brand-secondary-rgb), 0.45), rgba(var(--stela-brand-secondary-rgb), 0));
    --stela-dashboard-shell-blob-secondary: radial-gradient(circle at center, rgba(var(--stela-brand-primary-rgb), 0.32), rgba(var(--stela-brand-primary-rgb), 0));
    --stela-dashboard-shell-border: rgba(148, 163, 184, 0.22);
    --stela-dashboard-card-bg: rgba(255, 255, 255, 0.95);
    --stela-dashboard-card-overlay: linear-gradient(150deg, rgba(129, 140, 248, 0.16), rgba(59, 130, 246, 0.10), rgba(45, 212, 191, 0.12));
    --stela-dashboard-list-item-bg: rgba(255, 255, 255, 0.82);
    --stela-dashboard-empty-bg: rgba(255, 255, 255, 0.78);
    --stela-dashboard-empty-border: rgba(148, 163, 184, 0.32);
    --stela-dashboard-progress-track: rgba(var(--stela-brand-primary-rgb), 0.16);
    --stela-dashboard-progress-fill: linear-gradient(90deg, rgba(var(--stela-brand-primary-rgb), 0.95), rgba(var(--stela-success-strong-rgb), 0.85));
    --stela-dashboard-metric-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 249, 255, 0.9) 100%);
    --stela-dashboard-metric-border: rgba(148, 163, 184, 0.22);
    --stela-dashboard-metric-shadow: rgba(var(--stela-brand-secondary-rgb), 0.12);
    --stela-dashboard-metric-shadow-hover: rgba(var(--stela-brand-secondary-rgb), 0.18);
    --stela-dashboard-metric-overlay: linear-gradient(135deg, rgba(var(--stela-brand-secondary-rgb), 0.14), rgba(var(--stela-brand-secondary-rgb), 0.1), rgba(var(--stela-brand-primary-rgb), 0.12));
    --stela-dashboard-quick-nav-icon-bg: rgba(var(--stela-brand-secondary-rgb), 0.12);
    --stela-dashboard-quick-nav-icon-hover-bg: rgba(var(--stela-brand-secondary-rgb), 0.16);
    --stela-dashboard-quick-nav-icon-color: var(--stela-brand-secondary);
    --stela-dashboard-primary-action-shadow: rgba(var(--stela-success-strong-rgb), 0.35);
    --stela-dashboard-quick-nav-icon-active-bg: rgba(255, 255, 255, 0.28);
    --stela-dashboard-hero-overlay: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    --stela-project-status-tile-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.94));
    --stela-project-status-tile-border: rgba(var(--stela-ink-rgb), 0.04);
    --stela-project-status-tile-shadow: rgba(var(--stela-ink-rgb), 0.08);
    --stela-project-status-tile-hover-border: rgba(var(--stela-brand-primary-rgb), 0.6);
    --stela-project-status-tile-hover-shadow: rgba(var(--stela-ink-rgb), 0.18);
    --stela-project-status-ring-track: rgba(var(--stela-ink-rgb), 0.08);
    --stela-project-status-ring-inner-shadow: rgba(var(--stela-ink-rgb), 0.05);
    --stela-customer-toolbar-bg: rgba(255, 255, 255, 0.9);
    --stela-customer-toolbar-border: rgba(148, 163, 184, 0.26);
    --stela-customer-toolbar-shadow: rgba(15, 23, 42, 0.18);
    --stela-customer-toolbar-fade-left: linear-gradient(to right, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0));
    --stela-customer-toolbar-fade-right: linear-gradient(to left, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0));
    --stela-customer-toolbar-button-shadow: rgba(15, 23, 42, 0.28);
    --stela-project-card-scrim: linear-gradient(180deg, rgba(245, 248, 255, 0.65) 18%, rgba(228, 228, 228, 0.98) 85%);
    --stela-project-card-scrim-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 10%, rgba(240, 243, 249, 0.98) 90%);
    --stela-letterhead-card-bg: linear-gradient(135deg, rgba(var(--stela-brand-secondary-rgb), 0.08), rgba(var(--stela-brand-primary-rgb), 0.05));
    --stela-letterhead-card-border: rgba(var(--stela-ink-rgb), 0.08);
    --stela-letterhead-card-shadow: rgba(var(--stela-ink-rgb), 0.18);
    --stela-letterhead-preview-bg: rgba(255, 255, 255, 0.9);
    --stela-letterhead-badge-bg: rgba(var(--stela-brand-secondary-rgb), 0.88);
    --stela-letterhead-badge-color: var(--stela-text-inverse);
    --stela-letterhead-dropzone-border: rgba(var(--stela-ink-rgb), 0.18);
    --stela-letterhead-dropzone-bg: rgba(var(--stela-ink-rgb), 0.04);
    --stela-letterhead-dropzone-active-border: rgba(var(--stela-brand-secondary-rgb), 0.58);
    --stela-letterhead-dropzone-active-bg: rgba(var(--stela-brand-secondary-rgb), 0.16);
    --stela-form-preview-overlay: rgba(255, 255, 255, 0.78);
    --stela-project-hero-scrim: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.9) 50%, rgba(255, 255, 255, 0.97) 100%);
}

[data-bs-theme='dark'] {
    --stela-surface-base: #0b1120;
    --stela-surface-raised: #111827;
    --stela-surface-soft: rgba(148, 163, 184, 0.08);
    --stela-surface-muted: rgba(148, 163, 184, 0.12);
    --stela-surface-glass: rgba(var(--stela-ink-rgb), 0.78);
    --stela-surface-tint: rgba(30, 41, 59, 0.65);
    --stela-overlay-strong: rgba(var(--stela-ink-rgb), 0.75);
    --stela-page-gradient-start: rgba(var(--stela-ink-rgb), 0.18);
    --stela-page-gradient-end: rgba(var(--stela-ink-rgb), 0.26);

    --stela-border-subtle: rgba(148, 163, 184, 0.18);
    --stela-border-strong: rgba(148, 163, 184, 0.28);
    --stela-border-muted: rgba(148, 163, 184, 0.32);
    --stela-info-border: rgba(96, 165, 250, 0.45);
    --stela-neutral-soft: rgba(var(--stela-ink-rgb), 0.35);

    --stela-shadow-soft: rgba(var(--stela-ink-rgb), 0.55);
    --stela-shadow-strong: rgba(var(--stela-ink-rgb), 0.68);

    --stela-text-primary: #e2e8f0;
    --stela-text-secondary: #cbd5f5;
    --stela-text-muted: #94a3b8;
    --stela-text-inverse: #0f172a;
    --stela-ink-rgb: 226, 232, 240;
    --stela-field-placeholder: rgba(var(--stela-ink-rgb), 0.42);

    --stela-brand-primary: #61B36B;
    --stela-brand-primary-rgb: 134, 239, 172;
    --stela-brand-secondary: #93a5ff;
    --stela-brand-secondary-rgb: 147, 165, 255;
    --stela-info-accent: #0ea5e9;
    --stela-info-soft: rgba(96, 165, 250, 0.18);
    --stela-success-soft: rgba(134, 239, 172, 0.16);
    --stela-success-ring: rgba(134, 239, 172, 0.45);
    --stela-success-border: rgba(134, 239, 172, 0.5);
    --stela-success-strong: #4ade80;
    --stela-success-strong-rgb: 74, 222, 128;
    --stela-success-highlight: rgba(var(--stela-success-strong-rgb), 0.25);
    --stela-danger-strong: #f87171;
    --stela-danger-strong-rgb: 248, 113, 113;
    --stela-danger-highlight: rgba(var(--stela-danger-strong-rgb), 0.25);
    --stela-warning-strong: #facc15;
    --stela-warning-strong-rgb: 250, 204, 21;

    --stela-scrollbar-thumb: rgba(148, 163, 184, 0.55);
    --stela-scrollbar-track: rgba(148, 163, 184, 0.16);

    --stela-heatmap-1: #7f1d1d;
    --stela-heatmap-2: #78350f;
    --stela-heatmap-3: #854d0e;
    --stela-heatmap-4: #166534;
    --stela-heatmap-5: #1e3a8a;
    --stela-heatmap-6: #4c1d95;
    --stela-heatmap-7: #a21caf;

    --stela-dashboard-shell-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(17, 24, 39, 0.9) 45%, rgba(15, 23, 42, 0.92) 100%);
    --stela-dashboard-shell-blob-primary: radial-gradient(circle at center, rgba(var(--stela-brand-secondary-rgb), 0.28), rgba(var(--stela-brand-secondary-rgb), 0));
    --stela-dashboard-shell-blob-secondary: radial-gradient(circle at center, rgba(var(--stela-brand-primary-rgb), 0.24), rgba(var(--stela-brand-primary-rgb), 0));
    --stela-dashboard-shell-border: rgba(148, 163, 184, 0.28);
    --stela-dashboard-card-bg: rgba(15, 23, 42, 0.74);
    --stela-dashboard-card-overlay: linear-gradient(150deg, rgba(var(--stela-brand-secondary-rgb), 0.18), rgba(var(--stela-brand-primary-rgb), 0.16), rgba(var(--stela-brand-secondary-rgb), 0.12));
    --stela-dashboard-list-item-bg: rgba(15, 23, 42, 0.76);
    --stela-dashboard-empty-bg: rgba(24, 32, 54, 0.68);
    --stela-dashboard-empty-border: rgba(148, 163, 184, 0.36);
    --stela-dashboard-progress-track: rgba(var(--stela-brand-primary-rgb), 0.28);
    --stela-dashboard-progress-fill: linear-gradient(90deg, rgba(var(--stela-success-strong-rgb), 0.88), rgba(var(--stela-brand-secondary-rgb), 0.85));
    --stela-dashboard-metric-bg: linear-gradient(140deg, rgba(15, 23, 42, 0.92) 0%, rgba(24, 32, 54, 0.88) 100%);
    --stela-dashboard-metric-border: rgba(148, 163, 184, 0.32);
    --stela-dashboard-metric-shadow: rgba(var(--stela-brand-secondary-rgb), 0.24);
    --stela-dashboard-metric-shadow-hover: rgba(var(--stela-brand-secondary-rgb), 0.32);
    --stela-dashboard-metric-overlay: linear-gradient(135deg, rgba(var(--stela-brand-secondary-rgb), 0.22), rgba(var(--stela-brand-secondary-rgb), 0.18), rgba(var(--stela-brand-primary-rgb), 0.2));
    --stela-dashboard-quick-nav-icon-bg: rgba(var(--stela-brand-secondary-rgb), 0.24);
    --stela-dashboard-quick-nav-icon-hover-bg: rgba(var(--stela-brand-secondary-rgb), 0.32);
    --stela-dashboard-quick-nav-icon-color: var(--stela-brand-secondary);
    --stela-dashboard-primary-action-shadow: rgba(var(--stela-success-strong-rgb), 0.45);
    --stela-dashboard-quick-nav-icon-active-bg: rgba(15, 23, 42, 0.55);
    --stela-dashboard-hero-overlay: linear-gradient(135deg, rgba(var(--stela-ink-rgb), 0.18), rgba(var(--stela-ink-rgb), 0));
    --stela-project-status-tile-bg: linear-gradient(140deg, rgba(15, 23, 42, 0.9), rgba(24, 32, 54, 0.85));
    --stela-project-status-tile-border: rgba(148, 163, 184, 0.24);
    --stela-project-status-tile-shadow: rgba(var(--stela-brand-secondary-rgb), 0.26);
    --stela-project-status-tile-hover-border: rgba(var(--stela-brand-primary-rgb), 0.65);
    --stela-project-status-tile-hover-shadow: rgba(var(--stela-brand-secondary-rgb), 0.35);
    --stela-project-status-ring-track: rgba(var(--stela-ink-rgb), 0.35);
    --stela-project-status-ring-inner-shadow: rgba(var(--stela-ink-rgb), 0.12);
    --stela-customer-toolbar-bg: rgba(15, 23, 42, 0.82);
    --stela-customer-toolbar-border: rgba(148, 163, 184, 0.32);
    --stela-customer-toolbar-shadow: rgba(8, 12, 24, 0.6);
    --stela-customer-toolbar-fade-left: linear-gradient(to right, rgba(13, 20, 33, 0.65), rgba(13, 20, 33, 0));
    --stela-customer-toolbar-fade-right: linear-gradient(to left, rgba(13, 20, 33, 0.65), rgba(13, 20, 33, 0));
    --stela-customer-toolbar-button-shadow: rgba(8, 12, 24, 0.62);
    --stela-project-card-scrim: linear-gradient(180deg, rgba(5, 8, 15, 0.35) 18%, rgba(1, 3, 8, 0.92) 88%);
    --stela-project-card-scrim-hover: linear-gradient(180deg, rgba(9, 14, 24, 0.7) 12%, rgba(1, 3, 8, 0.95) 91%);
    --stela-letterhead-card-bg: linear-gradient(135deg, rgba(23, 32, 56, 0.85), rgba(18, 27, 48, 0.82));
    --stela-letterhead-card-border: rgba(148, 163, 184, 0.28);
    --stela-letterhead-card-shadow: rgba(8, 12, 24, 0.55);
    --stela-letterhead-preview-bg: rgba(15, 23, 42, 0.9);
    --stela-letterhead-badge-bg: rgba(var(--stela-brand-secondary-rgb), 0.65);
    --stela-letterhead-badge-color: var(--stela-text-inverse);
    --stela-letterhead-dropzone-border: rgba(148, 163, 184, 0.28);
    --stela-letterhead-dropzone-bg: rgba(15, 23, 42, 0.6);
    --stela-letterhead-dropzone-active-border: rgba(var(--stela-brand-secondary-rgb), 0.58);
    --stela-letterhead-dropzone-active-bg: rgba(var(--stela-brand-secondary-rgb), 0.18);
    --stela-form-preview-overlay: rgba(8, 12, 24, 0.72);
    --stela-project-hero-scrim: linear-gradient(140deg, rgba(11, 17, 32, 0.94) 0%, rgba(15, 23, 42, 0.9) 55%, rgba(11, 17, 32, 0.9) 100%);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder,
.form-select::placeholder {
    color: var(--stela-field-placeholder) !important;
    opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.form-control::-webkit-input-placeholder {
    color: var(--stela-field-placeholder) !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
.form-control:-ms-input-placeholder {
    color: var(--stela-field-placeholder) !important;
}

/* Glass Action Bar */
.glass-action-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 28px 48px -26px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.glass-action-shell::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(196, 196, 196, 0.35));
    opacity: 0.55;
    z-index: -2;
}

.glass-action-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.55);
    opacity: 0.65;
    filter: blur(28px);
    z-index: -3;
}

.glass-action-shell--floating {
    position: sticky;
    bottom: 24px;
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 40;
}

[data-bs-theme='dark'] .glass-action-shell {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 34px 60px -28px rgba(3, 7, 18, 0.55);
}

[data-bs-theme='dark'] .glass-action-shell::after {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(196, 196, 196, 0.35));
    opacity: 0.45;
}

[data-bs-theme='dark'] .glass-action-shell::before {
    background: rgba(15, 23, 42, 0.7);
    opacity: 0.6;
}

.glass-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-action-group--primary,
.glass-action-group--context {
    flex: 0 0 auto;
}

.glass-action-group--context {
    justify-content: flex-end;
}

.glass-action-divider {
    width: 1px;
    height: 42px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0.08));
    border-radius: 999px;
}

@media (min-width: 576px) {
    .glass-action-divider { height: 46px; }
}

.glass-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 20px 40px -22px rgba(15, 23, 42, 0.22);
}

.glass-action-btn:hover,
.glass-action-btn:focus,
.glass-action-btn:focus-visible {
    background: rgba(255, 255, 255, 0.75);
    box-shadow:
        0 20px 40px -22px rgba(var(--stela-ink-rgb), 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    outline: none;
}

.glass-action-btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 6px rgba(var(--stela-ink-rgb), 0.18);
}

.glass-action-btn i {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.glass-action-btn--primary {
    border-color: rgba(134, 239, 172, 0.65);
    background: #ffffff;
    box-shadow:
        0 14px 30px -20px rgba(56, 189, 248, 0.3),
        inset 0 0 0 1px rgba(134, 239, 172, 0.55);
}

.glass-action-btn--primary::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    background: radial-gradient(circle at 32% 32%, rgba(134, 239, 172, 0.35), rgba(255, 255, 255, 0) 60%);
    opacity: 0.65;
    pointer-events: none;
}

.glass-action-btn--primary .glass-action-btn__text {
    color: #0f172a;
}

.glass-action-btn--ghost {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.7);
}

.glass-action-btn--context {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.7);
}

.glass-action-btn--phone i,
.glass-action-btn--map i {
    color: #111827;
}

[data-bs-theme='dark'] .glass-action-btn {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.32);
    color: #e2e8f0;
}

[data-bs-theme='dark'] .glass-action-btn:hover,
[data-bs-theme='dark'] .glass-action-btn:focus,
[data-bs-theme='dark'] .glass-action-btn:focus-visible {
    background: rgba(15, 23, 42, 0.8);
}

.glass-action-btn__text {
    opacity: 0;
    max-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 600;
    transition: opacity 0.4s ease, max-width 0.4s ease, margin 0.4s ease;
}

.glass-action-btn--reveal-left:hover .glass-action-btn__text,
.glass-action-btn--reveal-left:focus .glass-action-btn__text,
.glass-action-btn--reveal-left:focus-visible .glass-action-btn__text {
    opacity: 1;
    max-width: 160px;
    margin-left: 0.5rem;
    transition: opacity 0.18s ease-out, max-width 0.18s ease-out, margin 0.18s ease-out;
}

.glass-action-btn--reveal-left:hover,
.glass-action-btn--reveal-left:focus,
.glass-action-btn--reveal-left:focus-visible {
    width: auto;
    padding: 0 1.1rem 0 0.9rem;
}

.glass-action-btn--reveal-left,
.glass-action-btn--reveal-right {
    padding: 0;
}

.glass-action-btn--reveal-right {
    flex-direction: row-reverse;
}

.glass-action-btn--reveal-right:hover .glass-action-btn__text,
.glass-action-btn--reveal-right:focus .glass-action-btn__text,
.glass-action-btn--reveal-right:focus-visible .glass-action-btn__text {
    opacity: 1;
    max-width: 160px;
    margin-right: 0.5rem;
    transition: opacity 0.18s ease-out, max-width 0.18s ease-out, margin 0.18s ease-out;
}

.glass-action-btn--reveal-right:hover,
.glass-action-btn--reveal-right:focus,
.glass-action-btn--reveal-right:focus-visible {
    width: auto;
    padding: 0 0.9rem 0 1.1rem;
}

.glass-action-btn--hidden {
    display: none !important;
}

@media (max-width: 575.98px) {
    .glass-action-shell {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.75rem 1rem;
    }
    .glass-action-divider {
        width: 60%;
        height: 1px;
    }
    .glass-action-group--context {
        justify-content: center;
    }
}

.required-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.required-marker {
    color: var(--stela-danger-strong);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.required-field {
    border-color: rgba(var(--stela-danger-strong-rgb), 0.45) !important;
    box-shadow: 0 0 0 3px rgba(var(--stela-danger-strong-rgb), 0.2);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.required-field:focus,
.required-field:focus-visible {
    border-color: rgba(var(--stela-danger-strong-rgb), 0.6) !important;
    box-shadow: 0 0 0 4px rgba(var(--stela-danger-strong-rgb), 0.28);
}

body {
    background-color: var(--stela-surface-base);
    color: var(--stela-text-primary);
}

/* Katalog-View Styles */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--stela-info-accent);
    border-radius: 0.5rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px var(--stela-shadow-soft);
    border: 1px solid var(--stela-border-subtle);
    padding: 7px;
    background: var(--stela-surface-raised);
}

/* Center the switches vertically within the filter bar */
.filter-bar .form-check.form-switch { align-self: center; }

#ofen-cards {
    gap: 1rem;
}

.ofen-card {
    background: var(--stela-surface-raised);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px var(--stela-shadow-soft);
    border: 1px solid var(--stela-border-subtle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: pop-in 0.4s ease;
}

.ofen-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.ofen-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
}

.ofen-card .info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ofen-card .info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--stela-text-primary);
}

.ofen-card .info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--stela-text-secondary);
}

/* Mobile: Tooltips im Aside-Menü vollständig unterdrücken */
@media (max-width: 991.98px) {
  .vertical-menu .tooltip { display: none !important; opacity: 0 !important; visibility: hidden !important; }
}

/* Customer (Kunden) Form: Sektionen & Toolbar */
.customer-card { position: relative; overflow: visible; }
.customer-modal-layout { display: flex; gap: 1.35rem; align-items: flex-start; }
.customer-section-toolbar {
  position: sticky;
  top: 1rem;
  left: 0;
  align-self: flex-start;
  z-index: 5;
  min-width: 148px;
  padding: 1.35rem 1.05rem 1.4rem;
  background-color: var(--stela-customer-toolbar-bg);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  border: 1px solid var(--stela-customer-toolbar-border);
  box-shadow:
    0 28px 65px -32px rgba(15, 23, 42, 0.45),
    0 18px 28px -22px rgba(15, 23, 42, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
}
.customer-section-toolbar-track {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
  padding: 0.35rem 0;
  margin: 0;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}
.customer-section-toolbar-track::before,
.customer-section-toolbar-track::after {
  display: none;
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 26px;
  pointer-events: none;
  transition: opacity .2s ease;
  opacity: 0;
  z-index: 2;
}
.customer-section-toolbar.has-left .customer-section-toolbar-track::before { opacity: 1; }
.customer-section-toolbar.has-right .customer-section-toolbar-track::after { opacity: 1; }
.customer-section-toolbar-track::before { left: 4px; background: var(--stela-customer-toolbar-fade-left); }
.customer-section-toolbar-track::after { right: 4px; background: var(--stela-customer-toolbar-fade-right); }
.customer-section-toolbar-track::-webkit-scrollbar { height: 6px; }
.customer-section-toolbar-track::-webkit-scrollbar-thumb {
  background: var(--stela-scrollbar-thumb);
  border-radius: 999px;
}
.customer-section-toolbar-track::-webkit-scrollbar-track {
  background: var(--stela-scrollbar-track);
  border-radius: 999px;
}
.customer-section-toolbar .btn-icon-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 62px;
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.1;
  box-shadow:
    0 22px 40px -26px rgba(15, 23, 42, 0.4),
    0 12px 20px -18px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
.customer-section-toolbar .btn-icon-text:not(.btn-stela) {
  background-color: rgba(255, 255, 255, 0.92);
}
.customer-section-toolbar .btn-icon-text.is-visible:not(.active):not(.btn-stela):not(.needs-attention) {
  border-color: rgba(var(--stela-brand-secondary-rgb), 0.25);
  background-color: rgba(255, 255, 255, 0.98);
  color: var(--stela-brand-secondary);
  box-shadow:
    0 24px 46px -30px rgba(var(--stela-ink-rgb), 0.32),
    0 14px 24px -18px rgba(var(--stela-ink-rgb), 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.customer-section-toolbar .btn-icon-text.needs-attention:not(.active):not(.btn-stela) {
  background: linear-gradient(135deg,
    rgba(var(--stela-brand-secondary-rgb), 0.35) 0%,
    rgba(var(--stela-brand-secondary-rgb), 0.2) 55%,
    rgba(255, 255, 255, 0.92) 100%);
  border-color: rgba(var(--stela-brand-secondary-rgb), 0.55);
  color: #111 !important;
  box-shadow:
    0 28px 55px -32px rgba(var(--stela-ink-rgb), 0.45),
    0 16px 26px -18px rgba(var(--stela-ink-rgb), 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: onboardingGlowSoft 2.4s ease-in-out infinite;
}
@keyframes onboardingGlowSoft {
  0% { box-shadow:
    0 24px 50px -30px rgba(var(--stela-ink-rgb), 0.35),
    0 14px 24px -18px rgba(var(--stela-ink-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.8); }
  55% { box-shadow:
    0 32px 62px -28px rgba(var(--stela-ink-rgb), 0.45),
    0 18px 28px -16px rgba(var(--stela-ink-rgb), 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.95); }
  100% { box-shadow:
    0 24px 50px -30px rgba(var(--stela-ink-rgb), 0.35),
    0 14px 24px -18px rgba(var(--stela-ink-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.8); }
}
.customer-section-toolbar .btn-icon-text i { font-size: 1.25rem; }
.customer-section-toolbar .btn-icon-text.active,
.customer-section-toolbar .btn-icon-text:hover,
.customer-section-toolbar .btn-icon-text:focus {
  box-shadow:
    0 26px 55px -32px rgba(15, 23, 42, 0.55),
    0 16px 28px -18px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transform: translateY(-2px);
}
.customer-section-toolbar .btn-icon-text .badge { font-size: 0.62rem; font-weight: 600; }
.customer-sections { flex: 1 1 auto; min-width: 0; }
.customer-section {
  border: 1px solid var(--stela-border-subtle);
  border-radius: 1rem;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
.customer-section--profile { overflow: visible; }
.customer-section:hover {
  border-color: var(--stela-border-strong);
  box-shadow: 0 10px 25px -18px var(--stela-shadow-strong);
}
.customer-section.is-visible {
  border-color: rgba(var(--stela-brand-secondary-rgb), 0.2);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 55px -34px rgba(var(--stela-ink-rgb), 0.26);
}
.customer-section.is-visible .customer-section-header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: rgba(var(--stela-brand-secondary-rgb), 0.2);
}
.customer-section-header {
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--stela-border-subtle);
  background: var(--stela-surface-soft);
}
.customer-section-body { padding: 1.25rem 1.1rem; }
.customer-section-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.customer-section .toggle-indicator { transition: transform .2s ease; }
.customer-section.is-collapsed .customer-section-body { display: none; }
.customer-section.is-collapsed .toggle-indicator { transform: rotate(-90deg); opacity: .65; }
.customer-section:not(.is-collapsed) .toggle-indicator { transform: rotate(0deg); }
.customer-section .badge { font-weight: 600; }
.customer-avatar-abs { top: -15px; right: 80px; left: auto; transform: translateY(-50%); z-index: 2; }
.customer-stammdaten { padding-top: 2.5rem; }
.customer-project-table { background: var(--stela-surface-tint); border: 1px dashed var(--stela-border-subtle); }
.note-composer textarea { min-height: 88px; }
.note-queued {
  background: var(--stela-info-soft);
  border: 1px dashed var(--stela-info-border);
}
.note-queued-text {
  white-space: pre-wrap;
}
.customer-section .form-label {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--stela-text-secondary);
}

/* Dienstleistung (Workflow) Avatar an gleicher Stelle wie gewünscht */
.workflow-avatar-abs { top: -100px; right: 150px; left: auto; z-index: 2; }
.workflow-avatar-abs .workflow-icon-preview { cursor: pointer; }
[data-workflow-icon].drag-over { outline: 2px dashed var(--stela-brand-primary); outline-offset: 4px; }
@media (max-width: 991.98px) {
  .form-builder-col-2 { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 992px) {
  .form-builder-col-2 { flex: 0 0 20%; max-width: 20%; }
}

.customer-section-toolbar-mobile {
  display: none;
}

#entityCreateModal .customer-section--profile { overflow: visible; }
#entityCreateModal .customer-avatar-abs {
  top: 0;
  transform: translateY(-85%);
}
#entityCreateModal .customer-stammdaten { padding-top: 3.25rem; }

@media (max-width: 991.98px) {
  .customer-section-toolbar {
    top: 0;
    padding: 0.7rem 0.6rem;
    border-radius: 1.25rem;
    min-width: 0;
    width: 100%;
    box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.35);
  }
  .customer-section-toolbar-track {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.45rem;
    padding: 0.25rem 0.2rem;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
  }
  .customer-section-toolbar-track::before,
  .customer-section-toolbar-track::after {
    display: block;
    top: 10px;
    bottom: 10px;
  }
  .customer-section-toolbar .btn-icon-text {
    flex: 0 0 auto;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    min-width: 62px;
    padding: 0.5rem 0.55rem;
    gap: 0.3rem;
    box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.35);
  }
  .customer-section-toolbar .btn-icon-text i { font-size: 1.1rem; }
  .customer-modal-layout { flex-direction: column; }
  .customer-avatar-abs {
    position: static !important;
    transform: none !important;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
  }
  .customer-stammdaten { padding-top: 0; }
}

.table-page-marker td {
  background: var(--stela-surface-soft);
  color: var(--stela-text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.table-page-marker td .page-highlight {
  color: var(--stela-brand-secondary);
  font-weight: 700;
}

.builder-layout-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
  border-radius: 0.9rem;
  background: var(--stela-surface-raised);
  padding: 0.6rem 0.95rem;
  font-weight: 600;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.builder-layout-option:hover,
.builder-layout-option:focus {
  border-color: rgba(var(--stela-ink-rgb), 0.2);
  box-shadow: 0 4px 18px -10px rgba(var(--stela-ink-rgb), 0.35);
  background: var(--bs-gray-50);
}

.builder-layout-option.active {
  border-color: rgba(var(--stela-brand-primary-rgb), 0.7);
  background: rgba(var(--stela-brand-primary-rgb), 0.12);
  box-shadow: 0 6px 18px -8px rgba(var(--stela-brand-primary-rgb), 0.45);
}

.builder-layout-option:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.builder-layout-option .builder-layout-label {
  white-space: nowrap;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--stela-text-primary);
}

.builder-layout-option .builder-layout-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.builder-layout-option .builder-layout-preview span {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: rgba(var(--stela-brand-secondary-rgb), 0.15);
  border: 1px solid rgba(var(--stela-brand-secondary-rgb), 0.45);
  min-width: 16px;
  transition: background-color .2s ease;
}

.builder-layout-option .builder-layout-preview span[data-size="xl"] { min-width: 56px; }
.builder-layout-option .builder-layout-preview span[data-size="l"] { min-width: 40px; }
.builder-layout-option .builder-layout-preview span[data-size="m"] { min-width: 28px; }
.builder-layout-option .builder-layout-preview span[data-size="s"] { min-width: 22px; }
.builder-layout-option .builder-layout-preview span[data-size="xs"] { min-width: 18px; }

.builder-layout-option--full {
  width: 100%;
  justify-content: space-between;
}

/* Workflows: deaktive Zeilen dezenter darstellen */
/* Dienstleistungstabellen & Steps: Hover- und Delete-Feedback zentral definiert */
tr.wf-row[data-active="0"] { opacity: 0.7; }
tr.wf-row,
#wf-steps-body tr[data-id] {
  cursor: pointer;
  transition: background-color .24s ease, color .24s ease;
}
tr.wf-row:not(.to-delete):hover,
tr.wf-row:not(.to-delete):hover > *,
#wf-steps-body tr[data-id]:not(.to-delete):hover,
#wf-steps-body tr[data-id]:not(.to-delete):hover > * {
  background-color: rgba(33, 37, 41, .06) !important;
}
tr.wf-row.to-delete,
tr.wf-row.to-delete > *,
#wf-steps-body tr.to-delete,
#wf-steps-body tr.to-delete > * {
  background-color: rgba(220,53,69,.15) !important;
  color: var(--bs-danger-text-emphasis, #842029) !important;
}
.drag-handle { display:inline-block; width:14px; height:14px; background-image: radial-gradient(currentColor 1px, transparent 1px); background-size:4px 4px; background-position:0 0; opacity:.5; cursor: ns-resize; }
#wf-steps-body tr[data-id] .drag-handle { cursor: grab; }
#wf-steps-table { min-width: 940px; }
#wf-steps-table .wf-col-pos { width: 40px; }
#wf-steps-table .wf-col-name { min-width: 180px; }
#wf-steps-table .wf-col-action { min-width: 140px; }
#wf-steps-table .wf-col-responsible { min-width: 200px; }
#wf-steps-table .wf-col-desc { min-width: 220px; }
#wf-steps-table .wf-col-follow { min-width: 160px; }
#wf-steps-table input.form-control-sm { min-width: 0; }
.wf-description-group textarea { resize: vertical; }
.wf-description-group { position: relative; }
.wf-description-header { position: sticky; top: 0; z-index: 3; background: var(--bs-body-bg, #fff); padding-bottom: .35rem; transition: box-shadow .24s ease, background-color .24s ease; }
.wf-description-header::after { content: ''; display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(0,0,0,.05); transition: opacity .24s ease; }
.wf-description-header.is-stuck { box-shadow: 0 6px 12px -6px rgba(0,0,0,.18); background: rgba(255,255,255,.97); }
.wf-description-header.is-stuck::after { opacity: 0; }
.wf-description-sentinel { height: 1px; }

.category { flex: 1; }

#company-table tbody tr,
.table-hover tbody tr { cursor: pointer; }

.cursor-pointer { cursor: pointer; }

#pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

/* --- Sidebar layout & polish --- */
.vertical-menu {
    /* position: static;  */
}
.vertical-menu .sidebar-menu-scroll {
    /* height: auto;
    overflow: visible;
    padding-bottom: .75rem; */
}

body[data-sidebar-size="sm"] .vertical-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

body[data-sidebar="dark"][data-sidebar-size="sm"] {
    min-height: auto;
}

/* --- Sidebar polish --- */
.vertical-menu #sidebar-menu a { text-decoration: none; }
.vertical-menu .metismenu > li > a {
    display: flex; align-items: center; gap: .6rem;
    width: 100%;
    font-weight: 600; color: var(--bs-gray-700);
    transform-origin: left center;
    padding: .55rem 1rem .55rem 1.25rem; /* base left indent */
    transition: transform .18s ease, color .2s ease, background-color .2s ease, padding-left .18s ease;
    will-change: transform, padding-left;
}
.vertical-menu .metismenu > li > a i { font-size: 18px; opacity: .9; }
.vertical-menu #sidebar-menu .has-arrow:after { transition: transform .2s ease; }
.vertical-menu .metismenu > li.mm-active > a,
.vertical-menu .metismenu > li > a:hover,
.vertical-menu .metismenu > li:hover > a { color: var(--bs-primary); transform: scale(1.03) translateX(4px); padding-left: 1.5rem; }

.vertical-menu .metismenu .sub-menu li > a {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem 1rem .35rem 2rem; /* base left indent for submenu */
    font-weight: 500;
    color: var(--bs-gray-700);
    transition: transform .18s ease, color .2s ease, padding-left .18s ease;
    will-change: transform, padding-left;
}
.vertical-menu .metismenu .sub-menu li > a:hover,
.vertical-menu .metismenu .sub-menu li:hover > a { color: var(--bs-primary); transform: translateX(6px); padding-left: 2.5rem; }

.vertical-menu .metismenu .menu-search { padding: .25rem 0 .35rem 0; }
.vertical-menu .metismenu .menu-search .form-control { font-size: .875rem; }
.vertical-menu .metismenu .sidebar-results { max-height: 220px; overflow-y: auto; }
.vertical-menu .metismenu .sidebar-results .list-group-item { border: 0; padding: .35rem 1rem; }
.vertical-menu .metismenu .sidebar-results .list-group-item i { font-size: 16px; opacity: .8; }
.vertical-menu .metismenu .sidebar-results .list-group-item img { width: 24px; height: 24px; object-fit: cover; }

/* Smooth submenu animation on hover */
.vertical-menu ul.sub-menu.submenu-animating { overflow: hidden; transition: height .24s ease; will-change: height; }

/* Sidebar edge toggle button */
.sidebar-pin-btn {
    position: absolute;
    right: -14px;
    top: 57px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: var(--bs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
    z-index: 1103;
}
.sidebar-pin-btn:hover { background: #2aa673; }
.sidebar-pin-btn i { transition: transform .25s ease; font-size: 18px; }
#sidebar-pin-toggle.expanded i { transform: rotate(180deg); }

@media (min-width: 992px) {
  body[data-sidebar-size='sm'] .vertical-menu {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      right: auto;
      width: 70px !important;
      transform: none !important;
  }
  body[data-sidebar-size='sm'] .vertical-menu .sidebar-menu-scroll {
      height: calc(100vh - var(--topbar-height, 70px));
      margin-top: var(--topbar-height, 70px);
  }
}

/* Collapsed sidebar (icon-only): auto width flyouts matching content */
body[data-sidebar-size='sm'] .vertical-menu #sidebar-menu > ul > li:hover > a {
    width: auto !important;
    min-width: 230px;
}
body[data-sidebar-size='sm'] .vertical-menu #sidebar-menu > ul > li:hover > ul {
    width: auto !important;
    min-width: 210px;
}
body[data-sidebar-size='sm'] .vertical-menu #sidebar-menu > ul > li:hover > ul a {
    width: auto !important;
    min-width: 210px;
    white-space: nowrap;
}
/* deeper nested flyouts */
body[data-sidebar-size='sm'] .vertical-menu #sidebar-menu ul li:hover > ul {
    width: auto !important;
    min-width: 210px;
}
body[data-sidebar-size='sm'] .vertical-menu #sidebar-menu ul li:hover > ul a {
    width: auto !important;
    min-width: 210px;
    white-space: nowrap;
}


#pagination button {
    padding: 0.5rem 0.75rem;
    background-color: var(--stela-surface-soft);
    border: 1px solid var(--stela-border-subtle);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#pagination button:hover { background-color: var(--stela-surface-muted); }

#pagination button.active {
    background-color: var(--stela-brand-secondary);
    color: var(--stela-text-inverse);
    border-color: var(--stela-brand-secondary);
}

.modal-tech li,
.modal-features li {
    background: var(--stela-surface-soft);
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-tech li:hover,
.modal-features li:hover {
    background: var(--stela-surface-muted);
    transform: scale(1.02);
}

.ts-wrapper.plugin-remove_button:not(.rtl) .item {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.ts-wrapper.plugin-remove_button:not(.rtl) .item {
    margin: 3px;
    cursor: pointer;
}
.ts-wrapper.plugin-remove_button:not(.rtl) .item:hover {
    background: var(--stela-surface-muted);
    scale: 1.02;
}

/* Favorisierte TomSelect-Items deutlich markieren (Fallback, falls Bootstrap subtle-Farben nicht greifen) */
.ts-wrapper .item.fav-item {
    background-color: var(--bs-warning-bg-subtle, #fff3cd) !important;
    color: var(--bs-warning-text-emphasis, #664d03) !important;
}

@keyframes pop-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
    .filter-bar { flex-direction: column; }
    .filter-bar .filter-group { flex-wrap: wrap; }
}

/* Rainbow-Ring: dreht sich nahtlos um das Input (Pastell wie Button) */
@property --ring-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

#artikel-url,
#impressum-url {
    position: relative;
    border: 2px solid transparent;
    border-radius: .25rem;
    background:
        linear-gradient(var(--bs-body-bg, #fff), var(--bs-body-bg, #fff)) padding-box,
        conic-gradient(from var(--ring-angle),
            #ffb3ba,
            #ffdfba,
            #ffffba,
            #baffc9,
            #bae1ff,
            #d4bfff,
            #ffb3f0,
            #ffb3ba
        ) border-box;
    background-clip: padding-box, border-box;
    animation: ring-spin 6s linear infinite;
}

#artikel-scan,
#impressum-scan {
    background-image: linear-gradient(
        90deg,
        #ffb3ba,
        #ffdfba,
        #ffffba,
        #baffc9,
        #bae1ff,
        #d4bfff,
        #ffb3f0
    );
    background-size: 200% 100%;
    border: none;
    color: #a200ff;
    animation: rainbow-bg 5s linear infinite;
}

#artikel-scan:hover,
#impressum-scan:hover {
    filter: brightness(0.9);
}

@keyframes ring-spin {
    to { --ring-angle: 360deg; }
}

@keyframes rainbow-bg {
    from { background-position: 0% 0%; }
    to   { background-position: 200% 0%; }
}

/* Hersteller-Logo Placeholder nur ausblenden, wenn Bild erfolgreich geladen */
#logo-wrapper.logo-loaded #logo-placeholder { display: none !important; }
#logo-wrapper.logo-loaded #logo-preview { display: block !important; }

/* Mobile Right-Slide Sidebar + FAB (override) */
@media (max-width: 991.98px) {
  .vertical-menu {
    right: 0; left: auto;
    width: calc(100% - 72px);
    max-width: 420px;
    transform: translateX(100%);
    transition: transform .28s ease;
  }
  body.sidebar-enable .vertical-menu { transform: translateX(0); z-index: 1061; }
  .fab-menu {
    position: fixed; right: 16px; bottom: 36px; width: 56px; height: 56px; border-radius: 50%;
    background: #28a745; color:#fff; border:none; box-shadow:0 6px 18px rgba(0,0,0,.2);
    display:inline-flex; align-items:center; justify-content:center; z-index:1062;
    transition: transform .24s ease, left .24s ease, right .24s ease, background-color .2s ease;
  }
  .fab-menu:active { transform: scale(.96); }
  body.sidebar-enable .fab-menu { right:auto; background:#198754; }
}
/* Mobile Sidebar Overlay & FAB */
@media (max-width: 991.98px) {
  .vertical-menu {
    position: fixed;
    top: 0; right: 0; left: auto!important; bottom: 0;
    z-index: 1060; /* über Content/Modals (Bootstrap Modal ist 1055), unter Right Sidebar (9999) */
    box-shadow: 0 0 24px rgba(0,0,0,.25);
    display: block;
    width: calc(100% - 72px); /* Platz für FAB-X */
    max-width: 420px;
    transform: translateX(100%);
    transition: transform .28s ease;
  }
  /* Wenn geöffnet: sichtbar einsliden */
  body.sidebar-enable .vertical-menu { transform: translateX(0); }
  /* Content darunter halten */
  .main-content { position: relative; z-index: 1; }
  /* Topbar mobil fixieren (sticky) und über Sidebar halten) */
#page-topbar { position: sticky; top: 0; z-index: 1061; background: var(--bs-body-bg, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
body.modal-open #page-topbar { z-index: 1040; pointer-events: none; }
body.modal-open .vertical-menu,
body.modal-open .menu-overlay { z-index: 1040; pointer-events: none; }
body.modal-open.sidebar-enable .vertical-menu { transform: translateX(100%) !important; }
body.modal-open.sidebar-enable .menu-overlay { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
body.modal-open.sidebar-enable:after { content: none !important; }
  /* Optional: Backdrop bei offenem Menü */
  body.sidebar-enable:after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1059; /* knapp unter der Sidebar */
  }
  /* FAB unten rechts */
  .fab-menu { position: fixed; right:16px; bottom:36px; width:56px; height:56px; border-radius:50%; background:#28a745; color:#fff; border:none; box-shadow:0 10px 28px rgba(0,0,0,.28); display:inline-flex; align-items:center; justify-content:center; z-index:1062; transition: right .28s ease, background-color .2s ease; will-change: right; }
  .fab-menu:active { transform: scale(.96); }
  body.sidebar-enable .fab-menu { right:autowie kann es; background:#198754; }
  /* Topbar Hamburger auf Mobile ausblenden */
  .navbar-header .vertical-menu-btn { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) { .fab-menu { right: 20px; bottom: 50px; } }

/* Mobile: Sidebar-Pin-Button ausblenden */
@media (max-width: 991.98px) { .sidebar-pin-btn { display: none !important; } }

/* STELA Brand Helpers */
:root {
  --stela-green: var(--stela-brand-primary);
  --bs-modal-zindex: 2005;
  --bs-backdrop-zindex: 1995;
  --stela-modal-zindex: 2005;
  --stela-backdrop-zindex: 1995;
}
.text-stela,
a.text-stela,
.text-stela:hover,
.text-stela:focus,
a.text-stela:hover,
a.text-stela:focus {
  color: var(--stela-brand-primary) !important;
}

.modal {
  z-index: var(--stela-modal-zindex, 2005) !important;
}
.modal-backdrop {
  z-index: var(--stela-backdrop-zindex, 1995) !important;
}
body.modal-open .menu-overlay,
body.modal-open .vertical-overlay,
body.modal-open .layout-overlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
body.modal-open:after {
  content: none !important;
}
body.modal-open #mobileMenuFab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(24px) !important;
}

/* Modals: unter der Topbar mit Abstand */
:root { --topbar-height: 70px; }
@media (max-width: 991.98px) { .modal .modal-dialog { margin: calc(var(--topbar-height) + 12px) auto 16px !important; } }
@media (min-width: 992px) { .modal .modal-dialog { margin: calc(var(--topbar-height) + 16px) auto 24px; } }

/* Fallback: STELA Button (falls Theme/App CSS nicht geladen ist) */
.btn-stela {
  background: var(--stela-brand-primary) !important;
  border-color: var(--stela-brand-primary) !important;
  color: #fff !important;
}
.btn-stela:hover,
.btn-stela:focus,
.btn-stela:active,
.btn-stela.active,
.show > .btn-stela.dropdown-toggle {
  background: #55a65f !important; /* leicht dunkler */
  border-color: #55a65f !important;
  color: #fff !important;
}
.btn-stela:focus,
.btn-stela:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(var(--stela-brand-primary-rgb), 0.3) !important;
}
.btn-stela.disabled,
.btn-stela:disabled {
  background: rgba(var(--stela-brand-primary-rgb), 0.65) !important;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.65) !important;
  color: #fff !important;
}
.btn-outline-stela {
  color: var(--stela-brand-primary) !important;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.55) !important;
  background: transparent !important;
}
.btn-outline-stela i {
  color: inherit !important;
}
.btn-outline-stela:hover,
.btn-outline-stela:focus,
.btn-outline-stela:active,
.btn-outline-stela.active,
.show > .btn-outline-stela.dropdown-toggle {
  color: #fff !important;
  background: var(--stela-brand-primary) !important;
  border-color: var(--stela-brand-primary) !important;
}
.btn-outline-stela:hover i,
.btn-outline-stela:focus i,
.btn-outline-stela:active i,
.btn-outline-stela.active i,
.show > .btn-outline-stela.dropdown-toggle i {
  color: #fff !important;
}
.btn-outline-stela:focus,
.btn-outline-stela:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(var(--stela-brand-primary-rgb), 0.25) !important;
}
.btn-outline-stela.disabled,
.btn-outline-stela:disabled {
  color: rgba(var(--stela-brand-primary-rgb), 0.6) !important;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.35) !important;
  background: transparent !important;
}

.company-detail-header {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.company-rights-pill {
  font-weight: 600;
  padding: 0.45rem 0.75rem;
}

.company-metrics .company-metric-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.company-metrics .company-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 34, 58, 0.08);
}

.company-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.company-metric-card .company-metric-action {
  position: relative;
  z-index: 2;
}

.company-metric-card.company-storage-card--ok {
  border: 1px solid rgba(34, 197, 94, 0.25);
  box-shadow: 0 16px 32px -18px rgba(34, 197, 94, 0.4);
}

.company-metric-card.company-storage-card--ok .company-metric-icon {
  box-shadow: 0 0 0 12px rgba(34, 197, 94, 0.08);
}

.company-metric-card.company-storage-card--warning {
  border: 1px solid rgba(241, 180, 76, 0.35);
  box-shadow: 0 16px 32px -18px rgba(241, 180, 76, 0.35);
}

.company-metric-card.company-storage-card--warning .company-metric-icon {
  box-shadow: 0 0 0 12px rgba(241, 180, 76, 0.12);
}

.company-metric-card.company-storage-card--error {
  border: 1px solid rgba(220, 53, 69, 0.4);
  box-shadow: 0 16px 32px -18px rgba(220, 53, 69, 0.35);
}

.company-metric-card.company-storage-card--error .company-metric-icon {
  box-shadow: 0 0 0 12px rgba(220, 53, 69, 0.12);
}

.company-metric-card.company-storage-card--inactive {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  opacity: 0.95;
}

.company-metric-card.company-storage-card--empty {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.65);
}

.company-overview-layout .card {
  height: 100%;
}

.company-role-entry {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--stela-surface-raised);
}

.company-role-entry + .company-role-entry {
  margin-top: 0.75rem;
}

.company-member-group {
  margin-top: 1.5rem;
}

.company-member-group:first-of-type {
  margin-top: 0.75rem;
}

.company-member-group-header {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--stela-border-subtle);
}

.company-member-list {
  margin-top: 0.75rem;
}

.company-member-entry {
  display: flex;
  gap: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  background: var(--stela-surface-raised);
  align-items: flex-start;
}

.company-member-entry + .company-member-entry {
  margin-top: 0.75rem;
}

.company-member-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--stela-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--stela-brand-primary);
  text-transform: uppercase;
  overflow: hidden;
}

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

.company-member-body {
  flex: 1;
}

.company-member-roles .badge {
  font-weight: 500;
}

.company-member-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.company-member-entry.is-current-user {
  border-color: rgba(var(--stela-brand-primary-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--stela-brand-primary-rgb), 0.3);
}

/* Fallbacks für Avatar/Topbar wenn Theme CSS fehlt */
.header-profile-user { height: 36px; width: 36px; border-radius: 50}
.header-profile-user { height: 36px; width: 36px; border-radius: 50%; object-fit: cover; }
.avatar, .avatar-sm, .avatar-md, .avatar-lg, .avatar-xl { border-radius: 50%; object-fit: cover; }
.avatar { height: 2.7rem; width: 2.7rem; }
.avatar-sm { height: 3rem; width: 3rem; }
.avatar-md { height: 4.5rem; width: 4.5rem; }
.avatar-lg { height: 6rem; width: 6rem; }
.avatar-xl { height: 7.5rem; width: 7.5rem; }


/* Kundenliste: Aktions-Icons (Archiv/Dearchiv) */
.action-icon { border: 0; background: transparent !important; padding: .25rem .25rem !important; line-height: 1; }
.action-icon i { font-size: 18px; transition: color .18s ease, transform .18s ease; }
.action-icon:focus { outline: none; box-shadow: none; }
.icon-archive { color: #dc3545; } /* rot (danger) */
.icon-unarchive { color: #6c757d; } /* grau (secondary) */
/* Hover-Farben laut Vorgabe: Archiv -> grau, Dearchivieren -> grün */
.btn-archive:hover .icon-archive { color: #6c757d; }
.btn-unarchive:hover .icon-unarchive { color: var(--stela-brand-primary); }
.action-icon:hover i { transform: scale(1.08); }

/* Kunden-Form: kompakte Ansicht für bestehende Adressen/Personen */
.address-item.existing .address-view,
.contact-item.existing .contact-view {
  padding: .5rem .75rem; border-radius: .375rem; background: var(--stela-surface-raised); cursor: pointer; font-size: .9rem;
}
.address-item.existing .address-view:hover,
.contact-item.existing .contact-view:hover { background: var(--stela-surface-soft); }
.address-item.existing.editing .address-view,
.contact-item.existing.editing .contact-view { display: none; }
.address-item.existing .address-edit.d-none,
.contact-item.existing .contact-edit.d-none { display: none !important; }

/* Rollen: Drag-Handle dezenter anzeigen */
#role-list .drag-handle { cursor: grab; }
#role-list .drag-handle i { font-size: 18px; opacity: .6; }
#role-list li.list-group-item:active .drag-handle { cursor: grabbing; }

/* Formular-Builder Vorschau */
.form-preview-page {
  width: 21cm;
  min-height: 29.7cm;
  margin: 0 auto 2rem auto;
  background-color: var(--stela-surface-raised);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.12);
  border-radius: 12px;
  padding: var(--preview-margin-top, 25mm) var(--preview-margin-right, 20mm) var(--preview-margin-bottom, 25mm) var(--preview-margin-left, 20mm);
  position: relative;
  overflow: hidden;
}

.form-preview-content {
  position: relative;
  z-index: 2;
}

.form-preview-header {
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.form-preview-letterhead-note {
  font-size: 0.75rem;
  color: var(--stela-text-muted);
  margin-left: 1rem;
  font-weight: 400;
}

.form-preview-body {
  min-height: 22cm;
}

.form-preview-letterhead-layer {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.form-preview-overlay {
  position: absolute;
  inset: 0;
  background: var(--stela-form-preview-overlay);
  pointer-events: none;
  z-index: 1;
}

.form-preview-letterhead-frame {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  opacity: 0.85;
}

.form-preview-field {
  margin-bottom: 1rem;
}

.form-preview-field--empty {
  border: 1px dashed var(--stela-border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--stela-text-muted);
  background-color: var(--stela-surface-muted);
}

.form-preview-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-preview-required {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.form-preview-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--stela-ink-rgb), 0.12);
  font-size: 0.85rem;
  cursor: pointer;
}

.form-preview-help-icon i {
  line-height: 1;
}

.form-layout-card .form-label { font-weight: 600; }

.form-margin-designer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem 0;
  flex-wrap: wrap;
}

.form-margin-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: var(--stela-text-muted);
}

.form-margin-side input {
  width: 96px;
  text-align: center;
}

.form-margin-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.form-margin-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: var(--stela-text-muted);
}

.form-margin-text {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.form-margin-page {
  width: min(320px, 100%);
  aspect-ratio: 210 / 297;
  border-radius: 18px;
  border: 1px solid rgba(33, 37, 41, 0.16);
  box-shadow: inset 0 0 0 1px rgba(33, 37, 41, 0.06);
  background: linear-gradient(135deg, rgba(248,249,250,0.95), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(73, 80, 87, 0.55);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

.form-margin-page::before {
  content: '';
  position: absolute;
  inset: 12% 10%;
  border-radius: 12px;
  border: 1px dashed rgba(108, 117, 125, 0.25);
}

.collapse-toggle-icon {
  display: inline-flex;
  transition: transform 0.24s ease;
}

@media (max-width: 1200px) {
  .form-margin-designer {
    gap: 1.5rem;
  }
}

@media (max-width: 992px) {
  .form-margin-designer {
    flex-direction: column;
    gap: 1rem;
  }
  .form-margin-side,
  .form-margin-row {
    flex-direction: row;
    justify-content: center;
  }
  .form-margin-side input,
  .form-margin-row input {
    width: 100px;
  }
  .form-margin-page {
    width: min(280px, 100%);
  }
}

.form-preview-input {
  border: 1px solid #ced4da;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(248, 249, 250, 0.9);
  font-size: 0.875rem;
  color: #6c757d;
}

.form-preview-input--textarea {
  min-height: 5rem;
}

.form-preview-input--number::after {
  content: '123';
  color: rgba(108, 117, 125, 0.35);
  float: right;
}

.form-preview-input--email::after {
  content: 'email@example.com';
  color: rgba(108, 117, 125, 0.35);
  float: right;
}

.builder-row,
.builder-pagebreak {
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  will-change: transform;
}

.builder-row.is-delete-hover,
.builder-pagebreak.is-delete-hover {
  background-color: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 18px 32px -20px rgba(220, 38, 38, 0.28);
}
.builder-row.is-delete-hover .builder-column {
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.25);
}

.builder-row .builder-field-list {
  min-height: 3.5rem;
}

.builder-column {
  transition: background-color 0.2s ease, border-color 0.15s ease, transform 0.15s ease;
}

.builder-column:hover {
  background-color: rgba(var(--stela-brand-primary-rgb), 0.08);
}

.builder-field-tile {
  border: 1px solid var(--stela-border-subtle);
  border-radius: 0.75rem;
  background: var(--stela-surface-raised);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.builder-field-tile:last-child {
  margin-bottom: 0;
}

.builder-field-tile:hover,
.builder-field-tile:focus-within {
  background: var(--stela-surface-glass);
  border-color: var(--stela-border-strong);
  box-shadow: 0 12px 26px rgba(var(--stela-ink-rgb), 0.18);
  transform: translateY(-1px);
}

.builder-field-tile.is-delete-hover,
.builder-field.is-delete-hover {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
  box-shadow: 0 14px 28px -16px rgba(220, 38, 38, 0.26) !important;
}

.form-letterhead-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--stela-letterhead-card-bg);
  border: 1px solid var(--stela-letterhead-card-border);
  box-shadow: 0 18px 42px -24px var(--stela-letterhead-card-shadow);
  position: relative;
}

.form-letterhead-card__preview {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--stela-letterhead-preview-bg);
  box-shadow: 0 14px 28px -18px rgba(var(--stela-ink-rgb), 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-letterhead-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--stela-letterhead-preview-bg);
}

.form-letterhead-edit {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  box-shadow: 0 8px 18px rgba(var(--stela-ink-rgb), 0.28);
}

.form-letterhead-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--stela-letterhead-badge-bg);
  color: var(--stela-letterhead-badge-color);
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-letterhead-card__body {
  flex: 1 1 220px;
  min-width: 0;
}

.form-letterhead-upload {
  border: 1px solid var(--stela-border-muted);
  border-radius: 1rem;
  padding: 1.2rem;
  background: var(--stela-surface-muted);
  box-shadow: inset 0 1px 2px rgba(var(--stela-ink-rgb), 0.04);
}

.form-letterhead-upload__input {
  background: var(--stela-surface-raised);
}

.form-letterhead-dropzone {
  border: 2px dashed var(--stela-letterhead-dropzone-border);
  background: var(--stela-letterhead-dropzone-bg);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.form-letterhead-dropzone.is-dragover {
  border-color: var(--stela-letterhead-dropzone-active-border);
  background: var(--stela-letterhead-dropzone-active-bg);
  transform: translateY(-2px);
}

.builder-surface-box {
  background: var(--stela-surface-raised);
  box-shadow: inset 0 1px 0 rgba(var(--stela-ink-rgb), 0.04);
}

.table tbody tr.row-success > td {
  background-color: #e6ffed !important;
  transition: background-color .8s ease;
}

.builder-drag-handle {
  cursor: grab;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
}

.builder-drag-handle:active {
  cursor: grabbing;
}

.builder-row.is-dragging,
.builder-pagebreak.is-dragging {
  opacity: 0;
  border-style: dashed;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.35) !important;
  box-shadow: none;
  pointer-events: none;
}

.builder-row.is-dragging-collapsed,
.builder-pagebreak.is-dragging-collapsed {
  margin: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
}

.builder-field.is-dragging {
  opacity: 0;
}

.builder-drag-ghost {
  position: fixed;
  top: -9999px;
  left: -9999px;
  pointer-events: none;
  z-index: 1095;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--stela-brand-primary-rgb), 0.45);
  box-shadow: 0 18px 45px rgba(var(--stela-ink-rgb), 0.18), 0 8px 22px rgba(var(--stela-ink-rgb), 0.22);
  background: var(--stela-surface-raised);
  overflow: hidden;
  opacity: 0.98;
  transform-origin: center center;
}

.builder-drag-ghost--row {
  transform: rotate(-2.5deg) scale(0.98);
}

.builder-drag-ghost--field {
  transform: rotate(-1.5deg) scale(0.99);
}

.builder-drag-ghost .builder-drag-handle,
.builder-drag-ghost [data-action] {
  pointer-events: none !important;
}

.builder-row.drag-over,
.builder-pagebreak.drag-over {
  border-color: rgba(var(--stela-brand-primary-rgb), 0.7) !important;
  border-style: dashed;
  background-color: rgba(var(--stela-brand-primary-rgb), 0.08);
  box-shadow: 0 10px 26px rgba(var(--stela-brand-primary-rgb), 0.18);
  transform: translateY(4px);
}

.builder-row.drag-over::before,
.builder-pagebreak.drag-over::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  height: 8px;
  border-radius: 999px;
  background: rgba(var(--stela-brand-primary-rgb), 0.3);
  box-shadow: 0 6px 18px rgba(var(--stela-brand-primary-rgb), 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.builder-row.drag-over.drag-over--before::before,
.builder-pagebreak.drag-over.drag-over--before::before {
  top: -10px;
  opacity: 1;
  transform: scaleX(0.9);
}

.builder-row.drag-over.drag-over--after::before,
.builder-pagebreak.drag-over.drag-over--after::before {
  bottom: -10px;
  opacity: 1;
  transform: scaleX(0.9);
}

.builder-row.drag-over::after,
.builder-pagebreak.drag-over::after {
  content: 'Hier loslassen';
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #198754;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(var(--stela-brand-primary-rgb), 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.builder-row.drag-over.drag-over--before::after,
.builder-pagebreak.drag-over.drag-over--before::after {
  top: -26px;
  opacity: 1;
}

.builder-row.drag-over.drag-over--after::after,
.builder-pagebreak.drag-over.drag-over--after::after {
  bottom: -26px;
  opacity: 1;
}

.builder-row-placeholder {
  height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.builder-row-placeholder.active {
  height: 0;
  margin: 0;
  opacity: 0;
}

.builder-row-placeholder::after {
  display: none;
}

.builder-row-placeholder .placeholder-body {
  display: none;
}

.builder-field.drag-over {
  border-color: rgba(var(--stela-brand-primary-rgb), 0.6) !important;
  background-color: rgba(var(--stela-brand-primary-rgb), 0.08);
  transform: translateY(2px);
  box-shadow: 0 6px 16px rgba(var(--stela-brand-primary-rgb), 0.18);
}

.builder-column.drag-over-column {
  border: 2px dashed rgba(var(--stela-brand-primary-rgb), 0.6);
  background: rgba(var(--stela-brand-primary-rgb), 0.05);
}

.builder-fields {
  position: relative;
}

.builder-row-ghost {
  pointer-events: none;
  border-radius: 0.85rem;
  box-shadow: 0 24px 48px -24px rgba(var(--stela-ink-rgb), 0.32);
  transition: transform 0.32s ease;
  background: var(--stela-surface-raised);
  overflow: hidden;
}

.builder-action-bar {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 40;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(var(--stela-ink-rgb), 0.12);
  box-shadow: 0 28px 65px -30px rgba(15, 23, 42, 0.45), 0 18px 28px -18px rgba(15, 23, 42, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  transition: transform 0.3s ease, bottom 0.3s ease, box-shadow 0.3s ease;
}

.builder-action-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.65rem;
  min-width: 46px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  gap: 0.35rem;
  box-shadow: 0 18px 44px -22px rgba(var(--stela-ink-rgb), 0.35);
  transition: box-shadow 0.25s ease, transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  text-decoration: none;
}

.builder-action-btn i {
  font-size: 1.25rem;
  line-height: 1;
}

.builder-action-btn span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.35s ease, opacity 0.25s ease;
}

.builder-action-btn--primary {
  background: var(--stela-brand-primary);
  color: #fff;
}

.builder-action-btn--ghost {
  background: rgba(var(--stela-ink-rgb), 0.06);
  color: var(--stela-text-primary);
}

.builder-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 52px -26px rgba(var(--stela-ink-rgb), 0.42);
}

.builder-action-btn:hover span,
.builder-action-btn:focus-visible span,
.builder-action-bar.is-bottom .builder-action-btn span {
  max-width: 150px;
  opacity: 1;
}

.builder-action-btn:focus-visible {
  outline: 3px solid rgba(var(--stela-brand-secondary-rgb), 0.45);
  outline-offset: 3px;
}

.builder-action-bar.is-bottom {
  transform: translateX(-33%) translateY(0);
}

.builder-action-meta {
  color: rgba(var(--stela-ink-rgb), 0.55);
}

[data-builder-fields].is-dragging-field .builder-column {
  background: rgba(var(--stela-brand-primary-rgb), 0.03);
}

.form-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
  border-radius: 0.75rem;
  background: var(--stela-surface-raised);
  min-height: 140px;
}

.form-preview-image--align-left {
  justify-content: flex-start;
}

.form-preview-image--align-right {
  justify-content: flex-end;
}

figure.form-preview-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(var(--stela-ink-rgb), 0.12);
}

.form-preview-image--empty {
  flex-direction: column;
  gap: 0.35rem;
  border-style: dashed;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.5);
  background: rgba(var(--stela-brand-primary-rgb), 0.08);
  color: rgba(var(--stela-ink-rgb), 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.form-preview-field--horizontal {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-preview-field--horizontal .form-preview-label {
  width: 32%;
  margin-bottom: 0;
  font-weight: 600;
  text-align: right;
}

.form-preview-field--horizontal .form-preview-input,
.form-preview-field--horizontal .form-preview-signature {
  flex: 1 1 auto;
}

.form-preview-field--horizontal .form-preview-image,
.form-preview-field--horizontal .form-preview-image--empty {
  flex: 0 0 auto;
}

.form-preview-field--horizontal .form-image-static,
.form-preview-field--horizontal .form-image-static-placeholder {
  flex: 0 0 auto;
}

@media (max-width: 767.98px) {
  .form-preview-field--horizontal {
    flex-direction: column;
    align-items: stretch;
  }

  .form-preview-field--horizontal .form-preview-label {
    width: 100%;
    text-align: left;
    margin-bottom: 0.35rem;
  }
}

.form-preview-image--empty i {
  font-size: 1.4rem;
  color: rgba(var(--stela-brand-primary-rgb), 0.9);
}

.form-preview-heading {
  margin-bottom: 0.5rem;
}

.form-preview-heading-title {
  margin: 0;
  font-weight: 600;
}

.form-preview-heading-subtitle {
  margin: 0.25rem 0 0;
  color: rgba(108, 117, 125, 0.85);
  font-size: 0.95rem;
}

.form-preview-heading--align-left {
  text-align: left;
}

.form-preview-heading--align-center {
  text-align: center;
}

.form-preview-heading--align-right {
  text-align: right;
}

.form-preview-list {
  margin: 0;
  padding-left: 1.25rem;
}

.form-preview-list--bullet {
  list-style-type: disc;
}

.form-preview-list--numbered {
  list-style-type: decimal;
}

.form-preview-image-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(var(--stela-brand-primary-rgb), 0.55);
  border-radius: 0.85rem;
  background: rgba(var(--stela-brand-primary-rgb), 0.08);
  color: rgba(var(--stela-ink-rgb), 0.68);
  font-weight: 600;
}

.form-preview-image-upload i {
  font-size: 1.3rem;
  color: rgba(var(--stela-brand-primary-rgb), 0.95);
}

/* Signature preview adopt new glass design */
.form-preview-signature {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.builder-insert {
  position: relative;
  margin: 0.25rem 0;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: padding 0.28s ease, background-color 0.2s ease;
}

.builder-insert:first-of-type {
  margin-top: 0.5rem;
}

.builder-insert-line {
  height: 1px;
  width: 60%;
  background: rgba(var(--stela-brand-primary-rgb), 0.25);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, height 0.3s ease, width 0.3s ease;
  pointer-events: none;
}

.builder-insert-btn {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%) scale(0.65);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(var(--stela-brand-primary-rgb), 0.5);
  background: var(--stela-surface-raised);
  color: var(--stela-success-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.builder-insert-btn i {
  font-size: 18px;
}

.builder-insert:hover,
.builder-insert:focus-within,
.builder-insert:focus-visible {
  padding: 2.4rem 0;
  outline: none;
}

.builder-insert:hover .builder-insert-line,
.builder-insert:focus-within .builder-insert-line,
.builder-insert:focus-visible .builder-insert-line {
  background: rgba(var(--stela-brand-primary-rgb), 0.85);
  box-shadow: 0 10px 22px rgba(var(--stela-brand-primary-rgb), 0.24);
  height: 5px;
  width: 90%;
}

.builder-insert:hover .builder-insert-btn,
.builder-insert:focus-within .builder-insert-btn,
.builder-insert:focus-visible .builder-insert-btn,
.builder-insert-btn:focus-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
  border-color: rgba(var(--stela-brand-primary-rgb), 0.8);
  box-shadow: 0 8px 18px rgba(var(--stela-brand-primary-rgb), 0.28);
  outline: none;
}

.builder-insert.is-target {
  padding: 1.2rem 0 1.6rem;
  margin: 0.2rem 0 0.9rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(var(--stela-brand-primary-rgb), 0.06), rgba(95, 210, 170, 0.1));
  transition: padding 0.18s ease, background-color 0.18s ease, margin 0.18s ease;
}

.builder-insert.is-target .builder-insert-line {
  background: rgba(var(--stela-brand-primary-rgb), 0.85);
  height: 4px;
  width: 82%;
  box-shadow: 0 10px 22px rgba(var(--stela-brand-primary-rgb), 0.22);
}

.builder-insert.is-target .builder-insert-btn {
  opacity: 1;
  pointer-events: auto;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  border-color: rgba(var(--stela-brand-primary-rgb), 0.8);
  box-shadow: 0 10px 24px rgba(var(--stela-brand-primary-rgb), 0.25);
}

.builder-insert.is-target::after {
  content: 'Zeile wird hier eingefügt';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translate(-50%, -100%);
  color: var(--stela-success-strong, #198754);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(var(--stela-brand-primary-rgb), 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(var(--stela-brand-primary-rgb), 0.18);
}

.table tr.form-row {
  cursor: pointer;
}

.form-row td.open-edit {
  cursor: pointer;
}

/* Orientierung & Panels (Tab 1) */
.company-detail .roles-presets .btn { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.company-detail .roles-presets .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.company-detail .roles-loading,
.company-detail .membership-loading { font-size: 0.9rem; }
.company-detail .membership-entry,
.structure-member {
  background: var(--stela-surface-raised);
  border: 1px solid rgba(var(--stela-ink-rgb), 0.05);
}
.company-detail .membership-entry .badge { font-size: 0.72rem; }
.company-detail .membership-entry .avatar-title { font-size: 1rem; }
.company-detail .membership-role-chips .badge { font-weight: 500; }
.company-detail .membership-empty,
.company-detail .roles-empty-state { background-color: rgba(247, 248, 249, 0.7); }

/* Listenstruktur Tab */
.structure-tree { background: var(--stela-surface-raised); border-radius: 0.75rem; overflow: hidden; }
.structure-department + .structure-department { border-top: 1px solid rgba(var(--stela-ink-rgb), 0.05); }
.structure-department-header { background: rgba(var(--stela-ink-rgb), 0.08); transition: background 0.2s ease; }
.structure-department-header:hover { background: rgba(var(--stela-ink-rgb), 0.12); }
.structure-empty .structure-department-header { opacity: 0.65; }
.structure-members { padding: 0.75rem 1rem 1rem 3.25rem; display: flex; gap: 0.75rem; flex-direction: column; }
.structure-member { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border-radius: 0.75rem; padding: 0.75rem 1rem; transition: box-shadow 0.18s ease, border 0.18s ease, background 0.18s ease; }
.structure-member:focus-visible { outline: 2px solid var(--stela-brand-secondary); outline-offset: 2px; }
.structure-member.dragging { opacity: 0.7; background: rgba(var(--stela-brand-primary-rgb), 0.08); border-color: rgba(var(--stela-brand-primary-rgb), 0.45); box-shadow: 0 6px 24px rgba(var(--stela-brand-primary-rgb), 0.25); }
.structure-member.drop-target { border-style: dashed; border-color: rgba(var(--stela-brand-secondary-rgb), 0.6); box-shadow: inset 0 0 0 1px rgba(var(--stela-brand-secondary-rgb), 0.35); }
.structure-member-main { display: flex; gap: 1rem; align-items: center; flex: 1; min-width: 0; }
.structure-member-body { min-width: 0; }
.structure-member-body .structure-member-chips { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.structure-avatar,
.project-step-row .step-avatar {
  background: rgba(var(--stela-brand-secondary-rgb), 0.12);
  color: var(--stela-brand-secondary);
}

.structure-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; text-transform: uppercase; position: relative; overflow: hidden; }
.structure-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.structure-initials { font-size: 0.85rem; }
.structure-member-meta { display: flex; align-items: center; gap: 0.5rem; }
.structure-status { width: 10px; height: 10px; border-radius: 50%; display: inline-flex; }
.structure-status-online { background: var(--stela-success-strong); }
.structure-status-recent { background: var(--stela-warning-strong); }
.structure-status-invited { background: var(--stela-brand-secondary); border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(var(--stela-brand-secondary-rgb), 0.25); }
.structure-status-offline { background: rgba(var(--stela-ink-rgb), 0.35); }
.structure-handle .btn { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

@media (max-width: 991.98px) {
  .structure-members { padding-left: 2.25rem; }
  .structure-member { flex-direction: column; align-items: flex-start; }
  .structure-member-meta { width: 100%; justify-content: space-between; }
}

/* Onboarding cards */
[data-onboarding-presets] .list-group-item { cursor: pointer; user-select: none; }
[data-onboarding-presets] .list-group-item:hover { background: rgba(var(--stela-brand-secondary-rgb), 0.08); }
[data-onboarding-invite] .invite-step + .invite-step { margin-top: 0.75rem; }
[data-onboarding-guardrails] i { font-size: 1.1rem; }
.structure-filter.active {
    background: var(--stela-brand-secondary);
    color: var(--stela-text-inverse);
    border-color: var(--stela-brand-secondary);
}

.project-card .project-header .badge {
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.project-card .project-progress .progress-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--stela-success-strong) 0%, var(--stela-surface-soft) 0%);
    position: relative;
}

.project-card .project-progress .progress-ring span {
    background: var(--stela-surface-raised);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-weight: 600;
    color: var(--stela-text-primary);
}

.project-tabs .nav-link {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.project-status-widget .project-status-grid {
    display: flex;
    flex-wrap: wrap;
}

.project-status-tile {
    position: relative;
    display: block;
    padding: 1.35rem;
    border-radius: 1.2rem;
    border: 1px solid var(--stela-project-status-tile-border);
    background: var(--stela-project-status-tile-bg);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 18px 38px var(--stela-project-status-tile-shadow);
    transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.project-status-tile:hover {
    transform: translateY(-6px);
    border-color: var(--stela-project-status-tile-hover-border);
    box-shadow: 0 28px 60px var(--stela-project-status-tile-hover-shadow);
}

.project-status-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.project-status-share {
    font-size: 0.85rem;
}

.project-status-ring {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0.5rem 0;
    background: conic-gradient(
        var(--ps-accent, var(--stela-brand-secondary)) calc(var(--ps-progress, 0) * 1%),
        var(--stela-project-status-ring-track) calc(var(--ps-progress, 0) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-status-ring::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--stela-surface-raised);
    box-shadow: inset 0 0 0 1px var(--stela-project-status-ring-inner-shadow);
}

.project-status-count {
    position: relative;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--ps-accent, var(--stela-brand-secondary));
}

.project-status-link {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.project-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
    background: linear-gradient(135deg, rgba(246, 248, 255, 0.78) 0%, rgba(241, 250, 247, 0.62) 100%);
    border-radius: 22px;
}

.project-hero__backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.03);
    filter: saturate(108%) brightness(0.9);
    opacity: 0.35;
    transition: opacity .3s ease;
    pointer-events: none;
}

.project-hero__scrim {
    position: absolute;
    inset: 0;
    background: var(--stela-project-hero-scrim);
    pointer-events: none;
}

.project-hero__content {
    position: relative;
    z-index: 2;
}

.project-hero__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.project-hero__labels {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex: 1 1 0;
}

.project-hero__media {
    width: 240px;
    max-width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(var(--stela-ink-rgb), 0.05);
    box-shadow: 0 18px 40px -22px rgba(var(--stela-ink-rgb), 0.45);
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    flex-shrink: 0;
    position: relative;
}

.project-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero__edit {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 30px -18px rgba(var(--stela-ink-rgb), 0.55);
    opacity: .95;
    transition: transform .18s ease, opacity .18s ease;
}

.project-hero__media:hover .project-hero__edit,
.project-hero__edit:focus-visible {
    transform: translateY(-2px);
    opacity: 1;
}

.project-hero__reference {
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(var(--stela-ink-rgb), .55);
}

.project-hero__title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--stela-text-primary);
}

.project-hero__subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(var(--stela-ink-rgb), .75);
}

.project-hero__meta {
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.project-hero__meta .dot {
    font-size: .65rem;
    line-height: 1;
}

.project-hero__status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.project-hero__status-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.project-hero__action {
    border-radius: 999px;
    padding-inline: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.project-hero__metrics {
    margin-top: 1.5rem;
}

.project-cover-preview {
    position: relative;
    background: rgba(var(--stela-ink-rgb), 0.04);
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    border-radius: 18px;
    overflow: hidden;
    padding-top: 60%;
}

.project-cover-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-title-image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.project-title-image-preview-wrapper {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(var(--stela-ink-rgb), 0.1);
    background: rgba(var(--stela-ink-rgb), 0.04);
    box-shadow: 0 18px 40px -28px rgba(var(--stela-ink-rgb), 0.45);
    position: relative;
}

.project-title-image-preview-wrapper img {
    display: block;
    width: min(480px, 100%);
    max-height: 280px;
    object-fit: cover;
}

.project-title-image-trigger {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 32px -18px rgba(var(--stela-ink-rgb), 0.55);
}

.project-mini-card {
    background: var(--stela-surface-raised);
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 30px -18px rgba(var(--stela-ink-rgb), 0.2);
    min-height: 110px;
}

.project-mini-card__label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(var(--stela-ink-rgb), .55);
    margin-bottom: .35rem;
}

.project-mini-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--stela-text-primary);
}

.project-mini-card__hint {
    font-size: .82rem;
    margin-top: .35rem;
    color: var(--stela-text-muted);
}

.project-mini-card--stacked .project-mini-card__label {
    margin-bottom: .65rem;
}

.project-mini-card__stacked {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 1rem;
    margin: 0;
}

.project-mini-card__stacked dt {
    margin: 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(var(--stela-ink-rgb), .55);
}

.project-mini-card__stacked dd {
    margin: 0;
    font-weight: 600;
    color: var(--stela-text-primary);
    font-size: .95rem;
    display: flex;
    gap: .5rem;
    align-items: center;
}

.project-mini-card__stacked dd .form-control {
    flex: 1 1 auto;
}

.project-mini-card__stacked dd .btn-link {
    padding: 0;
    font-size: .8rem;
}

.project-mini-card__stacked dt.project-milestone-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    cursor: default;
}

.project-milestone-chevron {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform .2s ease;
}

.project-mini-card__stacked dd.project-milestone-field {
    align-items: stretch;
}

.project-tabs-modern {
    position: relative;
}

.project-tabs-modern::before,
.project-tabs-modern::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
    z-index: 2;
}

.project-tabs-modern::before {
    left: 0;
    box-shadow: inset 12px 0 12px -12px rgba(var(--stela-ink-rgb), 0.4);
}

.project-tabs-modern::after {
    right: 0;
    box-shadow: inset -12px 0 12px -12px rgba(var(--stela-ink-rgb), 0.4);
}

.project-tabs-modern.has-shadow-left::before {
    opacity: 1;
}

.project-tabs-modern.has-shadow-right::after {
    opacity: 1;
}

.project-tabs-modern .nav-tabs {
    border-bottom: 0;
    gap: .5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .2rem;
}

.project-tabs-modern .nav-link {
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(var(--stela-ink-rgb), 0.05);
    color: rgba(var(--stela-ink-rgb), 0.7);
    padding: 0.45rem 1.2rem;
    font-weight: 600;
    transition: all .18s ease;
    white-space: nowrap;
}

.project-tabs-modern .nav-link.active,
.project-tabs-modern .nav-link:focus,
.project-steps-list .project-step-row:hover {
    border-color: rgba(var(--stela-brand-secondary-rgb), 0.3);
}

.project-tabs-modern .nav-link.active,
.project-tabs-modern .nav-link:focus {
    background: var(--stela-surface-raised);
    box-shadow: 0 6px 18px -12px rgba(var(--stela-brand-secondary-rgb), 0.5);
    color: var(--stela-brand-secondary);
}

.project-body .project-tab-content {
    padding: 0;
}

.project-steps-list .project-step-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: stretch;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    box-shadow: 0 16px 32px -24px rgba(var(--stela-ink-rgb), 0.25);
}

.project-steps-list .project-step-row:hover {
    box-shadow: 0 22px 38px -20px rgba(var(--stela-brand-secondary-rgb), 0.28);
}

.project-step-row .step-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.project-step-row .project-step-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.project-step-row .project-step-body h5 {
    margin: 0;
    font-size: 1.05rem;
}

.project-step-row .project-step-body .small {
    color: rgba(var(--stela-ink-rgb), 0.6);
}

.project-step-row .project-step-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    min-width: 200px;
}

.project-step-row .btn-action {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.4rem 1.4rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .project-step-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .project-step-row .project-step-action {
        width: 100%;
        min-width: 0;
        align-items: stretch;
    }

    .project-step-row .btn-action,
    .project-step-row .btn-group>.btn-action,
    .project-step-row .btn-group .btn {
        width: 100%;
        justify-content: center;
    }

    .project-step-row .btn-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }
}

.project-card-mini {
    border-radius: 20px;
    background: var(--stela-surface-raised);
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    box-shadow: 0 24px 50px -24px rgba(var(--stela-ink-rgb), 0.35) !important;
    transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
    position: relative;
    overflow: hidden;
}
.project-card-mini:hover {
    box-shadow: 0 26px 44px -18px rgba(var(--stela-ink-rgb), 0.28);
    border-color: rgba(var(--stela-ink-rgb), 0.14);
    transform: translateY(-2px);
}
.project-card-mini[data-project-card] {
    cursor: pointer;
}
.project-card-mini .card-body {
    position: relative;
    z-index: 2;
}
.project-card-mini__backdrop {
  opacity: 0.32;
  transition: opacity 0.3s ease;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
    transition: transform .22s ease;
    z-index: 0;
    pointer-events: none;
}
.project-card-mini__scrim {
    position: absolute;
    inset: 0;
    background: var(--stela-project-card-scrim);
    z-index: 1;
    transition: background .18s ease;
    pointer-events: none;
}
.project-card-mini.has-cover:hover .project-card-mini__backdrop {
  opacity: 0.45;
  opacity: 0.32;
  transition: opacity 0.3s ease;
    transform: scale(1.07);
}
.project-card-mini.has-cover:hover .project-card-mini__scrim {
    background: var(--stela-project-card-scrim-hover);
}
.project-card-title-trigger {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: color .18s ease;
    display: inline;
}
.project-card-title-trigger:hover,
.project-card-title-trigger:focus {
    color: var(--stela-brand-primary);
    text-decoration: none;
}
.project-card-title-trigger:focus {
    outline: none;
}
.project-card-mini .project-card-ref { font-size: .78rem; letter-spacing: .08em; }
.project-card-mini .dot { font-size: .65rem; line-height: 1; }
.project-card-entities .project-card-entity-link {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: inherit;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: color 0.18s ease;
}
.project-card-entities .project-card-entity-link:hover,
.project-card-entities .project-card-entity-link:focus {
    color: var(--stela-brand-primary);
    text-decoration: none;
}
.project-card-entities .project-card-entity-link:focus {
    outline: none;
}
.project-card-entities .project-card-entity-link i {
    font-size: 1rem;
    line-height: 1;
}
.project-progress-ring {
    width: 90px;
    height: 90px;
}
.project-progress-ring::before {
    inset: 7px;
}
.project-progress-ring span {
    font-size: 1rem;
}
.mini-progress-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background: conic-gradient(var(--stela-success-strong) 0%, rgba(var(--stela-ink-rgb), 0.08) 0%);
    font-weight: 700;
    color: var(--stela-text-primary);
}
.mini-progress-ring::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--stela-surface-raised);
    box-shadow: inset 0 0 0 1px rgba(var(--stela-ink-rgb), 0.06);
}
.mini-progress-ring span { position: relative; font-size: .85rem; }

.project-step-row.is-readonly {
    background: var(--stela-surface-soft);
    border-color: rgba(var(--stela-ink-rgb), 0.08);
    opacity: 0.9;
}

.project-step-row .project-step-action .project-step-reopen {
    border-radius: 999px;
}

.project-step-row--highlight {
    animation: project-step-highlight 1.4s ease;
    border-color: rgba(var(--stela-brand-primary-rgb), 0.6) !important;
    box-shadow: 0 0 0 0 rgba(var(--stela-brand-primary-rgb), 0.3);
}

@keyframes project-step-highlight {
    0% { box-shadow: 0 0 0 0 rgba(var(--stela-brand-primary-rgb), 0.3); }
    60% { box-shadow: 0 0 0 12px rgba(var(--stela-brand-primary-rgb), 0); }
    100% { box-shadow: none; }
}

@media (max-width: 991.98px) {
    .project-hero__header {
        flex-direction: column;
    }
    .project-hero__media {
        width: 100%;
    }
    .project-hero__status {
        width: 100%;
        align-items: stretch;
    }
    .project-hero__status-actions {
        justify-content: space-between;
        width: 100%;
    }
    .project-hero__status .project-status-pill {
        margin-top: 0;
    }
    .project-hero__metrics {
        margin-top: 1rem;
    }
    .project-steps-list .project-step-row {
        flex-direction: column;
    }
    .project-step-row .project-step-action {
        align-items: stretch;
        min-width: 0;
    }
}

@media (max-width: 576px) {
    .project-mini-card__stacked dt.project-milestone-label {
        cursor: pointer;
    }
    .project-milestone-chevron {
        display: inline-flex;
    }
    .project-mini-card__stacked dt.project-milestone-label[aria-expanded="true"] .project-milestone-chevron {
        transform: rotate(180deg);
    }
    .project-mini-card__stacked {
        grid-template-columns: 1fr;
        gap: 0.45rem 0;
    }
    .project-mini-card__stacked dt {
        font-size: .78rem;
    }
    .project-mini-card__stacked dd {
        margin-left: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: .35rem;
    }
    .project-mini-card__stacked dd .form-control {
        width: 100%;
    }
    .project-mini-card__stacked dd .btn-link {
        padding-left: 0;
    }
    .project-mini-card__stacked dd[data-milestone-panel] {
        display: none;
    }
    .project-mini-card__stacked dd[data-milestone-panel].is-open {
        display: flex;
    }
    .project-tabs-modern .nav-tabs {
        padding-bottom: .3rem;
    }
}

.project-summary-info .project-reference {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.project-summary-info .project-title {
    font-size: 1.4rem;
}

.project-summary-info .project-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
}

.project-status-pill {
    background: rgba(var(--stela-brand-secondary-rgb), 0.15);
    color: var(--stela-brand-secondary);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.project-meta-line {
    font-size: 0.95rem;
}

.project-step-row {
    background: var(--stela-surface-raised);
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    border-radius: 0.9rem;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.project-step-row:hover {
    border-color: rgba(var(--stela-brand-primary-rgb), 0.35);
    box-shadow: 0 12px 32px rgba(var(--stela-ink-rgb), 0.08);
}

.project-step-row .btn-action {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.35rem 1.2rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.project-step-row .btn-action input[type="file"] {
    display: none;
}

.project-step-row.is-readonly {
    background: var(--stela-surface-soft);
    border-color: rgba(var(--stela-ink-rgb), 0.12);
    opacity: 0.85;
}

.project-step-row.is-readonly .btn-action {
    cursor: not-allowed;
    opacity: 0.65;
}

.project-step-row.is-readonly .btn-action:hover {
    box-shadow: none;
}

.project-step-row .project-step-body h5 {
    font-size: 1.05rem;
}

.project-step-row .project-step-body .small a {
    color: inherit;
    text-decoration: none;
}

.project-step-row .project-step-body .small a:hover {
    text-decoration: underline;
}

.project-step-row .project-step-action {
    min-width: 180px;
    text-align: right;
}

@media (max-width: 768px) {
    .project-step-row .project-step-action {
        text-align: left;
    }
}

.project-step-row .badge {
    font-size: 0.7rem;
}
.project-step-row .project-step-body .text-muted.small {
    color: rgba(var(--stela-ink-rgb), 0.6)!important;
}

.project-tabs .nav-link.active {
    border-bottom: 3px solid var(--stela-brand-secondary);
}

.project-steps-list .project-step-row {
    border-radius: 1rem;
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
}

.project-step-meta span {
    display: inline-flex;
    align-items: center;
}

.project-step-row .project-step-action .btn-action {
    min-width: 150px;
}

/* Dashboard Shell Styling */
body .dashboard-shell {
    position: relative;
    background: var(--stela-dashboard-shell-bg);
    border-radius: 36px;
    padding: 2.5rem 2.75rem 3rem;
    box-shadow: 0 32px 70px rgba(var(--stela-ink-rgb), 0.14);
    overflow: hidden;
    border: 1px solid var(--stela-dashboard-shell-border);
}

body .dashboard-shell::before,
body .dashboard-shell::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(22px);
    opacity: 0.45;
    pointer-events: none;
}

body .dashboard-shell::before {
    top: -160px;
    right: -120px;
    width: 360px;
    height: 360px;
    background: var(--stela-dashboard-shell-blob-primary);
}

body .dashboard-shell::after {
    bottom: -150px;
    left: -110px;
    width: 340px;
    height: 340px;
    background: var(--stela-dashboard-shell-blob-secondary);
}

body .dashboard-shell .card {
    border-radius: 28px;
    background: var(--stela-dashboard-card-bg, var(--stela-surface-glass));
    border: 1px solid var(--stela-border-muted);
    box-shadow: 0 24px 52px rgba(var(--stela-ink-rgb), 0.12);
    position: relative;
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

body .dashboard-shell .card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--stela-dashboard-card-overlay);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

body .dashboard-shell .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(var(--stela-ink-rgb), 0.18);
}

body .dashboard-shell .card:hover::before {
    opacity: 1;
}

body .dashboard-shell .card .card-body {
    position: relative;
    z-index: 1;
    padding: 1.75rem;
}

body .dashboard-shell .card .card-header {
    border-bottom: none;
    background: transparent;
    padding: 1.75rem 1.75rem 0;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(var(--stela-brand-secondary-rgb), 0.16) 0%, rgba(var(--stela-brand-primary-rgb), 0.12) 55%, rgba(var(--stela-success-strong-rgb), 0.14) 100%);
    border-radius: 32px;
    padding: 2rem 2.4rem;
    box-shadow: 0 24px 48px rgba(var(--stela-brand-secondary-rgb), 0.22);
    border: 1px solid var(--stela-border-muted);
    position: relative;
    overflow: hidden;
}

.dashboard-hero .badge {
    letter-spacing: 0.08em;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
}

.dashboard-hero .lead {
    max-width: 540px;
}

.dashboard-hero__top {
    position: relative;
    z-index: 1;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: var(--stela-dashboard-hero-overlay);
    opacity: 0.65;
    pointer-events: none;
}

.dashboard-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.dashboard-quick-nav__item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--stela-text-primary);
    background: var(--stela-dashboard-list-item-bg, var(--stela-surface-glass));
    box-shadow: inset 0 0 0 1px var(--stela-border-muted);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.dashboard-quick-nav__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(var(--stela-brand-secondary-rgb), 0.25);
}

.dashboard-quick-nav__item.is-active {
    background: linear-gradient(135deg, rgba(var(--stela-brand-secondary-rgb), 0.95) 0%, rgba(var(--stela-brand-secondary-rgb), 0.85) 50%, rgba(var(--stela-brand-primary-rgb), 0.9) 100%);
    color: var(--stela-text-inverse);
    box-shadow: 0 16px 34px rgba(var(--stela-brand-secondary-rgb), 0.35);
}

.dashboard-quick-nav__item.is-active .dashboard-quick-nav__icon {
    background: var(--stela-dashboard-quick-nav-icon-active-bg);
    color: var(--stela-text-inverse);
}

.dashboard-quick-nav__icon {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--stela-dashboard-quick-nav-icon-bg);
    color: var(--stela-dashboard-quick-nav-icon-color);
}

.dashboard-quick-nav__item:hover .dashboard-quick-nav__icon {
    background: var(--stela-dashboard-quick-nav-icon-hover-bg);
}

.dashboard-quick-nav::-webkit-scrollbar {
    display: none;
}

.dashboard-quick-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.dashboard-primary-action {
    box-shadow: 0 18px 40px var(--stela-dashboard-primary-action-shadow);
}

.dashboard-metrics {
    margin: 0;
}

.dashboard-metric {
    background: var(--stela-dashboard-metric-bg);
    border-radius: 28px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    min-height: 170px;
    box-shadow: 0 26px 45px var(--stela-dashboard-metric-shadow);
    border: 1px solid var(--stela-dashboard-metric-border);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-metric:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 55px var(--stela-dashboard-metric-shadow-hover);
}

.dashboard-metric::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--stela-dashboard-metric-overlay);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.dashboard-metric:hover::after {
    opacity: 1;
}

.dashboard-metric__icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(var(--stela-brand-primary-rgb), 0.12);
    color: var(--metric-color, var(--stela-brand-primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: inset 0 0 0 1px rgba(var(--stela-brand-primary-rgb), 0.35);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.dashboard-metric__content {
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
}

.dashboard-metric__label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: rgba(var(--stela-ink-rgb), 0.6);
}

.dashboard-metric__value {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--stela-text-primary);
}

.dashboard-metric__trend {
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--stela-neutral-soft);
}

.dashboard-metric__trend.is-up {
    color: var(--stela-success-strong);
    background: var(--stela-success-highlight);
}

.dashboard-metric__trend.is-down {
    color: var(--stela-danger-strong);
    background: var(--stela-danger-highlight);
}

.dashboard-metric-actions {
    width: auto;
    justify-content: flex-end;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    align-self: flex-end;
}

.dashboard-metric-actions .metric-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(var(--stela-brand-primary-rgb), 0.35);
}

.dashboard-metric-actions .metric-action-icon .mdi {
    line-height: 1;
}

.dashboard-metric-actions .metric-action-icon:hover,
.dashboard-metric-actions .metric-action-icon:focus {
    box-shadow: 0 10px 18px rgba(var(--stela-brand-primary-rgb), 0.25);
}

.dashboard-metric--link {
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
}

.dashboard-grid {
    align-items: stretch;
}

.dashboard-grid__column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-grid__column > * {
    flex: 1 1 auto;
}

.dashboard-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.92) 100%);
    border-radius: 30px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 30px 52px rgba(var(--stela-ink-rgb), 0.12);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    padding: 1.8rem 2rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.dashboard-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(var(--stela-brand-secondary-rgb), 0.12), rgba(var(--stela-brand-primary-rgb), 0.1), rgba(var(--stela-brand-secondary-rgb), 0.1));
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.dashboard-panel::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(var(--stela-ink-rgb), 0.18), rgba(var(--stela-ink-rgb), 0));
    opacity: 0.6;
    pointer-events: none;
}

.dashboard-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 34px 60px rgba(var(--stela-brand-secondary-rgb), 0.18);
}

.dashboard-panel:hover::before {
    opacity: 1;
}

.dashboard-panel > * {
    position: relative;
    z-index: 1;
}

.dashboard-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-panel__title {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--stela-text-primary);
}

.dashboard-panel__meta {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(var(--stela-ink-rgb), 0.55);
}

.dashboard-panel__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-panel__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-panel--compact {
    padding: 1.25rem 1.4rem;
    border-radius: 18px;
}

.dashboard-panel__divider {
    height: 1px;
    width: 100%;
    background: rgba(var(--stela-ink-rgb), 0.06);
    margin: 0.75rem 0;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-list__item {
    background: var(--stela-dashboard-list-item-bg, var(--stela-surface-glass));
    border-radius: 20px;
    padding: 1.1rem 1.3rem;
    border: 1px solid var(--stela-border-muted);
    box-shadow: 0 18px 34px rgba(var(--stela-ink-rgb), 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-list__item:hover {
    border-color: rgba(var(--stela-brand-secondary-rgb), 0.35);
    box-shadow: 0 24px 40px rgba(var(--stela-brand-secondary-rgb), 0.18);
    transform: translateY(-3px);
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.dashboard-chip--primary {
    background: rgba(var(--stela-brand-secondary-rgb), 0.16);
    color: var(--stela-brand-secondary);
}

.dashboard-chip--warning {
    background: rgba(var(--stela-warning-strong-rgb), 0.18);
    color: var(--stela-warning-strong);
}

.dashboard-chip--danger {
    background: var(--stela-danger-highlight);
    color: var(--stela-danger-strong);
}

.dashboard-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    border-radius: 22px;
    background: var(--stela-dashboard-empty-bg, var(--stela-surface-muted));
    border: 1px dashed var(--stela-dashboard-empty-border);
    box-shadow: inset 0 0 0 1px var(--stela-border-subtle);
}
@media (max-width: 767.98px) {
    .dashboard-hero {
        padding: 1.6rem;
    }

    .dashboard-metric {
        padding: 1.5rem;
        min-height: 150px;
    }

    .dashboard-quick-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.6rem;
        padding-bottom: 0.4rem;
        margin: 0 -0.15rem;
    }

    .dashboard-quick-nav__item {
        flex: 0 0 auto;
    }

    .dashboard-quick-nav__icon {
        width: 30px;
        height: 30px;
    }

    .dashboard-grid__column {
        gap: 1rem;
    }
}

body .dashboard-shell .card-title,
body .dashboard-shell h4.card-title {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--stela-text-primary);
}

body .dashboard-shell .text-muted {
    color: var(--stela-text-muted) !important;
}

body .dashboard-shell .progress {
    background: var(--stela-dashboard-progress-track);
    border-radius: 999px;
    overflow: hidden;
}

body .dashboard-shell .progress-bar {
    border-radius: 999px;
    background: var(--stela-dashboard-progress-fill);
}

@media (max-width: 767.98px) {
    body .dashboard-shell {
        padding: 1.25rem;
    }

    body .dashboard-shell .card .card-body {
        padding: 1.35rem;
    }
}

/* Dashboard – Tuning (calmer, modern look) */
.dashboard-hero {
  background: linear-gradient(180deg, rgba(var(--stela-brand-secondary-rgb), 0.06), rgba(var(--stela-brand-primary-rgb), 0.05));
  box-shadow: 0 12px 28px rgba(var(--stela-ink-rgb), 0.12);
  border-color: rgba(var(--stela-ink-rgb), 0.08);
}
.dashboard-quick-nav__item {
  background: var(--stela-surface-glass);
  box-shadow: inset 0 0 0 1px var(--stela-border-muted);
}
.dashboard-quick-nav__item:hover { box-shadow: 0 10px 22px -12px rgba(var(--stela-ink-rgb), 0.3); }
.dashboard-quick-nav__item:focus-visible { outline: 2px solid rgba(var(--stela-brand-secondary-rgb), 0.5); outline-offset: 2px; }

.dashboard-metric {
  background: var(--stela-surface-raised);
  border-color: rgba(var(--stela-ink-rgb), 0.08);
  box-shadow: 0 12px 28px -16px rgba(var(--stela-ink-rgb), 0.25);
}
.dashboard-metric::after { opacity: 0.08; }
.dashboard-metric:hover { box-shadow: 0 16px 36px -18px rgba(var(--stela-ink-rgb), 0.3); }
.dashboard-metric__icon { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metric-color, var(--stela-brand-primary)) 30%, transparent); }

.dashboard-panel {
  border-radius: 22px;
  background: linear-gradient(180deg, var(--stela-surface-raised), var(--stela-surface-tint));
  box-shadow: 0 18px 40px -18px rgba(var(--stela-ink-rgb), 0.24);
}
.dashboard-panel--compact { border-radius: 16px; }

.project-status-ring { width: 110px; height: 110px; }
@media (max-width: 575.98px) { .project-status-ring { width: 92px; height: 92px; } }

@media (prefers-reduced-motion: reduce) {
  .dashboard-quick-nav__item,
  .dashboard-metric,
  .dashboard-panel,
  .project-status-tile { transition: none; }
}

/* Dashboard – 3 cards per row are handled in Blade (col-lg-4),
   here we add brand gradient + hover lift for cards. */
:root { --stela-green: var(--stela-brand-primary); }

/* Dashboard cards – clean white with STELA border */
.dashboard-panel.card,
.dashboard-metric.card {
  background: var(--stela-surface-raised) !important;
  border: 1px solid rgba(var(--stela-brand-primary-rgb), 0.28) !important;
  box-shadow: 0 18px 38px -20px rgba(var(--stela-ink-rgb), 0.24);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.dashboard-panel.card:hover,
.dashboard-metric.card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 22px 46px -22px rgba(var(--stela-ink-rgb), 0.28);
  border-color: rgba(var(--stela-brand-primary-rgb), 0.45) !important;
}

.dashboard-panel.card::before,
.dashboard-metric.card::after { content: none; }

.dashboard-panel .dashboard-panel__title,
.dashboard-panel .dashboard-panel__meta,
.dashboard-panel .dashboard-list__item,
.dashboard-panel .dashboard-empty { position: relative; z-index: 1; }
.main-content .page-content  {
    background: linear-gradient(180deg, var(--stela-page-gradient-start) 0%, var(--stela-page-gradient-end) 100%) !important;
    min-height: 100vh;
}

.rank-picker {
    width: 100%;
}

.rank-picker__select {
    width: 100%;
    border-radius: 999px;
    padding: 0.55rem 2.75rem 0.55rem 1.1rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 1px 1px rgba(var(--stela-ink-rgb), 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.9rem;
}

.rank-picker__select:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.rank-picker__select option {
    color: #111827;
    font-size: 0.92rem;
}

.rank-picker__badges {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rank-chip {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.rank-chip.is-allowed {
    background: linear-gradient(135deg, rgba(134, 239, 172, 0.25), rgba(74, 222, 128, 0.3));
    border-color: rgba(34, 197, 94, 0.55);
    color: #166534;
}

.rank-chip.is-selected {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.4), rgba(21, 128, 61, 0.55));
    border-color: rgba(21, 128, 61, 0.9);
    color: #ecfdf5;
    box-shadow: 0 6px 14px -10px rgba(21, 128, 61, 0.6);
}

.rank-chip.is-blocked {
    background: rgba(226, 232, 240, 0.65);
    border-color: rgba(148, 163, 184, 0.45);
    color: rgba(100, 116, 139, 0.85);
}

.rank-picker__summary {
    margin-top: 0.35rem;
}

.workflow-toggle {
    display: inline-flex;
}

.workflow-toggle__btn {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: rgba(248, 250, 252, 0.95);
    color: #475569;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.workflow-toggle__btn:hover {
    border-color: rgba(100, 116, 139, 0.95);
    color: #1f2937;
}

.btn-check:focus + .workflow-toggle__btn {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
}

.btn-check:checked + .workflow-toggle__btn {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.3));
    border-color: rgba(34, 197, 94, 0.6);
    color: #14532d;
    box-shadow: 0 6px 12px -8px rgba(16, 185, 129, 0.45);
}
.project-upload-dropzone {
    border: 2px dashed rgba(var(--stela-ink-rgb), 0.18);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
    position: relative;
    z-index: 2;
}
.project-upload-dropzone:hover {
    border-color: rgba(var(--stela-brand-primary-rgb), 0.75);
    background: rgba(var(--stela-brand-primary-rgb), 0.08);
}
.project-upload-dropzone.is-dragover,
.project-upload-dropzone.has-files {
    border-color: rgba(52, 144, 220, 0.9);
    background: rgba(52, 144, 220, 0.08);
    box-shadow: 0 12px 32px -22px rgba(var(--stela-ink-rgb), 0.5);
}
.project-upload-dropzone__icon i {
    font-size: 2.75rem;
}
.project-upload-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.project-upload-preview__item {
    border: 1px solid rgba(var(--stela-ink-rgb), 0.08);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    background: var(--stela-surface-raised);
    box-shadow: 0 18px 36px -24px rgba(var(--stela-ink-rgb), 0.45);
}
.project-upload-preview__media iframe {
    border: 0;
}
.project-upload-preview__media audio,
.project-upload-preview__media video {
    width: 100%;
}
.project-upload-preview__media img {
    max-height: 260px;
    width: 100%;
    object-fit: contain;
    box-shadow: 0 12px 32px -20px rgba(var(--stela-ink-rgb), 0.35);
}
.project-upload-preview__actions .btn {
    flex: 0 0 auto;
}
.project-file-preview__media iframe {
    border: 0;
    min-height: 60vh;
}

@media (max-width: 575.98px) {
    .project-upload-dropzone {
        padding: 1.75rem 1.25rem !important;
    }
}
