/* ==========================================================================
   FDH INDUSTRIAL DESIGN SYSTEM - WERKSTATT & HOF-MANAGEMENT STYLEGUIDE
   Kein KI-Kitsch | Keine Farbverläufe | Keine Glass-Effekte | 100% Funktional
   ========================================================================== */

:root {
    /* Farbpalette - Industrie Hell / Tagmodus */
    --surface-bg: #F4F5F7;
    --surface-card: #FFFFFF;
    --surface-sunken: #E9ECEF;
    --border-color: #D0D5DD;
    --border-strong: #98A2B3;
    
    /* Text */
    --text-primary: #1D2939;
    --text-secondary: #475467;
    --text-muted: #667085;
    
    /* Primäre Signal-Farbe (Aktionen) */
    --action-primary: #0F52BA;
    --action-primary-hover: #083D8D;
    --action-primary-text: #FFFFFF;
    
    /* Industrie-Ampel Status-Farben */
    --status-green: #2E7D32;
    --status-green-bg: #E8F5E9;
    --status-green-border: #A5D6A7;

    --status-yellow: #B26A00;
    --status-yellow-bg: #FFF8E1;
    --status-yellow-border: #FFE082;

    --status-orange: #D84315;
    --status-orange-bg: #FBE9E7;
    --status-orange-border: #FFAB91;

    --status-red: #C62828;
    --status-red-bg: #FFEBEE;
    --status-red-border: #EF9A9A;

    --status-archived: #455A64;
    --status-archived-bg: #ECEFF1;
    --status-archived-border: #CFD8DC;

    /* Typografie */
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

    /* Touch-Maße */
    --touch-min-height: 48px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

/* Dark Mode (Anthrazit / Akkusparend auf Hof-Handys) */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-bg: #14171A;
        --surface-card: #1E2328;
        --surface-sunken: #111417;
        --border-color: #2F363D;
        --border-strong: #444D56;
        
        --text-primary: #F0F3F6;
        --text-secondary: #C9D1D9;
        --text-muted: #8B949E;
        
        --action-primary: #1F6FEB;
        --action-primary-hover: #388BFD;
        
        --status-green-bg: #0D2818;
        --status-green: #4ADE80;
        --status-green-border: #166534;

        --status-yellow-bg: #2B1D00;
        --status-yellow: #FBBF24;
        --status-yellow-border: #854D0E;

        --status-orange-bg: #2E150B;
        --status-orange: #FB923C;
        --status-orange-border: #9A3412;

        --status-red-bg: #2D0F0F;
        --status-red: #F87171;
        --status-red-border: #991B1B;

        --status-archived-bg: #1B2127;
        --status-archived: #94A3B8;
        --status-archived-border: #334155;
    }
}

/* Allgemeine Reset- und Layoutregeln */
body {
    font-family: var(--font-ui);
    background-color: var(--surface-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Robuste Industrie-Buttons */
.btn-industrial {
    min-height: var(--touch-min-height);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background-color 0.1s ease, border-color 0.1s ease;
    user-select: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--action-primary);
    color: #FFFFFF;
    border-color: var(--action-primary);
}

.btn-primary:active {
    background-color: var(--action-primary-hover);
}

.btn-secondary {
    background-color: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-strong);
}

.btn-secondary:active {
    background-color: var(--surface-sunken);
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-green {
    background-color: var(--status-green-bg);
    color: var(--status-green);
    border-color: var(--status-green-border);
}

.status-yellow {
    background-color: var(--status-yellow-bg);
    color: var(--status-yellow);
    border-color: var(--status-yellow-border);
}

.status-orange {
    background-color: var(--status-orange-bg);
    color: var(--status-orange);
    border-color: var(--status-orange-border);
}

.status-red {
    background-color: var(--status-red-bg);
    color: var(--status-red);
    border-color: var(--status-red-border);
}

.status-archived {
    background-color: var(--status-archived-bg);
    color: var(--status-archived);
    border-color: var(--status-archived-border);
}

/* Handschuh-freundliche Checkboxen */
.industrial-checkbox {
    width: 26px;
    height: 26px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    accent-color: var(--action-primary);
}

/* Kompakte Fahrzeug-Karten (Stapelansicht) */
.vehicle-card-compact {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: border-color 0.15s ease;
    cursor: pointer;
}

.vehicle-card-compact:hover {
    border-color: var(--action-primary);
}

.vehicle-thumbnail {
    width: 90px;
    height: 75px;
    background-color: var(--surface-sunken);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

/* Mobile Bottom-Navigation (Fixiert) */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--surface-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 40;
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
}

.mobile-bottom-item.active {
    color: var(--action-primary);
}

/* Sticky Save Footer in Formular */
.sticky-form-footer {
    position: sticky;
    bottom: 0;
    background-color: var(--surface-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    z-index: 20;
}

/* Stellplatz Kacheln */
.slot-tile {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-family: var(--font-mono);
}

.slot-occupied {
    border-left: 4px solid var(--action-primary);
    background-color: var(--surface-sunken);
}

.slot-free {
    border-left: 4px solid var(--status-green);
}

/* Print Styling (DIN A4 & A5 Industriestandard) */
@media print {
    body {
        background: #FFF !important;
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body * {
        visibility: hidden !important;
    }
    .print-active, 
    .print-active *,
    #print-amtlicher-verwertungsnachweis, 
    #print-amtlicher-verwertungsnachweis *,
    #print-ankaufvertrag, 
    #print-ankaufvertrag *,
    #print-annahme-quittung, 
    #print-annahme-quittung *,
    #print-windshield-slip, 
    #print-windshield-slip *,
    #print-pdf-area, 
    #print-pdf-area * {
        visibility: visible !important;
    }
    .print-active,
    #print-amtlicher-verwertungsnachweis:not(.hidden),
    #print-ankaufvertrag:not(.hidden),
    #print-annahme-quittung:not(.hidden),
    #print-windshield-slip:not(.hidden),
    #print-pdf-area:not(.hidden) {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #FFF !important;
        color: #000 !important;
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .page-break {
        page-break-after: always !important;
        break-after: page !important;
        height: 0 !important;
        display: block !important;
        clear: both !important;
    }
    @page {
        margin: 6mm 8mm;
        size: A4 portrait;
    }
}

/* ============================================================ */
/* AMTLICHER VERWERTUNGSNACHWEIS (§ 15 FZV) – BUNDESMUSTER ANLAGE 8 */
/* ============================================================ */
.vn-form-container {
    --vn-red: #D32F2F;
    --vn-red-dark: #B71C1C;
    --vn-red-light: #FFEBEE;
    --vn-red-border: #E53935;
    font-family: Arial, Helvetica, sans-serif;
    color: #111;
    background: #FFF;
    line-height: 1.25;
}

.vn-sheet {
    border: 1.5px solid var(--vn-red-border);
    padding: 10px 14px;
    background: #FFF;
    position: relative;
    box-sizing: border-box;
}

.vn-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid var(--vn-red-border);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.vn-red-title {
    color: var(--vn-red);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -0.01em;
    margin: 0;
}

.vn-red-banner {
    background-color: var(--vn-red);
    color: #FFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2.5px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 6px;
    margin-bottom: 4px;
}

.vn-banner-num {
    background: #FFF;
    color: var(--vn-red);
    font-weight: 900;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    margin-right: 6px;
    font-size: 9px;
}

.vn-field-box {
    border: 1px solid var(--vn-red-border);
    background: #FFF;
    padding: 3px 6px;
    min-height: 22px;
    display: flex;
    align-items: center;
}

.vn-comb-grid {
    display: inline-flex;
    border: 1px solid var(--vn-red-border);
    background: #FFF;
}

.vn-comb-cell {
    width: 15px;
    height: 18px;
    border-right: 1px solid #FFCDD2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: 700;
    color: #000;
}
.vn-comb-cell:last-child {
    border-right: none;
}

.vn-input-underline {
    border-bottom: 1px dashed var(--vn-red-border);
    font-weight: 700;
    color: #000;
    padding: 0 4px;
    display: inline-block;
    min-width: 80px;
}

/* Toast Notification System */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 32px);
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background-color: #1E293B;
    color: #F8FAFC;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-item.toast-success {
    border-left: 4px solid #10B981;
}

.toast-item.toast-success .toast-icon {
    color: #10B981;
}

.toast-item.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-item.toast-error .toast-icon {
    color: #EF4444;
}

.toast-item.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-item.toast-info .toast-icon {
    color: #3B82F6;
}

.toast-item.toast-fadeout {
    opacity: 0;
    transform: translateY(-8px);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Status Indicator Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot-green {
    background-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot-yellow {
    background-color: #F59E0B;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot-orange {
    background-color: #F97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.status-dot-red {
    background-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-dot-gray {
    background-color: #64748B;
}

