:root {
    --wagenborg-red: #DF091E;
    --wagenborg-dark: #333333;
    --wagenborg-light-bg: #f8f9fa;
    --wagenborg-border: #e0e0e0;
}

body { 
    background-color: var(--wagenborg-light-bg); 
    font-family: 'Arial', 'Helvetica Neue', sans-serif; 
    color: var(--wagenborg-dark);
}

.wagenborg-header {
    background-color: white;
    border-bottom: 5px solid var(--wagenborg-red);
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.wagenborg-header img {
    max-height: 50px;
}

.wagenborg-container {
    background: white;
    padding: 40px;
    border: 1px solid var(--wagenborg-border);
    border-radius: 0; 
}

/* Form Step Animation */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.step-indicator { 
    color: var(--wagenborg-dark); 
    font-weight: bold; 
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px; 
}

.section-title { 
    margin-top: 2rem; 
    padding-bottom: 0.5rem; 
    margin-bottom: 1.5rem; 
    color: var(--wagenborg-dark);
    font-weight: 800;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--wagenborg-red);
}

.btn-primary, .btn-secondary {
    border-radius: 0; 
    font-weight: bold;
    padding: 10px 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--wagenborg-dark);
    border-color: var(--wagenborg-dark);
}

.btn-primary:hover {
    background-color: var(--wagenborg-red);
    border-color: var(--wagenborg-red);
}

.btn-success {
    background-color: var(--wagenborg-red);
    border-color: var(--wagenborg-red);
    border-radius: 0;
    font-weight: bold;
    padding: 12px 30px;
    text-transform: uppercase;
}

.btn-success:hover {
    background-color: #b30718; 
    border-color: #b30718;
}

/* Inputs */
.form-control, .form-select {
    border-radius: 0;
    border: 1px solid #ccc;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wagenborg-red);
    box-shadow: none; 
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

.table-dark th {
    background-color: var(--wagenborg-dark) !important;
    border-bottom: 4px solid var(--wagenborg-red) !important; 
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.table-hover tbody tr {
    border-left: 4px solid transparent; 
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    border-left: 4px solid var(--wagenborg-red); 
    background-color: #fdfdfd;
}

.view-tabs {
    border-bottom: 2px solid var(--wagenborg-border);
    margin-bottom: 25px;
}

.view-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    color: var(--wagenborg-dark);
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.view-tab-btn:hover {
    color: var(--wagenborg-red);
}

.view-tab-btn.active {
    border-bottom: 3px solid var(--wagenborg-red);
    color: var(--wagenborg-red);
}

/* Hide non-active views */
.print-view {
    display: none;
}
.print-view.active {
    display: block;
}

/* Custom CSS to enforce the exact Word document look */
.replica-table {
    border-collapse: collapse !important;
    width: 100% !important;
    border: 2px solid #000 !important;
}
.replica-table th, .replica-table td {
    border: 1px solid #000 !important;
    padding: 4px 8px !important;
    color: #000 !important;
}
.replica-table .section-head {
    background-color: #f0f0f0 !important;
    font-size: 0.95rem;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ==========================================================================
   UNIFIED PRINTING STYLES (Ultra-Aggressive A4 Fit)
   ========================================================================== */
@media print {
    /* 1. Squeeze the physical paper margins as tight as standard printers allow */
    @page {
        size: A4 portrait;
        margin: 3mm; /* Reduced from 10mm down to 5mm */
    }

    body { 
        background-color: #fff !important; 
        margin: 0 !important; 
        padding: 0 !important; 
    }

    /* 2. Hide web UI wrappers entirely */
    .wagenborg-header, 
    .btn-secondary, 
    .view-tabs, 
    .print-btn, 
    .nav-pills, 
    .border-bottom.pb-2 { 
        display: none !important; 
    }

    .wagenborg-container { 
        box-shadow: none !important; 
        border: none !important; 
        padding: 0 !important; 
    }

    /* 3. Hide all page content by default */
    body * {
        visibility: hidden;
    }
    
    /* 4. Reveal ONLY the currently active print view / tab */
    .tab-content > .active, 
    .tab-content > .active *,
    .print-view.active,
    .print-view.active * {
        visibility: visible;
    }
    
    /* Move the active view to the absolute top-left of the printed paper */
    .tab-content > .active,
    .print-view.active {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* ==========================================================================
       5. MAXIMUM COMPRESSION RULES to guarantee 1-page fit
       ========================================================================== */
       
    .replica-table {
        font-size: 9px !important; /* Dropped from 11px to 10px */
        margin-bottom: 4px !important; /* Cut space between tables in half */
        line-height: 1.1 !important; /* Tighten the text line spacing */
    }
    
    /* Shave every possible pixel off the row heights */
    .replica-table th, .replica-table td {
        padding: 2px 3px !important; 
    }

    /* Shrink the logo slightly just for the print view */
    .replica-table img {
        max-height: 35px !important;
    }

    /* Compress the headings and gaps */
    h5.mb-4 {
        margin-bottom: 5px !important;
        font-size: 13px !important;
    }
    
    /* Override Bootstrap margin classes aggressively */
    .mb-4 { margin-bottom: 4px !important; }
    .mb-2 { margin-bottom: 2px !important; }
    .mt-5 { margin-top: 10px !important; } /* Pull the footer way up */
    .mt-3 { margin-top: 3px !important; }
}

