/* TopSolid PDM Sync - Custom Styles */

/* General */
body {
    background-color: #f8f9fa;
    height: 100vh;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

/* ========== Viewport-Scroll-Layout (Standard) ==========
 * Card-Header + Filter bleiben IMMER sichtbar.
 * NUR die Tabellendaten (.table-responsive) scrollen.
 * Kein sichtbarer Scrollbalken. 10px Abstand zum unteren Rand.
 * Sidebar, Menü, Filter = fest. Nur Daten scrollen.
 * Siehe CLAUDE.md → "UI-Layout Standard" für Details.
 * ======================================================= */

/* Hauptcontainer füllt Viewport minus Navbar */
#mainContent {
    height: calc(100vh - 56px);
    overflow: hidden;
    padding-bottom: 10px !important;
    box-sizing: border-box;
}

#mainContent > .row {
    height: 100%;
}

/* Sidebar = fest, kein Scroll */
#sidebarColumn {
    max-height: 100%;
    overflow: hidden;
}

/* Content-Bereich */
#contentColumn {
    height: 100%;
    overflow: hidden;
    max-width: 1600px;
}

/* Section-Card füllt verfügbaren Platz */
.content-section > .card {
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-section > .card > .card-header {
    flex-shrink: 0;
}

/* Card-Body = Flex-Container, scrollt NICHT selbst */
.content-section > .card > .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Alle direkten Kinder in card-body bleiben fest (Filter, Buttons, Hinweise) */
.content-section > .card > .card-body > .row,
.content-section > .card > .card-body > .d-flex,
.content-section > .card > .card-body > .alert,
.content-section > .card > .card-body > .mb-2,
.content-section > .card > .card-body > .mb-3,
.content-section > .card > .card-body > p,
.content-section > .card > .card-body > h5,
.content-section > .card > .card-body > h6 {
    flex-shrink: 0;
}

/* Tab-Container: Flex-Höhe durchreichen an tab-pane → table-responsive */
.content-section > .card > .card-body > .tab-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-section > .card > .card-body > .tab-content > .tab-pane.active {
    flex: 1;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

/* PDM-Import Tab: Row + linke Spalte scrollbar */
#tabPdmImport > .row {
    flex: 1;
    min-height: 0;
    flex-wrap: nowrap !important;
    overflow: hidden;
}

#tabPdmImport > .row > .col-md-4 > .card {
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#tabPdmImport > .row > .col-md-4 > .card > .card-body {
    overflow-y: auto;
    padding-bottom: 3rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#tabPdmImport > .row > .col-md-4 > .card > .card-body::-webkit-scrollbar {
    display: none;
}

/* NUR table-responsive = Scroll-Container (ohne Scrollbalken) */
.content-section .table-responsive {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: auto !important;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-section .table-responsive::-webkit-scrollbar {
    display: none;
}

/* Dropdowns in table-responsive: aus overflow-Container ausbrechen */
.content-section .table-responsive .dropdown-menu {
    position: fixed !important;
    z-index: 1050;
}

/* Autocomplete-Dropdowns in Modals: ueber Modal-Layer rendern */
.modal .dropdown-menu.autocomplete-dropdown {
    position: fixed !important;
    z-index: 1070 !important;
}

/* Sticky Tabellenkopf innerhalb table-responsive */
.content-section .table > thead > tr > th,
.modal .table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Form Validation */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Cards */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table td {
    vertical-align: middle;
}

/* Inline-Edit in Angebotspositionen — kein Zeilen-Shift */
#angebotPositionenBody td {
    height: 38px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.editable-menge,
.editable-multi {
    display: inline-block;
    min-width: 50px;
    text-align: right;
}

.inline-edit-input {
    width: 100%;
    max-width: 70px;
    border: 1px solid #86b7fe;
    border-radius: 3px;
    outline: none;
    background: #fff;
    font-size: inherit;
    padding: 1px 4px;
    line-height: inherit;
    box-sizing: border-box;
}

/* Part Type Badges */
.badge-sheet-metal {
    background-color: #198754;
}

.badge-bending-part {
    background-color: #ffc107;
    color: #000;
}

.badge-non-sheet-metal {
    background-color: #fd7e14;
}

.badge-assembly {
    background-color: #0d6efd;
}

/* Baugruppen-Komponenten: scrollbare Liste */
#assemblySection .table-responsive {
    max-height: calc(100vh - 450px);
    overflow-y: auto !important;
    padding-bottom: 2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#assemblySection .table-responsive::-webkit-scrollbar {
    display: none;
}

/* Perimeter Popover */
.popover { max-width: 280px; }
.popover .table { font-size: 0.85rem; }

/* Linked Docs Badges */
#linkedDocsBadges .badge { font-size: 0.8rem; padding: 0.4em 0.6em; }

/* Recent Searches */
#recentSearches .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0.5rem 1rem;
}

#recentSearches .list-group-item:hover {
    background-color: #e9ecef;
}

#recentSearches .list-group-item.text-muted {
    cursor: default;
}

#recentSearches .list-group-item.text-muted:hover {
    background-color: transparent;
}

/* Loading Animation */
#loadingSpinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Connection Status */
#connectionStatus .badge {
    font-size: 0.85rem;
    padding: 0.5em 0.8em;
}

/* Search Input */
#searchInput:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Component Table */
#componentsTable {
    font-size: 0.9rem;
}

#componentsTable tbody tr {
    transition: background-color 0.2s ease;
}

#componentsTable .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Nested Components (sub-assemblies) */
.component-depth-1 {
    background-color: #fff;
}

.component-depth-2 {
    background-color: #f8f9fa;
}

.component-depth-3 {
    background-color: #e9ecef;
}

/* Toast Notifications */
.toast {
    min-width: 300px;
}

.toast-success .toast-header {
    background-color: #d1e7dd;
}

.toast-error .toast-header {
    background-color: #f8d7da;
}

.toast-warning .toast-header {
    background-color: #fff3cd;
}

/* Welcome Message */
#welcomeMessage i {
    opacity: 0.3;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
}

/* Navigation Menu */
#mainMenu .accordion-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

#mainMenu .accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0d6efd;
}

#mainMenu .list-group-item {
    padding: 0.5rem 1rem 0.5rem 2rem;
    font-size: 0.85rem;
    border: none;
}

#mainMenu .list-group-item:hover {
    background-color: #f8f9fa;
}

#mainMenu .list-group-item.active {
    background-color: #0d6efd;
    color: white;
}

#mainMenu .accordion-item {
    border: none;
}

#subMenuProduktion .accordion-button {
    padding-left: 2rem;
    font-size: 0.85rem;
}

.content-section {
    display: block;
}

/* Login Modal */
#loginModal .modal-header {
    border-bottom: none;
}

#loginModal .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ISO Editor Resizer */
#isoEditorResizer {
    transition: background-color 0.2s ease;
}

#isoEditorResizer:hover {
    background-color: #6c757d !important;
}

#isoEditorResizer:active,
#isoEditorResizer.dragging {
    background-color: #0d6efd !important;
}

/* Prevent text selection while dragging */
.iso-resizing {
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: col-resize !important;
}

.iso-resizing * {
    cursor: col-resize !important;
}

/* Hidden Scrollbar for ISO Preview Panels (scrollable but invisible) */
#isoPreviewBauteilInfo,
#isoPreviewPartLegend {
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

#isoPreviewBauteilInfo::-webkit-scrollbar,
#isoPreviewPartLegend::-webkit-scrollbar {
    display: none;  /* Chrome/Safari/Opera */
    width: 0;
    height: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 10px;
    }

    .card {
        margin-bottom: 1rem;
    }

    #componentsTable {
        font-size: 0.8rem;
    }
}

/* Collapsible Sidebar */
#sidebarColumn {
    transition: all 0.3s ease;
    /* height + overflow bereits oben im Viewport-Scroll-Layout definiert */
}

#contentColumn {
    transition: all 0.3s ease;
    /* height + overflow bereits oben im Viewport-Scroll-Layout definiert */
}

.sidebar-collapsed #sidebarColumn {
    flex: 0 0 50px !important;
    max-width: 50px !important;
    min-width: 50px !important;
}

.sidebar-collapsed #contentColumn {
    flex: 0 0 calc(100% - 50px) !important;
    max-width: calc(100% - 50px) !important;
}

.sidebar-collapsed #sidebarCard .card-body {
    display: none;
}

.sidebar-collapsed #sidebarCard .sidebar-title {
    display: none;
}

.sidebar-collapsed #sidebarCard .card-header {
    padding: 0.5rem;
    justify-content: center;
}

.sidebar-collapsed #sidebarToggle {
    margin: 0;
}

.sidebar-collapsed #toggleIcon {
    transform: rotate(180deg);
}

#toggleIcon {
    transition: transform 0.3s ease;
}

#sidebarToggle {
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

/* Print Styles */
@media print {
    .navbar,
    #logoutBtn,
    #testConnectionBtn,
    .toast-container {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Kritische Felder - Rohmaterial Bearbeitung */
.kritisches-feld-gesperrt {
    background-color: #f8f9fa !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.85;
}

.kritisches-feld-gesperrt:hover {
    background-color: #e9ecef !important;
}

.kritisches-feld-entsperrt {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.kritisches-feld-entsperrt:focus {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.35);
}

/* Wrapper für kritische Felder - ermöglicht Doppelklick auf gesperrte Elemente */
.kritisches-feld-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Hover-Effekt für Admin */
.kritisches-feld-wrapper[style*="cursor: pointer"]:hover .kritisches-feld-gesperrt {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
}

/* Hover-Effekt für Nicht-Admin */
.kritisches-feld-wrapper[style*="cursor: not-allowed"]:hover .kritisches-feld-gesperrt {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
}

/* ========================================
   Resizable Modals
   ======================================== */

/* Modal-Content resizable mit Flexbox für Content-Wachstum */
.modal .modal-dialog .modal-content {
    resize: both !important;
    overflow: auto !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 3.5rem) !important;
    max-width: calc(100vw - 2rem) !important;
}

/* Modal-Body wächst mit und scrollt bei Bedarf */
.modal .modal-dialog .modal-body {
    flex: 1 1 auto !important;
    overflow: auto !important;
    min-height: 0 !important;
    height: 100% !important;
}

/* Header und Footer bleiben fix */
.modal .modal-dialog .modal-header,
.modal .modal-dialog .modal-footer {
    flex-shrink: 0 !important;
}

/* Resize-Handle visueller Indikator */
.modal .modal-dialog .modal-content::after {
    content: '' !important;
    position: absolute !important;
    right: 4px !important;
    bottom: 4px !important;
    width: 14px !important;
    height: 14px !important;
    cursor: se-resize !important;
    background: linear-gradient(-45deg,
        #adb5bd 25%, transparent 25%,
        transparent 50%, #adb5bd 50%,
        #adb5bd 75%, transparent 75%) !important;
    background-size: 4px 4px !important;
    opacity: 0.6 !important;
    transition: opacity 0.2s ease !important;
    pointer-events: none !important;
    z-index: 1000 !important;
    border-radius: 2px !important;
}

.modal .modal-dialog .modal-content:hover::after {
    opacity: 1 !important;
}

/* Modal-Dialog Zentrierung */
.modal .modal-dialog {
    max-width: calc(100vw - 2rem) !important;
    width: fit-content !important;
    margin: 1.75rem auto !important;
}

/* ========================================
   Mindestgrößen (min) und Startgrößen
   Breite kann wachsen, Höhe kann wachsen
   ======================================== */

/* Standard Modal */
.modal .modal-dialog:not(.modal-lg):not(.modal-xl):not(.modal-sm) .modal-content {
    min-width: 500px !important;
    min-height: 200px !important;
}

/* Large Modal */
.modal .modal-dialog.modal-lg {
    width: 800px !important;
}
.modal .modal-dialog.modal-lg .modal-content {
    min-width: 800px !important;
    min-height: 280px !important;
}

/* Extra Large Modal */
.modal .modal-dialog.modal-xl {
    width: min(90vw, 1400px) !important;
}
.modal .modal-dialog.modal-xl .modal-content {
    min-width: 1000px !important;
    min-height: 400px !important;
}

/* Auftrags-Dialog: extra breit fuer Positionen-Tabelle */
#auftragModal .modal-dialog.modal-xl {
    width: min(96vw, 1700px) !important;
    max-width: min(96vw, 1700px) !important;
}

/* Small Modal */
.modal .modal-dialog.modal-sm .modal-content {
    min-width: 300px !important;
    min-height: 150px !important;
}

/* ========================================
   ISO Editor Modal - Spezielle Styles
   damit Inhalt mitwächst beim Resize
   ======================================== */

/* ISO Editor Modal: volle Höhe und breite Startgröße */
#isoEditorModal .modal-content {
    height: 90vh !important;
    min-height: 600px !important;
    min-width: 1400px !important;
    width: 90vw !important;
}

/* Modal-Body als Flex-Container */
#isoEditorModal .modal-body {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* Editor Container füllt verfügbaren Platz */
#isoEditorContainer {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Editor Panel (links) - volle Höhe */
#isoEditorPanel {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Textarea füllt Panel */
#isoEditorContent {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 200px !important;
}

/* Backdrop (Syntax-Highlighting) passt sich an */
#isoEditorBackdrop {
    min-height: 200px !important;
}

/* Preview Panel - volle Höhe */
#isoPreviewPanel {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Preview Canvas Container - wächst mit */
#isoPreviewPanel > .position-relative {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 200px !important;
}

/* Canvas selbst füllt Container */
#isoPreviewCanvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   Bauteil-Bibliothek Styles
   ======================================== */

/* Bauteil Card Hover Effect */
.bauteil-card .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
}

.bauteil-card .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    border-color: #0d6efd;
}

/* SVG Container in Cards */
.bauteil-card .card-body > div:first-child {
    border-radius: 0.375rem 0.375rem 0 0;
    border-bottom: 1px solid #e9ecef;
}

/* SVG Scaling in Cards */
.bauteil-card svg {
    max-width: 100%;
    max-height: 140px;
    height: auto;
    width: auto;
}

/* SVG Wrapper */
.bauteil-svg-wrapper {
    min-width: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge Animations */
.bauteil-card .badge {
    transition: transform 0.15s ease;
}

.bauteil-card:hover .badge {
    transform: scale(1.05);
}

/* Bauteil Detail Modal - Large SVG Preview */
#bauteilDetailSVG svg {
    max-width: 100% !important;
    max-height: 380px !important;
    height: auto !important;
    width: auto !important;
}

/* SVG in Table View */
#bauteilTableBody svg {
    max-width: 45px;
    max-height: 45px;
}

/* View Toggle Buttons */
#sectionBauteilBibliothek .btn-group .btn {
    padding: 0.375rem 0.75rem;
}

#sectionBauteilBibliothek .btn-group .btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Statistics Badges */
#bauteilStats .badge {
    transition: transform 0.2s ease;
}

#bauteilStats .badge:hover {
    transform: scale(1.05);
}

/* ISO Upload Modal - Progress Bar */
#isoUploadProgress .progress-bar {
    transition: width 0.3s ease;
}

/* SMB Scanner Modal - Result Cards */
#smbScanResult .card {
    border: none;
    background: #f8f9fa;
}

#smbScanResult .fs-3 {
    transition: transform 0.2s ease;
}

#smbScanResult .fs-3:hover {
    transform: scale(1.1);
}

/* Empty State */
.bauteil-card .bi-inbox {
    opacity: 0.3;
}

/* ========================================
   Telephony Floating Panel
   ======================================== */

.telephony-floating-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 400px;
    z-index: 9998;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.telephony-panel-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #0dcaf0;
    color: #fff;
    cursor: move;
    user-select: none;
}

.telephony-panel-title {
    font-size: 0.9rem;
}

.telephony-panel-body {
    padding: 12px;
    max-height: 70vh;
    overflow-y: auto;
}

.telephony-floating-panel.minimized .telephony-panel-body {
    display: none;
}

.telephony-floating-panel.minimized {
    width: auto;
    min-width: 200px;
}

/* Snapshot Modal */
#snapshotModalBody h6 {
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

#snapshotModalBody .table {
    margin-bottom: 0;
}

#snapshotModalBody .badge {
    font-size: 0.7em;
}

/* Aktive Filter visuell hervorheben */
.filter-active {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 1px #0d6efd;
}

/* === Operator Panel — Vollbild-Modus === */
body.operator-fullscreen #sidebar,
body.operator-fullscreen #sidebarColumn {
    display: none !important;
}
body.operator-fullscreen #main-content,
body.operator-fullscreen #mainContent {
    margin-left: 0 !important;
    padding: 10px !important;
}
body.operator-fullscreen #contentColumn {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Operator Panel Styling — alle Panels */
#sectionOperatorSchneiden,
#sectionOperatorMechanisch,
#sectionOperatorBiegen,
#sectionOperatorSchweissen,
#sectionOperatorZusammenbau,
#sectionOperatorOberflaeche {
    font-size: 1.15rem;
    height: 100%;
}
#sectionOperatorSchneiden .btn,
[id^="sectionOperator"] .btn {
    min-height: 44px;
    font-size: 1.05rem;
}
[id^="sectionOperator"] .btn-lg {
    min-height: 56px;
    font-size: 1.2rem;
    padding: 12px 30px;
}
[id^="sectionOperator"] input[type="number"] {
    min-height: 44px;
    font-size: 1.3rem;
    text-align: center;
    max-width: 120px;
}
[id^="sectionOperator"] .table td,
[id^="sectionOperator"] .table th {
    padding: 10px 8px;
    vertical-align: middle;
}

/* Dringlichkeits-Farben */
.urgency-overdue { background-color: rgba(220, 53, 69, 0.15) !important; }
.urgency-soon { background-color: rgba(255, 193, 7, 0.15) !important; }
.urgency-ok { background-color: rgba(25, 135, 84, 0.08) !important; }
.urgency-none { }

/* Op-Screen — korrekte Flex-Chain fuer Vollbild-Scroll */
.op-screen {
    height: 100%;
}
.op-screen > .card {
    height: calc(100vh - 30px);
    max-height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.operator-fullscreen .op-screen > .card {
    height: calc(100vh - 30px);
    max-height: calc(100vh - 30px);
}
.op-screen > .card > .card-header {
    flex-shrink: 0;
}
.op-screen > .card > .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
/* Fixe Elemente in op-screen card-body */
.op-screen > .card > .card-body > .d-flex,
.op-screen > .card > .card-body > .mb-2,
.op-screen > .card > .card-body > .mb-3,
.op-screen > .card > .card-body > .alert,
.op-screen > .card > .card-body > .form-check {
    flex-shrink: 0;
}
.op-screen > .card > .card-body > .table-responsive {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.op-screen > .card > .card-body > .table-responsive::-webkit-scrollbar {
    display: none;
}

/* === Kostenrechner — Scroll-Fix === */
#sectionKalkulation > .card > .card-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#sectionKalkulation > .card > .card-body::-webkit-scrollbar {
    display: none;
}

/* === Operator Historie Timeline === */
.op-historie-entry {
    padding: 8px 12px;
    border-left: 3px solid #dee2e6;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
}
.op-historie-entry.nc {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}
.op-historie-entry .meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Screen 2 Artikel-Info — card-body needs special flex handling */
.op-screen .card-body.d-flex.flex-column > .row.g-0 {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Hide scrollbar in Historie container */
[id$="Historie"]::-webkit-scrollbar {
    display: none;
}

/* ============================================================
   PDF Annotator
   ============================================================ */
.pdf-annotator {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.pdf-annotator-toolbar {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.pdf-annotator-toolbar button {
    min-width: 40px;
    min-height: 40px;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pdf-annotator-toolbar button:hover {
    background-color: #e9ecef;
}
.pdf-annotator-toolbar button.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}
.pdf-annotator-toolbar .separator {
    width: 1px;
    background: #dee2e6;
    margin: 0 4px;
    align-self: stretch;
}
.pdf-annotator-viewer {
    position: relative;
    overflow: auto;
    flex: 1;
    background: #e9ecef;
    text-align: center;
    min-height: 0;
}
.pdf-annotator-canvas {
    display: block;
    margin: 0 auto;
}
.pdf-annotator-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}
.pdf-annotator-footer {
    padding: 4px 8px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 0.85rem;
    text-align: center;
    flex-shrink: 0;
}

/* Annotation pin text input overlay */
.pdf-pin-input {
    position: absolute;
    z-index: 100;
    background: white;
    border: 2px solid var(--bs-primary);
    border-radius: 4px;
    padding: 4px;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.pdf-pin-input input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}
