/* Modern Racing-Inspired Automotive Design */

:root {
    /* Racing Colors */
    --racing-black: #0a0a0a;
    --racing-dark: #1a1a1a;
    --racing-gray: #2d2d2d;
    --racing-silver: #c0c0c0;
    --racing-silver-light: #e8e8e8;
    --racing-orange: #ff6b00;
    --racing-orange-light: #ff8c42;
    --racing-orange-dark: #cc5500;
    --racing-green: #00ff41;
    --racing-red: #ff0000;
    --racing-yellow: #ffd700;
    
    /* Brand Colors */
    --primary-dark: #1a1a1a;
    --primary-darker: #0a0a0a;
    --secondary-light: #f5f5f5;
    --secondary-lighter: #ffffff;
    --accent: #adb5bd;
    --border-color: #e0e0e0;
    --text-dark: #1a1a1a;
    --text-light: #6c757d;
    
    /* Responsive breakpoints */
    --mobile-table-min-width: 600px;
}


/* ============================================= */
/* SCHLICHTES & SERIÖSES DESIGN (theme-serios)  */
/* Komplettes schwarz-weiß-grau Design          */
/* Orange nur im Logo beibehalten               */
/* ============================================= */

/* Basis-Einstellungen */
.theme-serios {
    --serios-primary: #333333;
    --serios-primary-dark: #1a1a1a;
    --serios-accent: #333333;
    --serios-bg: #f5f5f5;
    --serios-card-bg: #ffffff;
    --serios-text: #1a1a1a;
    --serios-text-muted: #6b7280;
    --serios-border: #e0e0e0;
    --serios-sidebar-bg: #111111;
    --serios-sidebar-text: #d4d4d4;
}

/* Sidebar komplett neu */
.theme-serios .sidebar {
    background: var(--serios-sidebar-bg) !important;
    border-right: 1px solid #222 !important;
    box-shadow: none !important;
}

.theme-serios .sidebar-racing-pattern,
.theme-serios .content-background-pattern,
.theme-serios .racing-flag-pattern {
    display: none !important;
}

.theme-serios .brand-logo-item,
.theme-serios .brand-logo-icon {
    display: none !important;
}

.theme-serios .sidebar-main-logo {
    margin: 0 !important;
    filter: none !important;
}

/* Navigation Links */
.theme-serios .nav-link {
    color: var(--serios-sidebar-text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    margin: 2px 8px !important;
    padding: 0.75rem 1rem !important;
    border-left: none !important;
    transition: background-color 0.2s ease !important;
}

.theme-serios .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: none !important;
    box-shadow: none !important;
}

.theme-serios .nav-link::before {
    display: none !important;
}

.theme-serios .nav-link.active {
    background: #333333 !important;
    color: #ffffff !important;
    border-left: none !important;
    box-shadow: none !important;
}

.theme-serios .nav-highlight-button {
    background: #333333 !important;
    border-color: #333333 !important;
    color: #fff !important;
}

.theme-serios .nav-highlight-button:hover {
    background: #444444 !important;
}

.theme-serios .nav-divider {
    border-color: #333 !important;
}

.theme-serios .nav-section-label {
    color: #888 !important;
}

.theme-serios .nav-category-header {
    color: #ccc !important;
}

.theme-serios .nav-chevron {
    border-color: #888 !important;
}

.theme-serios .nav-sub-dot {
    background: #666 !important;
}

.theme-serios .nav-sub-link {
    color: #bbb !important;
}

.theme-serios .nav-sub-link:hover {
    color: #fff !important;
}

.theme-serios .user-info-section {
    border-bottom-color: rgba(255,255,255,0.1) !important;
}

.theme-serios .badge.bg-info {
    background: #555 !important;
}

/* Main Content Area */
.theme-serios main {
    background: var(--serios-bg) !important;
}

.theme-serios .content {
    background: var(--serios-bg) !important;
}

/* Top Row / Header */
/* Top/Header für alle Themes einheitlich dunkelgrau mit feiner orangefarbener Akzentlinie unten */
.theme-serios .top-row,
.theme-modern .top-row,
.top-row {
    background: #1e1e1e !important;
    border-bottom: 2px solid var(--racing-orange) !important;
    border-image: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    padding: 0.75rem 1.5rem !important;
}

.theme-serios .brand-title {
    color: #1a1a1a !important;
    font-size: 1.5rem !important;
    text-shadow: none !important;
}

.theme-serios .brand-silver {
    color: #666 !important;
    text-shadow: none !important;
}

.theme-serios .brand-orange {
    color: #333 !important;
    text-shadow: none !important;
}

.theme-serios .brand-gear-icon,
.theme-serios .racing-flag,
.theme-serios .racing-speed,
.theme-serios .top-row-racing-elements {
    display: none !important;
}

/* Typography */
.theme-serios h1,
.theme-serios h2,
.theme-serios h3,
.theme-serios h4,
.theme-serios h5,
.theme-serios h6 {
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--serios-text) !important;
    font-weight: 600 !important;
}

/* Cards - Komplett neu */
.theme-serios .card {
    background: var(--serios-card-bg) !important;
    border: 1px solid var(--serios-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: box-shadow 0.2s ease !important;
}

.theme-serios .card::before {
    display: none !important;
}

.theme-serios .card:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--serios-border) !important;
}

.theme-serios .card-header {
    background: #fafafa !important;
    border-bottom: 1px solid var(--serios-border) !important;
    color: var(--serios-text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    padding: 1rem 1.25rem !important;
}

.theme-serios .card-header.bg-dark,
.theme-serios .card-header.bg-primary,
.theme-serios .card-header.bg-secondary,
.theme-serios .card-header.bg-success,
.theme-serios .card-header.bg-info,
.theme-serios .card-header.bg-warning {
    background: #333 !important;
    color: #fff !important;
}

.theme-serios .card-header.bg-danger {
    background: #555 !important;
    color: #fff !important;
}

.theme-serios .card-body {
    padding: 1.25rem !important;
}

/* Buttons - Schwarz-Grau-Weiß */
.theme-serios .btn {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    padding: 0.5rem 1rem !important;
}

.theme-serios .btn::before,
.theme-serios .btn:hover::before {
    display: none !important;
}

.theme-serios .btn:hover {
    transform: none !important;
}

.theme-serios .btn-primary {
    background: #333333 !important;
    border-color: #333333 !important;
    color: #ffffff !important;
}

.theme-serios .btn-primary:hover {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
    box-shadow: none !important;
}

.theme-serios .btn-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    color: #ffffff !important;
}

.theme-serios .btn-secondary:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
}

.theme-serios .btn-outline-primary {
    color: #333333 !important;
    border-color: #333333 !important;
    background: transparent !important;
}

.theme-serios .btn-outline-primary:hover {
    background: #333333 !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

.theme-serios .btn-outline-secondary {
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    background: transparent !important;
}

.theme-serios .btn-outline-secondary:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
}

.theme-serios .btn-outline-danger {
    color: #555 !important;
    border-color: #555 !important;
}

.theme-serios .btn-outline-danger:hover {
    background: #555 !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

.theme-serios .btn-outline-info {
    color: #555 !important;
    border-color: #555 !important;
}

.theme-serios .btn-outline-info:hover {
    background: #555 !important;
    color: #ffffff !important;
}

.theme-serios .btn-success {
    background: #374151 !important;
    border-color: #374151 !important;
}

.theme-serios .btn-success:hover {
    background: #1f2937 !important;
    border-color: #1f2937 !important;
}

.theme-serios .btn-danger {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
}

.theme-serios .btn-danger:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
}

.theme-serios .btn-warning {
    background: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #1a1a1a !important;
}

.theme-serios .btn-info {
    background: #555 !important;
    border-color: #555 !important;
    color: #fff !important;
}

/* Form Controls */
.theme-serios .form-control,
.theme-serios .form-select {
    border: 1px solid var(--serios-border) !important;
    border-radius: 6px !important;
    padding: 0.625rem 0.875rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.theme-serios .form-control:focus,
.theme-serios .form-select:focus {
    border-color: #333333 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1) !important;
}

.theme-serios .form-label {
    font-weight: 500 !important;
    color: var(--serios-text) !important;
    margin-bottom: 0.375rem !important;
}

/* Tables */
.theme-serios .table {
    border-color: var(--serios-border) !important;
}

.theme-serios .table thead th {
    background: #f9fafb !important;
    border-bottom: 1px solid var(--serios-border) !important;
    color: var(--serios-text) !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.theme-serios .table tbody tr {
    border-bottom: 1px solid var(--serios-border) !important;
}

.theme-serios .table tbody tr:hover {
    background: #f9fafb !important;
}

/* Tabs */
.theme-serios .nav-tabs {
    border-bottom: 1px solid var(--serios-border) !important;
}

.theme-serios .nav-tabs .nav-link {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: var(--serios-text-muted) !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0.75rem 1.25rem !important;
    border-radius: 0 !important;
}

.theme-serios .nav-tabs .nav-link:hover {
    border-bottom-color: #ccc !important;
    color: var(--serios-text) !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.theme-serios .nav-tabs .nav-link.active {
    border-bottom-color: #333 !important;
    color: #333 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Badges */
.theme-serios .badge {
    font-weight: 500 !important;
    border-radius: 4px !important;
    padding: 0.35rem 0.65rem !important;
}

.theme-serios .badge.bg-primary {
    background: #333 !important;
}

.theme-serios .badge.bg-success {
    background: #555 !important;
}

.theme-serios .badge.bg-warning {
    background: #999 !important;
    color: #1a1a1a !important;
}

/* Alerts */
.theme-serios .alert {
    border-radius: 6px !important;
    border-width: 1px !important;
}

.theme-serios .alert-info {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #333 !important;
}

.theme-serios .alert-success {
    background: #f5f5f5 !important;
    border-color: #ccc !important;
    color: #333 !important;
}

/* Modals */
.theme-serios .modal-content {
    border: 1px solid var(--serios-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.theme-serios .modal-header {
    background: #fafafa !important;
    border-bottom: 1px solid var(--serios-border) !important;
    border-radius: 8px 8px 0 0 !important;
    color: #1a1a1a !important;
}

.theme-serios .modal-header.bg-warning,
.theme-serios .modal-header.bg-danger,
.theme-serios .modal-header.bg-primary,
.theme-serios .modal-header.bg-success {
    background: #333 !important;
    color: #fff !important;
}

/* Breadcrumbs */
.theme-serios .breadcrumb {
    background: transparent !important;
    padding: 0 !important;
}

.theme-serios .breadcrumb-item a {
    color: #555 !important;
}

/* Spinners */
.theme-serios .spinner-border {
    border-color: #333 !important;
    border-right-color: transparent !important;
}

/* Dropdown */
.theme-serios .dropdown-menu {
    border: 1px solid var(--serios-border) !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* User Emoji Container */
.theme-serios .user-emoji-container {
    border-color: #666 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    box-shadow: none !important;
}

.theme-serios .user-emoji-container:hover {
    transform: none !important;
}

/* Dashboard Cards */
.theme-serios .dashboard-icon {
    filter: grayscale(100%) !important;
}

/* Customer Group Header */
.theme-serios .customer-group-header {
    background: #f5f5f5 !important;
    border-left: 3px solid #333 !important;
}

.theme-serios .customer-group-header h6,
.theme-serios .customer-group-header td {
    color: var(--serios-text) !important;
}

/* Fancy Switch für seriöses Design */
.theme-serios .fancy-switch .form-check-input {
    background-color: #d1d5db !important;
    border-color: #9ca3af !important;
}

.theme-serios .fancy-switch .form-check-input:checked {
    background-color: #333333 !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}

/* Form check / switch */
.theme-serios .form-check-input:checked {
    background-color: #333 !important;
    border-color: #333 !important;
}

/* Links */
.theme-serios a,
.theme-serios .btn-link {
    color: #333 !important;
}

.theme-serios a:hover,
.theme-serios .btn-link:hover {
    color: #000 !important;
    transform: none !important;
}

/* Settings sidebar */
.theme-serios .settings-sidebar-card .card-header {
    background: #333 !important;
    color: #fff !important;
}

/* Image gallery */
.theme-serios .image-gallery-item.current-logo {
    border-color: #333 !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.15) !important;
    background: #fafafa !important;
}

.theme-serios .image-gallery-item:hover {
    border-color: #999 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transform: none !important;
}

.theme-serios .logo-badge {
    background: #333 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.theme-serios .logo-badge i {
    animation: none !important;
}

/* Auftrag Document Styles */
.theme-serios .auftragsnummer-box {
    background: #333 !important;
}

.theme-serios .document-header {
    border-bottom-color: #333 !important;
}

/* Sidebar logo bar clean in serios theme */
.theme-serios .sidebar .bg-gradient {
    background: var(--serios-sidebar-bg) !important;
    box-shadow: none !important;
}

/* KalenderWidget btn-purple im seriösen Design */
.theme-serios .btn-purple {
    background: #444 !important;
    border-color: #444 !important;
    color: #fff !important;
}

.theme-serios .btn-purple:hover {
    background: #222 !important;
    border-color: #222 !important;
}

/* bg-purple Badge im seriösen Design */
.theme-serios .bg-purple {
    background: #555 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Quick-Actions im seriösen Design (Dashboard) */
.theme-serios .quick-action {
    border-color: #333 !important;
    background: #fafafa !important;
    color: #1a1a1a !important;
}

/* ── RechnungDetails PDF-Vorschau im seriösen Design ─── */
.theme-serios .rechnung-pdf-header {
    background: linear-gradient(135deg, #111 0%, #1f1f1f 100%) !important;
}
.theme-serios .rechnung-pdf-header .rechnung-pdf-archiv-badge {
    background: rgba(255,255,255,0.06) !important;
    color: #9ca3af !important;
    border-color: rgba(255,255,255,0.12) !important;
}

.theme-serios .quick-action i {
    color: #333 !important;
}

.theme-serios .quick-action:hover {
    background: #333 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.theme-serios .quick-action:hover i {
    color: #fff !important;
}

/* Print Styles für seriöses Design */
@media print {
    .theme-serios .card {
        box-shadow: none !important;
        border: 1px solid #e0e0e0 !important;
    }
}



/* Modern GarageBuddy design */
.theme-modern {
    background: #f3f4f6;
}

.theme-modern {
    background: #eef1f5 !important;
    color: #1f2937;
}

.theme-modern .sidebar {
    background: #0f172a !important;
    border-right: 2px solid var(--racing-orange) !important;
    box-shadow: none !important;
}

.theme-modern .sidebar-racing-pattern,
.theme-modern .content-background-pattern {
    display: none !important;
}

.theme-modern main {
    background: #eef1f5 !important;
}

.theme-modern .brand-title {
    color: #111827;
    text-shadow: none !important;
}

.theme-modern .content {
    background: #f8fafc !important;
}

.theme-modern h1,
.theme-modern h2,
.theme-modern h3,
.theme-modern h4,
.theme-modern h5,
.theme-modern h6 {
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #111827 !important;
}

.theme-modern .card {
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

.theme-modern .card::before {
    display: none !important;
}

.theme-modern .card-header {
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #111827 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.theme-modern .nav-link {
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #e2e8f0 !important;
    border-left: 3px solid transparent;
}

.theme-modern .nav-link.active {
    background-color: rgba(255, 107, 0, 0.18) !important;
    border-left-color: var(--racing-orange);
    box-shadow: none !important;
}

.theme-modern .btn {
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
}

.theme-modern .btn-primary {
    background: #ff6b00 !important;
    border-color: #ff6b00 !important;
}

.theme-modern .btn-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Clean Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--racing-black);
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Links */
a, .btn-link {
    color: var(--racing-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--racing-orange-dark);
    text-decoration: none;
    transform: none;
}

/* Content Area – Clean & Airy */
.content {
    padding-top: 1.1rem;
    background: #f0f2f5;
    min-height: calc(100vh - 3.5rem);
    flex: 1;
    position: relative;
    z-index: 1;
}

.content-background-pattern {
    display: none;
}

h1:focus {
    outline: none;
}

/* Form & Input Styling */
.form-control, .form-control-plaintext {
    border: 1.5px solid #e0e3e8;
    border-radius: 14px;
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0.6rem 1rem;
    background: #fff;
}

.form-control:focus {
    border-color: var(--racing-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
    transform: none;
}

.form-select {
    border-radius: 14px;
    border: 1.5px solid #e0e3e8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    border-color: var(--racing-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid #28a745;
}

.invalid {
    outline: 2px solid #dc3545;
}

.validation-message {
    color: #dc3545;
    font-weight: 600;
}

/* Required field validation error */
.field-validation-error,
.theme-serios .field-validation-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
    animation: validation-shake 0.4s ease;
}

.field-validation-error-text {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

@keyframes validation-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Alerts – Soft & Rounded */
.alert {
    border-radius: 16px;
    border: none;
    font-weight: 500;
    backdrop-filter: blur(8px);
    padding: 1rem 1.25rem;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.12);
    color: #856404;
}

.alert-danger {
    background: rgba(255, 0, 0, 0.08);
    color: #721c24;
}

.alert-info {
    background: rgba(13, 110, 253, 0.08);
    color: #004085;
}

/* Buttons – Modern, Flowing, Pill-ish */
.btn {
    border-radius: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    position: relative;
    overflow: hidden;
    padding: 0.5rem 1.15rem;
}

.btn::before {
    display: none;
}

.btn:hover::before {
    display: none;
}

.btn:focus, .btn:active:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.2);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--racing-orange);
    border-color: var(--racing-orange);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.2);
}

.btn-primary:hover {
    background: var(--racing-orange-dark);
    border-color: var(--racing-orange-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.25);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--racing-orange);
    border-color: var(--racing-orange);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--racing-orange);
    border-color: var(--racing-orange);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

/* Additional Button Variants */
.btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.25);
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-light {
    background: #f8f9fa;
    border-color: #e0e3e8;
    color: var(--racing-black);
}

.btn-light:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: var(--racing-black);
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--racing-dark);
    border-color: var(--racing-dark);
    color: white;
}

.btn-dark:hover {
    background: var(--racing-black);
    border-color: var(--racing-black);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Purple/Violet Badge for Closed Orders */
.bg-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%) !important;
    color: white !important;
    border: 2px solid #8a63d2;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

/* Small Buttons */
.btn-sm {
    border-width: 1.5px;
    border-radius: 10px;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
}

/* Large Buttons */
.btn-lg {
    border-width: 1.5px;
    border-radius: 16px;
    padding: 0.65rem 1.5rem;
}

/* Cards – Flowing, Modern, Airy */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.card::before {
    display: none;
}

.card:hover::before {
    display: none;
}

.card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: transparent;
}

.card-header {
    background: #fafbfc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-dark);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 20px 20px 0 0;
    padding: 1rem 1.25rem;
}

/* Ensure headings inside card-headers are always visible */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: inherit;
}

/* Light/warning background card-headers need dark headings */
.card-header.bg-light h1,
.card-header.bg-light h2,
.card-header.bg-light h3,
.card-header.bg-light h4,
.card-header.bg-light h5,
.card-header.bg-light h6 {
    color: var(--text-dark);
}

.card-header.bg-warning h1,
.card-header.bg-warning h2,
.card-header.bg-warning h3,
.card-header.bg-warning h4,
.card-header.bg-warning h5,
.card-header.bg-warning h6 {
    color: var(--text-dark);
}

/* Navigation Bar – Clean */
.bg-gradient {
    background: #0d0d0d !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border-bottom: none;
    padding: 0.2rem 0.3rem;
    min-height: auto;
}

.bg-gradient .container-fluid {
    padding: 0;
}

.bg-gradient .navbar-brand {
    padding: 0;
    margin: 0;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0;
    color: white !important;
    text-transform: none;
    transition: color 0.2s ease;
}

.navbar-logo {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.4));
    transition: filter 0.2s ease;
}

.navbar-logo:hover {
    filter: drop-shadow(0 0 12px rgba(255, 107, 0, 0.6));
}

.sidebar-main-logo {
    width: auto;
    max-width: 90%;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255, 107, 0, 0.5));
    transition: filter 0.2s ease;
    margin: 0;
    display: block;
}

.sidebar-main-logo:hover {
    filter: drop-shadow(0 0 18px rgba(255, 107, 0, 0.7));
}

.brand-text {
    color: var(--racing-orange);
    font-weight: 700;
    font-size: 1.5rem;
}

/* Dashboard Icons */
.dashboard-icon {
    color: var(--racing-orange);
    font-weight: 700;
    font-size: 1.3rem;
    margin-right: 0.5rem;
    transition: color 0.2s ease;
    filter: none;
}

.card-body:hover .dashboard-icon {
    color: var(--racing-orange-dark);
    transform: none;
    filter: none;
}

/* Dashboard Buttons */
.btn-dashboard {
    background: var(--racing-orange);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7rem 1.5rem;
    transition: all 0.25s ease;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.2);
}

.btn-dashboard:hover {
    background: var(--racing-orange-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
}

/* Logout Button */
.btn-logout {
    background: #f5f5f5;
    border: 1.5px solid #dee2e6;
    color: var(--racing-black);
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 14px;
    padding: 0.7rem 1rem;
}

.btn-logout:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.25);
    transform: translateY(-1px);
}

/* Sidebar Navigation Layout with Racing Theme */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    background: #141414 !important;
    border-right: 1px solid #1f1f1f !important;
    display: flex !important;
    flex-direction: column !important;
    width: 300px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15) !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1000 !important;
}

main {
    flex: 1;
    margin-left: 300px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar Background Pattern – Hidden */
.sidebar-racing-pattern {
    display: none;
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 3000;
    width: 44px;
    height: 44px;
    background: #e8521a;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #c94210;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation when open */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }

    /* Push top-row text right so it doesn't overlap the hamburger */
    .top-row {
        padding-left: 68px !important;
    }
}

.racing-flag-pattern {
    display: none;
}

.brand-logo-item {
    display: none;
}

.brand-logo-item:nth-child(2) { animation-delay: -5s; }
.brand-logo-item:nth-child(3) { animation-delay: -10s; }
.brand-logo-item:nth-child(4) { animation-delay: -15s; }
.brand-logo-item:nth-child(5) { animation-delay: -20s; }

.brand-logo-text {
    display: none;
}

.racing-icon {
    display: none;
}

/* Navigation Link Styling */
.nav-link-styled {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0.6rem 0.8rem !important;
    border-radius: 12px !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.nav-link-styled:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: none !important;
}

.nav-emoji {
    font-size: 1.3rem;
    min-width: 28px;
    text-align: center;
    display: inline-block;
}

.nav-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
}

.nav-link-styled:hover .nav-text {
    color: #ff6b00;
}

/* Dashboard & Logout Highlight Button */
.nav-highlight-button {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    background: var(--racing-orange) !important;
    border-radius: 14px !important;
    padding: 0.9rem 1rem !important;
    margin: 0.3rem 0 !important;
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.2) !important;
    border: none !important;
    transition: background 0.2s ease, box-shadow 0.2s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* Spezifisches Dashboard Button Design: Heller als Sidebar (Anthrazit) mit oranger Umrandung */
.dashboard-highlight-button {
    background: #232323 !important;
    border: 2px solid var(--racing-orange) !important;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.15) !important;
}

.dashboard-highlight-button:hover {
    background: #2e2e2e !important;
    box-shadow: 0 4px 18px rgba(255, 107, 0, 0.3) !important;
    border-color: var(--racing-orange-light) !important;
}

.nav-highlight-button:hover {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35) !important;
    background: var(--racing-orange-dark) !important;
}

.nav-highlight-button .nav-emoji {
    font-size: 1.5rem;
    min-width: 32px;
}

.nav-highlight-button .nav-text {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    color: white !important;
}

/* Logout Button Specific */
.nav-logout-button {
    background: #dc3545 !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2) !important;
}

.nav-logout-button:hover {
    background: #c82333 !important;
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3) !important;
}

/* Settings Button Specific */
.nav-settings-button {
    background: #495057 !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(73, 80, 87, 0.2) !important;
}

.nav-settings-button:hover {
    background: #6c757d !important;
    box-shadow: 0 4px 16px rgba(108, 117, 125, 0.3) !important;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 1rem;
}

/* ===== Section Labels ===== */
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.5rem 1.2rem 0.35rem;
    margin-bottom: 0.15rem;
    user-select: none;
}

/* ===== Navigation Category Dropdowns ===== */
.nav-category {
    margin-bottom: 0.2rem;
}

.nav-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent; /* Vorbereitung für Hover-Grenzlinie */
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-align: left;
}

.nav-category-header:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: var(--racing-orange) !important; /* Orangene Umrandung bei Hover */
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.15);
}

.nav-cat-icon {
    font-size: 1.1rem;
    min-width: 26px;
    text-align: center;
    transition: none;
}

.nav-category-header:hover .nav-cat-icon {
    transform: none;
}

.nav-category-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3px;
    transition: color 0.25s ease;
}

.nav-category-header:hover .nav-category-label {
    color: #fff;
}

/* Chevron */
.nav-chevron {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transform: rotate(-45deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-category-header:hover .nav-chevron {
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-chevron.expanded {
    transform: rotate(45deg);
    border-color: var(--racing-orange);
}

/* Category items container */
.nav-category-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    margin-left: 1.1rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.06);
}

.nav-category-items.show {
    max-height: 500px;
    opacity: 1;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    border-left-color: rgba(255, 107, 0, 0.25);
}

/* ===== Sub-link Items ===== */
.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 0.75rem;
    margin: 1px 0;
    border-radius: 10px;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid transparent; /* Vorbereitung für Hover-Grenzlinie */
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.nav-sub-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--racing-orange-light);
    border-color: var(--racing-orange) !important; /* Dezentere oder vollflächige orange Umrandung */
}

.nav-sub-link.active {
    background: rgba(255, 107, 0, 0.12);
    color: var(--racing-orange);
}

.nav-sub-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.nav-sub-link:hover .nav-sub-dot {
    background: var(--racing-orange);
}

.nav-sub-link.active .nav-sub-dot {
    background: var(--racing-orange);
    width: 7px;
    height: 7px;
}

.nav-sub-text {
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-sub-link:hover .nav-sub-text {
    color: var(--racing-orange-light);
    font-weight: 600;
}

.nav-sub-link.active .nav-sub-text {
    color: var(--racing-orange);
    font-weight: 700;
}

/* Top Row – Clean Header */
.top-row {
    background: #1e1e1e !important;
    border-bottom: 2px solid var(--racing-orange) !important;
    border-image: none !important;
    padding: 0.8rem 2rem;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}

.top-row::after {
    display: none !important;
}

.top-row > * {
    position: relative;
    
}

.top-row-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.top-row-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 20px #ff6b00);
}

.brand-gear-icon {
    font-size: 2.5rem;
    color: var(--racing-orange);
    filter: none;
}

.brand-title {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #e8e8e8;
    letter-spacing: 0.03em;
    text-shadow: 0 0 18px rgba(255,107,0,0.2);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: none;
}

.brand-initial {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--racing-orange);
    margin-right: 1px;
}

.brand-silver {
    font-weight: 800;
    background: linear-gradient(135deg, #d0d0d0 0%, #ffffff 40%, #a8a8a8 70%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Silver mit Glow */
.brand-silver-flat {
    font-weight: 900;
    background: linear-gradient(135deg, #c0c0c0 0%, #ffffff 40%, #a0a0a0 70%, #e8e8e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.06em;
    filter: drop-shadow(0 0 8px rgba(192,192,192,0.85)) drop-shadow(0 0 18px rgba(220,220,220,0.55));
}

.brand-gray {
    font-weight: 600;
    color: #b0b0b0;
}

.brand-tld {
    font-weight: 400;
    color: #686868;
    font-size: 0.7em;
    letter-spacing: 0.04em;
}

.brand-icon-wrench {
    display: none;
}

.brand-icon-flip {
    display: none;
}

/* Wrench + Gear combo icon */
.brand-icon-combo {
    display: none;
}

.brand-icon-combo-flip {
    display: none;
}

.brand-icon-left {
    font-size: 1.8rem;
    color: #c8c8c8;
    filter: drop-shadow(0 0 6px rgba(200,200,200,0.8)) drop-shadow(0 0 14px rgba(255,255,255,0.35));
    flex-shrink: 0;
}

.brand-icon-right {
    font-size: 1.8rem;
    color: #ff6b00;
    filter: drop-shadow(0 0 6px rgba(255,107,0,0.9)) drop-shadow(0 0 16px rgba(255,140,66,0.55));
    flex-shrink: 0;
}

.brand-icon-combo svg {
    width: 100%;
    height: 100%;
}

.brand-icon-combo-flip {
    transform: scaleX(-1);
}

.brand-orange {
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b00 0%, #ff8c42 50%, #ffb347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255,107,0,0.9)) drop-shadow(0 0 22px rgba(255,140,66,0.65));
}

.top-row-racing-elements {
    display: none;
}

.racing-flag {
    display: none;
}

.racing-speed {
    display: none;
}

/* Sidebar Navigation Links */
.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.nav-item {
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 0.75rem 1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    border-radius: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent !important; /* Vorbereitung für Hover-Grenzlinie */
    position: relative;
    overflow: hidden;
}

.nav-link-dokumente {
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    letter-spacing: 0;
}

.nav-link-text-compact {
    line-height: 1.3;
    display: inline-block;
}

.nav-link i {
    font-size: 1.1rem;
    width: 1.2rem;
    flex-shrink: 0;
}

.nav-link::before {
    display: none;
}

.nav-link:hover::before {
    display: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: var(--racing-orange) !important; /* Orangener Rahmen bei Hover */
    transform: none;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

.nav-link.active {
    background: rgba(255, 107, 0, 0.15) !important;
    color: var(--racing-orange) !important;
    font-weight: 600;
    box-shadow: none;
}

/* Status Badges – Clean */
.part-number-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: none;
    text-transform: none;
    letter-spacing: 0;
}

.status-ordered {
    background: var(--racing-orange);
    color: #fff;
    border: none;
    box-shadow: none;
}

.status-delivered {
    background: #28a745;
    color: #fff;
    border: none;
    box-shadow: none;
}

/* Tab Navigation – Clean Underline */
.nav-tabs {
    border-bottom: 1px solid #e0e3e8;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #6c757d !important;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.75rem 1.25rem;
    margin-right: 0.25rem;
    transition: color 0.2s ease, border-color 0.2s ease;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    background: transparent;
    transform: none;
    border-bottom-color: #adb5bd;
    box-shadow: none;
    color: var(--racing-black) !important;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--racing-orange) !important;
    border-bottom-color: var(--racing-orange);
    transform: none;
    box-shadow: none;
}

/* Filter Buttons – Pill Style */
.filter-btn-group .btn {
    border: 1.5px solid #e0e3e8;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.55rem 1.25rem;
    transition: all 0.2s ease;
    border-radius: 20px;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
}

.filter-btn-group .btn:not(.active) {
    background: #fff;
    color: var(--racing-black) !important;
    border-color: #e0e3e8;
}

.filter-btn-group .btn:not(.active):hover {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
    border-color: #adb5bd;
}

.filter-btn-group .btn.active {
    background: var(--racing-orange);
    color: white !important;
    border-color: var(--racing-orange);
    transform: none;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.2);
}

/* Scrollbar – Subtle */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 8px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Document Type Headers */
.document-type-header {
    transition: background 0.2s ease;
    background: #1a1a1a !important;
    border-left: 3px solid var(--racing-orange) !important;
    border-radius: 0 12px 12px 0;
}

.document-type-header:hover {
    transform: none;
    background: #2d2d2d !important;
    box-shadow: none;
}

/* User Emoji Container – Clean */
.user-emoji-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: rgba(255, 107, 0, 0.08);
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 0, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.user-emoji-container:hover {
    transform: none;
    border-color: var(--racing-orange);
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.15);
}

.user-emoji {
    font-size: 3.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.edit-overlay i {
    color: white;
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.user-emoji-container.clickable {
    cursor: pointer;
}

.user-emoji-container.clickable:hover .edit-overlay {
    opacity: 1;
}

/* Timeline – Clean */
.timeline-marker-service {
    background: #0d6efd;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.timeline-marker-reparatur {
    background: var(--racing-orange);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.25);
}

.timeline-service .card {
    border-left: 3px solid #0d6efd;
}

.timeline-reparatur .card {
    border-left: 3px solid var(--racing-orange);
}

/* Service Cards – Subtle Hover */
.card[style*="cursor: pointer"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1) !important;
}

/* Modal – Clean & Rounded */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header.bg-gradient {
    background: #1a1a1a;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
}

/* User Info Section */
.user-info-section {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0;
    padding: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #111111;
    position: relative;
    overflow: hidden;
    margin-left: auto;
}

.login-background-logo {
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1400px;
    height: auto;
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
}

.login-background-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(255, 107, 0, 0.3));
}

.login-form-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
}

.login-logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 16px rgba(255, 107, 0, 0.5));
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border: none;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    position: relative;
    z-index: 10;
    max-height: 95vh;
    overflow-y: auto;
}

.login-card .card-body {
    padding: 2rem 3rem !important;
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-card p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.login-card .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.login-card .form-control-lg {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
}

.login-card .btn-lg {
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

.login-card hr {
    margin: 1.5rem 0;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.login-footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
}

.login-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* Background selector */
.background-selector-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.background-selector-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.6rem;
    border: 1.5px solid #e0e3e8;
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.background-menu {
    width: 250px;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    margin-top: 0.5rem;
}

/* Mobile responsive for login */
@media (max-width: 640px) {
    .login-container {
        padding: 1rem 0.5rem;
    }
    
    .login-form-wrapper {
        max-width: 100%;
        width: 100%;
    }
    
    .login-card .card-body {
        padding: 1.5rem 1rem !important;
    }
    
    .login-logo {
        max-width: 180px !important;
    }
    
    .login-card h1 {
        font-size: 1.5rem !important;
    }
    
    .login-card p {
        font-size: 0.85rem !important;
    }
    
    .login-card .form-control-lg {
        padding: 0.5rem 0.7rem;
        font-size: 0.95rem;
    }
    
    .login-card .btn-lg {
        padding: 0.6rem 0.9rem;
        font-size: 0.95rem;
    }
    
    .login-background-logo {
        left: 50%;
        width: 100%;
        max-width: 600px;
        opacity: 0.08;
    }
    
    .background-selector-wrapper {
        bottom: 10px;
        left: 10px;
    }
    
    .background-selector-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .background-menu {
        width: calc(100vw - 80px);
        max-width: 280px;
    }
}

/* Tablet responsive for login */
@media (min-width: 641px) and (max-width: 1024px) {
    .login-form-wrapper {
        max-width: 450px;
    }
    
    .login-card .card-body {
        padding: 2rem 2rem !important;
    }
    
    .login-logo {
        max-width: 220px;
    }
}

/* Responsive Design */

/* ============================================================
   RESPONSIVE LAYOUT — Single source of truth
   Breakpoints:
     Mobile  : max-width 640px   (phones)
     Tablet  : 641px – 1024px    (iPad portrait/landscape)
     Desktop : 1025px+           (laptop/desktop)
   ============================================================ */

/* ---------- Mobile (phones ≤ 640px) ---------- */
@media (max-width: 640px) {

    /* Sidebar: hidden off-screen, slides in when .sidebar-open */
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        transition: left 0.3s ease !important;
        z-index: 2000 !important;
    }

    .sidebar.sidebar-open {
        left: 0 !important;
    }

    /* Semi-transparent backdrop */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.55) !important;
        z-index: 1999 !important;
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }

    /* Content fills the whole screen — no sidebar offset */
    main {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Top-bar: leave room for hamburger button */
    .top-row {
        padding: 0.75rem 1rem 0.75rem 68px !important;
    }

    .top-row-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem !important;
    }

    .brand-title {
        font-size: 1.2rem !important;
    }

    .top-row-racing-elements {
        display: none;
    }

    /* Sidebar internals */
    .sidebar-main-logo {
        height: 100px !important;
        margin: 0 !important;
    }

    .user-emoji-container {
        width: 64px !important;
        height: 64px !important;
    }

    .user-emoji {
        font-size: 2.2rem !important;
    }

    /* Cards */
    .card-body {
        padding: 0.875rem !important;
    }

    /* Tables – horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 560px;
    }

    /* Button groups stack vertically */
    .btn-action-group {
        flex-direction: column !important;
        width: 100% !important;
    }

    .btn-action-group > * {
        width: 100% !important;
    }

    /* Filter pill buttons wrap */
    .filter-btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .filter-btn-group .btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.4rem);
    }

    /* Modals: full-width, scrollable body */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100vw - 1rem) !important;
        width: calc(100vw - 1rem) !important;
    }

    .modal-content {
        border-radius: 12px !important;
    }

    .modal-body {
        padding: 1rem !important;
        max-height: 65vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding: 0.875rem 1rem !important;
    }

    .modal-footer {
        padding: 0.75rem 1rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 110px;
    }
}

/* ---------- Tablet (iPad Portrait + Landscape: 641px – 1024px) ---------- */
@media (min-width: 641px) and (max-width: 1024px) {

    /* Sidebar: slide-in just like mobile */
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        transition: left 0.3s ease !important;
        z-index: 2000 !important;
    }

    .sidebar.sidebar-open {
        left: 0 !important;
    }

    /* Semi-transparent backdrop */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.55) !important;
        z-index: 1999 !important;
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }

    /* Content fills screen */
    main {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Top-bar: leave room for hamburger */
    .top-row {
        padding: 0.875rem 1.5rem 0.875rem 72px !important;
    }

    .brand-title {
        font-size: 1.5rem !important;
    }

    .sidebar-main-logo {
        height: 130px !important;
    }

    /* Tables */
    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem 0.6rem !important;
    }

    /* Modals: constrained but not cramped */
    .modal-dialog {
        max-width: 680px !important;
    }

    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ---------- Desktop (1025px+) ---------- */
@media (min-width: 1025px) {

    /* Hamburger hidden — sidebar always visible */
    .mobile-menu-btn {
        display: none !important;
    }

    .sidebar {
        position: fixed !important;
        left: 0 !important;
        width: 300px !important;
    }

    main {
        margin-left: 300px !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    /* Restore normal top-row padding */
    .top-row {
        padding: 0.8rem 2rem !important;
    }
}

/* Extra Large Screens */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1320px;
        margin: 0 auto;
    }
    
    .brand-title {
        font-size: 2.5rem !important;
    }

    .top-row-logo {
        height: 70px !important;
    }
}

/* Success Animations */
@keyframes success-flash {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(0, 255, 65, 0);
    }
}

/* Loading Spinner with Racing Theme */
.spinner-border {
    border-color: var(--racing-orange);
    border-right-color: transparent;
}

/* Blazor Error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #dc3545;
    border-top: none;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 12px 12px 0 0;
}

/* Responsive Table Utilities */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    /* Make tables scroll horizontally on mobile */
    .table-responsive table {
        min-width: var(--mobile-table-min-width);
        font-size: 0.85rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Card tables - Stack on mobile */
    .table-card-mobile {
        display: none;
    }
    
    .mobile-card-list {
        display: block;
    }
    
    .mobile-card-item {
        border: 1px solid #e8eaed;
        border-radius: 16px;
        padding: 1rem;
        margin-bottom: 1rem;
        background: white;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .mobile-card-item .card-label {
        font-weight: 600;
        color: var(--racing-orange);
        display: block;
        margin-bottom: 0.25rem;
        text-transform: none;
        font-size: 0.75rem;
        letter-spacing: 0;
    }
    
    .mobile-card-item .card-value {
        display: block;
        margin-bottom: 0.75rem;
        color: var(--text-dark);
    }
}

@media (min-width: 641px) {
    .mobile-card-list {
        display: none;
    }
    
    .table-card-mobile {
        display: table;
    }
}

/* Responsive Form Utilities */
@media (max-width: 640px) {
    /* Full-width standalone buttons on mobile */
    .d-grid .btn,
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Form labels more prominent on mobile */
    .form-label {
        font-weight: 600;
        font-size: 0.9rem;
    }

    /* Larger form inputs for touch — prevents iOS auto-zoom */
    .form-control,
    .form-select {
        font-size: 16px !important;
        min-height: 44px;
    }
}

/* Fancy toggle switches */
.fancy-switch .form-check-input {
    width: 3.2rem !important;
    height: 1.6rem !important;
    margin-top: 0.1rem;
    background-color: #2d2d2d !important;
    border: 2px solid rgba(255, 107, 0, 0.4) !important;
    background-image: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative;
    border-radius: 999px !important;
    transition: all 0.25s ease-in-out;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.fancy-switch .form-check-input:checked {
    background-color: var(--racing-orange) !important;
    border-color: var(--racing-orange-dark) !important;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.6);
}

.fancy-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.4) !important;
    outline: none !important;
}

.fancy-switch .form-check-input::after {
    content: "" !important;
    position: absolute;
    top: 50%;
    left: 0.15rem;
    width: 1.15rem;
    height: 1.15rem;
    background: #ffffff !important;
    border-radius: 50% !important;
    transform: translateY(-50%);
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fancy-switch .form-check-input:checked::after {
    left: 1.75rem;
}

.fancy-switch .form-check-label {
    font-weight: 600;
    color: #222;
    margin-left: 0.5rem;
    cursor: pointer;
    user-select: none;
}

/* ============================================================
   Marke Search Dropdown
   ============================================================ */
.marke-search-dropdown {
    position: relative;
}

.marke-input-wrapper {
    position: relative;
}

.marke-input-wrapper .form-control {
    padding-right: 2rem;
}

.marke-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: #999;
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
}

.marke-clear-btn:hover {
    color: #333;
}

.marke-dropdown-list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
}

.marke-dropdown-item {
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.12s;
}

.marke-dropdown-item:hover,
.marke-dropdown-item.active {
    background: #fff3eb;
    color: var(--racing-orange, #e8521a);
    font-weight: 600;
}

.marke-dropdown-empty {
    padding: 0.6rem 0.875rem;
    color: #888;
    font-size: 0.875rem;
    font-style: italic;
}

.theme-serios .marke-dropdown-item:hover,
.theme-serios .marke-dropdown-item.active {
    background: #f0f0f0;
    color: #1a1a1a;
}

/* ============================================================
   MISSING GLOBAL CLASSES
   ============================================================ */

/* theme-standard: Default theme (racing/orange) — applies the base styles,
   acts as an explicit class so the ThemeClass switch in MainLayout always
   resolves to a known class name. */
.theme-standard {
    /* inherits all base styles; no overrides needed */
}

/* nav-legal-link: Footer links in the sidebar */
.nav-legal-link {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-legal-link:hover {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.theme-serios .nav-legal-link {
    color: rgba(255, 255, 255, 0.3) !important;
}

.theme-serios .nav-legal-link:hover {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* btn-purple: Global purple button — used in KalenderWidget and Auftragsverwaltung */
.btn-purple {
    background-color: #6f42c1;
    color: #fff;
    border-color: #6f42c1;
}

.btn-purple:hover,
.btn-purple:focus {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

.btn-outline-purple {
    color: #6f42c1;
    border-color: #6f42c1;
    background: transparent;
}

.btn-outline-purple:hover {
    background: #6f42c1;
    color: #fff;
}

.theme-serios .btn-purple {
    background-color: #555 !important;
    border-color: #555 !important;
}

.theme-serios .btn-purple:hover {
    background-color: #333 !important;
    border-color: #333 !important;
}

/* Marken-Liste in Einstellungen */
.marken-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem;
}

.marken-list-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
}

.marken-list-item:hover {
    background: #fff3eb;
    border-color: var(--racing-orange, #e8521a);
}

.theme-serios .marken-list-item:hover {
    background: #f0f0f0;
    border-color: #555;
}


@media (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes for buttons only */
    .btn {
        min-height: 44px;
    }

    /* Disable hover effects on touch devices */
    .card:hover {
        transform: none;
    }
}

/* ============================================================
   COMPONENT-LEVEL RESPONSIVE RULES (Mobile ≤ 640px)
   All component tweaks are consolidated here to avoid
   cascade conflicts from duplicate media blocks.
   ============================================================ */
@media (max-width: 640px) {

    /* --- Grid --- */
    .row {
        margin-left: 0;
        margin-right: 0;
    }

    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Bootstrap col-md/lg force to full-width on phones */
    .col-md-6, .col-md-4, .col-md-8,
    .col-lg-4, .col-lg-6, .col-lg-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* --- Navigation tabs --- */
    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #e0e3e8;
    }

    .nav-tabs .nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }

    /* --- Cards --- */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    /* --- Typography --- */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    h4 { font-size: 1.1rem !important; }
    h5 { font-size: 1rem !important; }
    .lead { font-size: 1rem !important; }

    /* --- Legal pages --- */
    .legal-page .card-body { padding: 1rem !important; }
    .legal-page h2 { font-size: 1.3rem !important; }
    .legal-page h5 { font-size: 0.95rem !important; }
    .legal-page p, .legal-page li { font-size: 0.875rem; line-height: 1.55; }
    .legal-page ul { padding-left: 1rem; }
    .legal-page .text-muted.mb-4 { font-size: 0.8rem; }
}

/* Tablet supplement */
@media (min-width: 641px) and (max-width: 1024px) {
    .legal-page p,
    .legal-page li {
        font-size: 0.9rem;
    }

    /* Sidebar-Logo auf Tablet etwas kleiner */
    .sidebar-main-logo {
        height: 90px !important;
        max-height: 90px !important;
    }

    /* Dokument-Seiten auf Tablet: Padding reduzieren */
    .auftrag-document {
        padding: 1.5rem !important;
    }
}

/* Mobile: Dokument-Seiten (Rechnung, KV, Auftrag) */
@media (max-width: 640px) {
    .auftrag-document,
    #rechnung-print-area,
    #kv-print-area,
    #auftrag-print-area {
        padding: 1rem !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        max-width: 100% !important;
    }

    /* Signatur-Boxen auf mobil stacken */
    .signature-row-mobile {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* KalenderWidget: Kompakt-Header auf Mobil */
    .kalender-widget-header {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    /* KalenderWidget: Navigation stacked */
    .kalender-widget .card-header .d-flex.align-items-center.gap-1 {
        flex-wrap: wrap;
        gap: 0.3rem !important;
    }

    /* KalenderWidget: Monatsansicht Tabellenheader */
    .monat-table th {
        font-size: 0.7rem !important;
        padding: 0.2rem !important;
    }

    /* KalenderWidget Höhe auf Mobil reduzieren */
    .kalender-widget {
        height: auto !important;
        min-height: 300px;
    }

    /* Quick-Actions auf Dashboard: 2-spaltig */
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Buttons in Modals + Actions immer touch-freundlich */
    .btn {
        min-height: 44px;
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    /* Firmenverwaltung / Einstellungen: Tabellen-Header nicht umbrechen */
    th {
        white-space: nowrap;
    }

    /* Badges auf mobil etwas größer */
    .badge {
        font-size: 0.75rem !important;
        padding: 0.35em 0.6em !important;
    }

    /* Seiten-Titel auf mobile kleiner */
    .page-title {
        font-size: 1.4rem !important;
    }
}

/* Legal Pages (base) */
.legal-page {
    overflow-wrap: break-word;
    word-break: break-word;
}

.legal-page ul {
    padding-left: 1.25rem;
}

.legal-page p,
.legal-page li {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-row,
    .btn,
    .mobile-menu-btn {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Entferne Browser-generierte URLs und Links beim Drucken */
    @page {
        margin: 1.5cm;
    }

    a[href]:after {
        content: none !important;
    }

    abbr[title]:after {
        content: none !important;
    }
}

