/* ========================================================================== */
/* Expenia Intranet - Custom CSS Styles */
/* ========================================================================== */
/*
   Dieses CSS enthält alle Custom-Styles aus den View-Dateien.
   Strukturiert nach Modulen und sauber organisiert.
*/

/* ========================================================================== */
/* 1. CSS CUSTOM PROPERTIES (VARIABLES) */
/* ========================================================================== */

:root {
    /* CI Farben */
    --ci-main: #1d1d35;
    --ci-primary: #1d66b3;
    --ci-secondary: #9593a1;

    /* Bootstrap Overrides */
    --bs-primary: var(--ci-primary);
    --bs-primary-rgb: 29, 102, 179;
    --bs-secondary: var(--ci-secondary);
    --bs-secondary-rgb: 149, 147, 161;

    /* Custom App Variables */
    --text-color: #9593a1;
    --hover-bg: #2a2a4a;
    --border-color: #e9e9e9;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
}

/* ========================================================================== */
/* 2. AUTHENTIFIZIERUNG */
/* ========================================================================== */

/* Auth Cards (Login, Register, Welcome, Info) */
.login-card,
.register-card,
.welcome-card,
.info-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
}

.login-card {
    max-width: 450px;
}

.register-card {
    max-width: 550px;
}

/* Auth Pages Background */
body[class*="auth-"],
body[class*="welcome"],
body[class*="register"] {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(135deg, var(--ci-main) 0%, var(--ci-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Button Styles für Auth */
.btn-primary {
    background-color: var(--ci-primary);
    border-color: var(--ci-primary);
}

.btn-primary:hover {
    background-color: #154d8a;
    border-color: #154d8a;
}

/* ========================================================================== */
/* 3. MAIN LAYOUT & SIDEBAR */
/* ========================================================================== */

body {
    background-color: var(--bg-light);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
}

/* Haupt-Sidebar */
.sidebar {
    background-color: var(--ci-main);
    color: var(--text-color);
    transition: width 0.3s ease-in-out;
    width: 280px;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar .sidebar-header {
    height: 64px;
}

.sidebar .sidebar-header .logo {
    max-height: 40px;
    transition: opacity 0.3s ease-in-out;
}

.sidebar.collapsed .logo {
    opacity: 0;
}

.sidebar .nav-link {
    color: var(--text-color);
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
}

.sidebar .nav-link .nav-icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar .nav-link .nav-text {
    margin-left: 1rem;
    transition: opacity 0.3s ease-in-out, width 0.3s ease-in-out, margin-left 0.3s ease-in-out;
    white-space: nowrap;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    margin-left: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar .nav-link:hover {
    background-color: var(--hover-bg);
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: var(--ci-primary);
    color: #fff;
}

.sidebar .sidebar-footer {
    border-top: 1px solid #343a40;
}

.sidebar #collapse-icon {
    transition: transform 0.3s ease-in-out;
}

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

/* Secondary Sidebar */
.secondary-sidebar {
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    width: 280px;
    flex-shrink: 0;
}

.secondary-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.secondary-sidebar .sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.secondary-sidebar .nav {
    padding: 0.5rem;
}

.secondary-sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.secondary-sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.secondary-sidebar .nav-link .nav-text {
    margin-left: 1rem;
}

.secondary-sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--ci-primary);
}

.secondary-sidebar .nav-link.active {
    background-color: var(--ci-primary);
    color: #fff;
}

/* Main Header */
.main-header {
    height: 64px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Content Wrapper */
.content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}

/* ========================================================================== */
/* 4. CARDS & COMPONENTS */
/* ========================================================================== */

/* Custom Card - Universell eingesetzt */
.custom-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.custom-card:hover {
    /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); */
}

.custom-card .card-body {
    padding: 1.5rem;
}

.custom-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.75rem;
}

/* Chapter Cards (Dokumentation) */
.chapter-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chapter-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e7f3ff;
    border-radius: 0.5rem;
}

.chapter-icon i {
    color: var(--ci-primary);
}

/* ========================================================================== */
/* 5. MITARBEITER (EMPLOYEES) */
/* ========================================================================== */

/* Mitarbeiter Avatar */
.employee-avatar {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    color: white;
    margin-right: 12px;
}

/* Mitarbeiter Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background-color: #28a745;
    color: white;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-request {
    background-color: #17a2b8;
    color: white;
}

.status-inactive {
    background-color: #dc3545;
    color: white;
}

/* Employee Type Badge */
.employee-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

/* Employee Info */
.employee-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.employee-name {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
}

.employee-number {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Contact Info */
.contact-info {
    font-size: 0.85rem;
    line-height: 1.4;
}

.contact-email {
    color: #495057;
}

.contact-phone {
    color: #6c757d;
}

/* Action Buttons */
.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 2px;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Statistics Cards */
.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.stats-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--ci-primary);
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Bulk Actions */
.bulk-actions {
    background: #e7f3ff;
    border: 1px solid #b8d4f1;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
}

.bulk-actions.show {
    display: block;
}

/* ========================================================================== */
/* 6. TIMELINE & HISTORY */
/* ========================================================================== */

/* Employee Timeline */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 15px;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    left: -26px;
    top: 15px;
    z-index: 1;
}

.timeline-content {
    margin-left: 10px;
}

.timeline-point.bg-primary {
    background-color: var(--ci-primary);
}

.timeline-point.bg-success {
    background-color: #198754;
}

.timeline-point.bg-warning {
    background-color: #ffc107;
}

/* ========================================================================== */
/* 7. BUCHHALTUNG (ACCOUNTING) */
/* ========================================================================== */

/* Year Selector */
.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-selector .current-year {
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 11px;
}

.priority-1 { background-color: #dc3545; color: white; }
.priority-2 { background-color: #fd7e14; color: white; }
.priority-3 { background-color: #ffc107; color: #000; }
.priority-4 { background-color: #17a2b8; color: white; }
.priority-5 { background-color: #6c757d; color: white; }

/* Period Badges */
.period-badge {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    cursor: help;
    margin: 1px;
    transition: transform 0.2s;
}

.period-badge:hover {
    transform: scale(1.15);
}

.period-badge.has-xml {
    position: relative;
}

.period-badge .xml-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #17a2b8;
    border-radius: 50%;
    border: 1px solid white;
}

/* Status Badges */
.status-done {
    background-color: #28a745;
    color: white;
}

.status-booked {
    background-color: #17a2b8;
    color: white;
}

.status-partial {
    background-color: #ffc107;
    color: #000;
}

.status-overdue {
    background-color: #dc3545;
    color: white;
}

.status-soon {
    background-color: #fd7e14;
    color: white;
}

.status-pending {
    background-color: #6c757d;
    color: white;
}

/* Customer Styles */
.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    align-items: center;
}

.customer-name {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
}

.customer-id {
    font-size: 0.8rem;
    color: #6c757d;
}

.inactive-row {
    background-color: #f8f9fa;
    opacity: 0.7;
}

/* Legend */
.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 12px;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

/* Table Specific */
#accounting-table tbody tr {
    height: 60px;
}

#accounting-table tbody td {
    padding: 8px !important;
    vertical-align: middle;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* XML Upload Inline */
.xml-upload-zone-inline {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.xml-upload-zone-inline:hover {
    border-color: #28a745;
    background: #e8f5e9;
}

.xml-upload-zone-inline.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.xml-upload-zone-inline i {
    font-size: 1.5rem;
    color: #28a745;
}

.upload-results-inline {
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.upload-result-item {
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.upload-result-item.success {
    background: #d4edda;
    color: #155724;
}

.upload-result-item.error {
    background: #f8d7da;
    color: #721c24;
}

/* Full Page Drop Overlay */
.page-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.15);
    border: 4px dashed #28a745;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.page-drop-overlay.active {
    display: flex;
}

.page-drop-overlay-content {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
}

.page-drop-overlay-content i {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 15px;
}

.page-drop-overlay-content h3 {
    margin: 0;
    color: #28a745;
}

/* Result Items */
.result-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.result-item.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.result-item.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.result-item .filename {
    font-weight: 600;
    word-break: break-all;
}

.result-item .details {
    font-size: 0.8rem;
    color: #666;
}

/* Stat Boxes */
.stat-box {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--ci-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(29, 102, 179, 0.2);
}

.timeline-item:not(:last-child) .timeline-marker::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 20px);
    background: #dee2e6;
}

.timeline-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--ci-primary);
}

/* XML Upload Zone */
.xml-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.xml-upload-zone:hover,
.xml-upload-zone.dragover {
    border-color: var(--ci-primary);
    background: #e7f3ff;
}

.xml-upload-zone i {
    font-size: 3rem;
    color: #6c757d;
}


/* ========================================================================== */
/* 6. TABLES & LISTS */
/* ========================================================================== */

/* Compact Table Styles */
.compact-table {
    font-size: 0.875rem;
}

.compact-table thead th {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background-color: #f8f9fa;
}

.compact-table tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.compact-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Custom Table */
.custom-table {
    border-collapse: collapse;
}

/* ========================================================================== */
/* 7. NAVIGATION & TABS */
/* ========================================================================== */

/* Tabs Styling */
.nav-tabs {
    border-bottom: 2px solid #e0e0e0;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--ci-primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--ci-primary);
    background: transparent;
    border-bottom: 3px solid var(--ci-primary);
    margin-bottom: -2px;
}

/* ========================================================================== */
/* 8. SEARCH COMPONENTS */
/* ========================================================================== */

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-wrapper .fa-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    padding-left: 2.5rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid #ced4da !important;
}

.search-input:focus {
    box-shadow: 0 0 0 2px rgba(29, 102, 179, 0.2) !important;
    border-color: var(--ci-primary) !important;
}

/* ========================================================================== */
/* 9. PAGINATION */
/* ========================================================================== */

/* Bootstrap 5 Button Groups for Pagination */
nav[aria-label*="navigation"] .btn-group {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

nav[aria-label*="navigation"] .btn {
    min-width: 40px;
    font-weight: 500;
    font-size: 0.875rem;
}

nav[aria-label*="navigation"] .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-dark);
    background-color: var(--card-bg);
}

nav[aria-label*="navigation"] .btn-outline-secondary:hover:not(:disabled) {
    background-color: var(--bg-light);
    border-color: var(--ci-primary);
    color: var(--ci-primary);
}

nav[aria-label*="navigation"] .btn-outline-secondary:disabled {
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

nav[aria-label*="navigation"] .btn-primary {
    background-color: var(--ci-primary);
    border-color: var(--ci-primary);
    color: #ffffff;
    font-weight: 600;
}

nav[aria-label*="navigation"] .btn-primary:hover {
    background-color: #1557a0;
    border-color: #1557a0;
}

nav[aria-label*="navigation"] .btn:focus {
    box-shadow: 0 0 0 2px rgba(29, 102, 179, 0.2);
}

/* ========================================================================== */
/* 10. DOKUMENTATION */
/* ========================================================================== */

/* Markdown Content Styling */
.documentation-content {
    line-height: 1.7;
    color: #333;
}

.documentation-content h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ci-primary);
}

.documentation-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--ci-primary);
}

.documentation-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.documentation-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.documentation-content p {
    margin-bottom: 1rem;
}

.documentation-content ul,
.documentation-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.documentation-content li {
    margin-bottom: 0.5rem;
}

.documentation-content code {
    background-color: #f4f5f7;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e83e8c;
}

.documentation-content pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.documentation-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.documentation-content blockquote {
    border-left: 4px solid var(--ci-primary);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #666;
    font-style: italic;
}

.documentation-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.documentation-content table th,
.documentation-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.documentation-content table th {
    background-color: var(--bg-light);
    font-weight: 600;
}

.documentation-content table tr:nth-child(even) {
    background-color: #fafafa;
}

.documentation-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.documentation-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.documentation-content a {
    color: var(--ci-primary);
    text-decoration: none;
}

.documentation-content a:hover {
    text-decoration: underline;
}

/* Info-Boxen */
.documentation-content .info-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.documentation-content .info-box.info {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
}

.documentation-content .info-box.warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.documentation-content .info-box.success {
    background-color: #d1e7dd;
    border-left: 4px solid #198754;
}

.documentation-content .info-box.danger {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

/* ========================================================================== */
/* 11. UTILITIES & HELPERS */
/* ========================================================================== */

/* HTMX Loading Indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

/* Text Utilities */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge Utilities */
.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.xml-badges .badge {
    font-size: 0.7rem;
    margin-right: 2px;
}

/* Button Utilities */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
}

.btn-xs i {
    font-size: 0.875rem;
}

/* ========================================================================== */
/* 12. RESPONSIVE DESIGN */
/* ========================================================================== */

@media (max-width: 768px) {
    .sidebar,
    .secondary-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.show,
    .secondary-sidebar.show {
        transform: translateX(0);
        width: 280px;
    }

    .sidebar.collapsed {
        width: 280px;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 1030;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .search-wrapper {
        max-width: 100%;
    }
}

/* ========================================================================== */
/* 13. FOCUS STYLES & ACCESSIBILITY */
/* ========================================================================== */

/* Improved Focus Styles using CI Colors */
*:focus-visible {
    outline: 2px solid var(--ci-primary);
    outline-offset: 2px;
}

/* Form Focus Styles */
.form-control:focus,
.form-select:focus,
.btn:focus {
    border-color: var(--ci-primary);
    box-shadow: 0 0 0 2px rgba(29, 102, 179, 0.2);
}

/* ========================================================================== */
/* 15. AVATARS */
/* ========================================================================== */

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.avatar-circle-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2.5rem;
}

/* ========================================================================== */
/* 16. PRINT STYLES */
/* ========================================================================== */

@media print {
    .sidebar,
    .main-header,
    .sidebar-overlay {
        display: none !important;
    }

    .content-wrapper {
        overflow: visible;
    }

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

/* ========================================================================== */
/* 17. DOCUMENT UPLOAD & SPLIT (Employees) */
/* ========================================================================== */

/* Document Split Modal - 95vw Breite, 95vh Höhe */
#documentSplitModal .modal-dialog {
    max-width: 95vw;
    width: 95vw;
}

#documentSplitModal .modal-content {
    max-height: 95vh;
    height: 95vh;
}

#documentSplitModal .modal-body {
    max-height: calc(95vh - 120px);
    height: calc(95vh - 120px);
    overflow: hidden;
}

#documentSplitModal .row.h-100 {
    height: 100% !important;
}

#documentSplitModal .card.h-100 {
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

#documentSplitModal .card-body {
    overflow: hidden;
    flex: 1;
    min-height: 0; /* Wichtig für Flexbox-Overflow */
}

/* Upload Drop Zone */
.upload-drop-zone {
    border: 2px dashed #dee2e6 !important;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.upload-drop-zone:hover {
    border-color: var(--ci-primary) !important;
    background-color: #e7f3ff !important;
}

.upload-drop-zone.dragover {
    border-color: var(--bs-success) !important;
    background-color: #e8f5e9 !important;
}

/* File Items */
.file-item {
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f8f9fa;
}

/* Canvas Wrapper für Document Split */
.canvas-wrapper {
    position: relative;
    border-radius: 8px;
    touch-action: none;
    display: inline-block;
}

#canvasSourceSplit {
    display: block;
    max-width: 100%;
    max-height: calc(95vh - 280px);
}

#canvasOverlaySplit {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Corner Handles für Dokument-Ecken */
.corner-handle {
    position: absolute;
    width: 28px;
    height: 28px;
    background: #28a745 !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%);
    cursor: grab !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 8px !important;
    font-weight: bold !important;
    color: #fff !important;
    touch-action: none;
    user-select: none;
    pointer-events: auto !important;
}

.corner-handle:hover {
    background: #1e7e34 !important;
    transform: translate(-50%, -50%) scale(1.2);
}

.corner-handle:active,
.corner-handle.dragging {
    cursor: grabbing !important;
    background: #007bff !important;
    transform: translate(-50%, -50%) scale(1.25);
}

/* Preview Card Body - einfacher Container */
#previewCardBody {
    text-align: center;
}

/* Result Canvas Wrapper - wie result-container in scan.html */
#canvasResultWrapper {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* Result Canvas - exakt wie scan.html */
#canvasResultSplit {
    display: block;
    max-width: 100%;
    max-height: 60vh;
  border: 1px solid #ccc;
  box-shadow:
    0 0 0.5cm rgba(0, 0, 0, 0.2);

  box-sizing: border-box;
}

/* Placeholder */
#placeholderSplit {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Zoom Lens für präzises Positionieren der Ecken */
.zoom-lens {
    position: fixed;
    width: 180px;
    height: 180px;
    border: 3px solid #00ff88;
    border-radius: 50%;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
    display: none;
    transform: translate(-50%, -130%);
}

.zoom-lens.active {
    display: block;
}

.zoom-lens-canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.zoom-lens-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.zoom-lens-crosshair::before,
.zoom-lens-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 0, 0, 0.8);
}

.zoom-lens-crosshair::before {
    width: 1px;
    height: 20px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.zoom-lens-crosshair::after {
    width: 20px;
    height: 1px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================================================== */
/* 18. OCR HERVORHEBUNG */
/* ========================================================================== */

/* OCR-befüllte Felder hervorheben */
.ocr-filled {
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.05) !important;
    position: relative;
}

/* Animation beim Befüllen */
@keyframes ocr-highlight {
    0% { background-color: rgba(13, 110, 253, 0.2); }
    100% { background-color: rgba(13, 110, 253, 0.05); }
}

.ocr-filled {
    animation: ocr-highlight 1s ease-out;
}

/* OCR-Icon Indikator neben dem Feld */
.ocr-filled-wrapper {
    position: relative;
}

.ocr-filled-wrapper .ocr-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #0d6efd;
    font-size: 0.8rem;
    pointer-events: none;
}

/* ========================================================================== */
/* 19. DATEI-VORSCHAU LISTE */
/* ========================================================================== */

/* Hover-Effekt für Datei-Items */
.file-item {
    transition: background-color 0.15s ease;
}

.file-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.file-item:hover .fa-eye {
    color: var(--bs-primary) !important;
}

/* ========================================================================== */
/* 20. STATISTIK-ICONS (MITARBEITER-ÜBERSICHT) */
/* ========================================================================== */

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Empty State Styling */
.empty-state i {
    display: block;
}