/* =========================================================
   StagePilot App Shell v1
   Holy-Grail-App-Layout + kompakte Business-UI

   Diese Datei ist bewusst NEU und getrennt von site.css.
   Ziel: neues Layout stabilisieren, Alt-CSS erst danach bereinigen.
   ========================================================= */

:root {
    --sp-app-font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --sp-app-font-size: 14px;
    --sp-app-line-height: 1.35;

    --sp-app-header-bg: var(--sp-surface, #fff);
    --sp-app-footer-bg: var(--sp-surface, #fff);
    --sp-app-workspace-bg: var(--sp-bg, #f3f6fb);
    --sp-app-border: var(--sp-border, #dfe3ec);

    --sp-app-header-row-height: 44px;
    --sp-app-footer-height: 44px;
    --sp-app-workspace-gap: 10px;
    --sp-app-page-padding: 10px;
}

/* ---------------------------------------------------------
   Kompakte Grundtypografie
   --------------------------------------------------------- */
html {
    font-size: var(--sp-app-font-size) !important;
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0 !important;
    overflow: hidden;
    font-family: var(--sp-app-font-family);
    font-size: var(--sp-app-font-size);
    line-height: var(--sp-app-line-height);
}

/* ---------------------------------------------------------
   Holy-Grail Shell
   Header und Footer über beide Spalten, Sidebar + Workspace
   --------------------------------------------------------- */
.sp-shell {
    display: grid;
    grid-template-columns: var(--sp-sidebar-width, 260px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) var(--sp-app-footer-height);
    grid-template-areas:
        "header header"
        "sidebar workspace"
        "footer footer";
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    background: var(--sp-app-workspace-bg);
}

.sp-app-header {
    grid-area: header;
    min-width: 0;
    background: var(--sp-app-header-bg);
    border-bottom: 1px solid var(--sp-app-border);
    z-index: 1020;
}

.sp-app-header-top {
    min-height: var(--sp-app-header-row-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 12px;
}

.sp-app-header-left,
.sp-app-header-right,
.sp-app-brand-group,
.sp-app-user-group {
    display: flex;
    align-items: center;
    min-width: 0;
}

.sp-app-header-left,
.sp-app-brand-group {
    gap: 8px;
}

.sp-app-header-right,
.sp-app-user-group {
    gap: 7px;
}

.sp-app-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    white-space: nowrap;
}

.sp-app-brand-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--sp-color-text, #20253f);
}

.sp-app-version {
    font-size: 11px;
    color: var(--sp-color-text-soft, #66708f);
    font-variant-numeric: tabular-nums;
}

.sp-app-tenant {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: min(34vw, 420px);
    height: 28px;
    padding: 0 9px;
    border: 1px solid var(--sp-app-border);
    background: var(--sp-color-surface-soft, #f8fafc);
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-app-tenant-label {
    color: var(--sp-color-text-soft, #66708f);
    font-weight: 400;
    margin-right: 5px;
}

.sp-app-user-name {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 600;
}

.sp-app-header .btn,
.sp-app-footer .btn {
    min-height: 30px;
    padding: .25rem .55rem;
    border-radius: 6px;
    box-shadow: none;
    font-size: 12px;
}

.sp-app-header .sp-app-icon-btn {
    width: 30px;
    padding-left: 0;
    padding-right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Workspace-Tabs bilden die zweite Zeile des Headers. */
#sp-tablist.sp-workspace-tabs {
    min-height: 38px;
    padding: 0 12px 9px !important;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--sp-app-header-bg);
}

#sp-tablist.sp-workspace-tabs .nav-link.sp-workspace-tab {
    min-height: 30px;
    padding: 0 9px;
    gap: 7px;
    font-size: 12px;
}

#sp-tablist.sp-workspace-tabs .sp-tab-title {
    font-weight: 600;
}

#sp-tablist.sp-workspace-tabs .sp-tab-icon {
    width: 16px;
    min-width: 16px;
    font-size: .85rem;
}

#sp-tablist.sp-workspace-tabs .sp-tab-close {
    width: 16px;
    min-width: 16px;
    height: 16px;
}

#sp-tablist.sp-workspace-tabs .nav-link.sp-workspace-tab.active::after {
    bottom: -8px;
    border-left-width: 8px;
    border-right-width: 8px;
    border-top-width: 8px;
}

/* ---------------------------------------------------------
   Sidebar: eigener Scrollbereich
   --------------------------------------------------------- */
.sp-sidebar {
    grid-area: sidebar;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
    border-right: 1px solid var(--sp-color-sidebar-border, var(--sp-app-border));
}

.sp-sidebar-nav {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-top: 6px !important;
    padding-bottom: 12px !important;
}

.sp-sidebar-nav .text-uppercase.text-muted.small {
    font-size: 10px;
    margin-top: 9px !important;
    margin-bottom: 3px !important;
}

.sp-sidebar-nav .nav-link {
    min-height: 32px;
    margin-top: 1px;
    margin-bottom: 1px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    border-radius: 7px;
    font-size: 13px;
}

.sp-nav-ico {
    width: 20px;
    min-width: 20px;
    font-size: 14px;
}

/* Bestehende Sidebar-Zustände an die neue Grid-Shell anbinden. */
body.sp-sidebar-collapsed .sp-shell {
    grid-template-columns: var(--sp-rail-width, 64px) minmax(0, 1fr);
}

body.sp-sidebar-overlay .sp-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "header"
        "workspace"
        "footer";
}

body.sp-sidebar-overlay .sp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sp-sidebar-width, 260px);
    height: 100dvh;
    z-index: 1045;
    transform: translateX(-105%);
    transition: transform .18s ease-out;
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.15);
}

body.sp-sidebar-overlay.sp-sidebar-open .sp-sidebar {
    transform: translateX(0);
}

/* ---------------------------------------------------------
   Workspace: Browserseite selbst scrollt nicht mehr.
   Jeder aktive Tab erhält seinen eigenen Scrollkontext.
   --------------------------------------------------------- */
.sp-workspace {
    grid-area: workspace;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: var(--sp-app-page-padding);
    background: var(--sp-app-workspace-bg);
}

#sp-tabpanes {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

#sp-tabpanes > .sp-tabpane {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

#sp-tabpanes > .sp-tabpane.active {
    display: block;
}

.sp-tabpane-inner {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Hilfsklassen für Masken, die den kompletten Tab ausnutzen. */
.sp-page-fill {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.sp-page-scroll {
    min-height: 0;
    overflow: auto;
}

/* ---------------------------------------------------------
   Globaler Action-Footer
   --------------------------------------------------------- */
.sp-app-footer {
    grid-area: footer;
    min-width: 0;
    min-height: var(--sp-app-footer-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 12px;
    background: var(--sp-app-footer-bg);
    border-top: 1px solid var(--sp-app-border);
    z-index: 1015;
}

.sp-app-footer-status {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
}

.sp-app-footer-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-app-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.sp-app-actions:empty::after {
    content: "";
    display: block;
    width: 1px;
    height: 30px;
}

/* ---------------------------------------------------------
   Master / Detail Grundmuster
   --------------------------------------------------------- */
.sp-master-detail {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: var(--sp-app-workspace-gap);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-master-pane,
.sp-detail-pane {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Artikelverwaltung: Explorer-artige Master/Detail-Aufteilung
   --------------------------------------------------------- */
.sp-article-manage-page {
    overflow: hidden;
}

.sp-article-manage-page .sp-article-pane-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.sp-article-manage-page .sp-article-pane-card > .card-header {
    flex: 0 0 auto;
    padding: 8px 10px;
}

.sp-article-manage-page .sp-article-pane-card > .card-body {
    min-height: 0;
    padding: 8px 10px;
}

.sp-article-manage-page .sp-article-category-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-article-manage-page .sp-article-category-hint {
    flex: 0 0 auto;
    margin-bottom: 6px !important;
    font-size: 11px;
}

.sp-article-manage-page #categoryTree {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 3px;
}

.sp-article-manage-page .sp-tree {
    font-size: 12px;
}

.sp-article-manage-page .sp-tree-ul {
    padding-left: 8px;
}

.sp-article-manage-page .sp-tree-row {
    min-height: 27px;
    padding: 3px 5px;
    gap: 4px;
    border-radius: 5px;
}

.sp-article-manage-page .sp-article-list-body {
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-article-manage-page .sp-article-list-body > #articlesList {
    min-width: 0;
}

.sp-article-manage-page .sp-article-list-body .table-responsive {
    overflow: visible;
}

.sp-article-manage-page .sp-article-table {
    font-size: 12px;
}

.sp-article-manage-page .sp-article-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding-top: 6px;
    padding-bottom: 6px;
    background: var(--sp-color-surface-soft, #f8fafc);
    box-shadow: inset 0 -1px 0 var(--sp-app-border);
}

.sp-article-manage-page .sp-article-table tbody td {
    padding-top: 5px;
    padding-bottom: 5px;
}

.sp-article-manage-page .input-group-sm,
.sp-article-manage-page .form-select-sm,
.sp-article-manage-page .form-check-label,
.sp-article-manage-page .btn-sm {
    font-size: 12px;
}

.sp-article-manage-page .card-header .btn-group-sm > .btn {
    padding: 3px 6px;
}

/* ---------------------------------------------------------
   Artikel bearbeiten: Kopf und Tabs bleiben stehen,
   nur der eigentliche Maskeninhalt scrollt.
   --------------------------------------------------------- */
.sp-article-record-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.sp-article-record-page > .sp-record-topbar {
    flex: 0 0 auto;
    min-height: 0;
    margin: 0 !important;
    padding: 2px 4px 5px !important;
    align-items: center;
}

.sp-article-record-page .sp-record-title-wrap {
    gap: 10px;
    align-items: center;
}

.sp-article-record-page .sp-record-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 1rem;
}

.sp-article-record-page .sp-record-title.sp-record-title-soft {
    font-size: 20px;
    line-height: 1.15;
}

.sp-article-record-page .sp-record-subtitle {
    font-size: 11px;
}

.sp-article-record-page .sp-record-badges {
    gap: 5px;
    margin-top: 4px !important;
}

.sp-article-record-page .sp-record-badge {
    min-height: 23px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
}

.sp-article-record-page .sp-record-badges .sp-record-badge:first-child::after {
    display: none;
}

.sp-article-record-page .sp-record-topbar > .d-flex:last-child .btn {
    min-height: 30px;
    padding: .25rem .55rem;
    font-size: 12px;
    border-radius: 6px !important;
    box-shadow: none;
}

.sp-article-record-page > form.sp-record-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.sp-article-record-page .sp-main-tabs {
    flex: 0 0 auto;
    min-height: 0;
    padding: 8px 10px 10px;
    overflow-x: auto;
    overflow-y: hidden;
}

.sp-article-record-page .sp-main-tab {
    flex: 0 0 180px;
    min-width: 180px;
    min-height: 54px;
    padding: 8px 10px;
    gap: 4px;
}

.sp-article-record-page .sp-main-tab .sp-record-nav-row {
    gap: 7px;
}

.sp-article-record-page .sp-main-tab .sp-record-nav-icon,
.sp-article-record-page .sp-main-tab .sp-record-nav-icon svg {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}

.sp-article-record-page .sp-main-tab .sp-record-nav-title {
    font-size: 12px;
    font-weight: 700;
}

.sp-article-record-page .sp-main-tab .sp-record-nav-sub {
    font-size: 10px;
    line-height: 1.15;
}

.sp-article-record-page .sp-main-tab.is-active::after,
.sp-article-record-page .sp-main-tab.active::after {
    bottom: -10px;
    border-left-width: 9px;
    border-right-width: 9px;
    border-top-width: 9px;
}

.sp-article-record-page .sp-record-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 10px 12px 12px !important;
}

.sp-article-record-page .sp-record-pane {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sp-article-record-page .card {
    border-radius: 7px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .045);
}

.sp-article-record-page .card-header {
    padding: 8px 10px;
    font-size: 12px;
}

.sp-article-record-page .card-body {
    padding: 10px;
}

.sp-article-record-page .form-label {
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 600;
}

.sp-article-record-page .form-control,
.sp-article-record-page .form-select,
.sp-article-record-page .sp-article-category-toggle {
    min-height: 32px;
    height: auto;
    padding: .28rem .48rem;
    border-radius: 5px !important;
    font-size: 12px;
}

.sp-article-record-page textarea.form-control {
    min-height: 64px;
    line-height: 1.3;
}

.sp-article-record-page .sp-pricecard-header,
.sp-article-record-page .sp-pricecard-body {
    padding-top: 7px;
    padding-bottom: 7px;
}

.sp-article-record-page .sp-price-row {
    min-height: 30px;
}

/* ---------------------------------------------------------
   Responsive: Desktop bleibt bevorzugt. Auf kleineren Displays
   bleiben die Bereiche trotzdem kontrolliert scrollbar.
   --------------------------------------------------------- */
@media (max-width: 991.98px) {
    :root {
        --sp-app-page-padding: 8px;
    }

    .sp-app-header-top {
        gap: 7px;
        padding-inline: 8px;
    }

    .sp-app-brand-name {
        display: none;
    }

    .sp-app-tenant {
        max-width: 38vw;
    }

    .sp-app-user-name {
        max-width: 150px;
    }

    .sp-article-master-detail {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(210px, 36%) minmax(280px, 1fr);
    }

    .sp-article-record-page .sp-record-topbar {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .sp-app-version,
    .sp-app-tenant-label,
    .sp-app-user-name {
        display: none;
    }

    .sp-app-tenant {
        max-width: 42vw;
    }

    .sp-app-footer-status {
        display: none;
    }

    .sp-app-footer {
        justify-content: flex-end;
    }
}

/* Header-Steuerung abhängig vom Sidebar-Modus */
.sp-app-header [data-sp-sidebar-open] {
    display: none;
}

body.sp-sidebar-overlay .sp-app-header [data-sp-sidebar-open] {
    display: inline-flex;
}

body.sp-sidebar-overlay .sp-app-header [data-sp-sidebar-toggle] {
    display: none;
}


/* =========================================================
   StagePilot App Shell v2
   Projekte / Positionen – Viewport-Master-Detail
   ========================================================= */

.sp-positions-workspace {
    --sp-positions-workspace-height: min(760px, calc(100dvh - 220px));

    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--sp-positions-workspace-height);
    min-height: 420px;
    min-width: 0;
    overflow: hidden;
    gap: 7px;
}

.sp-positions-workspace > input[name="__RequestVerificationToken"],
.sp-positions-workspace > form.d-none,
.sp-positions-workspace > .modal,
.sp-positions-workspace > [data-sp-positions-context-menu="1"] {
    flex: 0 0 auto;
}

.sp-positions-workspace .sp-positions-workspace-head {
    flex: 0 0 auto;
    min-height: 34px;
    margin: 0 2px 1px !important;
    gap: 12px;
}

.sp-positions-workspace .sp-positions-workspace-head h4 {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.sp-positions-workspace .sp-positions-workspace-head .text-muted.small {
    font-size: 10px;
}

.sp-positions-workspace .sp-subtabs {
    flex: 0 0 auto;
}

.sp-positions-workspace .sp-subtabs > .btn {
    min-height: 30px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    line-height: 1.2;
}

.sp-positions-workspace .sp-positions-workspace-toolbar {
    flex: 0 0 auto;
    min-height: 31px;
    margin: 0 2px !important;
}

.sp-positions-workspace .sp-positions-workspace-toolbar .btn {
    min-height: 29px;
    padding: 3px 8px;
    font-size: 11px;
}

.sp-positions-workspace .sp-positions-workspace-toolbar .text-muted.small {
    font-size: 10px;
}

.sp-positions-workspace .sp-positions-workflow-alert {
    flex: 0 0 auto;
    margin: 0 2px !important;
    padding: 5px 8px !important;
    font-size: 11px;
}

.sp-positions-workspace .sp-positions-entry,
.sp-positions-workspace .sp-positions-dynamic {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.sp-positions-workspace .sp-positions-entry {
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
}

.sp-positions-workspace .sp-positions-settings-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-positions-workspace .sp-positions-settings-card > .card-header {
    padding: 5px 8px !important;
    min-height: 27px;
    font-size: 11px !important;
}

.sp-positions-workspace .sp-positions-settings-card > .card-body {
    padding: 7px 8px !important;
}

.sp-positions-workspace .sp-positions-settings-card .row {
    --bs-gutter-x: 8px;
    --bs-gutter-y: 5px;
}

.sp-positions-workspace .sp-positions-settings-card .form-label {
    margin-bottom: 2px;
    font-size: 10px !important;
    line-height: 1.15;
}

.sp-positions-workspace .sp-positions-settings-card .form-control,
.sp-positions-workspace .sp-positions-settings-card .form-select,
.sp-positions-workspace .sp-positions-settings-card .btn {
    min-height: 30px !important;
    height: 30px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 11px;
    border-radius: 5px !important;
}

.sp-positions-workspace .sp-positions-master-detail {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
    align-items: stretch !important;
}

.sp-positions-workspace .sp-positions-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-positions-workspace .sp-positions-pane > .card-header {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 8px !important;
    font-size: 11px !important;
    line-height: 1.2;
}

.sp-positions-workspace .sp-positions-pane > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    margin: 0;
    padding: 7px !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-positions-workspace .sp-positions-catalog-scroll {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.sp-positions-workspace .sp-positions-position-scroll {
    overflow: auto !important;
    background: #f3f6fb;
}

.sp-positions-workspace .sp-pos-header {
    position: sticky;
    top: 0;
    z-index: 12;
    background: #fff;
    box-shadow: 0 1px 0 rgba(148, 163, 184, .28);
}

.sp-positions-workspace .accordion-button {
    min-height: 30px;
    padding: 5px 8px !important;
    font-size: 11px;
}

.sp-positions-workspace .accordion-body {
    padding: 5px !important;
}

.sp-positions-workspace .sp-cat-row {
    min-height: 25px;
    padding: 3px 6px !important;
    gap: 5px;
    border-radius: 5px;
    font-size: 11px;
}

.sp-positions-workspace .sp-cat-caret {
    width: 15px;
    flex-basis: 15px;
}

.sp-positions-workspace .sp-cat-children {
    padding-left: 14px;
}

.sp-positions-workspace .sp-cat-filter,
.sp-positions-workspace [data-sp-wg-filter="1"] {
    min-height: 29px !important;
    padding: 3px 6px;
    font-size: 11px;
}

.sp-positions-workspace .sp-pos-sheet {
    border-radius: 6px !important;
}

.sp-positions-workspace .sp-pos-header {
    min-height: 30px;
    font-size: 10px;
}

.sp-positions-workspace .sp-pos-row {
    min-height: 31px;
}

.sp-positions-workspace .sp-pos-row .form-control,
.sp-positions-workspace .sp-pos-row .form-select {
    min-height: 27px !important;
    height: 27px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 11px;
    border-radius: 4px !important;
}

.sp-positions-workspace .sp-pos-row textarea.form-control {
    height: auto;
    min-height: 48px !important;
}

.sp-positions-workspace .sp-pos-handle,
.sp-positions-workspace .sp-pos-toggle,
.sp-positions-workspace .sp-pos-avail-icon,
.sp-positions-workspace .sp-note-indicator {
    font-size: 11px;
}

.sp-positions-workspace .sp-pos-summary {
    margin-top: 8px !important;
    padding-top: 8px;
    font-size: 11px;
}

.sp-positions-workspace .sp-positions-dynamic:not(.d-none) {
    display: block;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 2px;
}

[data-sp-project-root="1"] .sp-project-pane [data-sp-positions-panel="1"].sp-positions-workspace > .sp-positions-workspace-head,
[data-sp-project-root="1"] .sp-project-pane [data-sp-positions-panel="1"].sp-positions-workspace > .sp-positions-workspace-toolbar,
[data-sp-project-root="1"] .sp-project-pane [data-sp-positions-panel="1"].sp-positions-workspace > .sp-positions-workflow-alert,
[data-sp-project-root="1"] .sp-project-pane [data-sp-positions-panel="1"].sp-positions-workspace > .sp-positions-entry {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

[data-sp-project-pane="positions"]:not(.d-none) {
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .sp-positions-workspace {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-positions-workspace .sp-positions-entry {
        overflow: visible;
    }

    .sp-positions-workspace .sp-positions-master-detail {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(260px, 38vh) minmax(360px, 58vh);
        overflow: visible;
    }

    .sp-positions-workspace .sp-positions-pane {
        min-height: 260px;
    }

    .sp-positions-workspace .sp-positions-splitter {
        display: none !important;
    }

    [data-sp-project-pane="positions"]:not(.d-none) {
        overflow: visible;
    }
}



/* =========================================================
   StagePilot App Shell v3
   Projektbereich – vollständiger Viewport-Workspace
   ========================================================= */

/* Der äußere Workspace-Tab darf bei Projekten nicht mehr selbst scrollen. */
.sp-tabpane-inner.sp-project-host {
    overflow: hidden !important;
    scrollbar-gutter: auto;
}

[data-sp-project-root="1"].sp-project-workspace-page {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 0 !important;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Kompakter Projektkopf
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-project-topbar {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 4px 10px 5px !important;
    gap: 10px !important;
    align-items: center !important;
}

[data-sp-project-root="1"] .sp-record-title-wrap {
    gap: 9px !important;
    align-items: center !important;
}

[data-sp-project-root="1"] .sp-project-avatar {
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    font-size: 16px !important;
    line-height: 1;
}

[data-sp-project-root="1"] .sp-record-title.sp-record-title-soft {
    margin-bottom: 1px !important;
    font-size: 20px !important;
    line-height: 1.05 !important;
}

[data-sp-project-root="1"] .sp-record-subtitle {
    margin-bottom: 3px !important;
    font-size: 11px !important;
    line-height: 1.15;
}

[data-sp-project-root="1"] .sp-record-badges {
    gap: 4px !important;
}

[data-sp-project-root="1"] .sp-record-badge {
    min-height: 22px !important;
    padding: 2px 7px !important;
    font-size: 10px !important;
    line-height: 1.15;
}

[data-sp-project-root="1"] .sp-project-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    max-width: 48%;
}

[data-sp-project-root="1"] .sp-project-topbar-actions > form,
[data-sp-project-root="1"] .sp-project-topbar-actions > .btn {
    margin: 0 !important;
}

[data-sp-project-root="1"] .sp-project-topbar-actions .btn {
    min-height: 28px !important;
    padding: 3px 7px !important;
    font-size: 10px !important;
    line-height: 1.15;
}

[data-sp-project-root="1"] .sp-project-billing-mode-hint,
[data-sp-project-root="1"] .sp-project-billing-lock-note {
    flex-basis: 100%;
    margin-top: 0 !important;
    font-size: 9px !important;
    line-height: 1.15;
    text-align: right;
}

/* ---------------------------------------------------------
   Projekt-Navigation: deutlich flacher, sechs produktive Tabs
   passen auf normalen Desktopbreiten in eine Zeile.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-project-record-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 0 !important;
    background: transparent;
}

[data-sp-project-root="1"] .sp-project-nav-shell {
    flex: 0 0 auto;
    padding: 0 10px !important;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: #fff;
    overflow: visible !important;
}

[data-sp-project-root="1"] .sp-project-nav-frame {
    display: flex;
    min-width: 0;
    min-height: 52px;
    margin: 0 !important;
    padding: 0 0 7px !important;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-btn {
    flex: 1 1 150px !important;
    min-width: 138px !important;
    min-height: 52px !important;
    padding: 6px 9px 5px !important;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-row {
    gap: 6px !important;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-icon,
[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-icon svg {
    width: 17px !important;
    height: 17px !important;
    flex-basis: 17px !important;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-title {
    font-size: 12px !important;
    line-height: 1.05 !important;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-sub {
    margin-top: 2px;
    font-size: 9px !important;
    line-height: 1.05 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-sp-project-root="1"] .sp-project-nav-frame .sp-record-nav-btn.active::after {
    bottom: -8px !important;
    border-left-width: 8px !important;
    border-right-width: 8px !important;
    border-top-width: 8px !important;
}

/* Noch nicht implementierte Versionen belegen keinen Platz im produktiven UI. */
[data-sp-project-root="1"] .sp-project-nav-future {
    display: none !important;
}

/* ---------------------------------------------------------
   Aktiver Projekt-Tab erhält die gesamte Resthöhe.
   Nur sein eigener Inhalt scrollt.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-project-record-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 7px 10px 8px !important;
    overflow: hidden;
}

[data-sp-project-root="1"] .sp-project-tabcontent {
    display: block !important;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

[data-sp-project-root="1"] .sp-project-pane {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

[data-sp-project-root="1"] .sp-project-pane.d-none {
    display: none !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="positions"]:not(.d-none) {
    display: block;
    overflow: hidden !important;
}

/* Kopf-/Subprojektkarten kompakter und in der verfügbaren Höhe nutzbar. */
[data-sp-project-root="1"] .sp-project-panel-card {
    margin: 0 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

[data-sp-project-root="1"] .sp-project-panel-card > .card-header {
    min-height: 30px;
    padding: 6px 9px !important;
    font-size: 11px;
}

[data-sp-project-root="1"] .sp-project-panel-card > .card-body {
    padding: 9px !important;
}

[data-sp-project-root="1"] .sp-project-box {
    padding: 9px !important;
}

[data-sp-project-root="1"] .row.g-3 {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 7px;
}

[data-sp-project-root="1"] .form-label,
[data-sp-project-root="1"] .form-label.small.text-muted {
    margin-bottom: 2px !important;
    font-size: 10px !important;
    line-height: 1.15;
}

[data-sp-project-root="1"] .form-control,
[data-sp-project-root="1"] .form-select,
[data-sp-project-root="1"] .sp-treecombo > .btn {
    min-height: 31px !important;
    height: 31px;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
}

[data-sp-project-root="1"] textarea.form-control {
    height: auto;
    min-height: 58px !important;
}

[data-sp-project-root="1"] .sp-project-audit {
    margin-top: 7px !important;
    gap: 5px !important;
    font-size: 9px !important;
}

[data-sp-project-root="1"] .sp-project-audit-item {
    min-height: 24px !important;
    padding: 4px 7px !important;
}

/* Alte lokale Aktionsleisten bleiben als Fallback im Razor erhalten,
   sind in der neuen Shell aber nicht mehr doppelt sichtbar. */
.sp-shell [data-sp-project-root="1"] .sp-project-inline-actions,
.sp-shell [data-sp-project-root="1"] .sp-project-card-inline-footer {
    display: none !important;
}

/* Subprojektliste nutzt die komplette Tabhöhe. */
[data-sp-project-root="1"] [data-sp-project-pane="subprojects"] > .sp-project-panel-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

[data-sp-project-root="1"] [data-sp-project-pane="subprojects"] > .sp-project-panel-card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="subprojects"] .table-responsive {
    height: 100%;
    min-height: 0;
    overflow: auto;
}

/* ---------------------------------------------------------
   Positionen: obere Bedienflächen maximal verdichten.
   Der eigentliche Katalog/Positionsbereich bekommt die Resthöhe.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-positions-workspace {
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    gap: 4px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-workspace-head {
    min-height: 29px;
    margin: 0 !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-workspace-head .text-muted.small {
    display: none;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-workspace-head h4 {
    font-size: 13px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-subtabs > .btn {
    min-height: 27px !important;
    height: 27px;
    padding: 3px 8px !important;
    font-size: 10px !important;
}

/* Die Lagerfreigabe lebt sichtbar im globalen Footer; der Originalbutton
   bleibt im DOM und wird vom Footer ausgelöst/gespiegelt. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-workspace-toolbar {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-workflow-alert {
    margin: 0 !important;
    padding: 4px 7px !important;
    font-size: 10px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-entry,
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-dynamic {
    flex: 1 1 auto;
    min-height: 0;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-entry {
    gap: 4px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card > .card-header {
    display: none !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card > .card-body {
    padding: 4px 6px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card .row {
    --bs-gutter-x: 6px;
    --bs-gutter-y: 3px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card .form-label {
    margin-bottom: 1px !important;
    font-size: 9px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card .form-control,
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card .form-select,
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-settings-card .btn {
    min-height: 27px !important;
    height: 27px !important;
    font-size: 10px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-master-detail {
    flex: 1 1 auto;
    min-height: 0;
}

/* ---------------------------------------------------------
   Disposition: Karte/Tabelle bis zum unteren App-Footer.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-positions-dynamic:not(.d-none) {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    overflow: hidden !important;
    padding: 0 !important;
}

[data-sp-project-root="1"] .sp-positions-dynamic > [data-sp-dispo-panel="1"] {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 6px !important;
}

[data-sp-project-root="1"] [data-sp-dispo-panel="1"] > .card-header {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 9px !important;
    font-size: 11px;
}

[data-sp-project-root="1"] [data-sp-dispo-panel="1"] > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

[data-sp-project-root="1"] [data-sp-dispo-panel="1"] .sp-dispo-canvas {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

[data-sp-project-root="1"] [data-sp-dispo-panel="1"] .sp-dispo-scroll {
    width: 100%;
    height: 100% !important;
    max-height: none !important;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

[data-sp-project-root="1"] [data-sp-dispo-panel="1"] .sp-sticky-head {
    position: sticky;
    top: 0;
    z-index: 8;
}

/* ---------------------------------------------------------
   Personal: beide Spalten nutzen die volle Resthöhe.
   Die Ressourcenspalte und das Board scrollen jeweils intern.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-positions-dynamic > [data-sp-personnel-panel="1"] {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-layout {
    height: 100% !important;
    min-height: 0 !important;
    gap: 8px !important;
    align-items: stretch !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-card {
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-sidebar {
    position: relative !important;
    top: auto !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-card-header {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 9px !important;
    font-size: 11px;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-search {
    flex: 0 0 auto;
    padding: 7px 8px 0 !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-search input {
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 11px;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-filters {
    flex: 0 0 auto;
    margin: 6px 8px 7px !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-filter {
    min-width: 72px !important;
    height: 29px !important;
    font-size: 10px;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-resource-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 7px 8px !important;
    overflow: auto !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-board-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 7px !important;
    overflow: auto !important;
}

[data-sp-project-root="1"] [data-sp-personnel-panel="1"] .sp-personnel-help {
    flex: 0 0 auto;
    padding: 6px 8px !important;
    font-size: 10px !important;
    line-height: 1.2;
}

/* Transport-Platzhalter ebenfalls auf Resthöhe ausrichten. */
[data-sp-project-root="1"] .sp-positions-dynamic > .card {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 !important;
}

/* ---------------------------------------------------------
   Globale Projektaktionen im App-Footer
   --------------------------------------------------------- */
.sp-project-footer-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-project-footer-action-group[hidden] {
    display: none !important;
}

#sp-global-actions [data-sp-mirror-active][hidden] {
    display: none !important;
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-project-host {
        overflow: auto !important;
    }

    [data-sp-project-root="1"].sp-project-workspace-page {
        height: auto;
        overflow: visible;
    }

    [data-sp-project-root="1"] .sp-project-topbar {
        align-items: flex-start !important;
        flex-wrap: wrap;
    }

    [data-sp-project-root="1"] .sp-project-topbar-actions {
        max-width: 100%;
        width: 100%;
        justify-content: flex-start;
    }

    [data-sp-project-root="1"] .sp-project-record-shell,
    [data-sp-project-root="1"] .sp-project-record-content,
    [data-sp-project-root="1"] .sp-project-tabcontent,
    [data-sp-project-root="1"] .sp-project-pane {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    [data-sp-project-root="1"] .sp-positions-workspace {
        height: auto !important;
        overflow: visible;
    }

    [data-sp-project-root="1"] .sp-positions-dynamic:not(.d-none) {
        overflow: visible !important;
    }
}


/* =========================================================
   StagePilot App Shell v4
   Positionen – Liste bis zum Footer + einklappbare Zusammenfassung
   ========================================================= */

/* Die rechte Positionskarte verwaltet Liste und Summary getrennt.
   Dadurch kann die Summary nie mehr unter den globalen App-Footer geraten. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-position-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f3f6fb;
}

/* Nur dieser Bereich scrollt vertikal/horizontal durch die Positionen. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right .sp-positions-position-scroll {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none !important;
    padding: 7px 7px 10px !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #f3f6fb;
}

/* Links ebenfalls etwas Sicherheitsabstand am Listenende. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-catalog-scroll {
    padding-bottom: 12px !important;
}

/* Die Summary ist im Normalzustand nur eine sehr flache Leiste.
   Bei Bedarf öffnet sie sich nach oben und nimmt dann bewusst etwas Listenhöhe ein. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-drawer {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .05);
    overflow: hidden;
    font-size: 11px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 31px;
    padding: 5px 30px 5px 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--sp-color-text, #20253f);
    background: #fff;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle::-webkit-details-marker {
    display: none;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle::after {
    content: "▴";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: var(--sp-color-text-soft, #66708f);
    font-size: 11px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-drawer[open] > .sp-pos-summary-toggle::after {
    content: "▾";
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle:hover {
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 5%, #fff);
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle-title {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 10px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-toggle-hint {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-content {
    max-height: min(190px, 30dvh);
    padding: 8px 10px 10px;
    overflow: auto;
    border-top: 1px solid color-mix(in srgb, var(--sp-app-border, #dfe3ec) 75%, transparent);
    background: #fff;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px);
    gap: 24px;
    align-items: start;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-left,
[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-right {
    min-width: 0;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-values,
[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-total-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-values {
    max-width: 520px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-total-grid {
    margin-left: auto;
    max-width: 360px;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-total-grid .form-control {
    width: 145px;
    min-height: 27px !important;
    height: 27px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
}

/* Beim Öffnen der Summary wird ausschließlich die Positionsliste etwas kleiner.
   Der Projektbereich selbst bleibt weiterhin fest im App-Viewport. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-drawer[open] {
    max-height: min(225px, 36dvh);
}

@media (max-width: 991.98px) {
    [data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-position-body {
        display: block;
        overflow: visible !important;
    }

    [data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right .sp-positions-position-scroll {
        max-height: 65vh !important;
    }

    [data-sp-project-root="1"] .sp-positions-workspace .sp-pos-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}


/* =========================================================
   StagePilot App Shell v5
   Projekt-Viewport – sichere untere Kante / Summary-Footer
   ========================================================= */

/* ---------------------------------------------------------
   Projekt-Kopfdaten
   Der Projekt-Pane selbst wird NICHT gescrollt. Stattdessen
   füllt die Karte die verfügbare Resthöhe und nur ihr Body
   scrollt. Damit können Auditdaten und weitere Felder am Ende
   niemals hinter dem globalen App-Footer verschwinden.
   --------------------------------------------------------- */
[data-sp-project-root="1"] [data-sp-project-pane="head"]:not(.d-none) {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card > .card-header {
    flex: 0 0 auto;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    padding-bottom: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Auditbereich am Ende nicht direkt an die Scrollkante kleben. */
[data-sp-project-root="1"] [data-sp-project-pane="head"] .sp-project-audit {
    margin-bottom: 4px !important;
}

/* ---------------------------------------------------------
   Positionen
   Die Zusammenfassung ist jetzt ein echter Card-Footer der
   rechten Positionskarte. Die Card-Body-Höhe wird deshalb
   automatisch um die sichtbare Summary-Leiste reduziert.
   --------------------------------------------------------- */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-position-body {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right .sp-positions-position-scroll {
    flex: 1 1 0 !important;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0 !important;
    max-height: none !important;
    padding: 7px 7px 10px !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-summary-footer {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 0 !important;
    background: #fff !important;
    overflow: hidden;
}

/* Der Drawer selbst braucht als Card-Footer keine eigene obere
   Außenkante oder Schattenebene mehr. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-summary-footer > .sp-pos-summary-drawer {
    width: 100%;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Eingeklappt wird exakt die Leistenhöhe reserviert. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-summary-footer > .sp-pos-summary-drawer:not([open]) {
    height: 31px;
    max-height: 31px;
}

/* Aufgeklappt darf die Summary wachsen; die Positionsliste gibt
   dafür automatisch Platz frei. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-summary-footer > .sp-pos-summary-drawer[open] {
    height: auto;
    max-height: min(225px, 36dvh);
}

/* Sicherheitsabstand: letzter Listeninhalt bleibt oberhalb der
   festen Summary-Leiste vollständig erreichbar. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-pos-sheet-body {
    padding-bottom: 8px;
}

@media (max-width: 991.98px) {
    [data-sp-project-root="1"] [data-sp-project-pane="head"]:not(.d-none),
    [data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card {
        height: auto;
        overflow: visible !important;
    }

    [data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card > .card-body {
        overflow: visible !important;
    }

    [data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-summary-footer {
        position: static;
    }
}

/* =========================================================
   StagePilot App Shell v6
   Projekt-Viewport – reale Höhe bis zur globalen Action-Bar

   Hintergrund:
   Der Projektbereich liegt in einem dynamischen Workspace-Tab.
   height:100% allein ist dort nicht robust genug, weil mehrere
   verschachtelte Container eigene Padding-/Overflow-Kontexte haben.
   stagepilot-shell.js misst deshalb die tatsächlich sichtbare Höhe
   zwischen Projektoberkante und globalem Footer und setzt
   --sp-project-viewport-height.
   ========================================================= */

/* Der Host eines Projekts darf selbst nicht scrollen. Die Klasse wird
   von stagepilot-shell.js beim Laden eines Projekts gesetzt.
   :has() ist zusätzlich ein Fallback für aktuelle Chromium-Browser. */
.sp-tabpane-inner.sp-project-host,
.sp-tabpane-inner:has([data-sp-project-root="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

/* Das Projekt endet exakt oberhalb des globalen Footers. */
[data-sp-project-root="1"].sp-project-workspace-page {
    height: var(--sp-project-viewport-height, 100%) !important;
    max-height: var(--sp-project-viewport-height, 100%) !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Die gesamte Kette unterhalb der Projektnavigation muss schrumpfen
   dürfen. Sonst drückt ein inneres Pane den unteren Rand nach außen. */
[data-sp-project-root="1"] .sp-project-record-shell,
[data-sp-project-root="1"] .sp-project-record-content,
[data-sp-project-root="1"] .sp-project-tabcontent,
[data-sp-project-root="1"] .sp-project-pane {
    min-height: 0 !important;
    max-height: 100%;
}

[data-sp-project-root="1"] .sp-project-record-content {
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-project-tabcontent {
    overflow: hidden !important;
}

/* ---------------------------------------------------------
   Kopfdaten
   --------------------------------------------------------- */
[data-sp-project-root="1"] [data-sp-project-pane="head"]:not(.d-none) {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card > .card-body {
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 22px;
    padding-bottom: 22px !important;
}

[data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card > .card-body > form {
    min-height: min-content;
    padding-bottom: 2px;
}

/* ---------------------------------------------------------
   Positionen
   --------------------------------------------------------- */
[data-sp-project-root="1"] [data-sp-project-pane="positions"]:not(.d-none),
[data-sp-project-root="1"] [data-sp-project-pane="positions"]:not(.d-none) > [data-sp-positions-panel="1"] {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-entry {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-master-detail {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-left,
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Der Summary-Footer ist ein echter, immer reservierter Flex-Sibling
   des Positions-Card-Bodys. Er liegt nicht mehr im Listen-Scrollbereich. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-summary-footer {
    display: block !important;
    position: relative;
    z-index: 4;
    flex: 0 0 auto !important;
    min-height: 31px !important;
    max-height: min(225px, 36dvh) !important;
    overflow: hidden !important;
    background: #fff !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-summary-footer > .sp-pos-summary-drawer:not([open]) {
    display: block !important;
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-summary-footer > .sp-pos-summary-drawer[open] {
    display: block !important;
    min-height: 31px !important;
    max-height: min(225px, 36dvh) !important;
}

/* Der eigentliche Positions-Scrollbereich darf niemals den Footer
   verdrängen. */
[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right > .sp-positions-position-body {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

[data-sp-project-root="1"] .sp-positions-workspace .sp-positions-right .sp-positions-position-scroll {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-project-host,
    .sp-tabpane-inner:has([data-sp-project-root="1"]) {
        overflow: auto !important;
    }

    [data-sp-project-root="1"].sp-project-workspace-page {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    [data-sp-project-root="1"] [data-sp-project-pane="head"]:not(.d-none),
    [data-sp-project-root="1"] [data-sp-project-pane="head"] > .sp-project-panel-card,
    [data-sp-project-root="1"] [data-sp-project-pane="positions"]:not(.d-none),
    [data-sp-project-root="1"] [data-sp-project-pane="positions"]:not(.d-none) > [data-sp-positions-panel="1"] {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* =========================================================
   StagePilot App Shell v7
   Projektliste – kompakte Filter + eigene Resthöhenliste
   ========================================================= */

/* Die Projektliste nutzt den kompletten Workspace-Tab und darf nicht
   zusammen mit der gesamten Seite scrollen. */
.sp-tabpane-inner:has([data-sp-project-list-root="1"]),
.sp-tabpane-inner.sp-project-list-host {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

[data-sp-project-list-root="1"].sp-project-list-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 7px;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Überschrift
   --------------------------------------------------------- */
.sp-project-list-page .sp-project-list-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 29px;
    padding: 0 2px;
}

.sp-project-list-page .sp-project-list-heading-main {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.sp-project-list-page .sp-project-list-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--sp-color-text, #20253f);
}

.sp-project-list-page .sp-project-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 21px;
    padding: 0 6px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 18%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #6d61b5);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-project-list-page .sp-project-list-heading-hint {
    min-width: 0;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------
   Filterbereich
   Zwei kompakte Zeilen statt einer hohen Bootstrap-Card.
   --------------------------------------------------------- */
.sp-project-list-page .sp-project-list-filter-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}

.sp-project-list-page .sp-project-list-filter-card > .card-body {
    padding: 6px 8px !important;
}

.sp-project-list-page .sp-project-list-filter-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 5px 7px;
    align-items: end;
}

.sp-project-list-page .sp-project-filter-field {
    min-width: 0;
}

.sp-project-list-page .sp-project-filter-search {
    grid-column: span 4;
}

.sp-project-list-page .sp-project-filter-status,
.sp-project-list-page .sp-project-filter-type {
    grid-column: span 2;
}

.sp-project-list-page .sp-project-filter-actions {
    grid-column: span 4;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.sp-project-list-page .sp-project-filter-event-from,
.sp-project-list-page .sp-project-filter-event-to,
.sp-project-list-page .sp-project-filter-dispo-from,
.sp-project-list-page .sp-project-filter-dispo-to {
    grid-column: span 3;
}

.sp-project-list-page .sp-project-list-filter-grid .form-label {
    margin-bottom: 2px !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px !important;
    font-weight: 600;
    line-height: 1.1;
}

.sp-project-list-page .sp-project-list-filter-grid .form-control,
.sp-project-list-page .sp-project-list-filter-grid .form-select,
.sp-project-list-page .sp-project-list-filter-grid .btn {
    min-height: 29px !important;
    height: 29px !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    border-radius: 5px !important;
    font-size: 10px !important;
    line-height: 1.2;
}

.sp-project-list-page .sp-project-filter-actions .btn {
    min-width: 78px;
}

/* ---------------------------------------------------------
   Liste
   Die Card erhält die gesamte Resthöhe. Nur die Tabelle scrollt.
   --------------------------------------------------------- */
.sp-project-list-page .sp-project-list-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}

.sp-project-list-page .sp-project-list-card > .card-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 0;
    overflow: hidden;
}

.sp-project-list-page .sp-project-list-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-project-list-page .sp-project-list-table {
    min-width: 1120px;
    font-size: 11px;
}

.sp-project-list-page .sp-project-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    height: 30px;
    padding: 5px 7px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc) !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(148, 163, 184, .18);
}

.sp-project-list-page .sp-project-list-table tbody td {
    padding: 6px 7px !important;
    vertical-align: middle;
    border-color: color-mix(in srgb, var(--sp-app-border, #dfe3ec) 68%, transparent);
}

.sp-project-list-page .sp-project-row {
    cursor: pointer;
    outline: none;
}

.sp-project-list-page .sp-project-row:focus-visible {
    box-shadow: inset 3px 0 0 var(--sp-color-primary, #6d61b5);
}

.sp-project-list-page .sp-project-row-title {
    max-width: 560px;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-project-list-page .sp-project-row-note {
    max-width: 560px;
    margin-top: 2px;
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-project-list-page .sp-project-no {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sp-project-list-page .sp-project-status-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 42px;
    font-size: 13px;
}

.sp-project-list-page .sp-project-col-no {
    width: 132px;
}

.sp-project-list-page .sp-project-col-state {
    width: 66px;
}

.sp-project-list-page .sp-project-col-status {
    width: 145px;
}

.sp-project-list-page .sp-project-col-type {
    width: 140px;
}

.sp-project-list-page .sp-project-col-range {
    width: 220px;
}

.sp-project-list-page .sp-project-list-empty {
    padding: 28px 12px !important;
    color: var(--sp-color-text-soft, #66708f);
    text-align: center;
    font-size: 11px;
}

/* Kontextmenü etwas kompakter an den neuen Density-Standard anpassen. */
.sp-project-list-page [data-sp-project-context-menu="1"] {
    padding: 4px;
    border-radius: 6px;
    font-size: 11px;
}

.sp-project-list-page [data-sp-project-context-menu="1"] .dropdown-item {
    min-height: 29px;
    padding: 5px 8px;
    border-radius: 4px;
}

@media (max-width: 1199.98px) {
    .sp-project-list-page .sp-project-filter-search {
        grid-column: span 6;
    }

    .sp-project-list-page .sp-project-filter-status,
    .sp-project-list-page .sp-project-filter-type {
        grid-column: span 3;
    }

    .sp-project-list-page .sp-project-filter-actions {
        grid-column: span 12;
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner:has([data-sp-project-list-root="1"]),
    .sp-tabpane-inner.sp-project-list-host {
        overflow: auto !important;
    }

    [data-sp-project-list-root="1"].sp-project-list-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-project-list-page .sp-project-list-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .sp-project-list-page .sp-project-filter-search,
    .sp-project-list-page .sp-project-filter-status,
    .sp-project-list-page .sp-project-filter-type,
    .sp-project-list-page .sp-project-filter-event-from,
    .sp-project-list-page .sp-project-filter-event-to,
    .sp-project-list-page .sp-project-filter-dispo-from,
    .sp-project-list-page .sp-project-filter-dispo-to,
    .sp-project-list-page .sp-project-filter-actions {
        grid-column: span 6;
    }

    .sp-project-list-page .sp-project-list-card,
    .sp-project-list-page .sp-project-list-card > .card-body,
    .sp-project-list-page .sp-project-list-scroll {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-project-list-page .sp-project-list-scroll {
        max-height: 68vh;
        overflow: auto;
    }
}

@media (max-width: 640px) {
    .sp-project-list-page .sp-project-filter-search,
    .sp-project-list-page .sp-project-filter-status,
    .sp-project-list-page .sp-project-filter-type,
    .sp-project-list-page .sp-project-filter-event-from,
    .sp-project-list-page .sp-project-filter-event-to,
    .sp-project-list-page .sp-project-filter-dispo-from,
    .sp-project-list-page .sp-project-filter-dispo-to,
    .sp-project-list-page .sp-project-filter-actions {
        grid-column: span 12;
    }

    .sp-project-list-page .sp-project-filter-actions .btn {
        flex: 1 1 0;
    }
}

/* =========================================================
   StagePilot App Shell v8
   Warehouse – Listen + Prozess als Vollhöhen-Workspace
   ========================================================= */

/* Warehouse-Workspace selbst scrollt auf Desktop nicht. */
.sp-tabpane-inner.sp-warehouse-host,
.sp-tabpane-inner.sp-warehouse-list-host,
.sp-tabpane-inner:has([data-sp-wh-process="1"]),
.sp-tabpane-inner:has([data-sp-wh-listpage]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

/* ---------------------------------------------------------
   Warehouse Listen
   --------------------------------------------------------- */
.sp-warehouse-list-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 7px;
    overflow: hidden;
}

.sp-warehouse-list-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 1px 2px 2px;
}

.sp-warehouse-list-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sp-warehouse-list-title-wrap h4 {
    font-size: 17px;
    line-height: 1.15;
    font-weight: 700;
    white-space: nowrap;
}

.sp-warehouse-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 11px;
    background: #fff;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-warehouse-list-hint {
    min-width: 0;
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-warehouse-view-switch {
    flex: 0 0 auto;
}

.sp-warehouse-view-switch > .btn,
.sp-warehouse-state-filter > .btn {
    min-height: 28px !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
}

.sp-warehouse-filter-card,
.sp-warehouse-list-card {
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}

.sp-warehouse-filter-card {
    flex: 0 0 auto;
}

.sp-warehouse-filter-card > .card-body {
    padding: 6px 7px !important;
}

.sp-warehouse-filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sp-warehouse-list-search {
    width: min(360px, 34vw);
    margin-left: auto;
}

.sp-warehouse-list-search-wide {
    width: min(430px, 38vw);
}

.sp-warehouse-list-search .input-group-text,
.sp-warehouse-list-search .form-control {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 10px !important;
}

.sp-warehouse-list-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.sp-warehouse-list-card > .card-body {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-warehouse-list-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-warehouse-list-table {
    min-width: 980px;
    font-size: 11px;
}

.sp-warehouse-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    height: 30px;
    padding: 5px 7px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc) !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(148, 163, 184, .18);
}

.sp-warehouse-list-table tbody td {
    padding: 6px 7px !important;
    vertical-align: middle;
    border-color: color-mix(in srgb, var(--sp-app-border, #dfe3ec) 68%, transparent);
}

.sp-warehouse-list-row {
    cursor: pointer;
}

.sp-warehouse-list-row:hover > td {
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 4%, #fff);
}

.sp-warehouse-project-title {
    max-width: 620px;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-warehouse-project-meta {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.15;
}

.sp-warehouse-cancel-reason {
    max-width: 620px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--bs-danger);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-wh-id-cell {
    font-variant-numeric: tabular-nums;
}

.sp-wh-col-id { width: 82px; }
.sp-wh-col-status { width: 165px; }
.sp-wh-col-number { width: 90px; }
.sp-wh-col-date { width: 155px; }
.sp-wh-col-phase { width: 125px; }

.sp-warehouse-empty {
    padding: 28px 12px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 11px;
    text-align: center;
}

/* ---------------------------------------------------------
   Warehouse Prozess
   --------------------------------------------------------- */
.sp-warehouse-process-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 6px;
    overflow: hidden;
}

.sp-wh-process-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    min-height: 54px;
    padding: 2px 2px 4px;
}

.sp-wh-process-title-block {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.sp-wh-process-avatar {
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 13%, #fff);
    color: var(--sp-color-primary, #6d61b5);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
}

.sp-wh-process-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sp-wh-process-title {
    max-width: min(800px, 52vw);
    margin: 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-wh-process-title-row .badge {
    min-height: 21px;
    padding: 3px 7px;
    font-size: 9px;
    line-height: 1.1;
}

.sp-wh-process-subtitle,
.sp-wh-process-timestamps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.15;
}

.sp-wh-process-timestamps {
    gap: 12px;
}

.sp-wh-process-print-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sp-wh-process-print-actions .btn {
    min-height: 28px;
    padding: 3px 7px;
    font-size: 10px;
}

.sp-wh-process-alerts {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sp-wh-compact-alert {
    flex: 1 1 320px;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    font-size: 10px;
    line-height: 1.25;
}

.sp-wh-process-meta-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-wh-process-meta-card > .card-body {
    padding: 6px 8px !important;
}

.sp-wh-process-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(210px, .85fr) minmax(210px, .85fr);
    gap: 6px 14px;
    min-width: 0;
}

.sp-wh-meta-item {
    min-width: 0;
}

.sp-wh-meta-label {
    display: block;
    margin-bottom: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.sp-wh-meta-value {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Die echten Warehouse-Buttons bleiben für warehouse.js im DOM,
   werden aber nicht doppelt dargestellt. */
.sp-wh-action-sources {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.sp-wh-process-main {
    flex: 1 1 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 7px;
    width: 100%;
    height: 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-wh-lines-card,
.sp-wh-packages-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}

.sp-wh-lines-header,
.sp-wh-packages-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 5px 7px !important;
    background: #fff;
}

.sp-wh-lines-subtitle,
.sp-wh-packages-subtitle {
    margin-top: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    line-height: 1.1;
}

.sp-wh-process-search {
    width: min(390px, 38vw);
}

.sp-wh-process-search .input-group-text,
.sp-wh-process-search .form-control {
    min-height: 27px !important;
    height: 27px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 10px !important;
}

.sp-wh-lines-body {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-wh-lines-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-wh-lines-card table[data-sp-wh-lines="1"] {
    min-width: 1240px;
    font-size: 10px;
}

.sp-wh-lines-card table[data-sp-wh-lines="1"] thead th {
    position: sticky;
    top: 0;
    z-index: 12;
    height: 29px;
    padding: 4px 6px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc) !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sp-wh-lines-card table[data-sp-wh-lines="1"] tbody td {
    padding: 4px 6px !important;
    vertical-align: middle;
    border-color: color-mix(in srgb, var(--sp-app-border, #dfe3ec) 65%, transparent);
}

.sp-wh-lines-card table[data-sp-wh-lines="1"] .form-control {
    min-height: 27px !important;
    height: 27px !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
}

.sp-wh-lines-card table[data-sp-wh-lines="1"] .btn-sm {
    min-height: 26px;
    padding: 2px 5px;
    font-size: 9px;
}

.sp-wh-lines-card .sp-wh-actions-meta {
    margin-bottom: 2px;
    gap: 5px;
    font-size: 8px !important;
}

.sp-wh-lines-card .sp-wh-actions-grid {
    gap: 4px !important;
}

.sp-wh-lines-card .sp-wh-actions-slot {
    gap: 4px;
}

.sp-wh-lines-card .sp-wh-actions-ph {
    height: 26px;
}

.sp-wh-lines-card tr.sp-wh-cat-row > td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff) !important;
}

.sp-wh-lines-card .sp-wh-cat-title {
    font-size: 9px;
    font-weight: 700;
}

.sp-wh-return-locked {
    background: #f3f5f7 !important;
    opacity: .85;
    cursor: not-allowed;
}

tr.sp-wh-overbook td .sp-wh-overbook-text {
    color: var(--bs-danger);
    font-weight: 600;
}

/* ---------------------------------------------------------
   Cases / Packages als rechte Arbeitsleiste
   --------------------------------------------------------- */
.sp-wh-packages-pane {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-wh-packages-pane > .sp-wh-packages-card {
    height: 100%;
}

.sp-wh-packages-header .btn {
    min-height: 27px;
    padding: 2px 6px;
    font-size: 9px;
}

.sp-wh-packages-body {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-wh-packages-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-wh-packages-table {
    min-width: 300px;
    font-size: 9px;
}

.sp-wh-packages-table thead th {
    position: sticky;
    top: 0;
    z-index: 7;
    padding: 5px 6px !important;
    background: var(--sp-color-surface-soft, #f8fafc) !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.sp-wh-packages-table tbody td {
    padding: 6px !important;
    vertical-align: top;
}

.sp-wh-packages-action-col {
    width: 64px;
}

.sp-wh-package-meta {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
}

.sp-wh-package-lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sp-wh-package-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 14px;
    gap: 5px;
    align-items: center;
    min-width: 0;
}

.sp-wh-package-line-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-wh-package-line-qty {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-wh-package-line-remove {
    line-height: 1;
}

.sp-wh-packages-empty {
    padding: 16px 12px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.35;
}

/* ---------------------------------------------------------
   Globaler Warehouse-Footer
   --------------------------------------------------------- */
.sp-warehouse-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.sp-warehouse-footer-actions > [hidden] {
    display: none !important;
}

.sp-warehouse-footer-actions .btn {
    white-space: nowrap;
}

@media (max-width: 1250px) {
    .sp-wh-process-main {
        grid-template-columns: minmax(0, 1fr) minmax(270px, 300px);
    }

    .sp-wh-process-meta-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .sp-wh-meta-value {
        white-space: normal;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-warehouse-host,
    .sp-tabpane-inner.sp-warehouse-list-host,
    .sp-tabpane-inner:has([data-sp-wh-process="1"]),
    .sp-tabpane-inner:has([data-sp-wh-listpage]) {
        overflow: auto !important;
    }

    .sp-warehouse-list-page,
    .sp-warehouse-process-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-warehouse-list-heading,
    .sp-warehouse-filterbar,
    .sp-wh-process-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-warehouse-list-search,
    .sp-warehouse-list-search-wide,
    .sp-wh-process-search {
        width: 100%;
        margin-left: 0;
    }

    .sp-warehouse-list-card,
    .sp-warehouse-list-card > .card-body,
    .sp-warehouse-list-scroll {
        height: auto;
        min-height: 0;
    }

    .sp-warehouse-list-scroll {
        max-height: 68vh;
        overflow: auto;
    }

    .sp-wh-process-main {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .sp-wh-lines-card,
    .sp-wh-packages-pane,
    .sp-wh-packages-card,
    .sp-wh-lines-body,
    .sp-wh-packages-body {
        height: auto;
        min-height: 0;
    }

    .sp-wh-lines-scroll {
        max-height: 62vh;
    }

    .sp-wh-packages-scroll {
        max-height: 42vh;
    }

    .sp-wh-process-title {
        max-width: 82vw;
    }

    .sp-wh-process-print-actions {
        flex-wrap: wrap;
    }

    .sp-wh-process-meta-grid {
        grid-template-columns: 1fr;
    }
}

.sp-wh-process-page .min-w-0,
.sp-wh-packages-card .min-w-0 {
    min-width: 0;
}

/* =========================================================
   StagePilot App Shell – Werkstatt v1
   Listen- und Bearbeitungsworkspace
   ========================================================= */

/* Der äußere Workspace-Tab scrollt bei Werkstattseiten nicht mit. */
.sp-tabpane-inner.sp-workshop-host,
.sp-tabpane-inner:has([data-sp-workshop-list="1"]),
.sp-tabpane-inner:has([data-sp-workshop-edit="1"]) {
    overflow: hidden !important;
    scrollbar-gutter: auto;
}

.sp-workshop-list-page,
.sp-workshop-edit-page {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Gemeinsamer kompakter Werkstattkopf
   --------------------------------------------------------- */
.sp-workshop-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.sp-workshop-heading-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 18%, #dfe3ec);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    font-size: 18px;
    line-height: 1;
}

.sp-workshop-heading-title-row,
.sp-workshop-edit-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.sp-workshop-heading-title,
.sp-workshop-edit-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sp-color-text, #20253f);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.08;
}

.sp-workshop-heading-subtitle,
.sp-workshop-edit-eyebrow {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    line-height: 1.2;
}

.sp-workshop-count-badge {
    flex: 0 0 auto;
    min-width: 24px;
    font-size: 9px;
}

/* ---------------------------------------------------------
   Werkstattliste
   --------------------------------------------------------- */
.sp-workshop-list-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-workshop-list-heading {
    flex: 0 0 auto;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.sp-workshop-list-kpis {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.sp-workshop-kpi {
    min-width: 65px;
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fff;
}

.sp-workshop-kpi.is-warning {
    border-color: color-mix(in srgb, var(--bs-warning) 48%, #dfe3ec);
    background: color-mix(in srgb, var(--bs-warning) 7%, #fff);
}

.sp-workshop-kpi-value {
    color: var(--sp-color-text, #20253f);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-workshop-kpi-label {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
}

.sp-workshop-filter-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-workshop-filter-body {
    padding: 6px 8px !important;
}

.sp-workshop-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) minmax(130px, .7fr) minmax(120px, .65fr) minmax(170px, .9fr) auto;
    gap: 6px;
    align-items: end;
}

.sp-workshop-filter-grid > * {
    min-width: 0;
}

.sp-workshop-filter-card .form-label {
    margin-bottom: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 600;
}

.sp-workshop-filter-card .form-control,
.sp-workshop-filter-card .form-select,
.sp-workshop-filter-card .btn {
    min-height: 29px;
    height: 29px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 5px !important;
    font-size: 10px;
}

.sp-workshop-filter-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sp-workshop-filter-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 18px;
    min-height: 21px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid color-mix(in srgb, var(--sp-app-border, #dfe3ec) 72%, transparent);
    font-size: 9px;
}

.sp-workshop-filter-options .form-check {
    min-height: 0;
    margin: 0;
}

.sp-workshop-filter-options .form-check-input {
    width: 13px;
    height: 13px;
    margin-top: .05rem;
}

.sp-workshop-filter-hint {
    margin-left: auto;
    color: var(--sp-color-text-soft, #66708f);
}

.sp-workshop-list-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 0;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-workshop-list-card-body {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-workshop-list-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-workshop-table {
    min-width: 1120px;
    font-size: 10px;
}

.sp-workshop-table thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 6px 7px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec) !important;
    background: var(--sp-color-surface-soft, #f8fafc) !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    box-shadow: 0 1px 0 rgba(148, 163, 184, .16);
}

.sp-workshop-table tbody td {
    padding: 6px 7px !important;
    border-color: color-mix(in srgb, var(--sp-app-border, #dfe3ec) 62%, transparent);
}

.sp-workshop-table tbody tr[data-sp-workshop-row="1"] {
    cursor: pointer;
}

.sp-workshop-table tbody tr[data-sp-workshop-row="1"]:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 48%, transparent);
    outline-offset: -2px;
}

.sp-workshop-row-overdue > td {
    background: color-mix(in srgb, var(--bs-danger) 3.5%, #fff);
}

.sp-workshop-title-cell {
    min-width: 210px;
    max-width: 360px;
}

.sp-workshop-row-title,
.sp-workshop-source-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-workshop-priority {
    white-space: nowrap;
}

.sp-workshop-priority-20,
.sp-workshop-priority-30 {
    font-weight: 700;
}

.sp-workshop-priority-30 {
    color: var(--bs-danger);
}

.sp-workshop-empty-cell {
    padding: 28px 10px !important;
    color: var(--sp-color-text-soft, #66708f) !important;
    text-align: center;
}

/* ---------------------------------------------------------
   Werkstatt bearbeiten – fester Kopf + interne Scrollfläche
   --------------------------------------------------------- */
.sp-workshop-edit-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-workshop-edit-heading {
    flex: 0 0 auto;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 2px;
}

.sp-workshop-edit-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 4px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
}

.sp-workshop-edit-meta .badge {
    padding: 3px 6px;
    font-size: 8px;
}

.sp-workshop-edit-audit {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(105px, auto));
    gap: 5px;
}

.sp-workshop-edit-audit > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 7px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 5px;
    background: #fff;
}

.sp-workshop-edit-audit span {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
}

.sp-workshop-edit-audit strong {
    color: var(--sp-color-text, #20253f);
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}

.sp-workshop-add-order-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
    overflow: visible !important;
    z-index: 15;
}

.sp-workshop-add-order-card > .card-body {
    padding: 6px 8px !important;
    overflow: visible !important;
}

.sp-workshop-add-order-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    align-items: end;
}

.sp-workshop-add-order-picker {
    min-width: 0;
}

.sp-workshop-add-order-card .form-label,
.sp-workshop-edit-scroll .form-label {
    margin-bottom: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.15;
}

.sp-workshop-add-order-card .form-control,
.sp-workshop-add-order-card .btn,
.sp-workshop-edit-scroll .form-control,
.sp-workshop-edit-scroll .form-select {
    min-height: 29px;
    height: 29px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 5px !important;
    font-size: 10px;
}

.sp-workshop-add-order-button {
    min-width: 190px;
    min-height: 29px !important;
    height: 29px;
    padding: 3px 9px;
    font-size: 10px;
}

.sp-workshop-edit-scroll {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0 2px 10px 0;
}

.sp-workshop-edit-scroll > * + * {
    margin-top: 6px;
}

.sp-workshop-edit-scroll .sp-workshop-panel,
.sp-workshop-edit-scroll .sp-workshop-order,
.sp-workshop-files-drawer {
    margin-bottom: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-workshop-edit-scroll .sp-workshop-panel > .card-header,
.sp-workshop-edit-scroll .sp-workshop-order > .card-header {
    min-height: 30px;
    padding: 6px 8px !important;
    font-size: 10px;
}

.sp-workshop-edit-scroll .sp-workshop-panel > .card-body,
.sp-workshop-edit-scroll .sp-workshop-order > .collapse > .card-body {
    padding: 7px 8px !important;
}

.sp-workshop-validation:empty {
    display: none;
}

.sp-workshop-validation {
    margin: 0 0 6px !important;
    padding: 6px 8px;
    border: 1px solid color-mix(in srgb, var(--bs-danger) 28%, var(--sp-app-border, #dfe3ec));
    border-radius: 5px;
    background: color-mix(in srgb, var(--bs-danger) 4%, #fff);
    font-size: 10px;
}

.sp-workshop-orders-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 7px 0 5px;
    padding: 0 2px;
}

.sp-workshop-orders-title {
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 700;
}

.sp-workshop-orders-count {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    white-space: nowrap;
}

.sp-workshop-empty-orders {
    margin: 0 !important;
    padding: 7px 9px !important;
    font-size: 10px;
}

.sp-workshop-order + .sp-workshop-order {
    margin-top: 6px !important;
}

.sp-workshop-order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    background: #fbfdff !important;
}

.sp-workshop-order-title-wrap {
    min-width: 0;
}

.sp-workshop-order-title-row {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 6px;
}

.sp-workshop-order-index {
    flex: 0 0 auto;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    font-weight: 700;
}

.sp-workshop-order-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.sp-workshop-order-subtitle {
    margin-top: 1px;
    max-width: min(880px, 70vw);
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-workshop-order-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.sp-workshop-order-badges .badge {
    padding: 2px 5px;
    font-size: 7px;
}

.sp-workshop-order-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sp-workshop-order-actions .btn {
    min-height: 25px;
    height: 25px;
    padding: 2px 6px;
    border-radius: 5px !important;
    font-size: 9px;
}

.sp-workshop-order-body .row {
    --bs-gutter-x: 7px;
    --bs-gutter-y: 5px;
}

/* Fehlerbild und Reparaturbericht nebeneinander statt zwei sehr hoher Blöcke. */
.sp-workshop-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.sp-workshop-editor-block {
    min-width: 0;
}

.sp-workshop-editor-block .sp-rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px !important;
}

.sp-workshop-editor-block .sp-rich-toolbar .btn {
    min-height: 23px;
    height: 23px;
    padding: 2px 5px;
    border-radius: 4px !important;
    font-size: 8px;
}

.sp-workshop-edit-page .sp-rich-editor {
    min-height: 92px !important;
    height: 92px !important;
    padding: 5px 7px !important;
    overflow: auto;
    line-height: 1.3;
}

/* ---------------------------------------------------------
   Dateien: Native Details-Drawer – standardmäßig platzsparend
   --------------------------------------------------------- */
.sp-workshop-files-drawer {
    overflow: visible;
    background: #fff;
}

.sp-workshop-files-summary {
    position: relative;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 28px 5px 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: #fbfdff;
}

.sp-workshop-files-summary::-webkit-details-marker {
    display: none;
}

.sp-workshop-files-summary::after {
    content: "▸";
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
}

.sp-workshop-files-drawer[open] > .sp-workshop-files-summary::after {
    content: "▾";
}

.sp-workshop-files-drawer > .card-body {
    padding: 7px 8px !important;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
}

.sp-workshop-order-files-section {
    margin-top: 8px !important;
}

.sp-workshop-order-files-drawer + .sp-workshop-order-files-drawer {
    margin-top: 5px !important;
}

.sp-workshop-scroll-end {
    height: 4px;
}

/* ---------------------------------------------------------
   Gerätepicker kompakter, aber vorhandene JS-Hooks unverändert
   --------------------------------------------------------- */
.sp-workshop-edit-page .sp-device-tree-toggle {
    min-height: 29px !important;
    height: 29px !important;
}

.sp-workshop-edit-page .sp-device-tree-dropdown {
    z-index: 1080;
    max-height: min(430px, 58vh);
    border-radius: 7px;
}

.sp-workshop-edit-page .sp-device-tree-list {
    max-height: min(365px, 49vh);
    padding: 4px;
}

.sp-workshop-edit-page .sp-device-tree-nodebtn {
    padding-top: 5px;
    padding-bottom: 5px;
    border-radius: 5px;
    font-size: 10px;
}

.sp-workshop-edit-page .sp-device-tree-main {
    font-size: 10px;
}

.sp-workshop-edit-page .sp-device-tree-sub {
    font-size: 8px;
}

/* ---------------------------------------------------------
   Globaler Werkstatt-Footer
   --------------------------------------------------------- */
.sp-workshop-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.sp-workshop-footer-actions .btn {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .sp-workshop-filter-grid {
        grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(125px, 1fr));
    }

    .sp-workshop-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .sp-workshop-editor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-workshop-host,
    .sp-tabpane-inner:has([data-sp-workshop-list="1"]),
    .sp-tabpane-inner:has([data-sp-workshop-edit="1"]) {
        overflow: auto !important;
    }

    .sp-workshop-list-page,
    .sp-workshop-edit-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-workshop-list-heading,
    .sp-workshop-edit-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-workshop-list-kpis,
    .sp-workshop-edit-audit {
        width: 100%;
    }

    .sp-workshop-list-kpis .sp-workshop-kpi,
    .sp-workshop-edit-audit > div {
        flex: 1 1 0;
    }

    .sp-workshop-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sp-workshop-filter-search,
    .sp-workshop-filter-actions {
        grid-column: 1 / -1;
    }

    .sp-workshop-filter-actions {
        justify-content: flex-start;
    }

    .sp-workshop-filter-hint {
        width: 100%;
        margin-left: 0;
    }

    .sp-workshop-list-card,
    .sp-workshop-list-card-body {
        height: auto;
        min-height: 0;
    }

    .sp-workshop-list-scroll {
        max-height: 68vh;
    }

    .sp-workshop-add-order-form {
        grid-template-columns: 1fr;
    }

    .sp-workshop-add-order-button {
        width: 100%;
    }

    .sp-workshop-edit-scroll {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .sp-workshop-edit-title {
        white-space: normal;
    }

    .sp-workshop-order-header {
        flex-direction: column;
    }

    .sp-workshop-order-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .sp-workshop-order-subtitle {
        max-width: 90vw;
    }
}

@media (max-width: 640px) {
    .sp-workshop-filter-grid {
        grid-template-columns: 1fr;
    }

    .sp-workshop-filter-search,
    .sp-workshop-filter-actions {
        grid-column: auto;
    }

    .sp-workshop-list-kpis,
    .sp-workshop-edit-audit {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .sp-workshop-heading-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }
}

/* =========================================================
   StagePilot App Shell v9
   Adressen – Vollhöhenliste, Datensatz-Workspace, Kontakte
   ========================================================= */

.sp-tabpane-inner.sp-address-host,
.sp-tabpane-inner:has([data-sp-address-list="1"]),
.sp-tabpane-inner:has([data-sp-address-manage="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

.sp-address-list-page,
.sp-address-edit-page {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    font-size: 12px;
}

/* ---------------------------------------------------------
   Gemeinsamer Kopf
   --------------------------------------------------------- */
.sp-address-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.sp-address-heading-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 18%, #dfe3ec);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-primary, #6d61b5);
}

.sp-address-heading-icon svg {
    width: 22px;
    height: 22px;
}

.sp-address-heading-monogram {
    color: var(--sp-color-text, #20253f);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .03em;
}

.sp-address-heading-title-row,
.sp-address-edit-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.sp-address-heading-title,
.sp-address-edit-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sp-color-text, #20253f);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.08;
}

.sp-address-heading-subtitle,
.sp-address-edit-eyebrow {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    line-height: 1.2;
}

.sp-address-count-badge,
.sp-address-id-badge {
    flex: 0 0 auto;
    font-size: 9px;
}

/* ---------------------------------------------------------
   Adressliste
   --------------------------------------------------------- */
.sp-address-list-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-address-list-heading {
    flex: 0 0 auto;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.sp-address-list-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 29px;
    padding: 5px 9px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fff;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    white-space: nowrap;
}

.sp-address-summary-divider {
    color: #b2b8c8;
}

.sp-address-filter-card {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-address-filter-body {
    padding: 7px 8px !important;
}

.sp-address-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(520px, 2.4fr) auto;
    gap: 8px;
    align-items: end;
}

.sp-address-filter-grid > * {
    min-width: 0;
}

.sp-address-filter-card .form-label,
.sp-address-filter-label {
    display: block;
    margin-bottom: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
}

.sp-address-filter-card .form-control,
.sp-address-filter-card .btn {
    min-height: 31px;
    height: 31px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 5px !important;
    font-size: 11px;
}

.sp-address-role-filter {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 5px;
}

.sp-address-role-filter > .sp-address-filter-label {
    flex: 0 0 100%;
}

.sp-address-filter-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    margin: 0;
    cursor: pointer;
}

.sp-address-filter-chip > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-address-filter-chip > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 4px 9px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 5px;
    background: #fff;
    color: var(--sp-color-text, #20253f);
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.sp-address-filter-chip > input:checked + span {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 42%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 9%, #fff);
    color: var(--sp-color-primary, #574c9c);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp-color-primary, #6d61b5) 9%, transparent);
}

.sp-address-filter-chip > input:focus-visible + span {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 34%, transparent);
    outline-offset: 1px;
}

.sp-address-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.sp-address-list-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 7px !important;
    box-shadow: 0 1px 7px rgba(15, 23, 42, .04) !important;
}

.sp-address-list-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-address-list-scroll {
    flex: 1 1 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-address-table {
    min-width: 780px;
    font-size: 11.5px;
}

.sp-address-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 6px 8px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: #f7f8fb;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .015em;
    white-space: nowrap;
}

.sp-address-table > tbody > tr > td {
    padding: 6px 8px;
    vertical-align: middle;
    border-color: color-mix(in srgb, var(--sp-app-border, #dfe3ec) 72%, transparent);
}

.sp-address-row {
    cursor: pointer;
}

.sp-address-row:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 40%, transparent);
    outline-offset: -2px;
}

.sp-address-name-cell {
    min-width: 280px;
}

.sp-address-display-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-display-address {
    margin-top: 1px;
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.sp-address-role-badges .badge {
    font-size: 9px;
    font-weight: 600;
}

.sp-address-empty-cell {
    height: 90px;
    color: var(--sp-color-text-soft, #66708f) !important;
    text-align: center;
    vertical-align: middle !important;
}

/* ---------------------------------------------------------
   Address Manage – kompakter Datensatz-Workspace
   --------------------------------------------------------- */
.sp-address-edit-page {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-address-edit-heading {
    flex: 0 0 auto;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.sp-address-edit-title-row {
    margin-top: 1px;
}

.sp-address-edit-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.sp-address-edit-badges .badge {
    font-size: 8.5px;
    font-weight: 600;
}

.sp-address-edit-audit {
    display: grid;
    grid-template-columns: repeat(2, minmax(115px, auto));
    gap: 5px;
}

.sp-address-edit-audit > div {
    min-width: 115px;
    padding: 5px 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fff;
}

.sp-address-edit-audit span,
.sp-address-edit-audit strong {
    display: block;
}

.sp-address-edit-audit span {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8.5px;
    font-weight: 600;
}

.sp-address-edit-audit strong {
    margin-top: 1px;
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sp-address-success {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    font-size: 10.5px;
}

.sp-address-delete-form {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sp-address-manage-form {
    flex: 1 1 0;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: 0;
    min-width: 0;
    min-height: 0;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.sp-address-role-card {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 5px 7px !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 7px !important;
    background: #fff !important;
}

.sp-address-edit-page .sp-record-rolebar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 !important;
    padding: 0 !important;
}

.sp-address-edit-page .sp-record-rolechip {
    position: relative;
    margin: 0 !important;
    cursor: pointer;
}

.sp-address-edit-page .sp-record-rolechip > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-address-edit-page .sp-record-rolebox {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 5px;
    background: #fff;
    color: var(--sp-color-text, #20253f);
    font-size: 10.5px;
}

.sp-address-edit-page .sp-record-roleindicator {
    display: inline-block;
    flex: 0 0 10px;
    width: 10px;
    min-width: 10px;
    max-width: 10px;
    height: 10px;
    min-height: 10px;
    max-height: 10px;
    box-sizing: border-box;
    border: 1px solid #aeb5c5;
    border-radius: 999px;
    background: #fff;
    aspect-ratio: 1 / 1;
}

.sp-address-edit-page .sp-record-rolechip > input:checked + .sp-record-rolebox {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 42%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #574c9c);
}

.sp-address-edit-page .sp-record-rolechip > input:checked + .sp-record-rolebox .sp-record-roleindicator {
    border-color: var(--sp-color-primary, #6d61b5);
    background: var(--sp-color-primary, #6d61b5);
    box-shadow: inset 0 0 0 2px #fff;
}

/* Horizontaler Datensatz-Navigator */
.sp-address-nav {
    flex: 0 0 auto;
    display: flex !important;
    align-items: stretch;
    gap: 3px !important;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 7px !important;
    background: #fff !important;
    scrollbar-width: thin;
}

.sp-address-nav .sp-record-nav-btn {
    position: relative;
    flex: 0 0 auto;
    min-width: 118px;
    min-height: 43px;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1px;
    margin: 0 !important;
    padding: 5px 8px !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: transparent !important;
    color: var(--sp-color-text, #20253f) !important;
    text-align: left;
    box-shadow: none !important;
}

.sp-address-nav .sp-record-nav-btn:hover {
    background: #f7f8fb !important;
}

.sp-address-nav .sp-record-nav-btn.is-active {
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 9%, #fff) !important;
    color: var(--sp-color-primary, #574c9c) !important;
}

.sp-address-nav .sp-record-nav-btn.is-active::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 1px;
    height: 2px;
    border-radius: 2px;
    background: var(--sp-color-primary, #6d61b5);
}

.sp-address-nav .sp-record-nav-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.sp-address-nav .sp-record-nav-icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sp-address-nav .sp-record-nav-icon svg {
    width: 14px;
    height: 14px;
}

.sp-address-nav .sp-record-nav-title {
    overflow: hidden;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-nav .sp-record-nav-sub {
    width: 100%;
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8.5px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-content {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 7px !important;
    background: #fff !important;
}

.sp-address-edit-page .sp-record-pane {
    display: none !important;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 9px !important;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.sp-address-edit-page .sp-record-pane.is-active:not(.d-none) {
    display: block !important;
}

.sp-address-edit-page .sp-record-grid {
    display: grid !important;
    gap: 8px !important;
    align-items: start;
}

.sp-address-edit-page .sp-record-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sp-address-edit-page .sp-record-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sp-address-edit-page .sp-record-grid.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sp-address-edit-page .sp-col-span-2 { grid-column: span 2; }
.sp-address-edit-page .sp-col-span-3 { grid-column: span 3; }
.sp-address-edit-page .sp-col-span-4 { grid-column: span 4; }
.sp-address-edit-page .sp-col-span-5 { grid-column: span 5; }

.sp-address-edit-page .sp-field {
    min-width: 0;
}

.sp-address-edit-page .form-label {
    margin-bottom: 2px !important;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px !important;
    font-weight: 600;
    line-height: 1.15;
}

.sp-address-edit-page .form-control,
.sp-address-edit-page .form-select {
    min-height: 31px !important;
    height: 31px;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    border-radius: 5px !important;
    font-size: 11px !important;
}

.sp-address-edit-page textarea.form-control {
    height: auto !important;
    min-height: 62px !important;
    line-height: 1.35;
}

.sp-address-edit-page .sp-field-checks {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    min-height: 53px;
}

.sp-address-edit-page .form-check {
    min-height: 18px;
    margin: 0;
    font-size: 10.5px;
}

.sp-address-edit-page .form-check-input {
    margin-top: .15em;
}

.sp-address-edit-page .sp-record-subcard {
    margin: 0 !important;
    padding: 9px !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 6px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.sp-address-edit-page .sp-record-subcard + .sp-record-subcard {
    margin-top: 8px !important;
}

.sp-address-edit-page .sp-record-subcard-title {
    margin-bottom: 7px;
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 700;
}

.sp-address-edit-page .sp-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.sp-address-edit-page .sp-activity-group {
    min-width: 0;
    padding: 7px;
    border: 1px solid color-mix(in srgb, var(--sp-app-border, #dfe3ec) 82%, transparent);
    border-radius: 5px;
    background: #fbfcfe;
}

.sp-address-edit-page .sp-activity-group-title {
    margin-bottom: 5px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sp-address-edit-page .sp-activity-item {
    min-height: 22px;
    align-items: center;
    padding: 3px 5px 3px 24px;
    border-radius: 4px;
}

.sp-address-edit-page .sp-activity-item:hover {
    background: #f5f7fb;
}

.sp-address-edit-page [data-pane-page="absences"] .table-responsive {
    max-height: 46vh;
    overflow: auto;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 5px;
}

.sp-address-edit-page [data-pane-page="absences"] thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f8fb;
    font-size: 9.5px;
}

.sp-address-edit-page [data-pane-page="absences"] td {
    font-size: 10.5px;
}

.sp-address-inline-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
}

.sp-shell .sp-address-inline-actions {
    display: none !important;
}

/* ---------------------------------------------------------
   Ansprechpartner – Partial behält alle vorhandenen JS-Hooks
   --------------------------------------------------------- */
.sp-address-contacts-list {
    min-width: 0;
}

.sp-address-contacts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
}

.sp-address-contacts-toolbar .btn {
    min-height: 29px;
    height: 29px;
    padding: 3px 8px;
    font-size: 10px;
}

.sp-address-contacts-empty {
    padding: 26px 10px;
    color: var(--sp-color-text-soft, #66708f);
    text-align: center;
}

.sp-address-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.sp-address-contact-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.sp-address-contact-card:hover {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 28%, #dfe3ec);
    background: #fcfcff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.sp-address-contact-card:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 38%, transparent);
    outline-offset: 1px;
}

.sp-address-contact-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 16%, #dfe3ec);
    border-radius: 50%;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 800;
}

.sp-address-contact-main {
    min-width: 0;
}

.sp-address-contact-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 7px;
}

.sp-address-contact-name {
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-contact-subtitle {
    margin-top: 1px;
    overflow: hidden;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-contact-title-row .badge,
.sp-address-contact-skills .badge {
    font-size: 8.5px;
    font-weight: 600;
}

.sp-address-contact-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 10px;
    margin-top: 5px;
}

.sp-address-contact-details > div {
    min-width: 0;
    display: flex;
    gap: 5px;
    font-size: 9.5px;
}

.sp-address-contact-details span {
    flex: 0 0 34px;
    color: var(--sp-color-text-soft, #66708f);
}

.sp-address-contact-details a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-address-contact-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.sp-address-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-address-contact-actions .btn {
    min-width: 68px;
    min-height: 25px;
    height: 25px;
    padding: 2px 5px;
    font-size: 9px;
}

/* ---------------------------------------------------------
   Ansprechpartner-Modal
   --------------------------------------------------------- */
.sp-address-edit-page [data-sp-contact-modal] .modal-dialog {
    max-width: 820px;
}

.sp-address-edit-page [data-sp-contact-modal] .modal-header,
.sp-address-edit-page [data-sp-contact-modal] .modal-footer {
    padding: 8px 10px;
}

.sp-address-edit-page [data-sp-contact-modal] .modal-body {
    padding: 10px;
}

.sp-address-contact-form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
}

.sp-address-contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 8px;
}

.sp-address-contact-form .form-label {
    margin-bottom: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    font-weight: 600;
}

.sp-address-contact-form .form-control {
    min-height: 31px;
    height: 31px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 5px;
    font-size: 11px;
}

.sp-address-contact-skills-panel {
    margin-top: 9px;
    padding: 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fbfcfe;
}

.sp-address-contact-skills-title {
    margin-bottom: 6px;
    font-size: 10.5px;
    font-weight: 700;
}

.sp-address-contact-skill-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.sp-address-contact-skill-group {
    min-width: 0;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--sp-app-border, #dfe3ec) 78%, transparent);
    border-radius: 5px;
    background: #fff;
}

.sp-address-contact-skill-group-title {
    margin-bottom: 5px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sp-address-contact-skill-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 7px;
}

.sp-address-contact-form .form-check {
    min-width: 0;
    margin: 0;
    font-size: 10px;
}

.sp-address-contact-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
}

.sp-address-contact-form-actions .btn {
    min-height: 29px;
    height: 29px;
    padding: 3px 8px;
    font-size: 10px;
}

/* ---------------------------------------------------------
   Globaler Adress-Footer
   --------------------------------------------------------- */
.sp-address-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.sp-address-footer-actions .btn {
    white-space: nowrap;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1280px) {
    .sp-address-filter-grid {
        grid-template-columns: minmax(230px, 1fr) minmax(420px, 1.8fr) auto;
    }

    .sp-address-contact-card {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .sp-address-contact-avatar {
        width: 34px;
        height: 34px;
    }

    .sp-address-contact-actions {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-address-host,
    .sp-tabpane-inner:has([data-sp-address-list="1"]),
    .sp-tabpane-inner:has([data-sp-address-manage="1"]) {
        overflow: auto !important;
    }

    .sp-address-list-page,
    .sp-address-edit-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-address-list-heading,
    .sp-address-edit-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-address-filter-grid {
        grid-template-columns: 1fr;
    }

    .sp-address-filter-actions {
        justify-content: flex-start;
    }

    .sp-address-list-card,
    .sp-address-list-card-body {
        height: auto;
        min-height: 0;
    }

    .sp-address-list-scroll {
        height: auto;
        max-height: 68vh;
    }

    .sp-address-edit-audit {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-address-manage-form {
        height: auto;
        min-height: 0;
        overflow: visible !important;
    }

    .sp-address-content {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .sp-address-edit-page .sp-record-pane {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sp-address-edit-page .sp-record-grid.cols-4,
    .sp-address-edit-page .sp-record-grid.cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-address-edit-page .sp-col-span-4,
    .sp-address-edit-page .sp-col-span-5 {
        grid-column: span 2;
    }

    .sp-address-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sp-address-list-summary {
        width: 100%;
        white-space: normal;
    }

    .sp-address-role-filter {
        align-items: stretch;
    }

    .sp-address-filter-chip {
        flex: 1 1 calc(50% - 5px);
    }

    .sp-address-filter-chip > span {
        width: 100%;
    }

    .sp-address-edit-page .sp-record-grid.cols-2,
    .sp-address-edit-page .sp-record-grid.cols-4,
    .sp-address-edit-page .sp-record-grid.cols-5 {
        grid-template-columns: 1fr;
    }

    .sp-address-edit-page .sp-col-span-2,
    .sp-address-edit-page .sp-col-span-3,
    .sp-address-edit-page .sp-col-span-4,
    .sp-address-edit-page .sp-col-span-5 {
        grid-column: auto;
    }

    .sp-address-edit-page .sp-activity-grid,
    .sp-address-contact-form-grid,
    .sp-address-contact-skill-groups,
    .sp-address-contact-skill-items {
        grid-template-columns: 1fr;
    }

    .sp-address-contact-details {
        grid-template-columns: 1fr;
    }
}

/* Rollenabhängige Tabs müssen trotz der flex-Regel wirklich ausgeblendet bleiben. */
.sp-address-nav .sp-record-nav-btn.d-none {
    display: none !important;
}

/* =========================================================
   StagePilot App Shell – Dienstleistungen
   ========================================================= */

.sp-tabpane-inner.sp-service-host,
.sp-tabpane-inner:has([data-sp-services-manage="1"]),
.sp-tabpane-inner:has([data-sp-service-edit="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

.sp-action-source {
    position: fixed !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.sp-service-manage-page,
.sp-service-edit-page {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
}

.sp-service-manage-heading,
.sp-service-edit-heading {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 1px;
}

.sp-service-heading-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-service-heading-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 16%, #dfe3ec);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 6%, #fff);
    color: var(--sp-color-primary, #574c9c);
}

.sp-service-heading-icon svg {
    width: 21px;
    height: 21px;
}

.sp-service-heading-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.sp-service-heading-title {
    min-width: 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-service-heading-subtitle {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 11px;
    line-height: 1.25;
}

.sp-service-count-badge {
    min-width: 27px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    color: var(--sp-color-text, #20253f) !important;
    font-size: 10px;
    font-weight: 700;
}

.sp-service-manage-summary {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 11px;
    white-space: nowrap;
}

.sp-service-summary-divider {
    color: #a6adbd;
}

/* ---------------------------------------------------------
   Verwaltung: Kategorien + Liste
   --------------------------------------------------------- */
.sp-service-manage-layout {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 255px) minmax(0, 1fr);
    gap: 7px;
    overflow: hidden;
}

.sp-service-category-card,
.sp-service-list-card,
.sp-service-master-card,
.sp-service-price-card {
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    overflow: hidden;
}

.sp-service-category-card,
.sp-service-list-card,
.sp-service-master-card,
.sp-service-price-card {
    display: flex;
    flex-direction: column;
}

.sp-service-card-header {
    flex: 0 0 auto;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec) !important;
    background: #fbfcfe !important;
}

.sp-service-card-title {
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.sp-service-card-subtitle {
    margin-top: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
    line-height: 1.2;
}

.sp-service-card-header .btn {
    min-height: 27px;
    height: 27px;
    padding: 2px 7px;
    font-size: 10px;
}

.sp-service-category-body {
    flex: 1 1 0;
    min-height: 0;
    padding: 5px !important;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-service-category-tree {
    min-width: 0;
}

.sp-service-category-tree .sp-tree-ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-service-category-tree .sp-tree-li {
    margin: 0 0 2px;
    padding: 0;
}

.sp-service-category-tree .sp-tree-row {
    min-height: 29px;
    display: flex;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--sp-color-text, #20253f);
    cursor: pointer;
    font-size: 11.5px;
    line-height: 1.2;
    transition: background-color .12s ease, border-color .12s ease;
}

.sp-service-category-tree .sp-tree-row:hover {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 15%, #dfe3ec);
    background: #f8f9fc;
}

.sp-service-category-tree .sp-tree-row.active {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 32%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #574c9c);
    font-weight: 700;
}

.sp-service-list-toolbar {
    flex: 0 0 auto;
    min-height: 52px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec) !important;
    background: #fbfcfe !important;
}

.sp-service-search-wrap {
    flex: 1 1 420px;
    max-width: 650px;
}

.sp-service-search-wrap .form-label {
    margin-bottom: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    font-weight: 600;
}

.sp-service-search-wrap .form-control,
.sp-service-search-wrap .btn {
    min-height: 30px;
    height: 30px;
    font-size: 11.5px;
}

.sp-service-search-wrap .form-control {
    border-radius: 5px 0 0 5px;
}

.sp-service-search-wrap .btn {
    min-width: 34px;
    padding: 2px 8px;
}

.sp-service-search-wrap .btn.is-hidden {
    display: none !important;
}

.sp-service-archive-toggle {
    flex: 0 0 auto;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 1px 0 0;
    color: var(--sp-color-text, #20253f);
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.sp-service-archive-toggle .form-check-input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.sp-service-list-card-body {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-service-list-host,
.sp-service-list-result {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.sp-service-list-result {
    display: flex;
    flex-direction: column;
}

.sp-service-list-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-service-table {
    min-width: 760px;
    font-size: 12px;
}

.sp-service-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 31px;
    padding: 5px 7px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: #f7f8fb;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sp-service-table > tbody > tr > td {
    height: 35px;
    padding: 5px 7px;
    border-color: #edf0f5;
    vertical-align: middle;
}

.sp-service-row {
    cursor: pointer;
}

.sp-service-row:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 38%, transparent);
    outline-offset: -2px;
}

.sp-service-name-cell {
    min-width: 220px;
}

.sp-service-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-service-muted {
    color: var(--sp-color-text-soft, #66708f);
}

.sp-service-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 6px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 999px;
    background: #f8f9fb;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
    font-weight: 700;
    white-space: nowrap;
}

.sp-service-status.is-active {
    border-color: #b9dec8;
    background: #eef9f2;
    color: #287447;
}

.sp-service-status.is-inactive {
    border-color: #d8dce5;
    background: #f5f6f8;
    color: #747b8d;
}

.sp-service-row-delete {
    width: 26px;
    min-width: 26px;
    height: 25px;
    min-height: 25px;
    padding: 0 !important;
    font-size: 15px;
    line-height: 1;
}

.sp-service-empty-cell {
    height: 110px !important;
    color: var(--sp-color-text-soft, #66708f);
    text-align: center;
    vertical-align: middle !important;
}

/* ---------------------------------------------------------
   Bearbeitung
   --------------------------------------------------------- */
.sp-service-edit-form {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-service-edit-layout {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
    gap: 7px;
    overflow: hidden;
}

.sp-service-master-body {
    flex: 1 1 0;
    min-height: 0;
    padding: 8px !important;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-service-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sp-service-field-wide {
    grid-column: 1 / -1;
}

.sp-service-field {
    min-width: 0;
}

.sp-service-field .form-label {
    margin-bottom: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10.5px;
    font-weight: 600;
}

.sp-service-field .form-control,
.sp-service-field .form-select {
    min-height: 32px;
    height: 32px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 5px;
    font-size: 12px;
}

.sp-service-field .text-danger.small {
    display: block;
    margin-top: 2px;
    font-size: 9.5px;
}

.sp-service-active-panel {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    padding: 7px 8px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fbfcfe;
}

.sp-service-active-title {
    font-size: 11.5px;
    font-weight: 700;
}

.sp-service-active-hint {
    margin-top: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
}

.sp-service-switch {
    position: relative;
    flex: 0 0 34px;
    width: 34px;
    height: 20px;
    cursor: pointer;
}

.sp-service-switch > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-service-switch > span[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    border: 1px solid #c7ccd8;
    border-radius: 999px;
    background: #e9ebf0;
    transition: background-color .12s ease, border-color .12s ease;
}

.sp-service-switch > span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
    transition: transform .12s ease;
}

.sp-service-switch > input:checked + span[aria-hidden="true"] {
    border-color: var(--sp-color-primary, #6d61b5);
    background: var(--sp-color-primary, #6d61b5);
}

.sp-service-switch > input:checked + span[aria-hidden="true"]::after {
    transform: translateX(14px);
}

.sp-service-switch > input:focus-visible + span[aria-hidden="true"] {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 35%, transparent);
    outline-offset: 2px;
}

.sp-service-price-card-body {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.sp-service-price-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 7px;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-service-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    align-items: start;
    gap: 7px;
}

.sp-service-price-list-card {
    min-width: 0;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.sp-service-price-list-header {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 7px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: #fbfcfe;
}

.sp-service-price-list-title {
    min-width: 0;
    overflow: hidden;
    font-size: 11.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-service-price-default,
.sp-service-price-standard {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.sp-service-price-default {
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 22%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-primary, #574c9c);
}

.sp-service-price-standard {
    border: 1px solid #d8dce5;
    background: #f6f7f9;
    color: #6f7686;
}

.sp-service-price-list-body {
    padding: 3px 7px 5px;
}

.sp-service-price-row {
    min-width: 0;
    min-height: 36px;
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(120px, 150px);
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #eef0f4;
}

.sp-service-price-row:last-child {
    border-bottom: 0;
}

.sp-service-price-label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--sp-color-text, #20253f);
    font-size: 10.5px;
}

.sp-service-price-input-wrap {
    min-width: 0;
}

.sp-service-price-input {
    min-height: 29px !important;
    height: 29px !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
    font-size: 11.5px !important;
}

.sp-service-price-empty {
    margin: 8px;
    padding: 18px;
    border: 1px dashed var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fbfcfe;
    text-align: center;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.sp-service-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.sp-service-footer-actions .btn {
    white-space: nowrap;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1180px) {
    .sp-service-price-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-service-host,
    .sp-tabpane-inner:has([data-sp-services-manage="1"]),
    .sp-tabpane-inner:has([data-sp-service-edit="1"]) {
        overflow: auto !important;
    }

    .sp-service-manage-page,
    .sp-service-edit-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-service-manage-heading,
    .sp-service-edit-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-service-manage-summary {
        white-space: normal;
    }

    .sp-service-manage-layout,
    .sp-service-edit-layout {
        display: grid;
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-service-category-card {
        min-height: 230px;
        max-height: 40vh;
    }

    .sp-service-list-card {
        min-height: 480px;
    }

    .sp-service-edit-form {
        height: auto;
        overflow: visible;
    }

    .sp-service-master-body,
    .sp-service-price-card-body {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-service-price-scroll {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 640px) {
    .sp-service-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sp-service-search-wrap {
        flex-basis: auto;
        width: 100%;
        max-width: none;
    }

    .sp-service-archive-toggle {
        min-height: 26px;
    }

    .sp-service-field-grid,
    .sp-service-price-grid {
        grid-template-columns: 1fr;
    }

    .sp-service-field-wide {
        grid-column: auto;
    }

    .sp-service-price-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

/* =========================================================
   StagePilot – Preislisten
   ========================================================= */

.sp-tabpane-inner.sp-pricelist-host,
.sp-tabpane-inner:has([data-sp-pricelist-list="1"]),
.sp-tabpane-inner:has([data-sp-pricelist-edit="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

.sp-pricelist-list-page,
.sp-pricelist-edit-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    overflow: hidden;
}

.sp-pricelist-list-heading,
.sp-pricelist-edit-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 1px 1px 0;
}

.sp-pricelist-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.sp-pricelist-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 18%, #dfe3ec);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-primary, #5e55a3);
}

.sp-pricelist-heading-icon svg {
    width: 17px;
    height: 17px;
}

.sp-pricelist-heading-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.sp-pricelist-heading-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sp-color-text, #20253f);
    font-size: 17px;
    font-weight: 650;
    line-height: 22px;
}

.sp-pricelist-heading-subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 11.5px;
    line-height: 16px;
}

.sp-pricelist-summary-divider {
    color: #b5bac7;
}

.sp-pricelist-count,
.sp-pricelist-default-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 26%, #dfe3ec);
    border-radius: 999px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #574c9c);
    font-size: 10.5px;
    font-weight: 650;
    line-height: 15px;
    white-space: nowrap;
}

.sp-pricelist-list-card,
.sp-pricelist-edit-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.sp-pricelist-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    padding: 6px 10px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc);
}

.sp-pricelist-card-title {
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 650;
    line-height: 16px;
}

.sp-pricelist-card-subtitle {
    margin-top: 1px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-pricelist-list-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sp-pricelist-list-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-pricelist-table {
    min-width: 760px;
    font-size: 12px;
}

.sp-pricelist-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 6px 8px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc);
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .01em;
    white-space: nowrap;
}

.sp-pricelist-table tbody td {
    padding: 6px 8px;
    border-color: #edf0f5;
    vertical-align: middle;
}

.sp-pricelist-name-link {
    display: inline-block;
    max-width: min(460px, 42vw);
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-pricelist-name-link:hover {
    color: var(--sp-color-primary, #574c9c);
    text-decoration: underline;
}

.sp-pricelist-description {
    max-width: 520px;
    overflow: hidden;
    color: var(--sp-color-text-muted, #687087);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-pricelist-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 21px;
    padding: 1px 6px;
    border: 1px solid #dfe3ec;
    border-radius: 5px;
    background: #fff;
    color: var(--sp-color-text, #20253f);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .04em;
}

.sp-pricelist-empty {
    padding: 34px 18px;
    text-align: center;
}

.sp-pricelist-edit-form {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-pricelist-edit-card {
    max-width: 980px;
}

.sp-pricelist-edit-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px !important;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-pricelist-form-grid {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(260px, 1fr);
    gap: 10px 14px;
    max-width: 860px;
}

.sp-pricelist-field {
    min-width: 0;
}

.sp-pricelist-field-wide {
    grid-column: 1 / -1;
}

.sp-pricelist-edit-page .form-label {
    margin-bottom: 3px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    font-weight: 600;
}

.sp-pricelist-edit-page .form-control {
    min-height: 31px;
    padding: 4px 8px;
    font-size: 12px;
}

.sp-pricelist-description-input {
    min-height: 86px !important;
    resize: vertical;
}

.sp-pricelist-currency-input {
    max-width: 110px;
    text-transform: uppercase;
}

.sp-pricelist-standard-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-self: end;
    min-width: 0;
    min-height: 54px;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #e2e6ef;
    border-radius: 7px;
    background: #fafbfe;
}

.sp-pricelist-standard-title {
    color: var(--sp-color-text, #20253f);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 15px;
}

.sp-pricelist-standard-hint {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10px;
    line-height: 13px;
}

.sp-pricelist-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: pointer;
}

.sp-pricelist-switch > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-pricelist-switch > span[aria-hidden="true"] {
    position: relative;
    display: block;
    width: 34px;
    height: 19px;
    border: 1px solid #b9bfcd;
    border-radius: 999px;
    background: #e8ebf1;
    transition: background .15s ease, border-color .15s ease;
}

.sp-pricelist-switch > span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .24);
    transition: transform .15s ease;
}

.sp-pricelist-switch > input:checked + span[aria-hidden="true"] {
    border-color: var(--sp-color-primary, #6d61b5);
    background: var(--sp-color-primary, #6d61b5);
}

.sp-pricelist-switch > input:checked + span[aria-hidden="true"]::after {
    transform: translateX(15px);
}

.sp-pricelist-switch > input:focus-visible + span[aria-hidden="true"] {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 35%, transparent);
    outline-offset: 2px;
}

.sp-pricelist-info-box {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 860px;
    margin-top: 14px;
    padding: 9px 10px;
    border: 1px solid #e1e5ed;
    border-radius: 7px;
    background: #fafbfc;
}

.sp-pricelist-info-icon {
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 1px solid #cbd1dc;
    border-radius: 50%;
    color: #697086;
    font-size: 11px;
    font-weight: 700;
}

.sp-pricelist-info-title {
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 650;
    line-height: 15px;
}

.sp-pricelist-info-text {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 15px;
}

.sp-pricelist-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-pricelist-host,
    .sp-tabpane-inner:has([data-sp-pricelist-list="1"]),
    .sp-tabpane-inner:has([data-sp-pricelist-edit="1"]) {
        overflow: auto !important;
    }

    .sp-pricelist-list-page,
    .sp-pricelist-edit-page,
    .sp-pricelist-edit-form,
    .sp-pricelist-list-card,
    .sp-pricelist-edit-card {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-pricelist-list-scroll,
    .sp-pricelist-edit-body {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sp-pricelist-form-grid {
        grid-template-columns: 1fr;
    }

    .sp-pricelist-field-wide {
        grid-column: auto;
    }
}

/* =========================================================
   StagePilot Inquiries UI v1
   Liste + kompakter Anfragekopf + Positionsarbeitsbereich
   ========================================================= */

.sp-tabpane-inner.sp-inquiry-host,
.sp-tabpane-inner:has([data-sp-inquiry-list-page="1"]),
.sp-tabpane-inner:has([data-sp-inquiry-edit-page="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

.sp-inquiry-list-page,
.sp-inquiry-edit-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 8px;
    padding: 8px 10px;
    color: var(--sp-color-text, #20253f);
    font-size: 11.5px;
    line-height: 1.35;
}

.sp-inquiry-list-heading,
.sp-inquiry-edit-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-height: 42px;
}

.sp-inquiry-heading-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.sp-inquiry-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border: 1px solid #dde2eb;
    border-radius: 7px;
    background: #fff;
    color: var(--sp-color-primary, #6d61b5);
}

.sp-inquiry-heading-icon svg {
    width: 17px;
    height: 17px;
}

.sp-inquiry-heading-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.sp-inquiry-heading-title {
    max-width: min(680px, 65vw);
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 15px;
    font-weight: 680;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-inquiry-heading-subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 1px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10px;
    line-height: 14px;
}

.sp-inquiry-edit-subtitle {
    display: block;
    max-width: min(850px, 74vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-inquiry-summary-divider {
    opacity: .62;
}

.sp-inquiry-count,
.sp-inquiry-line-count,
.sp-inquiry-linked-offer {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    border: 1px solid #dfe3eb;
    border-radius: 999px;
    background: #fff;
    color: #687087;
    font-size: 9.5px;
    font-weight: 650;
    line-height: 14px;
    white-space: nowrap;
}

.sp-inquiry-linked-offer {
    border-color: #cce6d3;
    background: #f4fbf6;
    color: #39754a;
}

.sp-inquiry-status {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    border: 1px solid #dfe3eb;
    border-radius: 999px;
    background: #f7f8fa;
    color: #626a7d;
    font-size: 9.5px;
    font-weight: 680;
    line-height: 14px;
    white-space: nowrap;
}

.sp-inquiry-status.is-open {
    border-color: #cbd9f1;
    background: #f2f6fc;
    color: #3f628f;
}

.sp-inquiry-status.is-converted {
    border-color: #cce6d3;
    background: #f2faf4;
    color: #39754a;
}

.sp-inquiry-status.is-cancelled {
    border-color: #dfe2e8;
    background: #f5f6f8;
    color: #757b88;
}

.sp-inquiry-filter-card,
.sp-inquiry-list-card,
.sp-inquiry-head-card,
.sp-inquiry-lines-card {
    min-width: 0;
    margin: 0 !important;
    border: 1px solid var(--sp-app-border, #dfe3ec) !important;
    border-radius: 7px !important;
    background: #fff;
    box-shadow: none !important;
    overflow: hidden;
}

.sp-inquiry-filter-card {
    flex: 0 0 auto;
}

.sp-inquiry-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(140px, .7fr) minmax(170px, .85fr) minmax(170px, .85fr) auto;
    align-items: end;
    gap: 7px;
    padding: 7px 8px;
}

.sp-inquiry-filter-form label,
.sp-inquiry-field > label {
    display: block;
    margin: 0 0 2px;
    color: #737a8c;
    font-size: 9.5px;
    font-weight: 650;
    line-height: 13px;
}

.sp-inquiry-filter-form .form-control,
.sp-inquiry-filter-form .form-select,
.sp-inquiry-edit-page .form-control,
.sp-inquiry-edit-page .form-select,
.sp-inquiry-edit-page .btn {
    font-size: 10.5px;
}

.sp-inquiry-filter-form .form-control,
.sp-inquiry-filter-form .form-select,
.sp-inquiry-edit-page input.form-control,
.sp-inquiry-edit-page select.form-select {
    min-height: 29px;
    height: 29px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.sp-inquiry-filter-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sp-inquiry-filter-actions .btn {
    min-height: 29px;
    padding: 4px 9px;
    font-size: 10px;
}

.sp-inquiry-list-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sp-inquiry-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 35px;
    padding: 5px 8px !important;
    border-bottom: 1px solid #e5e8ef !important;
    background: #fafbfc !important;
}

.sp-inquiry-card-title,
.sp-inquiry-panel-title {
    color: #2d3348;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 14px;
}

.sp-inquiry-card-subtitle,
.sp-inquiry-panel-hint,
.sp-inquiry-card-meta {
    color: #7a8192;
    font-size: 9.5px;
    line-height: 13px;
}

.sp-inquiry-card-meta {
    white-space: nowrap;
}

.sp-inquiry-list-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sp-inquiry-list-scroll {
    height: 100%;
    min-height: 0;
    overflow: auto;
}

.sp-inquiry-table {
    width: 100%;
    font-size: 10.5px;
}

.sp-inquiry-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 6px 8px;
    border-bottom: 1px solid #dfe3eb;
    background: #f7f8fa;
    color: #697086;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 13px;
    white-space: nowrap;
}

.sp-inquiry-table tbody td {
    padding: 6px 8px;
    border-color: #eef0f4;
    vertical-align: middle;
}

.sp-inquiry-row {
    cursor: pointer;
}

.sp-inquiry-row:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 45%, transparent);
    outline-offset: -2px;
}

.sp-inquiry-no {
    color: #30384f;
    font-variant-numeric: tabular-nums;
    font-weight: 680;
    white-space: nowrap;
}

.sp-inquiry-title-cell {
    min-width: 210px;
}

.sp-inquiry-row-title {
    max-width: 520px;
    overflow: hidden;
    color: #272d41;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-inquiry-row-subtitle,
.sp-inquiry-updated {
    margin-top: 1px;
    color: #7a8192;
    font-size: 9.5px;
    white-space: nowrap;
}

.sp-inquiry-event-range {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #4e566b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sp-inquiry-event-separator {
    color: #a0a6b3;
}

.sp-inquiry-offer-link {
    color: var(--sp-color-primary, #6559aa);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.sp-inquiry-offer-link:hover {
    text-decoration: underline;
}

.sp-inquiry-empty {
    padding: 34px 12px;
    text-align: center;
}

.sp-inquiry-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-action-source-form {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Anfrage Edit ------------------------------------------------ */
.sp-inquiry-edit-form {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
    overflow: hidden;
}

.sp-inquiry-validation {
    flex: 0 0 auto;
    margin: 0 !important;
    font-size: 10px;
}

.sp-inquiry-validation:empty {
    display: none;
}

.sp-inquiry-head-card {
    flex: 0 0 auto;
    max-height: min(360px, 46vh);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sp-inquiry-head-body {
    min-height: 0;
    padding: 7px 8px !important;
    overflow: auto;
}

.sp-inquiry-head-grid {
    display: grid;
    grid-template-columns: minmax(250px, 2.1fr) minmax(120px, .72fr) minmax(150px, .9fr) minmax(170px, 1fr) minmax(170px, 1fr);
    gap: 6px;
    align-items: start;
}

.sp-inquiry-field {
    min-width: 0;
}

.sp-inquiry-field textarea.form-control {
    min-height: 50px;
    padding: 5px 7px;
    line-height: 1.3;
    resize: vertical;
}

.sp-inquiry-readonly-status {
    display: flex;
    align-items: center;
    min-height: 29px;
}

.sp-inquiry-compact-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
    gap: 7px;
    margin-top: 7px;
}

.sp-inquiry-compact-panel {
    min-width: 0;
    padding: 7px;
    border: 1px solid #e4e7ee;
    border-radius: 6px;
    background: #fbfcfd;
}

.sp-inquiry-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.sp-inquiry-customer-picker > .btn {
    min-height: 29px;
    padding: 4px 7px;
    border-color: #d8dde7;
    background: #fff;
}

.sp-inquiry-picker-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-inquiry-customer-menu {
    max-height: 360px;
    overflow: auto;
}

.sp-inquiry-customer-group {
    margin-bottom: 5px;
}

.sp-inquiry-customer-quick-grid,
.sp-inquiry-location-quick-grid,
.sp-inquiry-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
    margin-top: 6px;
}

.sp-inquiry-location-quick-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.sp-inquiry-field-wide {
    grid-column: 1 / -1;
}

.sp-inquiry-details {
    margin-top: 6px;
    border-top: 1px solid #e5e8ee;
    padding-top: 5px;
}

.sp-inquiry-details > summary {
    cursor: pointer;
    color: #687087;
    font-size: 9.5px;
    font-weight: 650;
    list-style-position: inside;
}

.sp-inquiry-details[open] > summary {
    color: var(--sp-color-primary, #6559aa);
}

.sp-inquiry-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 7px;
}

.sp-inquiry-lines-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.sp-inquiry-lines-header {
    min-height: 37px;
}

.sp-inquiry-line-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.sp-inquiry-line-actions .btn {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 9.5px;
}

.sp-inquiry-lines-body-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sp-inquiry-lines-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.sp-inquiry-lines-table {
    width: 100%;
    min-width: 920px;
    font-size: 10.5px;
}

.sp-inquiry-lines-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 5px 6px;
    border-bottom: 1px solid #dfe3eb;
    background: #f7f8fa;
    color: #697086;
    font-size: 9.5px;
    font-weight: 700;
    white-space: nowrap;
}

.sp-inquiry-lines-table tbody td {
    padding: 5px 6px;
    border-color: #eceff3;
    vertical-align: top;
}

.sp-inquiry-lines-table textarea.form-control {
    min-height: 49px;
    resize: vertical;
}

.sp-inquiry-line-title {
    margin-top: 4px;
}

.sp-inquiry-line-kind {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 1px 6px;
    border: 1px solid #dfe3eb;
    border-radius: 999px;
    background: #f7f8fa;
    color: #626a7d;
    font-size: 9px;
    font-weight: 680;
    white-space: nowrap;
}

.sp-inquiry-line-kind.is-article {
    border-color: #ccd9ef;
    background: #f3f6fb;
    color: #45628c;
}

.sp-inquiry-line-kind.is-heading {
    border-color: #d8d2ed;
    background: #f7f5fc;
    color: #625796;
}

.sp-inquiry-remove-line {
    min-width: 26px;
    min-height: 26px;
    padding: 1px 6px !important;
}

.sp-inquiry-lines-hint {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-top: 1px solid #e7eaf0;
    background: #fafbfc;
    color: #7a8192;
    font-size: 9.5px;
    line-height: 13px;
}

/* Artikel-TreeCombo aus der bisherigen View in den gemeinsamen Shell-Layer verschoben. */
.sp-inquiry-edit-page .sp-inquiry-article-treecombo .dropdown-menu {
    width: min(620px, calc(100vw - 48px));
    max-height: 430px;
    padding: 6px;
    overflow: auto;
}

.sp-inquiry-edit-page .sp-inquiry-article-treecombo > .btn {
    min-height: 27px;
    height: 27px;
    padding: 2px 6px;
    border-color: var(--bs-border-color);
    background: #fff;
    color: var(--bs-body-color);
}

.sp-inquiry-edit-page .sp-inquiry-article-treecombo > .btn:hover,
.sp-inquiry-edit-page .sp-inquiry-article-treecombo > .btn:focus,
.sp-inquiry-edit-page .sp-inquiry-article-treecombo > .btn.show {
    border-color: rgba(var(--bs-primary-rgb), .35);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.sp-inquiry-edit-page .sp-inquiry-article-tree-host {
    min-height: 32px;
}

.sp-inquiry-edit-page .sp-inquiry-article-category {
    margin: 0;
}

.sp-inquiry-edit-page .sp-inquiry-article-category-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
    min-height: 27px;
    padding: 1px 2px;
}

.sp-inquiry-edit-page .sp-treecombo-toggle {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #697086;
    font-size: 13px;
}

.sp-inquiry-edit-page .sp-treecombo-toggle:hover {
    background: #eef1f6;
}

.sp-inquiry-edit-page .sp-inquiry-article-category-name {
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-size: 10px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-inquiry-edit-page .sp-inquiry-article-category > .sp-treecombo-children {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, .28);
}

.sp-inquiry-edit-page .sp-inquiry-article-pick {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 7px;
    width: 100%;
    padding: 4px 6px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    font-size: 10px;
}

.sp-inquiry-edit-page .sp-inquiry-article-pick:hover,
.sp-inquiry-edit-page .sp-inquiry-article-pick:focus {
    outline: none;
    background: rgba(var(--bs-primary-rgb), .08);
}

.sp-inquiry-edit-page .sp-inquiry-article-no {
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}

.sp-inquiry-edit-page .sp-inquiry-article-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1240px) {
    .sp-inquiry-filter-form {
        grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .7fr) minmax(160px, .8fr) minmax(160px, .8fr);
    }

    .sp-inquiry-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .sp-inquiry-head-grid {
        grid-template-columns: minmax(240px, 1.8fr) minmax(125px, .75fr) minmax(145px, .9fr) minmax(170px, 1fr) minmax(170px, 1fr);
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-inquiry-host,
    .sp-tabpane-inner:has([data-sp-inquiry-list-page="1"]),
    .sp-tabpane-inner:has([data-sp-inquiry-edit-page="1"]) {
        overflow: auto !important;
    }

    .sp-inquiry-list-page,
    .sp-inquiry-edit-page,
    .sp-inquiry-edit-form,
    .sp-inquiry-list-card,
    .sp-inquiry-head-card,
    .sp-inquiry-lines-card,
    .sp-inquiry-list-body,
    .sp-inquiry-lines-body-wrap,
    .sp-inquiry-list-scroll,
    .sp-inquiry-lines-scroll {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .sp-inquiry-filter-form,
    .sp-inquiry-head-grid,
    .sp-inquiry-compact-columns,
    .sp-inquiry-notes-grid {
        grid-template-columns: 1fr;
    }

    .sp-inquiry-filter-actions {
        grid-column: auto;
        justify-content: flex-start;
    }

    .sp-inquiry-head-card {
        max-height: none;
    }

    .sp-inquiry-head-body {
        overflow: visible;
    }

    .sp-inquiry-heading-title,
    .sp-inquiry-edit-subtitle {
        max-width: calc(100vw - 95px);
    }

    .sp-inquiry-lines-scroll,
    .sp-inquiry-list-scroll {
        overflow-x: auto;
    }
}

/* =========================================================
   StagePilot App Shell v11 – Angebote
   Liste, Angebotskopf, Versionsworkflow, Editor und Details
   ========================================================= */

.sp-tabpane-inner.sp-offer-host,
.sp-tabpane-inner:has([data-sp-offer-list-page="1"]),
.sp-tabpane-inner:has([data-sp-offer-edit-page="1"]),
.sp-tabpane-inner:has([data-sp-offer-details-page="1"]) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.sp-shell .sp-offer-list-page,
.sp-shell .sp-offer-edit-page,
.sp-shell .sp-offer-details-page {
    height: 100%;
    min-height: 0;
    margin: 0;
    font-size: 12px;
    color: var(--sp-color-text, #20253f);
}

.sp-shell .sp-offer-list-page,
.sp-shell .sp-offer-details-page {
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
}

.sp-shell .sp-offer-edit-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.sp-shell .sp-offer-edit-page.is-create {
    overflow: auto;
    padding-bottom: 8px;
}

.sp-shell .sp-offer-list-heading,
.sp-shell .sp-offer-edit-heading,
.sp-shell .sp-offer-details-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 2px 2px 3px;
}

.sp-shell .sp-offer-heading-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.sp-shell .sp-offer-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 25%, #dde2ea);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-primary, #6255aa);
}

.sp-shell .sp-offer-heading-icon svg {
    width: 18px;
    height: 18px;
}

.sp-shell .sp-offer-heading-copy {
    min-width: 0;
}

.sp-shell .sp-offer-heading-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.sp-shell .sp-offer-heading-title {
    margin: 0;
    font-size: 17px;
    line-height: 21px;
    font-weight: 650;
    color: #23283f;
}

.sp-shell .sp-offer-heading-subtitle,
.sp-shell .sp-offer-edit-subtitle,
.sp-shell .sp-offer-details-heading-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 1px;
    color: #737a8e;
    font-size: 10.5px;
    line-height: 14px;
}

.sp-shell .sp-offer-edit-subtitle {
    max-width: min(720px, 65vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-summary-divider {
    opacity: .55;
}

.sp-shell .sp-offer-count,
.sp-shell .sp-offer-version-state,
.sp-shell .sp-offer-version-number,
.sp-shell .sp-offer-card-meta {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 1px 6px;
    border: 1px solid #e0e4ec;
    border-radius: 999px;
    background: #f8f9fc;
    color: #656d82;
    font-size: 9.8px;
    font-weight: 600;
    white-space: nowrap;
}

.sp-shell .sp-offer-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 9.8px;
    font-weight: 700;
    line-height: 13px;
    white-space: nowrap;
}

.sp-shell .sp-offer-status.is-draft {
    color: #375b9d;
    border-color: #c9d8ef;
    background: #f1f6fd;
}

.sp-shell .sp-offer-status.is-sent {
    color: #126579;
    border-color: #bfe1e8;
    background: #eef9fb;
}

.sp-shell .sp-offer-status.is-accepted {
    color: #27704c;
    border-color: #c3e3d2;
    background: #eff9f4;
}

.sp-shell .sp-offer-status.is-rejected {
    color: #a23d47;
    border-color: #edc7cb;
    background: #fff3f4;
}

.sp-shell .sp-offer-status.is-cancelled {
    color: #686f7c;
    border-color: #d7dbe2;
    background: #f5f6f8;
}

/* ---------- Angebotsliste ---------- */
.sp-shell .sp-offer-filter-card,
.sp-shell .sp-offer-list-card,
.sp-shell .sp-offer-details-card,
.sp-shell .sp-offer-details-positions,
.sp-shell .sp-offer-version-strip,
.sp-shell .sp-offer-head-card,
.sp-shell .sp-offer-settings-panel,
.sp-shell .sp-offer-details-subprojects {
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
}

.sp-shell .sp-offer-filter-card {
    flex: 0 0 auto;
    padding: 6px 7px;
}

.sp-shell .sp-offer-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 170px auto auto;
    gap: 7px;
    align-items: end;
}

.sp-shell .sp-offer-filter-form label,
.sp-shell .sp-offer-field > label,
.sp-shell .sp-offer-setting-field > label {
    display: block;
    margin: 0 0 2px;
    color: #6e7588;
    font-size: 9.5px;
    line-height: 12px;
    font-weight: 600;
}

.sp-shell .sp-offer-filter-form .form-control,
.sp-shell .sp-offer-filter-form .form-select,
.sp-shell .sp-offer-edit-page .form-control,
.sp-shell .sp-offer-edit-page .form-select,
.sp-shell .sp-offer-edit-page .btn {
    font-size: 10.5px;
}

.sp-shell .sp-offer-filter-form .form-control,
.sp-shell .sp-offer-filter-form .form-select,
.sp-shell .sp-offer-edit-page input.form-control,
.sp-shell .sp-offer-edit-page select.form-select {
    min-height: 28px;
    height: 28px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.sp-shell .sp-offer-version-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin: 0;
    padding: 3px 8px;
    border: 1px solid #dfe3ec;
    border-radius: 5px;
    background: #fafbfc;
    color: #555e72;
    font-size: 10.5px;
    white-space: nowrap;
}

.sp-shell .sp-offer-version-filter .form-check-input {
    width: 13px;
    height: 13px;
    margin: 0;
}

.sp-shell .sp-offer-filter-actions {
    display: flex;
    gap: 5px;
}

.sp-shell .sp-offer-filter-actions .btn {
    min-height: 28px;
    padding: 3px 9px;
    font-size: 10.5px;
}

.sp-shell .sp-offer-list-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-shell .sp-offer-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 35px;
    padding: 5px 8px;
    border-bottom: 1px solid #e4e7ed;
    background: #fafbfc;
}

.sp-shell .sp-offer-card-title {
    font-size: 11px;
    line-height: 14px;
    font-weight: 700;
    color: #343a50;
}

.sp-shell .sp-offer-card-subtitle {
    margin-top: 1px;
    color: #7a8191;
    font-size: 9.5px;
    line-height: 12px;
}

.sp-shell .sp-offer-list-body,
.sp-shell .sp-offer-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
}

.sp-shell .sp-offer-list-scroll {
    overflow: auto;
}

.sp-shell .sp-offer-table {
    width: 100%;
    min-width: 1060px;
    table-layout: fixed;
    font-size: 10.5px;
}

.sp-shell .sp-offer-table thead th,
.sp-shell .sp-offer-details-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 5px 7px;
    border-bottom: 1px solid #dfe3ec;
    background: #f6f7fa;
    color: #61697c;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 13px;
    white-space: nowrap;
}

.sp-shell .sp-offer-table tbody td {
    padding: 5px 7px;
    border-bottom: 1px solid #eceef2;
    vertical-align: middle;
}

.sp-shell .sp-offer-row {
    cursor: pointer;
    outline: none;
}

.sp-shell .sp-offer-row:hover td,
.sp-shell .sp-offer-row:focus-visible td {
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 5%, #fff);
}

.sp-shell .sp-offer-row:focus-visible td:first-child {
    box-shadow: inset 3px 0 0 var(--sp-color-primary, #6d61b5);
}

.sp-shell .sp-offer-col-no { width: 155px; }
.sp-shell .sp-offer-col-status { width: 105px; }
.sp-shell .sp-offer-col-version { width: 145px; }
.sp-shell .sp-offer-col-event { width: 220px; }
.sp-shell .sp-offer-col-updated { width: 125px; }
.sp-shell .sp-offer-col-actions { width: 155px; }

.sp-shell .sp-offer-no,
.sp-shell .sp-offer-row-title {
    overflow: hidden;
    color: #2f354c;
    font-weight: 650;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-row-id,
.sp-shell .sp-offer-row-subtitle,
.sp-shell .sp-offer-updated {
    margin-top: 1px;
    overflow: hidden;
    color: #7b8292;
    font-size: 9.5px;
    line-height: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-version-state {
    margin-right: 3px;
}

.sp-shell .sp-offer-version-state.is-current,
.sp-shell .sp-offer-version-state.is-accepted {
    color: #4f458f;
    border-color: #d7d1ef;
    background: #f5f2ff;
}

.sp-shell .sp-offer-version-state.is-superseded,
.sp-shell .sp-offer-version-state.is-discarded {
    color: #707786;
    background: #f4f5f7;
}

.sp-shell .sp-offer-event-range {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.sp-shell .sp-offer-event-separator {
    color: #a0a5b1;
}

.sp-shell .sp-offer-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.sp-shell .sp-offer-row-actions .btn {
    padding: 2px 6px;
    font-size: 9.5px;
}

.sp-shell .sp-offer-empty {
    padding: 28px 12px !important;
    color: #7d8495 !important;
    text-align: center;
}

/* ---------- Angebotseditor ---------- */
.sp-shell .sp-offer-heading-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.sp-shell .sp-offer-heading-links a {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 7px;
    border: 1px solid #dfe3ec;
    border-radius: 999px;
    background: #fff;
    color: #5d6480;
    font-size: 9.5px;
    text-decoration: none;
}

.sp-shell .sp-offer-heading-links a:hover {
    border-color: #c8cde0;
    color: var(--sp-color-primary, #5b50a0);
    background: #f8f7fd;
}

.sp-shell .sp-offer-version-strip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    padding: 4px 6px;
}

.sp-shell .sp-offer-version-label {
    color: #747b8d;
    font-size: 9.5px;
    font-weight: 600;
}

.sp-shell .sp-offer-version-buttons {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    overflow-x: auto;
}

.sp-shell .sp-offer-version-button {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid #dfe3ec;
    border-radius: 4px;
    background: #fafbfc;
    color: #596176;
    font-size: 9.5px;
    font-weight: 600;
    text-decoration: none;
}

.sp-shell .sp-offer-version-button.is-active {
    border-color: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 40%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #5b50a0);
}

.sp-shell .sp-offer-version-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.sp-shell .sp-offer-version-actions form {
    margin: 0;
}

.sp-shell .sp-offer-version-actions .btn {
    min-height: 23px;
    padding: 2px 7px;
    font-size: 9.5px;
}

.sp-shell .sp-offer-notice {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #dfe3ec;
    border-radius: 5px;
    font-size: 10px;
    line-height: 14px;
}

.sp-shell .sp-offer-notice.is-info {
    border-color: #cfe0ee;
    background: #f4f9fd;
    color: #3f6177;
}

.sp-shell .sp-offer-notice.is-success {
    border-color: #c5dfd1;
    background: #f2faf6;
    color: #376b51;
}

.sp-shell .sp-offer-notice.is-warning {
    border-color: #ead8ae;
    background: #fffaf0;
    color: #756031;
}

.sp-shell .sp-offer-head-form {
    flex: 0 0 auto;
    min-height: 0;
    margin: 0;
}

.sp-shell .sp-offer-head-card {
    overflow: hidden;
}

.sp-shell .sp-offer-head-card > summary,
.sp-shell .sp-offer-settings-panel > summary,
.sp-shell .sp-offer-details-subprojects > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 29px;
    padding: 4px 8px;
    background: #fafbfc;
    color: #3f4559;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.sp-shell .sp-offer-head-card > summary::-webkit-details-marker,
.sp-shell .sp-offer-settings-panel > summary::-webkit-details-marker,
.sp-shell .sp-offer-details-subprojects > summary::-webkit-details-marker {
    display: none;
}

.sp-shell .sp-offer-head-card > summary::after,
.sp-shell .sp-offer-settings-panel > summary::after,
.sp-shell .sp-offer-details-subprojects > summary::after {
    content: "▸";
    color: #8a90a0;
    font-size: 10px;
}

.sp-shell .sp-offer-head-card[open] > summary::after,
.sp-shell .sp-offer-settings-panel[open] > summary::after,
.sp-shell .sp-offer-details-subprojects[open] > summary::after {
    content: "▾";
}

.sp-shell .sp-offer-head-summary-meta,
.sp-shell .sp-offer-settings-summary,
.sp-shell .sp-offer-details-subprojects > summary > span:last-child {
    margin-left: auto;
    color: #7d8494;
    font-size: 9.5px;
    font-weight: 500;
}

.sp-shell .sp-offer-head-body {
    max-height: 245px;
    overflow: auto;
    padding: 6px 7px 7px;
    border-top: 1px solid #e7e9ee;
}

.sp-shell .sp-offer-validation {
    margin-bottom: 4px;
    font-size: 10px;
}

.sp-shell .sp-offer-validation:empty {
    display: none;
}

.sp-shell .sp-offer-head-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1.5fr) minmax(130px, 1fr) minmax(120px, .8fr) minmax(150px, 1fr);
    gap: 5px 7px;
    align-items: end;
}

.sp-shell .sp-offer-field {
    min-width: 0;
}

.sp-shell .sp-offer-field.is-title,
.sp-shell .sp-offer-field.is-customer-picker,
.sp-shell .sp-offer-field.is-description {
    grid-column: span 2;
}

.sp-shell .sp-offer-field textarea.form-control {
    min-height: 42px;
    height: 42px;
    resize: vertical;
}

.sp-shell .sp-offer-customer-menu {
    max-height: 320px;
    overflow: auto;
    font-size: 10.5px;
}

.sp-shell .sp-offer-address-details {
    margin-top: 6px;
    border-top: 1px solid #eceef2;
}

.sp-shell .sp-offer-address-details > summary {
    padding: 5px 1px 2px;
    color: #6c7385;
    font-size: 9.5px;
    font-weight: 600;
    cursor: pointer;
}

.sp-shell .sp-offer-address-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr .6fr 1fr .8fr 1.4fr;
    gap: 5px 7px;
    padding-top: 4px;
}

.sp-shell .sp-offer-create-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    padding: 16px;
    border: 1px dashed #cdd2dd;
    border-radius: 7px;
    background: #fafbfc;
    color: #626a7d;
}

.sp-shell .sp-offer-create-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f0eef9;
    color: var(--sp-color-primary, #6357a5);
    font-size: 20px;
}

.sp-shell .sp-offer-create-hint strong,
.sp-shell .sp-offer-create-hint span {
    display: block;
}

.sp-shell .sp-offer-create-hint span {
    margin-top: 2px;
    font-size: 10.5px;
}

.sp-shell .sp-offer-existing-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

.sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    margin: 0 !important;
    padding: 4px 7px !important;
    border: 1px solid #dfe3ec !important;
    border-radius: 6px;
    background: #fff !important;
}

.sp-shell .sp-offer-structure-title {
    color: #3d4357;
    font-size: 10.5px;
    font-weight: 700;
}

.sp-shell .sp-offer-structure-hint {
    color: #808697;
    font-size: 9.2px;
}

.sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0 !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar-actions label {
    margin: 0;
    color: #777e90;
    font-size: 9.5px;
    white-space: nowrap;
}

.sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar-actions .form-select {
    width: 220px;
    min-width: 0 !important;
    height: 25px;
    min-height: 25px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.sp-shell .sp-offer-auto-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 6px;
    border: 1px solid #dfe3ec;
    border-radius: 999px;
    background: #f8f9fb;
    color: #71788a;
    font-size: 9px;
    white-space: nowrap;
}

.sp-shell .sp-offer-settings-panel {
    flex: 0 0 auto;
    overflow: hidden;
}

.sp-shell .sp-offer-settings-grid {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) 90px minmax(120px, .8fr) 90px 80px auto auto auto auto;
    gap: 5px 7px;
    align-items: end;
    padding: 6px 7px;
    border-top: 1px solid #e7e9ee;
}

.sp-shell .sp-offer-setting-field {
    min-width: 0;
}

.sp-shell .sp-offer-setting-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    margin: 0;
    color: #626a7c;
    font-size: 9.5px;
    white-space: nowrap;
}

.sp-shell .sp-offer-setting-check .form-check-input {
    width: 12px;
    height: 12px;
    margin: 0;
}

.sp-shell .sp-offer-settings-save {
    min-height: 27px;
    white-space: nowrap;
}

.sp-shell .sp-offer-edit-page .sp-offer-editor-grid {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(250px, var(--sp-offer-catalog-width)) 12px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: stretch !important;
    overflow: hidden;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-pane,
.sp-shell .sp-offer-edit-page .sp-offer-position-workspace {
    min-height: 0;
    height: 100%;
    border: 1px solid #dfe3ec !important;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-pane {
    display: flex;
    flex-direction: column;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-pane-header,
.sp-shell .sp-offer-edit-page .sp-offer-position-workspace-head {
    flex: 0 0 auto;
    min-height: 31px;
    padding: 4px 7px !important;
    border-bottom: 1px solid #e3e6ec !important;
    background: #f8f9fb !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-pane-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto !important;
    padding: 5px !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-pane .accordion-button {
    min-height: 28px;
    padding: 4px 7px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-catalog-row {
    min-height: 25px;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 10px;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-workspace {
    display: flex;
    flex-direction: column;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-canvas {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto !important;
    background: #f7f8fa;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-sheet {
    min-height: 100%;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-header {
    position: sticky;
    top: 0;
    z-index: 6;
    min-height: 28px;
    background: #f3f5f8 !important;
    font-size: 9px !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-row {
    min-height: 29px;
    font-size: 10px;
}

.sp-shell .sp-offer-edit-page .sp-offer-position-title-input,
.sp-shell .sp-offer-edit-page .sp-offer-position-cell input,
.sp-shell .sp-offer-edit-page .sp-offer-position-cell select,
.sp-shell .sp-offer-edit-page .sp-offer-position-details textarea,
.sp-shell .sp-offer-edit-page .sp-offer-position-details input,
.sp-shell .sp-offer-edit-page .sp-offer-position-details select {
    font-size: 10px !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below {
    flex: 0 0 auto;
    padding: 4px 5px !important;
    border-top: 1px solid #dfe3ec !important;
    background: #fafbfc !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-header {
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 4px 6px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 10px;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body {
    display: grid;
    grid-template-columns: minmax(210px, 1.1fr) minmax(160px, .7fr) minmax(160px, .7fr) minmax(220px, 1fr);
    gap: 6px 12px;
    align-items: center;
    padding: 3px 6px !important;
    font-size: 10px;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body > .mb-3,
.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body > .d-flex,
.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body > .form-check {
    margin: 0 !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body > hr,
.sp-shell .sp-offer-edit-page .sp-offer-summary-below .form-text {
    display: none !important;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .form-label {
    margin-bottom: 1px;
    font-size: 9px;
}

.sp-shell .sp-offer-edit-page .sp-offer-summary-below .input-group .form-control,
.sp-shell .sp-offer-edit-page .sp-offer-summary-below .input-group .input-group-text,
.sp-shell .sp-offer-edit-page .sp-offer-summary-below .input-group .btn {
    min-height: 25px;
    height: 25px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 10px;
}

/* ---------- Angebotsdetails ---------- */
.sp-shell .sp-offer-details-heading-meta {
    justify-content: flex-end;
    margin-top: 0;
}

.sp-shell .sp-offer-details-heading-meta .is-warning {
    color: #a26924;
    font-weight: 600;
}

.sp-shell .sp-offer-details-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.sp-shell .sp-offer-details-overview {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 6px;
}

.sp-shell .sp-offer-details-card {
    overflow: hidden;
}

.sp-shell .sp-offer-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 10px;
    padding: 7px 8px;
}

.sp-shell .sp-offer-details-grid > div {
    min-width: 0;
}

.sp-shell .sp-offer-details-grid > div.is-wide {
    grid-column: span 3;
}

.sp-shell .sp-offer-details-grid span {
    display: block;
    margin-bottom: 1px;
    color: #7a8191;
    font-size: 9px;
    line-height: 11px;
}

.sp-shell .sp-offer-details-grid strong {
    display: block;
    overflow: hidden;
    color: #41475b;
    font-size: 10.5px;
    line-height: 14px;
    font-weight: 650;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-details-grid strong.is-normal {
    white-space: pre-wrap;
    font-weight: 500;
}

.sp-shell .sp-offer-total-lines {
    display: grid;
    gap: 5px;
    padding: 8px;
}

.sp-shell .sp-offer-total-lines > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 20px;
}

.sp-shell .sp-offer-total-lines .is-grand {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid #e5e8ed;
    font-size: 12px;
}

.sp-shell .sp-offer-details-subprojects {
    flex: 0 0 auto;
    overflow: hidden;
}

.sp-shell .sp-offer-subproject-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    max-height: 210px;
    padding: 6px;
    overflow: auto;
    border-top: 1px solid #e7e9ee;
}

.sp-shell .sp-offer-subproject-summary-card {
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #e2e5eb;
    border-radius: 5px;
    background: #fbfcfd;
}

.sp-shell .sp-offer-subproject-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sp-shell .sp-offer-subproject-summary-head strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-subproject-summary-head span,
.sp-shell .sp-offer-subproject-summary-meta,
.sp-shell .sp-offer-subproject-summary-description {
    color: #787f90;
    font-size: 9.3px;
    line-height: 12px;
}

.sp-shell .sp-offer-subproject-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
    margin-top: 4px;
}

.sp-shell .sp-offer-subproject-summary-description {
    margin-top: 4px;
    color: #5e6679;
}

.sp-shell .sp-offer-details-positions {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-shell .sp-offer-details-position-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.sp-shell .sp-offer-details-table {
    width: 100%;
    min-width: 1120px;
    table-layout: fixed;
    font-size: 10px;
}

.sp-shell .sp-offer-details-table tbody td {
    padding: 4px 6px;
    border-bottom: 1px solid #eceef2;
    vertical-align: middle;
}

.sp-shell .sp-offer-details-table tbody tr.is-heading td {
    background: #f8f9fb;
}

.sp-shell .sp-offer-details-table .is-right {
    text-align: right;
}

.sp-shell .sp-offer-details-table .is-total {
    font-weight: 700;
}

.sp-shell .sp-offer-details-pos { width: 60px; }
.sp-shell .sp-offer-details-subproject { width: 165px; }
.sp-shell .sp-offer-details-availability { width: 150px; }
.sp-shell .sp-offer-details-table th.is-right:nth-last-child(6) { width: 85px; }

.sp-shell .sp-offer-details-pos-cell {
    color: #8a90a0;
}

.sp-shell .sp-offer-details-position-title {
    color: #3f4559;
    font-weight: 650;
}

.sp-shell .sp-offer-details-position-description {
    margin-top: 1px;
    overflow: hidden;
    color: #7d8495;
    font-size: 9px;
    line-height: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sp-shell .sp-offer-subproject-pill,
.sp-shell .sp-offer-availability-pill {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 5px;
    border: 1px solid #dde1e8;
    border-radius: 999px;
    background: #f8f9fb;
    color: #687084;
    font-size: 9px;
    white-space: nowrap;
}

.sp-shell .sp-offer-subproject-pill.is-warning,
.sp-shell .sp-offer-availability-pill.is-warning {
    border-color: #ecd9a9;
    background: #fff9eb;
    color: #8a6728;
}

.sp-shell .sp-offer-availability-pill.is-ok {
    border-color: #c3e1d0;
    background: #f0faf5;
    color: #2d7450;
}

.sp-shell .sp-offer-availability-pill.is-bad {
    border-color: #edc4c7;
    background: #fff2f3;
    color: #a23d47;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .sp-shell .sp-offer-filter-form {
        grid-template-columns: minmax(220px, 1fr) 160px auto;
    }

    .sp-shell .sp-offer-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .sp-shell .sp-offer-head-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sp-shell .sp-offer-field.is-title,
    .sp-shell .sp-offer-field.is-customer-picker,
    .sp-shell .sp-offer-field.is-description {
        grid-column: span 2;
    }

    .sp-shell .sp-offer-address-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sp-shell .sp-offer-settings-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-offer-host,
    .sp-tabpane-inner:has([data-sp-offer-list-page="1"]),
    .sp-tabpane-inner:has([data-sp-offer-edit-page="1"]),
    .sp-tabpane-inner:has([data-sp-offer-details-page="1"]) {
        height: auto;
        overflow: visible;
    }

    .sp-shell .sp-offer-list-page,
    .sp-shell .sp-offer-edit-page,
    .sp-shell .sp-offer-details-page,
    .sp-shell .sp-offer-details-content,
    .sp-shell .sp-offer-existing-content {
        height: auto;
        overflow: visible;
    }

    .sp-shell .sp-offer-filter-form,
    .sp-shell .sp-offer-head-grid,
    .sp-shell .sp-offer-address-grid,
    .sp-shell .sp-offer-settings-grid,
    .sp-shell .sp-offer-details-overview,
    .sp-shell .sp-offer-details-grid,
    .sp-shell .sp-offer-subproject-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sp-shell .sp-offer-field.is-title,
    .sp-shell .sp-offer-field.is-customer-picker,
    .sp-shell .sp-offer-field.is-description,
    .sp-shell .sp-offer-details-grid > div.is-wide {
        grid-column: 1 / -1;
    }

    .sp-shell .sp-offer-head-body {
        max-height: none;
        overflow: visible;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-editor-grid {
        height: auto !important;
        grid-template-columns: 1fr !important;
        overflow: visible;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-editor-splitter {
        display: none !important;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-catalog-pane,
    .sp-shell .sp-offer-edit-page .sp-offer-position-workspace {
        height: auto;
        min-height: 360px;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-catalog-pane-body {
        max-height: 390px !important;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-position-canvas {
        max-height: 650px !important;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-summary-below .card,
    .sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body {
        display: block;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-summary-below .card-body > * {
        margin-bottom: 6px !important;
    }
}

@media (max-width: 640px) {
    .sp-shell .sp-offer-filter-form,
    .sp-shell .sp-offer-head-grid,
    .sp-shell .sp-offer-address-grid,
    .sp-shell .sp-offer-settings-grid,
    .sp-shell .sp-offer-details-overview,
    .sp-shell .sp-offer-details-grid,
    .sp-shell .sp-offer-subproject-summary-grid {
        grid-template-columns: 1fr;
    }

    .sp-shell .sp-offer-list-heading,
    .sp-shell .sp-offer-edit-heading,
    .sp-shell .sp-offer-details-heading,
    .sp-shell .sp-offer-version-strip,
    .sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar,
    .sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .sp-shell .sp-offer-heading-links,
    .sp-shell .sp-offer-version-actions {
        justify-content: flex-start;
        margin-left: 0;
    }

    .sp-shell .sp-offer-edit-page .sp-offer-structure-toolbar-actions .form-select {
        width: 100%;
    }
}


/* =========================================================
   StagePilot Angebote – Viewport-/Audit-Hotfix 2026-08-26
   Der Angebotsbereich wird wie der Projektbereich exakt bis
   zur Oberkante des globalen Footers begrenzt.
   ========================================================= */

@media (min-width: 992px) {
    .sp-shell .sp-offer-list-page,
    .sp-shell .sp-offer-edit-page,
    .sp-shell .sp-offer-details-page {
        height: var(--sp-offer-viewport-height, 100%) !important;
        max-height: var(--sp-offer-viewport-height, 100%) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .sp-shell .sp-offer-edit-page.is-create {
        overflow: hidden !important;
    }
}

.sp-shell .sp-offer-audit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    margin-top: 1px;
    color: #808697;
    font-size: 9px;
    line-height: 12px;
}

.sp-shell .sp-offer-audit-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    white-space: nowrap;
}

.sp-shell .sp-offer-audit-label {
    color: #8c92a1;
}

.sp-shell .sp-offer-audit-user {
    color: #5e6679;
    font-weight: 650;
}

.sp-shell .sp-offer-audit-time {
    color: #7c8394;
}

.sp-shell .sp-offer-audit-separator {
    color: #b0b5c0;
}

@media (max-width: 991.98px) {
    .sp-shell .sp-offer-audit {
        white-space: normal;
    }
}

/* =========================================================
   StagePilot Angebote – Viewport-Fix v2 2026-08-26
   Exakt nach dem bewährten Projekt-v6-Prinzip:
   - Host scrollt nicht
   - Root endet an der globalen Action-Bar
   - komplette Flex-/Grid-Kette darf schrumpfen
   - alte feste Mindesthöhen aus offers.css werden neutralisiert
   ========================================================= */

/* Wie beim Projekt: der Workspace-Host selbst darf keinen zweiten
   vertikalen Scrollkontext erzeugen. */
.sp-tabpane-inner.sp-offer-host,
.sp-tabpane-inner:has([data-sp-offer-edit-page="1"]),
.sp-tabpane-inner:has([data-sp-offer-list-page="1"]),
.sp-tabpane-inner:has([data-sp-offer-details-page="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

@media (min-width: 992px) {
    /* Der Angebots-Root endet exakt an der vom JS gemessenen Footer-Oberkante. */
    [data-sp-offer-edit-page="1"].sp-offer-edit-page,
    [data-sp-offer-list-page="1"].sp-offer-list-page,
    [data-sp-offer-details-page="1"].sp-offer-details-page {
        height: var(--sp-offer-viewport-height, 100%) !important;
        max-height: var(--sp-offer-viewport-height, 100%) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Entspricht beim Projekt der Kette
       record-shell -> record-content -> tabcontent -> pane.
       Jede Ebene muss schrumpfen dürfen, sonst drückt der Inhalt
       trotz korrekt gemessener Außenhöhe unter den Footer. */
    [data-sp-offer-edit-page="1"] .sp-offer-existing-content {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    [data-sp-offer-edit-page="1"] .sp-offer-editor-grid {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
        align-items: stretch !important;
    }

    /* offers.css enthält historisch min-height:360px.
       Diese feste Mindesthöhe war der eigentliche Höhen-Treiber. */
    [data-sp-offer-edit-page="1"] .sp-offer-editor-splitter {
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        align-self: stretch !important;
    }

    [data-sp-offer-edit-page="1"] .sp-offer-catalog-pane,
    [data-sp-offer-edit-page="1"] .sp-offer-position-workspace {
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    /* Die beiden eigentlichen Scrollflächen bekommen nur die Resthöhe.
       Alte 100vh-/Mindesthöhen aus offers.css dürfen hier nicht greifen. */
    [data-sp-offer-edit-page="1"] .sp-offer-catalog-pane-body,
    [data-sp-offer-edit-page="1"] .sp-offer-position-canvas {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    [data-sp-offer-edit-page="1"] .sp-offer-position-workspace-head,
    [data-sp-offer-edit-page="1"] .sp-offer-summary-below,
    [data-sp-offer-edit-page="1"] .sp-offer-structure-toolbar,
    [data-sp-offer-edit-page="1"] .sp-offer-settings-panel {
        flex-shrink: 0 !important;
    }

    /* Der Inhalt des weißen Positionsblatts darf größer sein als der Canvas;
       er erzeugt dann ausschließlich den inneren Canvas-Scrollbar. */
    [data-sp-offer-edit-page="1"] .sp-offer-position-sheet {
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
    }

    /* Details/Liste analog: nur der jeweilige Inhaltsbereich scrollt. */
    [data-sp-offer-list-page="1"] .sp-offer-list-card,
    [data-sp-offer-details-page="1"] .sp-offer-details-content,
    [data-sp-offer-details-page="1"] .sp-offer-details-positions {
        min-height: 0 !important;
        max-height: 100% !important;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-offer-host,
    .sp-tabpane-inner:has([data-sp-offer-edit-page="1"]),
    .sp-tabpane-inner:has([data-sp-offer-list-page="1"]),
    .sp-tabpane-inner:has([data-sp-offer-details-page="1"]) {
        overflow: auto !important;
    }

    [data-sp-offer-edit-page="1"].sp-offer-edit-page,
    [data-sp-offer-list-page="1"].sp-offer-list-page,
    [data-sp-offer-details-page="1"].sp-offer-details-page {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* =========================================================
   StagePilot – Benutzer
   ========================================================= */

.sp-tabpane-inner.sp-user-host,
.sp-tabpane-inner:has([data-sp-user-list="1"]),
.sp-tabpane-inner:has([data-sp-user-edit="1"]) {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
}

.sp-user-list-page,
.sp-user-edit-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    overflow: hidden;
}

.sp-user-list-heading,
.sp-user-edit-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 1px 1px 0;
}

.sp-user-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.sp-user-heading-icon,
.sp-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 18%, #dfe3ec);
    border-radius: 7px;
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 7%, #fff);
    color: var(--sp-color-primary, #5e55a3);
}

.sp-user-heading-icon svg {
    width: 17px;
    height: 17px;
}

.sp-user-avatar {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}

.sp-user-heading-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.sp-user-heading-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 17px;
    font-weight: 650;
    line-height: 22px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-user-heading-subtitle,
.sp-user-audit-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-user-audit-line {
    color: #7b8294;
    font-size: 9.5px;
    line-height: 13px;
}

.sp-user-summary-divider {
    color: #b5bac7;
}

.sp-user-count,
.sp-user-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 15px;
    white-space: nowrap;
}

.sp-user-count {
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 26%, #dfe3ec);
    background: color-mix(in srgb, var(--sp-color-primary, #6d61b5) 8%, #fff);
    color: var(--sp-color-primary, #574c9c);
}

.sp-user-status.is-active {
    border: 1px solid #b9dfca;
    background: #eef9f2;
    color: #2d7a4b;
}

.sp-user-status.is-inactive {
    border: 1px solid #d5d9e2;
    background: #f4f5f7;
    color: #73798a;
}

.sp-user-list-card,
.sp-user-edit-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.sp-user-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    gap: 12px;
    padding: 6px 10px !important;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc);
}

.sp-user-card-title,
.sp-user-section-title {
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 650;
    line-height: 16px;
}

.sp-user-card-subtitle,
.sp-user-section-hint {
    margin-top: 1px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-user-search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sp-user-search-box {
    position: relative;
    min-width: min(390px, 34vw);
}

.sp-user-search-icon {
    position: absolute;
    top: 50%;
    left: 9px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    color: #8a91a3;
    transform: translateY(-50%);
    pointer-events: none;
}

.sp-user-search-icon svg {
    width: 14px;
    height: 14px;
}

.sp-user-search-box .form-control {
    min-height: 31px;
    padding: 4px 8px 4px 29px;
    font-size: 12px;
}

.sp-user-search-form .btn {
    min-height: 31px;
    padding: 4px 9px;
    font-size: 11px;
}

.sp-user-list-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sp-user-list-scroll {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-user-table {
    min-width: 980px;
    font-size: 12px;
}

.sp-user-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 6px 8px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: var(--sp-color-surface-soft, #f8fafc);
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .01em;
    white-space: nowrap;
}

.sp-user-table tbody td {
    padding: 6px 8px;
    border-color: #edf0f5;
    vertical-align: middle;
}

.sp-user-name-link,
.sp-user-mail-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-user-name-link {
    color: var(--sp-color-text, #20253f);
    font-weight: 650;
    text-decoration: none;
}

.sp-user-name-link:hover {
    color: var(--sp-color-primary, #574c9c);
    text-decoration: underline;
}

.sp-user-mail-link {
    color: #45516d;
    text-decoration: none;
}

.sp-user-mail-link:hover {
    color: var(--sp-color-primary, #574c9c);
    text-decoration: underline;
}

.sp-user-primary-text {
    color: var(--sp-color-text, #20253f);
}

.sp-user-secondary,
.sp-user-date-cell {
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-user-empty {
    padding: 34px 18px;
    text-align: center;
}

.sp-user-edit-form {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-user-edit-card {
    max-width: 1180px;
}

.sp-user-edit-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px !important;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sp-user-validation {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #e3b9bd;
    border-radius: 7px;
    background: #fff5f5;
    color: #8b3039;
    font-size: 10.5px;
    line-height: 15px;
}

.sp-user-validation-title {
    margin-bottom: 2px;
    font-weight: 650;
}

.sp-user-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 1120px;
}

.sp-user-form-section {
    min-width: 0;
    padding: 10px;
    border: 1px solid #e4e7ee;
    border-radius: 7px;
    background: #fbfcfe;
}

.sp-user-form-section-wide {
    grid-column: 1 / -1;
}

.sp-user-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eceef3;
}

.sp-user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.sp-user-field {
    min-width: 0;
}

.sp-user-field-wide {
    grid-column: 1 / -1;
}

.sp-user-edit-page .form-label {
    margin-bottom: 3px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    font-weight: 600;
}

.sp-user-edit-page .form-control,
.sp-user-edit-page .form-select {
    min-height: 31px;
    padding: 4px 8px;
    font-size: 12px;
}

.sp-user-active-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid #dfe3ec;
    border-radius: 7px;
    background: #fff;
}

.sp-user-active-title {
    color: var(--sp-color-text, #20253f);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 15px;
}

.sp-user-active-hint {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10px;
    line-height: 13px;
}

.sp-user-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: pointer;
}

.sp-user-switch > input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-user-switch > span[aria-hidden="true"] {
    position: relative;
    display: block;
    width: 34px;
    height: 19px;
    border: 1px solid #b9bfcd;
    border-radius: 999px;
    background: #e8ebf1;
    transition: background .15s ease, border-color .15s ease;
}

.sp-user-switch > span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .24);
    transition: transform .15s ease;
}

.sp-user-switch > input[type="checkbox"]:checked + span[aria-hidden="true"] {
    border-color: var(--sp-color-primary, #6d61b5);
    background: var(--sp-color-primary, #6d61b5);
}

.sp-user-switch > input[type="checkbox"]:checked + span[aria-hidden="true"]::after {
    transform: translateX(15px);
}

.sp-user-switch > input[type="checkbox"]:focus-visible + span[aria-hidden="true"] {
    outline: 2px solid color-mix(in srgb, var(--sp-color-primary, #6d61b5) 35%, transparent);
    outline-offset: 2px;
}

.sp-user-personnel-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, .9fr);
    gap: 10px;
    align-items: stretch;
}

.sp-user-personnel-info {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #dde2ec;
    border-radius: 7px;
    background: #fff;
}

.sp-user-info-icon {
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 1px solid #cbd1dc;
    border-radius: 50%;
    color: #697086;
    font-size: 11px;
    font-weight: 700;
}

.sp-user-info-title {
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 650;
    line-height: 15px;
}

.sp-user-info-text {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 15px;
}

.sp-user-notes {
    min-height: 92px !important;
    resize: vertical;
}

.sp-user-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-user-host,
    .sp-tabpane-inner:has([data-sp-user-list="1"]),
    .sp-tabpane-inner:has([data-sp-user-edit="1"]) {
        overflow: auto !important;
    }

    .sp-user-list-page,
    .sp-user-edit-page,
    .sp-user-edit-form,
    .sp-user-list-card,
    .sp-user-edit-card {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-user-card-header,
    .sp-user-search-form {
        align-items: stretch;
    }

    .sp-user-card-header {
        flex-direction: column;
    }

    .sp-user-search-form {
        flex-wrap: wrap;
        width: 100%;
    }

    .sp-user-search-box {
        flex: 1 1 100%;
        min-width: 0;
    }

    .sp-user-list-scroll,
    .sp-user-edit-body {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sp-user-form-layout,
    .sp-user-form-grid,
    .sp-user-personnel-layout {
        grid-template-columns: 1fr;
    }

    .sp-user-form-section-wide,
    .sp-user-field-wide {
        grid-column: auto;
    }
}

/* ========================================================================== */
/* StagePilot App Shell v13 – Reportdaten                                     */
/* ========================================================================== */

.sp-tabpane-inner.sp-report-settings-host,
.sp-tabpane-inner:has([data-sp-report-settings="1"]) {
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

.sp-report-settings-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 12px 0;
    color: var(--sp-color-text, #20253f);
}

.sp-report-settings-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 2px 2px 9px;
}

.sp-report-settings-heading-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-report-settings-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #dfe3ed;
    border-radius: 8px;
    background: #f6f7fb;
    color: #49516d;
    font-size: 16px;
}

.sp-report-settings-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sp-report-settings-title {
    color: var(--sp-color-text, #20253f);
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
}

.sp-report-settings-subtitle {
    margin-top: 2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 15px;
}

.sp-report-settings-divider {
    color: #b2b7c5;
}

.sp-report-settings-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid #d9deea;
    border-radius: 999px;
    background: #f7f8fb;
    color: #59617a;
    font-size: 10px;
    font-weight: 650;
    line-height: 14px;
    white-space: nowrap;
}

.sp-report-settings-badge.is-default {
    border-color: #c9ddce;
    background: #f0f8f2;
    color: #34734a;
}

.sp-report-settings-heading-stats {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    border: 1px solid #e1e4ec;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.sp-report-settings-stat {
    min-width: 82px;
    padding: 5px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e8eaf0;
}

.sp-report-settings-stat:first-child {
    border-left: 0;
}

.sp-report-settings-stat-value {
    color: #252b43;
    font-size: 12px;
    font-weight: 700;
    line-height: 15px;
}

.sp-report-settings-stat-label {
    color: #7a8194;
    font-size: 9.5px;
    line-height: 12px;
    white-space: nowrap;
}

.sp-report-settings-form {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-report-settings-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 0 3px 10px 0;
}

.sp-report-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    padding: 7px 9px;
    border: 1px solid #dfe3ec;
    border-radius: 7px;
    background: #f8f9fb;
    color: #505870;
    font-size: 10.5px;
    line-height: 15px;
}

.sp-report-message.is-success {
    border-color: #cfe4d5;
    background: #f2f9f4;
    color: #39734a;
}

.sp-report-message.is-warning {
    border-color: #ead9b8;
    background: #fff9ed;
    color: #755b29;
}

.sp-report-settings-topgrid,
.sp-report-settings-midgrid {
    display: grid;
    gap: 10px;
    align-items: start;
}

.sp-report-settings-topgrid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.sp-report-settings-midgrid {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
    margin-top: 10px;
}

.sp-report-card {
    border: 1px solid #dfe3eb;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    background: #fff;
}

.sp-report-mapping-card,
.sp-report-layouts-card {
    margin-top: 10px;
}

.sp-report-card-header {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px solid #e5e7ee;
    background: #fafbfc;
}

.sp-report-card-header-split {
    flex-wrap: wrap;
}

.sp-report-card-title {
    color: #2a3047;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 15px;
}

.sp-report-card-subtitle {
    margin-top: 1px;
    color: #7a8193;
    font-size: 9.5px;
    line-height: 13px;
}

.sp-report-card-body {
    padding: 10px;
}

.sp-report-profile-strip {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(180px, .9fr) minmax(280px, 1.4fr);
    gap: 8px;
    align-items: end;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eceef3;
}

.sp-report-form-grid,
.sp-report-bank-grid,
.sp-report-footer-grid,
.sp-report-contact-grid {
    display: grid;
    gap: 8px;
}

.sp-report-form-grid-company {
    grid-template-columns: minmax(0, 1.25fr) minmax(100px, .42fr) minmax(150px, .8fr) minmax(140px, .7fr);
}

.sp-report-field-wide {
    grid-column: span 2;
}

.sp-report-field-street {
    grid-column: span 2;
}

.sp-report-bank-grid {
    grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.3fr) minmax(110px, .55fr);
}

.sp-report-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #eceef3;
}

.sp-report-contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sp-report-field {
    min-width: 0;
}

.sp-report-settings-page .form-label {
    margin-bottom: 2px;
    color: #5b6378;
    font-size: 9.5px;
    font-weight: 650;
    line-height: 12px;
}

.sp-report-settings-page .form-control,
.sp-report-settings-page .form-select {
    min-height: 30px;
    border-color: #d7dbe5;
    border-radius: 6px;
    font-size: 10.5px;
    line-height: 15px;
}

.sp-report-settings-page .form-control:focus,
.sp-report-settings-page .form-select:focus {
    border-color: #9aa7c7;
    box-shadow: 0 0 0 .12rem rgba(79, 96, 145, .12);
}

.sp-report-settings-page .form-control-sm,
.sp-report-settings-page .form-select-sm {
    min-height: 27px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 10px;
}

.sp-report-field-hint {
    margin-top: 2px;
    color: #8b91a0;
    font-size: 9px;
    line-height: 12px;
}

.sp-report-default-panel {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid #e2e5ec;
    border-radius: 7px;
    background: #f8f9fb;
}

.sp-report-default-title {
    color: #343b53;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 14px;
}

.sp-report-default-hint {
    margin-top: 1px;
    color: #818899;
    font-size: 9px;
    line-height: 12px;
}

.sp-report-switch,
.sp-report-mini-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.sp-report-switch input,
.sp-report-mini-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.sp-report-switch > span[aria-hidden="true"],
.sp-report-mini-switch > span[aria-hidden="true"] {
    position: relative;
    display: inline-block;
    border: 1px solid #bec4d2;
    border-radius: 999px;
    background: #dfe2e9;
    transition: background-color .12s ease, border-color .12s ease;
}

.sp-report-switch > span[aria-hidden="true"] {
    width: 34px;
    height: 18px;
}

.sp-report-mini-switch > span[aria-hidden="true"] {
    width: 28px;
    height: 16px;
}

.sp-report-switch > span[aria-hidden="true"]::after,
.sp-report-mini-switch > span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 27, 45, .18);
    transition: transform .12s ease;
}

.sp-report-switch > span[aria-hidden="true"]::after {
    width: 12px;
    height: 12px;
}

.sp-report-mini-switch > span[aria-hidden="true"]::after {
    width: 10px;
    height: 10px;
}

.sp-report-switch input:checked + span[aria-hidden="true"],
.sp-report-mini-switch input:checked + span[aria-hidden="true"] {
    border-color: #6374a5;
    background: #6374a5;
}

.sp-report-switch input:checked + span[aria-hidden="true"]::after {
    transform: translateX(16px);
}

.sp-report-mini-switch input:checked + span[aria-hidden="true"]::after {
    transform: translateX(12px);
}

.sp-report-switch input:focus-visible + span[aria-hidden="true"],
.sp-report-mini-switch input:focus-visible + span[aria-hidden="true"] {
    outline: 2px solid rgba(79, 96, 145, .25);
    outline-offset: 2px;
}

.sp-report-logo-card {
    align-self: stretch;
}

.sp-report-logo-preview {
    height: 144px;
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid #e0e3ea;
    border-radius: 7px;
    background: #fafbfc;
}

.sp-report-logo-preview img {
    max-width: 100%;
    max-height: 118px;
    object-fit: contain;
}

.sp-report-logo-meta {
    min-width: 0;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #7c8394;
    font-size: 9.5px;
    line-height: 13px;
    overflow-wrap: anywhere;
}

.sp-report-logo-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4b556f;
    font-weight: 650;
}

.sp-report-logo-state.is-present {
    color: #39754b;
}

.sp-report-logo-empty {
    height: 144px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px dashed #cfd4df;
    border-radius: 7px;
    background: #fafbfc;
    color: #8a91a2;
    font-size: 10px;
}

.sp-report-logo-empty i {
    font-size: 24px;
    color: #b1b6c3;
}

.sp-report-remove-logo {
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #656d82;
    font-size: 10px;
    cursor: pointer;
}

.sp-report-info-box,
.sp-report-layout-info,
.sp-report-card-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #687087;
    font-size: 9.5px;
    line-height: 14px;
}

.sp-report-info-box {
    padding: 7px 8px;
    border: 1px solid #e0e4ed;
    border-radius: 6px;
    background: #f8f9fb;
}

.sp-report-layout-info {
    padding: 8px 10px;
    border-bottom: 1px solid #e6e8ee;
    background: #f7f9fc;
}

.sp-report-card-note {
    padding: 7px 10px;
    border-top: 1px solid #e6e8ee;
    background: #fafbfc;
}

.sp-report-info-box i,
.sp-report-layout-info i,
.sp-report-card-note i {
    flex: 0 0 auto;
    margin-top: 1px;
}

.sp-report-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.sp-report-table {
    width: 100%;
    table-layout: fixed;
    color: #343a50;
    font-size: 10px;
}

.sp-report-table thead th {
    padding: 6px 7px;
    border-bottom: 1px solid #dfe3eb;
    background: #f4f6f9;
    color: #666e82;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    vertical-align: middle;
}

.sp-report-table tbody td {
    padding: 6px 7px;
    border-color: #edf0f4;
    vertical-align: middle;
}

.sp-report-table tbody tr:hover td {
    background: #fbfcfe;
}

.sp-report-mapping-table {
    min-width: 1120px;
}

.sp-report-mapping-table .sp-report-col-report {
    width: 150px;
}

.sp-report-mapping-table th:nth-child(2) {
    width: 255px;
}

.sp-report-mapping-table th:nth-child(3) {
    width: 180px;
}

.sp-report-col-toggle {
    width: 128px;
    text-align: center;
}

.sp-report-row-title {
    color: #30364d;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 14px;
}

.sp-report-row-key {
    margin-top: 1px;
    color: #9298a7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 8.5px;
    line-height: 11px;
}

.sp-report-layout-table {
    min-width: 920px;
}

.sp-report-layout-table .sp-report-col-active {
    width: 62px;
    text-align: center;
}

.sp-report-layout-table th:nth-child(2) {
    width: 210px;
}

.sp-report-layout-table th:nth-child(3) {
    width: 220px;
}

.sp-report-layout-table .sp-report-col-sort {
    width: 92px;
}

.sp-report-new-layout-row td {
    background: #fafbfc;
}

.sp-report-bottom-spacer {
    height: 2px;
}

.sp-report-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1279.98px) {
    .sp-report-settings-topgrid,
    .sp-report-settings-midgrid {
        grid-template-columns: 1fr;
    }

    .sp-report-logo-card {
        align-self: auto;
    }

    .sp-report-logo-card .sp-report-card-body {
        display: grid;
        grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .sp-report-logo-card .sp-report-info-box,
    .sp-report-logo-card .sp-report-field.mt-3 {
        margin-top: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-report-settings-host,
    .sp-tabpane-inner:has([data-sp-report-settings="1"]) {
        overflow: auto !important;
    }

    .sp-report-settings-page,
    .sp-report-settings-form,
    .sp-report-settings-scroll {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-report-settings-page {
        padding: 10px;
    }

    .sp-report-settings-heading {
        align-items: flex-start;
    }

    .sp-report-settings-heading-stats {
        display: none;
    }

    .sp-report-profile-strip,
    .sp-report-form-grid-company,
    .sp-report-bank-grid,
    .sp-report-footer-grid,
    .sp-report-contact-grid,
    .sp-report-logo-card .sp-report-card-body {
        grid-template-columns: 1fr 1fr;
    }

    .sp-report-default-panel,
    .sp-report-field-wide,
    .sp-report-field-street,
    .sp-report-logo-preview,
    .sp-report-logo-empty,
    .sp-report-logo-meta,
    .sp-report-remove-logo,
    .sp-report-logo-card .sp-report-info-box {
        grid-column: 1 / -1;
    }
}

@media (max-width: 639.98px) {
    .sp-report-profile-strip,
    .sp-report-form-grid-company,
    .sp-report-bank-grid,
    .sp-report-footer-grid,
    .sp-report-contact-grid,
    .sp-report-logo-card .sp-report-card-body {
        grid-template-columns: 1fr;
    }

    .sp-report-settings-title-row {
        flex-wrap: wrap;
    }
}

/* ========================================================================== */
/* StagePilot App Shell v14 – Nachrichtencenter                               */
/* ========================================================================== */

.sp-tabpane-inner.sp-message-center-host,
.sp-tabpane-inner:has([data-sp-message-center-page="1"]) {
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-message-center-host,
    .sp-tabpane-inner:has([data-sp-message-center-page="1"]) {
        height: auto;
        min-height: 0;
        overflow: auto !important;
    }
}

/* ========================================================================== */
/* StagePilot App Shell v15 – Kalenderabonnements                             */
/* ========================================================================== */

.sp-tabpane-inner.sp-calendar-host,
.sp-tabpane-inner:has([data-sp-calendar-list-page="1"]),
.sp-tabpane-inner:has([data-sp-calendar-edit-page="1"]),
.sp-tabpane-inner:has([data-sp-calendar-access-page="1"]) {
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

.sp-calendar-list-page,
.sp-calendar-edit-page,
.sp-calendar-access-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    padding: 10px 12px 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
}

.sp-calendar-list-heading,
.sp-calendar-edit-heading,
.sp-calendar-access-heading {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 14px;
    padding: 1px 1px 0;
}

.sp-calendar-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.sp-calendar-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid #dde2eb;
    border-radius: 8px;
    background: #f5f7fb;
    color: #4d5570;
    font-size: 16px;
}

.sp-calendar-heading-icon.is-key {
    border-color: #ead8a8;
    background: #fff8e7;
}

.sp-calendar-heading-title-row,
.sp-calendar-section-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    gap: 7px;
}

.sp-calendar-heading-title {
    color: var(--sp-color-text, #20253f);
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
}

.sp-calendar-heading-subtitle {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-calendar-heading-subtitle strong {
    color: #4c5368;
    font-weight: 650;
}

.sp-calendar-heading-count,
.sp-calendar-selection-count,
.sp-calendar-once-badge {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 2px 7px;
    border: 1px solid #dfe4ec;
    border-radius: 999px;
    background: #f8f9fb;
    color: #697087;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    white-space: nowrap;
}

.sp-calendar-once-badge {
    border-color: #ead8a8;
    background: #fff8e7;
    color: #8a6200;
}

.sp-calendar-summary-divider {
    color: #b0b5c0;
}

.sp-calendar-heading-stats {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 5px;
}

.sp-calendar-stat {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 4px;
    min-width: 72px;
    padding: 5px 8px;
    border: 1px solid #e1e5ec;
    border-radius: 6px;
    background: #fff;
}

.sp-calendar-stat-value {
    color: #32384d;
    font-size: 13px;
    font-weight: 750;
    line-height: 16px;
}

.sp-calendar-stat-label {
    color: #777e90;
    font-size: 8.5px;
    font-weight: 650;
    line-height: 11px;
    white-space: nowrap;
}

.sp-calendar-info-strip,
.sp-calendar-access-warning,
.sp-calendar-sync-note {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid #dce5f4;
    border-radius: 7px;
    background: #f6f9fe;
    color: #596178;
    font-size: 9.5px;
    line-height: 13px;
}

.sp-calendar-info-strip strong,
.sp-calendar-access-warning strong,
.sp-calendar-sync-note strong {
    color: #424a61;
    font-weight: 700;
}

.sp-calendar-info-icon,
.sp-calendar-access-warning-icon {
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e6eefc;
    color: #3f6fe8;
    font-size: 10px;
    font-weight: 800;
}

.sp-calendar-info-access {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid #dfe5ef;
    text-align: right;
    white-space: nowrap;
}

.sp-calendar-list-card,
.sp-calendar-section-card,
.sp-calendar-client-card {
    border: 1px solid #e0e4eb;
    box-shadow: 0 1px 2px rgba(26, 32, 44, .035) !important;
}

.sp-calendar-list-card {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-calendar-card-header,
.sp-calendar-section-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px solid #e2e6ed;
    background: #fafbfc;
}

.sp-calendar-card-title,
.sp-calendar-section-title {
    color: #343a50;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
}

.sp-calendar-card-subtitle,
.sp-calendar-section-subtitle {
    margin-top: 1px;
    color: #858b9a;
    font-size: 8.8px;
    line-height: 11px;
}

.sp-calendar-list-body {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-calendar-list-scroll {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sp-calendar-table {
    min-width: 1080px;
    color: #353b50;
    font-size: 10px;
}

.sp-calendar-table thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 6px 8px;
    border-bottom: 1px solid #dce1e8;
    background: #f4f6f9;
    color: #686f82;
    font-size: 8.8px;
    font-weight: 700;
    line-height: 12px;
    vertical-align: middle;
}

.sp-calendar-table tbody td {
    padding: 7px 8px;
    border-color: #edf0f4;
    line-height: 14px;
    vertical-align: middle;
}

.sp-calendar-table tbody tr:hover td {
    background: #fbfcfe;
}

.sp-calendar-row.is-disabled td {
    background: #fcfcfd;
    color: #777e8e;
}

.sp-calendar-color-dot {
    display: block;
    width: 13px;
    height: 13px;
    margin: auto;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sp-calendar-color, #3f6fe8);
    box-shadow: 0 0 0 1px rgba(54, 61, 80, .18);
}

.sp-calendar-name-link {
    color: #344766;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
}

.sp-calendar-name-link:hover {
    color: #315dd2;
    text-decoration: underline;
}

.sp-calendar-row-meta {
    margin-top: 1px;
    color: #949aa8;
    font-size: 8.5px;
    line-height: 11px;
}

.sp-calendar-chip-row,
.sp-calendar-row-actions,
.sp-calendar-footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.sp-calendar-row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.sp-calendar-row-actions form {
    margin: 0;
}

.sp-calendar-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 6px;
    border: 1px solid #e1e5ec;
    border-radius: 999px;
    background: #f8f9fb;
    color: #676e80;
    font-size: 8.7px;
    font-weight: 650;
    line-height: 11px;
}

.sp-calendar-status {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    white-space: nowrap;
}

.sp-calendar-status.is-active {
    border-color: #c8e2d2;
    background: #eef8f2;
    color: #28643e;
}

.sp-calendar-status.is-disabled {
    border-color: #dfe2e7;
    background: #f4f5f7;
    color: #737987;
}

.sp-calendar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    gap: 12px;
    padding: 28px;
    text-align: left;
}

.sp-calendar-empty-icon {
    font-size: 30px;
}

.sp-calendar-empty-title {
    color: #41485e;
    font-size: 12px;
    font-weight: 700;
}

.sp-calendar-empty-text {
    margin-top: 2px;
    color: #858b99;
    font-size: 9.5px;
}

/* Edit */
.sp-calendar-edit-form {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sp-calendar-edit-scroll,
.sp-calendar-access-scroll {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    padding: 0 2px 8px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.sp-calendar-edit-topgrid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr);
    gap: 8px;
    align-items: start;
}

.sp-calendar-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.sp-calendar-section-body {
    padding: 9px 10px;
}

.sp-calendar-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px 9px;
}

.sp-calendar-field {
    min-width: 0;
}

.sp-calendar-field-wide {
    grid-column: span 3;
}

.sp-calendar-color-field {
    grid-column: span 1;
}

.sp-calendar-field .form-label,
.sp-calendar-mini-label {
    display: block;
    margin: 0 0 3px;
    color: #666d80;
    font-size: 8.8px;
    font-weight: 700;
    line-height: 11px;
}

.sp-calendar-field .form-control,
.sp-calendar-field .form-select {
    min-height: 30px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 10px;
}

.sp-calendar-field-hint,
.sp-calendar-active-hint {
    margin-top: 3px;
    color: #9298a7;
    font-size: 8.4px;
    line-height: 11px;
}

.sp-calendar-color-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-calendar-color-control .form-control-color {
    flex: 0 0 56px;
    width: 56px;
    height: 30px;
    min-height: 30px;
    padding: 3px;
}

.sp-calendar-color-value {
    color: #747b8d;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 9px;
}

.sp-calendar-range-field {
    grid-column: span 2;
}

.sp-calendar-range-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.sp-calendar-active-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    padding: 7px 9px;
    border: 1px solid #e2e6ed;
    border-radius: 6px;
    background: #fafbfc;
}

.sp-calendar-active-title {
    color: #434a60;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
}

.sp-calendar-section-head-toggle {
    align-items: flex-start;
}

.sp-calendar-section-head-toggle .form-check {
    flex: 0 0 auto;
    padding-top: 1px;
    font-size: 9.5px;
}

.sp-calendar-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.sp-calendar-status-option,
.sp-calendar-inline-option {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 5px 7px;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    background: #fbfcfd;
    color: #545b70;
    cursor: pointer;
    font-size: 9.5px;
    line-height: 12px;
}

.sp-calendar-status-option:hover,
.sp-calendar-inline-option:hover {
    border-color: #cad7f3;
    background: #f7f9fe;
}

.sp-calendar-status-option .form-check-input,
.sp-calendar-inline-option .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.sp-calendar-preview-card {
    position: sticky;
    top: 0;
}

.sp-calendar-preview {
    min-height: 76px;
    padding: 7px;
    border: 1px solid #e0e5ed;
    border-radius: 6px;
    background: #fafbfc;
}

.sp-calendar-preview-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    color: #7e8596;
    font-size: 9px;
    line-height: 12px;
}

.sp-calendar-preview-placeholder > span {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #dce1e9;
    border-radius: 6px;
    background: #fff;
    color: #63708c;
    font-size: 14px;
}

.sp-calendar-preview-placeholder strong {
    display: block;
    margin-bottom: 2px;
    color: #52596e;
}

.sp-calendar-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.sp-calendar-preview-grid > div {
    padding: 7px 5px;
    border: 1px solid #e3e7ed;
    border-radius: 5px;
    background: #fff;
    text-align: center;
}

.sp-calendar-preview-value {
    color: #35476b;
    font-size: 15px;
    font-weight: 750;
    line-height: 18px;
}

.sp-calendar-preview-label {
    margin-top: 1px;
    color: #858b99;
    font-size: 8px;
    font-weight: 650;
    line-height: 10px;
}

.sp-calendar-security-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 7px 8px;
    border: 1px solid #eadfbf;
    border-radius: 6px;
    background: #fffbf0;
    color: #766b4c;
    font-size: 8.8px;
    line-height: 12px;
}

.sp-calendar-security-note strong {
    display: block;
    margin-bottom: 1px;
    color: #675a36;
    font-size: 9.3px;
}

.sp-calendar-security-icon {
    flex: 0 0 auto;
    font-size: 13px;
}

.sp-calendar-security-actions {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e6e8ed;
}

.sp-calendar-security-actions .btn {
    font-size: 9.5px;
}

.sp-calendar-validation {
    margin-bottom: 8px;
    padding: 7px 9px;
    border: 1px solid #e7bcbc;
    border-radius: 6px;
    background: #fff5f5;
    color: #8c3939;
    font-size: 9.5px;
    line-height: 13px;
}

.sp-calendar-validation-title {
    margin-bottom: 2px;
    font-weight: 700;
}

/* Access key */
.sp-calendar-access-warning {
    margin-bottom: 8px;
    border-color: #ead7aa;
    background: #fff9eb;
    color: #746748;
}

.sp-calendar-access-warning-icon {
    background: #f6e7bf;
    color: #8a6500;
}

.sp-calendar-link-card {
    margin-bottom: 8px;
}

.sp-calendar-link-row {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.sp-calendar-link-row + .sp-calendar-link-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eceef2;
}

.sp-calendar-link-label {
    min-width: 0;
}

.sp-calendar-link-label strong {
    display: block;
    color: #444b60;
    font-size: 9.8px;
    line-height: 12px;
}

.sp-calendar-link-label span {
    display: block;
    margin-top: 2px;
    color: #8a909e;
    font-size: 8.3px;
    line-height: 11px;
}

.sp-calendar-link-control .form-control,
.sp-calendar-link-control .btn {
    min-height: 30px;
    font-size: 9px;
}

.sp-calendar-link-control .form-control {
    color: #4a5268;
}

.sp-calendar-client-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sp-calendar-client-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
}

.sp-calendar-client-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e0e4eb;
    border-radius: 7px;
    background: #f7f8fa;
    color: #555d73;
    font-size: 13px;
    font-weight: 800;
}

.sp-calendar-client-card h2 {
    margin: 0 0 4px;
    color: #41485e;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 13px;
}

.sp-calendar-client-card p {
    margin: 0;
    color: #747b8d;
    font-size: 8.8px;
    line-height: 12px;
}

.sp-calendar-client-card p + p {
    margin-top: 4px;
}

.sp-calendar-sync-note {
    margin-top: 8px;
}

.sp-calendar-sync-note > span {
    flex: 0 0 auto;
    color: #5170b1;
    font-size: 15px;
}

.sp-calendar-bottom-spacer {
    height: 2px;
}

@media (max-width: 1279.98px) {
    .sp-calendar-edit-topgrid {
        grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr);
    }

    .sp-calendar-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-calendar-field-wide,
    .sp-calendar-range-field {
        grid-column: span 2;
    }

    .sp-calendar-color-field {
        grid-column: span 1;
    }

    .sp-calendar-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-calendar-host,
    .sp-tabpane-inner:has([data-sp-calendar-list-page="1"]),
    .sp-tabpane-inner:has([data-sp-calendar-edit-page="1"]),
    .sp-tabpane-inner:has([data-sp-calendar-access-page="1"]) {
        height: auto;
        min-height: 0;
        overflow: auto !important;
    }

    .sp-calendar-list-page,
    .sp-calendar-edit-page,
    .sp-calendar-access-page,
    .sp-calendar-edit-form,
    .sp-calendar-edit-scroll,
    .sp-calendar-access-scroll {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-calendar-list-page,
    .sp-calendar-edit-page,
    .sp-calendar-access-page {
        padding: 10px;
    }

    .sp-calendar-list-heading,
    .sp-calendar-edit-heading,
    .sp-calendar-access-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-calendar-heading-stats {
        width: 100%;
        overflow-x: auto;
    }

    .sp-calendar-info-strip {
        align-items: flex-start;
    }

    .sp-calendar-info-access {
        display: none;
    }

    .sp-calendar-list-card {
        min-height: 420px;
    }

    .sp-calendar-list-scroll {
        max-height: 65vh;
    }

    .sp-calendar-edit-topgrid,
    .sp-calendar-source-grid {
        grid-template-columns: 1fr;
    }

    .sp-calendar-preview-card {
        position: static;
    }

    .sp-calendar-client-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 639.98px) {
    .sp-calendar-form-grid,
    .sp-calendar-range-grid,
    .sp-calendar-status-grid,
    .sp-calendar-link-row {
        grid-template-columns: 1fr;
    }

    .sp-calendar-field-wide,
    .sp-calendar-range-field,
    .sp-calendar-color-field {
        grid-column: auto;
    }

    .sp-calendar-link-control {
        width: 100%;
    }

    .sp-calendar-footer-actions {
        width: 100%;
    }
}

/* ========================================================================== */
/* StagePilot App Shell v16 – Dashboard                                       */
/* ========================================================================== */

.sp-tabpane-inner.sp-dashboard-host,
.sp-tabpane-inner:has([data-sp-dashboard="1"]) {
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

.sp-dashboard-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    padding: 10px 12px 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
}

.sp-dashboard-heading {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 14px;
    padding: 1px 1px 0;
}

.sp-dashboard-heading-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.sp-dashboard-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid #dde2eb;
    border-radius: 8px;
    background: #f5f7fb;
    color: #4d5570;
    font-size: 17px;
    line-height: 1;
}

.sp-dashboard-heading-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    gap: 7px;
}

.sp-dashboard-heading-title {
    color: var(--sp-color-text, #20253f);
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
}

.sp-dashboard-heading-subtitle {
    margin-top: 2px;
    color: var(--sp-color-text-muted, #687087);
    font-size: 10.5px;
    line-height: 14px;
}

.sp-dashboard-heading-badge {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 2px 7px;
    border: 1px solid #dfe4ec;
    border-radius: 999px;
    background: #f8f9fb;
    color: #697087;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    white-space: nowrap;
}

.sp-dashboard-heading-meta {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 1px;
    max-width: 320px;
    color: #4b5368;
    font-size: 10px;
    line-height: 13px;
    text-align: right;
}

.sp-dashboard-heading-meta-label {
    color: #8a90a0;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sp-dashboard-commandbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-width: 0;
    min-height: 38px;
    padding: 4px 6px;
    border: 1px solid #e1e5ec;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .025);
}

.sp-dashboard-command-group,
.sp-dashboard-command-status {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sp-dashboard-command-label {
    color: #7b8295;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    white-space: nowrap;
}

.sp-dashboard-command-separator {
    flex: 0 0 1px;
    width: 1px;
    height: 22px;
    margin: 0 8px;
    background: #e5e8ee;
}

.sp-dashboard-command-status {
    color: #777f92;
    font-size: 9.5px;
    line-height: 12px;
    white-space: nowrap;
}

.sp-dashboard-live-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #2f9e69;
    box-shadow: 0 0 0 3px rgba(47, 158, 105, .10);
}

.sp-dashboard-refresh-button {
    margin-left: auto;
}

.sp-dashboard-commandbar .btn,
.sp-dashboard-commandbar .form-select,
.sp-dashboard-panel-tools .btn,
.sp-dashboard-panel-tools .form-control,
.sp-dashboard-panel-tools .form-select,
.sp-dashboard-number-control .form-control {
    border-radius: 5px !important;
    font-size: 9.5px;
}

.sp-dashboard-commandbar .btn,
.sp-dashboard-panel-tools .btn {
    min-height: 27px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.sp-dashboard-commandbar .btn-primary,
.sp-dashboard-panel-tools .btn-primary {
    background: var(--sp-color-primary, #635cad);
    border-color: var(--sp-color-primary, #635cad);
    color: #fff;
}

.sp-dashboard-commandbar .btn-outline-primary,
.sp-dashboard-panel-tools .btn-outline-primary,
.sp-dashboard-refresh-button {
    border-color: #d5dbe6;
    background: #fff;
    color: #53618a;
}

.sp-dashboard-commandbar .btn-outline-primary:hover,
.sp-dashboard-panel-tools .btn-outline-primary:hover,
.sp-dashboard-refresh-button:hover {
    border-color: #c9cede;
    background: #f4f5fb;
    color: #49457f;
}

.sp-dashboard-refresh-select {
    width: 112px !important;
    min-height: 27px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.sp-dashboard-workspace {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    padding-right: 2px;
    padding-bottom: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.sp-dashboard-panel {
    flex: 0 0 auto;
    min-width: 0;
    border: 1px solid #e1e5ec;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .025);
    overflow: hidden;
}

.sp-dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 43px;
    gap: 10px;
    padding: 5px 8px 5px 9px;
    border-bottom: 1px solid #e8ebf1;
    background: #fafbfc;
}

.sp-dashboard-panel-title-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.sp-dashboard-panel-icon {
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border: 1px solid #e0e4eb;
    border-radius: 5px;
    background: #fff;
    color: #5f6679;
    font-size: 12px;
    line-height: 1;
}

.sp-dashboard-panel-title {
    color: #33394b;
    font-size: 11px;
    font-weight: 750;
    line-height: 13px;
}

.sp-dashboard-panel-subtitle {
    margin-top: 1px;
    color: #858b9b;
    font-size: 8.6px;
    line-height: 11px;
}

.sp-dashboard-panel-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.sp-dashboard-range {
    min-width: 112px;
    color: #7f8698;
    font-size: 8.8px;
    font-variant-numeric: tabular-nums;
    line-height: 11px;
    text-align: right;
    white-space: nowrap;
}

.sp-dashboard-search {
    width: 205px !important;
}

.sp-dashboard-search .input-group-text {
    border-color: #dfe3ea;
    background: #f7f8fa;
    color: #7c8498;
    font-size: 11px;
}

.sp-dashboard-search .form-control {
    min-height: 27px;
    border-color: #dfe3ea;
}

.sp-dashboard-panel-body {
    min-width: 0;
    background: #fff;
}

.sp-dashboard-planning-body {
    height: 248px;
    min-height: 248px;
}

.sp-dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    height: 100%;
    gap: 7px;
    padding: 12px;
    color: #858b9b;
    font-size: 9.5px;
}

.sp-dashboard-loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #e2e5ec;
    border-top-color: var(--sp-color-primary, #635cad);
    border-radius: 999px;
    animation: sp-dashboard-spin .75s linear infinite;
}

@keyframes sp-dashboard-spin {
    to { transform: rotate(360deg); }
}

/* Existing dashboard.js renders the current Gantt into these selectors. */
.sp-dashboard-page .sp-dashboard-gantt {
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
    grid-template-rows: 35px minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.sp-dashboard-page .sp-dash-gantt-left-head {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-right: 1px solid #e6e9ef;
    border-bottom: 1px solid #e6e9ef;
    background: #f7f8fa;
    color: #737b8f;
    font-size: 8.8px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.sp-dashboard-page .sp-dash-gantt-axis-wrap {
    grid-column: 2;
    grid-row: 1;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid #e6e9ef;
    background: #fbfbfc;
    scrollbar-width: thin;
}

.sp-dashboard-page .sp-dash-gantt-axis {
    min-height: 35px;
}

.sp-dashboard-page .sp-dash-axis-col {
    padding: 4px 2px 3px;
    border-right-color: #eff1f4;
    color: #777f92;
}

.sp-dashboard-page .sp-dash-axis-col.is-weekend {
    background: #f4f3fa;
}

.sp-dashboard-page .sp-dash-axis-day {
    font-size: 8.8px;
    font-weight: 750;
    line-height: 11px;
}

.sp-dashboard-page .sp-dash-axis-dow {
    font-size: 7.5px;
    line-height: 9px;
}

.sp-dashboard-page .sp-dash-gantt-left {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border-right: 1px solid #e6e9ef;
    background: #fff;
    scrollbar-width: thin;
}

.sp-dashboard-page .sp-dash-gantt-body {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    max-height: none;
    overflow: auto;
    background: #fff;
    scrollbar-width: thin;
}

.sp-dashboard-page .sp-dash-left-row {
    padding-inline: 8px;
    border-bottom-color: #edf0f3;
    background: #fff;
    font-size: 9px;
}

.sp-dashboard-page .sp-dash-left-row:hover {
    background: #fafbfc;
}

.sp-dashboard-page .sp-dash-left-row-resource {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 7px;
}

.sp-dashboard-page .sp-dash-left-main,
.sp-dashboard-page .sp-dash-project-no,
.sp-dashboard-page .sp-dash-project-name {
    color: #3c4356;
    font-size: 9px;
}

.sp-dashboard-page .sp-dash-left-main,
.sp-dashboard-page .sp-dash-project-no {
    font-weight: 700;
}

.sp-dashboard-page .sp-dash-left-sub,
.sp-dashboard-page .sp-dash-project-sub {
    color: #858b9b;
    font-size: 7.8px;
    line-height: 10px;
}

.sp-dashboard-page .sp-dash-avatar {
    width: 26px;
    height: 26px;
    border-color: #e0e4ec;
    border-radius: 5px;
    background: #f0eff8;
    color: #625d90;
    font-size: 7.5px;
}

.sp-dashboard-page .sp-dash-project-row {
    padding-left: 6px;
    padding-right: 8px;
}

.sp-dashboard-page .sp-dash-project-line {
    grid-template-columns: 16px 19px minmax(0, 1fr);
    gap: 4px;
}

.sp-dashboard-page .sp-dash-project-toggle,
.sp-dashboard-page .sp-dash-project-toggle-spacer,
.sp-dashboard-page .sp-dash-project-kind {
    width: 16px;
    height: 16px;
    min-width: 16px;
}

.sp-dashboard-page .sp-dash-project-toggle {
    border-radius: 4px;
    color: #625d90;
}

.sp-dashboard-page .sp-dash-project-sub {
    padding-left: calc(var(--sp-project-indent, 0px) + 39px);
}

.sp-dashboard-page .sp-dash-grid-row {
    border-bottom-color: #edf0f3;
    background: repeating-linear-gradient(to right, #f0f2f5 0, #f0f2f5 1px, transparent 1px, transparent 38px);
}

.sp-dashboard-page .sp-dash-gantt-resources .sp-dash-grid-row {
    background: repeating-linear-gradient(to right, #f0f2f5 0, #f0f2f5 1px, transparent 1px, transparent 54px);
}

.sp-dashboard-page .sp-dash-project-grid-row.sp-dash-project-sub,
.sp-dashboard-page .sp-dash-project-sub {
    background-color: #fbfbfd;
}

.sp-dashboard-page .sp-dash-bar {
    height: 20px;
    gap: 5px;
    padding: 0 7px;
    border: 1px solid rgba(72, 79, 100, .12);
    border-radius: 5px;
    box-shadow: none;
}

.sp-dashboard-page .sp-dash-bar-event,
.sp-dashboard-page .sp-dash-bar-resource {
    box-shadow: 0 2px 5px rgba(15, 23, 42, .06);
}

.sp-dashboard-page .sp-dash-bar-resource {
    height: 26px;
}

.sp-dashboard-page .sp-dash-bar-badge {
    min-width: 18px;
    height: 15px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 7px;
}

.sp-dashboard-page .sp-dash-bar-label {
    font-size: 8px;
    font-weight: 700;
}

.sp-dashboard-page .sp-dash-today-line {
    width: 1px;
    background: rgba(205, 73, 73, .72);
    box-shadow: 0 0 0 1px rgba(205, 73, 73, .08);
}

.sp-dashboard-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(245px, .75fr);
    gap: 8px;
    min-width: 0;
}

.sp-dashboard-panel-warehouse,
.sp-dashboard-panel-vehicles {
    min-height: 280px;
}

.sp-dashboard-warehouse-tools {
    gap: 4px;
}

.sp-dashboard-number-control {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 27px;
    padding: 0 5px;
    border: 1px solid #dfe3ea;
    border-radius: 5px;
    background: #fff;
    color: #747c90;
    font-size: 8.5px;
    font-weight: 650;
    white-space: nowrap;
}

.sp-dashboard-number-control .form-control {
    width: 42px;
    min-height: 24px;
    height: 24px;
    padding: 1px 2px;
    border: 0;
    background: transparent;
    box-shadow: none !important;
    font-size: 9px;
    text-align: center;
}

.sp-dashboard-warehouse-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 6px;
    padding: 7px;
}

.sp-dashboard-warehouse-summary {
    flex: 0 0 auto;
    gap: 4px;
}

.sp-dashboard-page .sp-warehouse-summary .badge {
    min-height: 19px;
    padding: 3px 6px;
    border: 1px solid #e0e4eb;
    border-radius: 4px;
    background: #f8f9fb !important;
    color: #687087 !important;
    font-size: 8px;
    font-weight: 700;
}

.sp-dashboard-page .sp-warehouse-summary .badge.text-bg-danger {
    border-color: #ebc9cd;
    background: #fff2f3 !important;
    color: #a33f48 !important;
}

.sp-dashboard-page .sp-warehouse-summary .badge.text-bg-warning {
    border-color: #eadcb0;
    background: #fff8e8 !important;
    color: #8c6a12 !important;
}

.sp-dashboard-warehouse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 6px;
}

.sp-dashboard-page .sp-warehouse-book-panel {
    min-height: 215px;
    border: 1px solid #e4e7ed;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
}

.sp-dashboard-page .sp-warehouse-book-title {
    min-height: 31px;
    gap: 6px;
    padding: 0 8px;
    border-bottom: 1px solid #e7eaf0;
    background: #f8f9fb;
    color: #4b5367;
    font-size: 9px;
    font-weight: 750;
}

.sp-dashboard-direction-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
}

.sp-dashboard-direction-dot.is-out {
    background: #6f6aa3;
}

.sp-dashboard-direction-dot.is-in {
    background: #4d8a73;
}

.sp-dashboard-page .sp-warehouse-book-list {
    max-height: 250px;
    overflow: auto;
    scrollbar-width: thin;
}

.sp-dashboard-page .sp-wh-date-head {
    padding: 4px 8px;
    border-color: #eceef2;
    background: rgba(251, 251, 252, .96);
    color: #83899a;
    font-size: 7.5px;
    letter-spacing: .04em;
}

.sp-dashboard-page .sp-wh-book-row {
    gap: 7px;
    padding: 6px 6px 6px 8px;
    border-bottom-color: #edf0f3;
    border-left-width: 3px;
}

.sp-dashboard-page .sp-wh-book-main {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
}

.sp-dashboard-page .sp-wh-book-time {
    color: #4b5265;
    font-size: 8.5px;
    font-weight: 750;
}

.sp-dashboard-page .sp-wh-book-title-line {
    gap: 4px;
}

.sp-dashboard-page .sp-wh-task {
    color: #41485b;
    font-size: 8.8px;
    font-weight: 750;
}

.sp-dashboard-page .sp-wh-status,
.sp-dashboard-page .sp-wh-offset {
    min-height: 16px;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 7px;
    font-weight: 700;
}

.sp-dashboard-page .sp-wh-project {
    color: #747c8f;
    font-size: 8px;
}

.sp-dashboard-page .sp-wh-reason {
    margin-top: 1px;
    color: #9197a5;
    font-size: 7.2px;
}

.sp-dashboard-page .sp-wh-book-actions .btn {
    min-height: 24px;
    padding: 2px 6px;
    border-radius: 4px !important;
    border-color: #d7dce6;
    color: #59668b;
    font-size: 7.8px;
}

.sp-dashboard-vehicle-body {
    display: flex;
    min-height: 235px;
    padding: 7px;
}

.sp-dashboard-page .sp-dashboard-placeholder-compact {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    gap: 10px;
    padding: 14px;
    border: 1px dashed #d9dee8;
    border-radius: 5px;
    background: #fafbfc;
    text-align: left;
}

.sp-dashboard-page .sp-dashboard-placeholder-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid #e2e5eb;
    border-radius: 6px;
    background: #fff;
    font-size: 16px;
}

.sp-dashboard-placeholder-title {
    color: #4a5164;
    font-size: 9.5px;
    font-weight: 750;
}

.sp-dashboard-placeholder-text {
    margin-top: 2px;
    color: #8a90a0;
    font-size: 8.3px;
    line-height: 11px;
}

.sp-dashboard-modal {
    border-radius: 8px;
    border-color: #dfe3ea;
}

.sp-dashboard-modal .modal-header,
.sp-dashboard-modal .modal-footer {
    border-color: #e7eaf0;
}

.sp-dashboard-modal .form-control {
    border-radius: 5px !important;
}

.sp-dashboard-bottom-spacer {
    flex: 0 0 2px;
    height: 2px;
}

.sp-dashboard-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 1500px) {
    .sp-dashboard-planning-body {
        height: 265px;
        min-height: 265px;
    }

    .sp-dashboard-page .sp-dashboard-gantt {
        grid-template-columns: 275px minmax(0, 1fr);
    }
}

@media (max-width: 1279.98px) {
    .sp-dashboard-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-dashboard-panel-tools {
        width: 100%;
        flex-wrap: wrap;
    }

    .sp-dashboard-range {
        margin-left: auto;
    }

    .sp-dashboard-lower-grid {
        grid-template-columns: 1fr;
    }

    .sp-dashboard-panel-vehicles,
    .sp-dashboard-vehicle-body {
        min-height: 130px;
    }
}

@media (max-width: 991.98px) {
    .sp-tabpane-inner.sp-dashboard-host,
    .sp-tabpane-inner:has([data-sp-dashboard="1"]) {
        height: auto;
        min-height: 0;
        overflow: auto !important;
    }

    .sp-dashboard-page,
    .sp-dashboard-workspace {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sp-dashboard-page {
        padding: 10px;
    }

    .sp-dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-dashboard-heading-meta {
        justify-items: start;
        max-width: none;
        text-align: left;
    }

    .sp-dashboard-commandbar {
        flex-wrap: wrap;
        gap: 5px;
    }

    .sp-dashboard-command-separator {
        display: none;
    }

    .sp-dashboard-command-status {
        order: 3;
        width: 100%;
    }

    .sp-dashboard-refresh-button {
        margin-left: 0;
    }

    .sp-dashboard-planning-body {
        height: 360px;
        min-height: 360px;
    }

    .sp-dashboard-page .sp-dashboard-gantt {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sp-dashboard-resource-tools,
    .sp-dashboard-warehouse-tools {
        align-items: stretch;
    }

    .sp-dashboard-search {
        width: 100% !important;
    }

    .sp-dashboard-warehouse-grid {
        grid-template-columns: 1fr;
    }

    .sp-dashboard-page .sp-warehouse-book-list {
        max-height: 320px;
    }
}

@media (max-width: 639.98px) {
    .sp-dashboard-heading-icon {
        flex-basis: 31px;
        width: 31px;
        height: 31px;
    }

    .sp-dashboard-command-group {
        width: 100%;
        justify-content: space-between;
    }

    .sp-dashboard-commandbar .btn-group {
        flex: 1 1 auto;
    }

    .sp-dashboard-commandbar .btn-group .btn {
        flex: 1 1 0;
    }

    .sp-dashboard-refresh-select {
        width: 145px !important;
    }

    .sp-dashboard-refresh-button {
        width: 100%;
    }

    .sp-dashboard-page .sp-dashboard-gantt {
        grid-template-columns: 185px minmax(0, 1fr);
    }

    .sp-dashboard-panel-tools .btn-group {
        width: 100%;
    }

    .sp-dashboard-panel-tools .btn-group .btn {
        flex: 1 1 0;
    }

    .sp-dashboard-range {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .sp-dashboard-number-control {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* =========================================================
   StagePilot App Shell v16
   Globale Dialoge, Toasts und Login
   ========================================================= */

/* ---------------------------------------------------------
   Globale Bootstrap-Dialoge
   Einheitliche kompakte Optik auch für bestehende Modals, die
   von einzelnen Fachmodulen dynamisch erzeugt werden.
   --------------------------------------------------------- */
.modal-backdrop.show {
    opacity: .30;
}

.modal .modal-dialog {
    --bs-modal-width: 520px;
}

.modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 8px !important;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}

.modal .modal-header {
    min-height: 48px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--sp-app-border, #dfe3ec);
    background: #fafbfc;
}

.modal .modal-title {
    color: var(--sp-color-text, #20253f);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.modal .modal-body {
    padding: 12px;
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    line-height: 1.45;
}

.modal .modal-footer {
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
    background: #fafbfc;
}

.modal .modal-footer .btn,
.modal .modal-header .btn {
    min-height: 30px;
    padding: 3px 9px;
    border-radius: 5px !important;
    box-shadow: none;
    font-size: 10.5px;
}

.modal .modal-body .form-label {
    margin-bottom: 4px;
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 650;
}

.modal .modal-body .form-control,
.modal .modal-body .form-select {
    min-height: 32px;
    padding: 5px 7px;
    border-color: var(--sp-app-border, #dfe3ec);
    border-radius: 5px !important;
    font-size: 11px;
    box-shadow: none;
}

.modal .modal-body .form-control:focus,
.modal .modal-body .form-select:focus {
    border-color: color-mix(in srgb, var(--sp-color-primary, #635cad) 48%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-color-primary, #635cad) 10%, transparent);
}

.sp-ui-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.sp-ui-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #635cad) 20%, #dfe3ec);
    border-radius: 6px;
    background: color-mix(in srgb, var(--sp-color-primary, #635cad) 8%, #fff);
    color: var(--sp-color-primary, #635cad);
    font-size: 12px;
    font-weight: 800;
}

.sp-ui-modal-title {
    font-size: 12px !important;
    font-weight: 750 !important;
}

.sp-ui-modal-kicker {
    margin-top: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sp-confirm-danger .sp-ui-modal-icon {
    border-color: rgba(220, 53, 69, .22);
    background: rgba(220, 53, 69, .09);
    color: #b42318;
}

.sp-confirm-warning .sp-ui-modal-icon {
    border-color: rgba(255, 193, 7, .30);
    background: rgba(255, 193, 7, .15);
    color: #856404;
}

.sp-confirm-success .sp-ui-modal-icon {
    border-color: rgba(25, 135, 84, .22);
    background: rgba(25, 135, 84, .09);
    color: #146c43;
}

.sp-ui-modal-message {
    white-space: normal;
}

.sp-note-input {
    min-height: 112px !important;
    resize: vertical;
    line-height: 1.4;
}

.sp-note-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 5px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
}

.sp-note-hint {
    flex: 1 1 auto;
    min-width: 0;
}

.sp-note-count {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.sp-note-shortcut {
    margin-top: 5px;
    color: var(--sp-color-text-muted, #7d84a0);
    font-size: 8px;
}

/* ---------------------------------------------------------
   Toasts
   --------------------------------------------------------- */
.sp-toast-host {
    top: 12px !important;
    right: 12px !important;
    z-index: 2100 !important;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: min(360px, calc(100vw - 24px));
    padding: 0 !important;
    pointer-events: none;
}

.sp-toast {
    --sp-toast-accent: var(--sp-color-primary, #635cad);
    --sp-toast-soft: color-mix(in srgb, var(--sp-toast-accent) 9%, #fff);

    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 24px;
    align-items: start;
    gap: 9px;
    width: 100%;
    max-width: none;
    padding: 10px;
    pointer-events: auto;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-left: 4px solid var(--sp-toast-accent);
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    color: var(--sp-color-text, #20253f);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .15);
}

.sp-toast-success {
    --sp-toast-accent: #198754;
}

.sp-toast-danger {
    --sp-toast-accent: #dc3545;
}

.sp-toast-warning {
    --sp-toast-accent: #c28a00;
}

.sp-toast-info,
.sp-toast-primary {
    --sp-toast-accent: var(--sp-color-primary, #635cad);
}

.sp-toast-secondary,
.sp-toast-light,
.sp-toast-dark {
    --sp-toast-accent: #6c757d;
}

.sp-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--sp-toast-accent) 22%, #dfe3ec);
    border-radius: 50%;
    background: var(--sp-toast-soft);
    color: var(--sp-toast-accent);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
}

.sp-toast-copy {
    min-width: 0;
}

.sp-toast-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.sp-toast-title {
    min-width: 0;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-toast-small {
    flex: 0 0 auto;
    color: var(--sp-color-text-muted, #7d84a0);
    font-size: 8px;
}

.sp-toast-message {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sp-toast-close {
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    padding: 5px;
    border-radius: 4px;
    opacity: .48;
}

.sp-toast-close:hover {
    background-color: var(--sp-color-surface-soft, #f6f6fd);
    opacity: .8;
}

/* ---------------------------------------------------------
   Login
   --------------------------------------------------------- */
.sp-tabpane-inner:has([data-sp-login-page="1"]) {
    overflow: auto !important;
}

.sp-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 18px;
}

.sp-login-card {
    position: relative;
    width: min(440px, 100%);
    overflow: hidden;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 9px !important;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}

.sp-login-card-body {
    padding: 24px 26px 20px;
}

.sp-login-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sp-login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #635cad) 22%, #dfe3ec);
    border-radius: 8px;
    background: color-mix(in srgb, var(--sp-color-primary, #635cad) 9%, #fff);
    color: var(--sp-color-primary, #635cad);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .04em;
}

.sp-login-kicker {
    color: var(--sp-color-primary, #635cad);
    font-size: 9px;
    font-weight: 750;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sp-login-title {
    margin: 1px 0 0;
    color: var(--sp-color-text, #20253f);
    font-size: 19px;
    font-weight: 780;
    line-height: 1.15;
}

.sp-login-subtitle {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    line-height: 1.3;
}

.sp-login-alert {
    margin-bottom: 14px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 10px;
    line-height: 1.35;
}

.sp-login-form .form-label {
    margin-bottom: 4px;
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 650;
}

.sp-login-form .form-control {
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px !important;
    background: #fff;
    font-size: 11px;
    box-shadow: none;
}

.sp-login-form .form-control:focus {
    border-color: color-mix(in srgb, var(--sp-color-primary, #635cad) 48%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-color-primary, #635cad) 10%, transparent);
}

.sp-login-remember {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
}

.sp-login-submit {
    min-height: 38px;
    border-radius: 6px !important;
    font-size: 11px;
    font-weight: 700;
    box-shadow: none !important;
}

.sp-login-submit-busy {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.sp-login-busy-status {
    margin-top: 8px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.3;
    text-align: center;
}

.sp-login-footnote {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
    color: var(--sp-color-text-muted, #7d84a0);
    font-size: 8.5px;
    line-height: 1.35;
    text-align: center;
}

.sp-login-progress-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 3px;
    overflow: hidden;
    background: transparent;
    opacity: 0;
}

.sp-login-progress-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    background: var(--sp-color-primary, #635cad);
}

.sp-login-page.is-busy .sp-login-progress-line {
    opacity: 1;
    background: color-mix(in srgb, var(--sp-color-primary, #635cad) 12%, #fff);
}

.sp-login-page.is-busy .sp-login-progress-line::after {
    animation: spLoginProgress 1.05s ease-in-out infinite;
}

.sp-login-page.is-busy .sp-login-form-fields {
    opacity: .48;
    pointer-events: none;
    user-select: none;
}

.sp-login-page.is-busy .sp-login-form .form-control {
    background: #f4f5f8;
    color: var(--sp-color-text-soft, #66708f);
}

.sp-login-page.is-busy .sp-login-submit {
    border-color: #8d92a3 !important;
    background: #8d92a3 !important;
    color: #fff !important;
    filter: none !important;
    transform: none !important;
}

.sp-login-page.is-busy .sp-login-submit-idle {
    display: none;
}

.sp-login-page.is-busy .sp-login-submit-busy {
    display: inline-flex;
}

.sp-login-busy-global,
.sp-login-busy-global * {
    cursor: progress !important;
}

@keyframes spLoginProgress {
    0% { left: -35%; }
    55% { left: 48%; }
    100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-login-page.is-busy .sp-login-progress-line::after {
        animation: none;
        left: 0;
        width: 100%;
    }
}

@media (max-width: 639.98px) {
    .sp-toast-host {
        top: 8px !important;
        right: 8px !important;
        width: calc(100vw - 16px);
    }

    .sp-login-page {
        align-items: flex-start;
        padding: 10px 4px;
    }

    .sp-login-card-body {
        padding: 18px 16px 16px;
    }

    .modal .modal-dialog {
        margin: 8px;
    }
}
/* =========================================================
   StagePilot App Shell v17
   Passwort ändern
   ========================================================= */

.sp-tabpane-inner:has([data-sp-change-password-page="1"]) {
    overflow: auto !important;
}

.sp-change-password-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 18px;
}

.sp-change-password-card {
    position: relative;
    width: min(520px, 100%);
    overflow: hidden;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}

.sp-change-password-card-body {
    padding: 24px 26px 20px;
}

.sp-change-password-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.sp-change-password-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--sp-color-primary, #635cad) 22%, #dfe3ec);
    border-radius: 8px;
    background: color-mix(in srgb, var(--sp-color-primary, #635cad) 9%, #fff);
    color: var(--sp-color-primary, #635cad);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .04em;
}

.sp-change-password-kicker {
    color: var(--sp-color-primary, #635cad);
    font-size: 9px;
    font-weight: 750;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sp-change-password-title {
    margin: 1px 0 0;
    color: var(--sp-color-text, #20253f);
    font-size: 19px;
    font-weight: 780;
    line-height: 1.15;
}

.sp-change-password-subtitle {
    margin-top: 2px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 10px;
    line-height: 1.35;
}

.sp-change-password-alert {
    margin-bottom: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 10px;
    line-height: 1.4;
}

.sp-change-password-alert-title {
    margin-bottom: 2px;
    font-weight: 750;
}

.sp-change-password-error-list {
    margin: 3px 0 0;
    padding-left: 17px;
}

.sp-change-password-error-list > li + li {
    margin-top: 2px;
}

.sp-change-password-user {
    margin-bottom: 13px;
    padding: 8px 10px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px;
    background: #fafbfc;
}

.sp-change-password-user-label {
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8.5px;
    font-weight: 650;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sp-change-password-user-value {
    margin-top: 2px;
    overflow: hidden;
    color: var(--sp-color-text, #20253f);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-change-password-fields {
    display: grid;
    gap: 10px;
}

.sp-change-password-field .form-label {
    margin-bottom: 4px;
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 650;
}

.sp-change-password-field .form-control {
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 6px !important;
    background: #fff;
    font-size: 11px;
    box-shadow: none;
}

.sp-change-password-field .form-control:focus {
    border-color: color-mix(in srgb, var(--sp-color-primary, #635cad) 48%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-color-primary, #635cad) 10%, transparent);
}

.sp-change-password-match {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 19px;
    margin-top: 3px;
    color: var(--sp-color-text-muted, #7d84a0);
    font-size: 8.5px;
}

.sp-change-password-match-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f1f3f6;
    color: #8a91a2;
    font-size: 8px;
    font-weight: 850;
}

.sp-change-password-match.is-valid {
    color: #287447;
}

.sp-change-password-match.is-valid .sp-change-password-match-icon {
    background: #eaf6ee;
    color: #287447;
}

.sp-change-password-match.is-invalid {
    color: #b42318;
}

.sp-change-password-match.is-invalid .sp-change-password-match-icon {
    background: #fceceb;
    color: #b42318;
}

.sp-change-password-policy {
    margin-top: 13px;
    padding: 9px 10px;
    border: 1px solid var(--sp-app-border, #dfe3ec);
    border-radius: 7px;
    background: #fafbfc;
}

.sp-change-password-policy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.sp-change-password-policy-title {
    color: var(--sp-color-text, #20253f);
    font-size: 10px;
    font-weight: 750;
}

.sp-change-password-policy-subtitle {
    margin-top: 1px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8.5px;
    line-height: 1.25;
}

.sp-change-password-policy-state {
    flex: 0 0 auto;
    min-height: 19px;
    padding: 2px 6px;
    border: 1px solid #dfe3ec;
    border-radius: 999px;
    background: #fff;
    color: #747b8e;
    font-size: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.sp-change-password-policy-state.is-valid {
    border-color: #c9e6d3;
    background: #f0faf3;
    color: #287447;
}

.sp-change-password-policy-state.is-invalid {
    border-color: #efd4d1;
    background: #fff6f5;
    color: #a13a30;
}

.sp-change-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}

.sp-change-password-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 8.7px;
    line-height: 1.25;
}

.sp-change-password-rule-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #eef0f4;
    color: #8b92a3;
    font-size: 8px;
    font-weight: 850;
}

.sp-change-password-rule.is-valid {
    color: #287447;
}

.sp-change-password-rule.is-valid .sp-change-password-rule-icon {
    background: #e8f5ec;
    color: #287447;
}

.sp-change-password-rule.is-invalid {
    color: #a13a30;
}

.sp-change-password-rule.is-invalid .sp-change-password-rule-icon {
    background: #fbeceb;
    color: #a13a30;
}

.sp-change-password-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
}

.sp-change-password-submit,
.sp-change-password-cancel {
    min-height: 38px;
    border-radius: 6px !important;
    font-size: 11px;
    font-weight: 700;
    box-shadow: none !important;
}

.sp-change-password-submit {
    flex: 1 1 auto;
}

.sp-change-password-cancel {
    flex: 0 0 auto;
    padding-inline: 14px;
}

.sp-change-password-submit-busy {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.sp-change-password-busy-status {
    margin-top: 8px;
    color: var(--sp-color-text-soft, #66708f);
    font-size: 9px;
    line-height: 1.3;
    text-align: center;
}

.sp-change-password-footnote {
    margin-top: 15px;
    padding-top: 11px;
    border-top: 1px solid var(--sp-app-border, #dfe3ec);
    color: var(--sp-color-text-muted, #7d84a0);
    font-size: 8.5px;
    line-height: 1.35;
    text-align: center;
}

/* Busy-Zustand */
.sp-change-password-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 3px;
    overflow: hidden;
    background: transparent;
    opacity: 0;
}

.sp-change-password-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    background: var(--sp-color-primary, #635cad);
}

.sp-change-password-page.is-busy .sp-change-password-progress {
    opacity: 1;
    background: color-mix(in srgb, var(--sp-color-primary, #635cad) 12%, #fff);
}

.sp-change-password-page.is-busy .sp-change-password-progress::after {
    animation: spChangePasswordProgress 1.05s ease-in-out infinite;
}

.sp-change-password-page.is-busy .sp-change-password-fields,
.sp-change-password-page.is-busy .sp-change-password-policy,
.sp-change-password-page.is-busy .sp-change-password-user {
    opacity: .48;
    pointer-events: none;
    user-select: none;
}

.sp-change-password-page.is-busy .sp-change-password-field .form-control {
    background: #f4f5f8;
    color: var(--sp-color-text-soft, #66708f);
}

.sp-change-password-page.is-busy .sp-change-password-submit {
    border-color: #8d92a3 !important;
    background: #8d92a3 !important;
    color: #fff !important;
    filter: none !important;
    transform: none !important;
}

.sp-change-password-page.is-busy .sp-change-password-submit-idle {
    display: none;
}

.sp-change-password-page.is-busy .sp-change-password-submit-busy {
    display: inline-flex;
}

.sp-change-password-page.is-busy .sp-change-password-cancel {
    pointer-events: none;
    opacity: .48;
}

.sp-change-password-busy-global,
.sp-change-password-busy-global * {
    cursor: progress !important;
}

@keyframes spChangePasswordProgress {
    0% { left: -35%; }
    55% { left: 48%; }
    100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-change-password-page.is-busy .sp-change-password-progress::after {
        animation: none;
        left: 0;
        width: 100%;
    }
}

@media (max-width: 639.98px) {
    .sp-change-password-page {
        align-items: flex-start;
        padding: 10px 4px;
    }

    .sp-change-password-card-body {
        padding: 18px 16px 16px;
    }

    .sp-change-password-rules {
        grid-template-columns: 1fr;
    }

    .sp-change-password-policy-head {
        flex-direction: column;
        gap: 6px;
    }

    .sp-change-password-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .sp-change-password-submit,
    .sp-change-password-cancel {
        width: 100%;
    }
}
