.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.625rem 1.25rem;
    min-height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    user-select: none;
}
.btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
    min-height: 36px;
    border-radius: var(--radius-sm);
}
.btn-micro {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    min-height: 44px;
    min-width: 44px;
    border-radius: var(--radius-md);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    user-select: none;
}
.btn-micro:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.btn-micro-success {
    color: var(--success);
}
.btn-micro-success:hover, .btn-micro-success:active {
    background-color: rgba(16, 185, 129, 0.15);
}
.btn-micro-warning {
    color: var(--warning);
}
.btn-micro-warning:hover, .btn-micro-warning:active {
    background-color: rgba(245, 158, 11, 0.15);
}
.btn-micro-danger {
    color: #fca5a5;
}
.btn-micro-danger:hover, .btn-micro-danger:active {
    background-color: rgba(239, 68, 68, 0.15);
}
.btn-micro-info {
    color: var(--brand-primary);
}
.btn-micro-info:hover, .btn-micro-info:active {
    background-color: rgba(56, 189, 248, 0.15);
}
.btn-primary {
    background-color: var(--brand-primary);
    color: #020617;
    border-color: transparent;
}
.btn-primary:hover {
    background-color: var(--brand-primary-hover);
}
.btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
.btn-secondary:hover {
    background-color: #334155;
    color: #ffffff;
}
.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
    background-color: var(--danger);
    color: #ffffff;
}
.form-input, .form-textarea {
    width: 100%;
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary) !important;
    font-family: inherit;
    font-size: 0.875rem;
    min-height: 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
html.light .form-input,
html.light .form-textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.form-input:focus, .form-textarea:focus {
    outline: 2px solid var(--brand-primary) !important;
    outline-offset: 1px;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}
.form-textarea {
    min-height: 84px;
    resize: vertical;
}
.form-input-sm {
    min-height: 36px;
    padding: 0.375rem 0.65rem;
    font-size: 0.8125rem;
}
.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}
.form-input:disabled, .form-textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-surface-elevated) !important;
}
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}
.form-group {
    margin-bottom: 1rem;
}
select.form-input, select.form-textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.25rem;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
html.light select.form-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}
html.light .btn-primary {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}
html.light .btn-primary:hover {
    background-color: #0369a1 !important;
}
html.light .btn-secondary {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
html.light .btn-secondary:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}
html.light .btn-danger {
    background-color: #ffe4e6 !important;
    color: #be123c !important;
    border-color: #fda4af !important;
}
html.light .btn-danger:hover {
    background-color: #e11d48 !important;
    color: #ffffff !important;
}

/* Smart Sub-Navigation & Workspace Controls (Zero-Scroll Architecture) */
.nd-workspace-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
}
.nd-subnav-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}
.nd-subnav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    min-height: 40px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.nd-subnav-pill:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border-color: var(--border-subtle);
}
.nd-subnav-pill.active {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}
html.dark .nd-subnav-pill.active {
    color: #020617 !important;
}
.nd-subnav-step-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}
.pos-row {
    transition: background-color 0.15s ease;
}
.pos-row:hover {
    background-color: rgba(30, 41, 59, 0.6);
}
.star-rating-label {
    cursor: pointer;
    display: inline-block;
    transition: transform 0.1s ease;
}
.star-rating-label:hover {
    transform: scale(1.15);
}
.star-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.star-icon {
    color: #f59e0b;
    user-select: none;
}
.tab-nav-btn {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-pane {
    animation: fadeInPane 0.15s ease-out;
}
@keyframes fadeInPane {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
.peer:checked ~ .peer-checked\:after\:translate-x-full::after,
.peer-checked\:after\:translate-x-full::after,
.peer-checked\:after\:translate-x-full { transform: translateX(100%); }
.peer:checked ~ .peer-checked\:after\:border-white::after,
.peer-checked\:after\:border-white::after,
.peer-checked\:after\:border-white { border-color: #ffffff; }
.peer-focus\:outline-none:focus,
.peer-focus\:outline-none { outline: 2px solid transparent; outline-offset: 2px; }

@media print {
    .no-print { display: none !important; }
    .print-shadow-none { box-shadow: none !important; border: 1px solid #cbd5e1 !important; }
}

/* Universal Command Palette (Cmd+K / Strg+K Spotlight Engine) */
.nd-cmd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    padding-left: 1rem;
    padding-right: 1rem;
    animation: fadeInPane 0.15s ease-out;
}

.nd-cmd-dialog {
    width: 100%;
    max-width: 640px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nd-cmd-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface-elevated);
}

.nd-cmd-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    font-size: 1rem;
    font-family: inherit;
}

.nd-cmd-input::placeholder {
    color: var(--text-muted);
}

.nd-cmd-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nd-cmd-group-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
}

.nd-cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.1s ease;
    font-size: 0.8125rem;
}

.nd-cmd-item:hover,
.nd-cmd-item.active {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-subtle);
    color: #ffffff;
}

.nd-cmd-item-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.nd-cmd-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nd-cmd-item-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nd-cmd-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.nd-cmd-kbd {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.nd-cmd-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface-elevated);
    font-size: 0.6875rem;
    color: var(--text-muted);
}

html.light .nd-cmd-dialog {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.15);
}

html.light .nd-cmd-header,
html.light .nd-cmd-footer {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

html.light .nd-cmd-item:hover,
html.light .nd-cmd-item.active {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* Vim-Style Keyboard Row Navigation (J/K) */
tr.nd-row-focused {
    background-color: rgba(56, 189, 248, 0.12) !important;
    outline: 2px solid var(--brand-primary) !important;
    outline-offset: -2px !important;
    transition: background-color 0.1s ease, outline 0.1s ease;
}

html.light tr.nd-row-focused {
    background-color: rgba(2, 132, 199, 0.08) !important;
    outline: 2px solid var(--brand-primary) !important;
}

.nd-row-focused td {
    color: var(--text-primary) !important;
}

/* Dual-Screen Split-View Engine (Zone C Canvas Split) */
.nd-canvas-split {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr) !important;
    gap: 1.25rem !important;
    align-items: start !important;
}

@media (max-width: 1280px) {
    .nd-canvas-split {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Schutz vor horizontaler Stauchung aller Modul-Karten & Sektionen */
.portal-section {
    min-width: 0;
    width: 100%;
}

.portal-section .nd-glass-card,
.portal-section .portal-calendar-day,
.portal-section .nd-sub-panel {
    min-width: 0;
}

.nd-drawer-backdrop.nd-drawer-docked {
    position: static !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    z-index: 10 !important;
}

.nd-drawer-docked .nd-drawer-panel {
    position: sticky !important;
    top: 5rem !important;
    max-height: calc(100vh - 6rem) !important;
    box-shadow: var(--shadow-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-xl) !important;
}

/* Mobile Touch-Friendly Drag Handle */
.nd-sheet-drag-handle {
    width: 40px;
    height: 4px;
    background-color: var(--border-subtle);
    border-radius: 9999px;
    margin: 0 auto 0.5rem auto;
}

/* Sprint 1: MDI Multi-Tab Workspace, Co-Editing & Drag & Drop */
.nd-workspace-tabs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.35rem 0.5rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.85rem;
    scrollbar-width: thin;
}

.nd-workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    min-height: 34px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.nd-workspace-tab:hover {
    color: var(--text-primary);
    border-color: var(--brand-primary);
}

.nd-workspace-tab.active {
    background-color: var(--brand-primary) !important;
    color: #020617 !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
    font-weight: 700;
}

.nd-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 9999px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.1s ease, background-color 0.1s ease;
}

.nd-tab-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.15);
}

.nd-tab-dirty {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--warning);
    display: inline-block;
}

/* Co-Editing Presence Banner & Avatars */
.nd-coedit-presence-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background-color: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-md);
    font-size: 0.6875rem;
    margin-bottom: 0.75rem;
}

.nd-coedit-avatars {
    display: flex;
    align-items: center;
}

.nd-coedit-avatars > * + * {
    margin-left: -0.25rem;
}

.nd-coedit-avatar {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background-color: var(--brand-accent);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

.nd-field-locked {
    border-color: var(--warning) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
    position: relative;
}

.nd-field-locked-indicator {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--warning);
    display: block;
    margin-top: 0.15rem;
}

/* Drag & Drop Reordering für Auftragspositionen */
tr.nd-drag-row {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

tr.nd-drag-row.nd-drag-over {
    border-top: 2px solid var(--brand-primary) !important;
    background-color: rgba(56, 189, 248, 0.1) !important;
}

.nd-drag-handle {
    cursor: grab;
    user-select: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.25rem 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s ease;
}

.nd-drag-handle:hover,
.nd-drag-handle:active {
    cursor: grabbing;
    color: var(--brand-primary);
}

/* Textbaustein-Picker (Slash-Command Menu & Snippets) */
.nd-snippet-menu {
    position: absolute;
    z-index: 80;
    max-height: 220px;
    overflow-y: auto;
    width: 320px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nd-snippet-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 0.75rem;
}

.nd-snippet-item:hover,
.nd-snippet-item.active {
    background-color: var(--bg-surface-elevated);
    color: var(--brand-primary);
}

.nd-snippet-item-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Sprint 1: Feste Kalender-Geometrie (Zero-Layout-Shift) & Nachtschicht-Fokus */
.nd-calendar-fixed-viewport {
    height: 740px;
    min-height: 740px;
    max-height: 740px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-card);
}

.nd-calendar-header-fixed {
    flex-shrink: 0;
    background-color: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
}

.nd-calendar-scroll-grid {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    position: relative;
}

.nd-calendar-night-shift-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
    background: rgba(56, 189, 248, 0.12);
    border-top: 1px dashed var(--brand-primary);
    border-bottom: 1px dashed var(--brand-primary);
}

/* Sprint 2: Penetrantes Fristen-Alert-Banner & Fälligkeits-Karten */
.nd-calendar-alert-banner {
    position: relative;
    border-left: 4px solid var(--danger);
    transition: all 0.2s ease-in-out;
}

.nd-asset-dossier-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sprint 3: Checklisten-Baukasten, Schicht-Kontrollen & Mängel-Status */
.nd-checklist-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.nd-defect-badge-critical {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
}

.nd-defect-badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-sm);
}

/* Präzisions-Linienführung & Kontrast für den Kalender (Tages- & Mehrtagsraster) */
.nd-cal-hour-row {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 64px;
    border-top: 2px solid #334155 !important;
    background-color: var(--bg-surface);
    transition: background-color 0.15s ease;
}

html.light .nd-cal-hour-row {
    border-top: 2px solid #cbd5e1 !important;
    background-color: #ffffff;
}

.nd-cal-hour-row:hover {
    background-color: rgba(56, 189, 248, 0.04);
}

.nd-cal-time-col {
    width: 5.5rem;
    padding: 0.5rem 0.65rem;
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    background-color: var(--bg-surface-elevated);
    border-right: 2px solid #334155;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    user-select: none;
}

html.light .nd-cal-time-col {
    background-color: #f1f5f9;
    border-right: 2px solid #cbd5e1;
    color: #0284c7;
}

.nd-cal-half-line {
    position: absolute;
    left: 5.5rem;
    right: 0;
    top: 50%;
    height: 1px;
    border-top: 1px dashed rgba(148, 163, 184, 0.25);
    pointer-events: none;
    z-index: 5;
}

html.light .nd-cal-half-line {
    border-top: 1px dashed rgba(100, 116, 139, 0.3);
}

.nd-cal-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    z-index: 25;
    pointer-events: none;
}

.nd-cal-now-dot {
    position: absolute;
    left: 5.25rem;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* Modale Pop-up Overlays (zentriert, z-index 60, kein Scroll-Verlust) */
.nd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background-color: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    animation: fadeInPane 0.15s ease-out;
}

.nd-modal-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    margin: auto;
}

html.light .nd-modal-card {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.15);
}

/* Customer-Picker Info Card */
.nd-customer-picker-card {
    padding: 0.75rem 1rem;
    background-color: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Auftragszeilen-Statusübergang */
.cwo-row {
    transition: background-color 0.15s ease;
}

/* Revisionssicherer Auftrags-Audit-Trail & Bearbeitungsverlauf */
.nd-history-timeline {
    position: relative;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Portal Tab-Buttons & Navigation */
.portal-tab-btn {
    white-space: nowrap;
    border-radius: var(--radius-md);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}

.portal-tab-btn:hover {
    transform: translateY(-1px);
}

.nd-nav-menu button,
.nd-nav-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nd-nav-menu button:hover,
.nd-nav-menu a:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-elevated);
}

.nd-nav-menu::before {
    content: '';
    position: absolute;
    top: -0.45rem;
    left: 0;
    right: 0;
    height: 0.45rem;
    background: transparent;
}

/* Kontextsensitives Schnellmenü in der linken Sidebar (Zone B - Strikt vertikal) */
.nd-sidebar-context-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    animation: fadeInPane 0.15s ease-out;
}

.nd-sidebar-context-group .nd-action-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
    display: block;
}

.nd-context-quick-btn,
.nd-sidebar-context-group .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.55rem;
    width: 100% !important;
    padding: 0.55rem 0.75rem;
    min-height: 40px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    text-align: left !important;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.nd-context-quick-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateX(2px);
}

.nd-context-quick-btn.nd-context-quick-primary {
    background-color: var(--brand-primary);
    color: #020617;
    border-color: transparent;
    font-weight: 700;
}

.nd-context-quick-btn.nd-context-quick-primary:hover {
    background-color: var(--brand-primary-hover);
    color: #020617;
}

html.light .nd-context-quick-btn.nd-context-quick-primary {
    background-color: #0284c7;
    color: #ffffff;
}

/* Symmetrische Kalender-Steuerleiste & Master-Detail Auftragsansicht */
.nd-cal-control-bar {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.nd-cal-top-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 1100px) {
    .nd-cal-top-row {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }
}

.nd-cal-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

@media (max-width: 1024px) {
    .nd-cal-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.nd-master-row {
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nd-master-row:hover {
    background-color: rgba(56, 189, 248, 0.08) !important;
}

.nd-master-row.nd-master-row-active {
    background-color: rgba(56, 189, 248, 0.14) !important;
    border-left: 3px solid var(--brand-primary);
}

.nd-order-detail-view {
    background-color: var(--bg-main);
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    animation: fadeInPane 0.18s ease-out;
}

.nd-freetext-position {
    background-color: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--brand-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    white-space: pre-line;
    line-height: 1.55;
}

/* 360° Akten- & Stammdaten-Dock (Sidebar) */
.nd-dossier-card {
    padding: 1rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

html.light .nd-dossier-card {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.nd-dossier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
}

.nd-dossier-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
}

.nd-dossier-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.nd-dossier-val {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.nd-history-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background-color: var(--border-subtle);
}

.nd-history-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.6875rem;
}

.nd-history-dot {
    position: absolute;
    left: -1.25rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: var(--brand-primary);
    border: 2px solid var(--bg-surface);
}

/* Vorher/Nachher-Slider (Image Comparison) */
.nd-before-after-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    user-select: none;
    min-height: 260px;
}
.nd-before-after-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 20;
}
.nd-before-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nd-after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(0 0, var(--slider-pos, 50%) 0, var(--slider-pos, 50%) 100%, 0 100%);
}
.nd-slider-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--slider-pos, 50%);
    width: 3px;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transform: translateX(-50%);
    pointer-events: none;
}
.nd-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: #ffffff;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    font-size: 11px;
    font-weight: 800;
}

.nd-thumb-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.nd-thumb-btn {
    position: relative;
    width: 72px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: var(--bg-surface);
}

.nd-thumb-btn:hover {
    border-color: var(--brand-primary);
    transform: scale(1.04);
}

/* Kanonische Container- & Layout-Klassen (Säule 1.4 Token-Optimierung) */
.nd-panel {
    padding: 1.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.nd-panel-sub {
    padding: 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.nd-kpi-box {
    padding: 0.75rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.nd-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.nd-grid-form {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .nd-grid-form {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}