/* ================================================
   BASIS
================================================ */
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f7fb;
    color: #1F4E79;
}

/* ================================================
   MELDINGENBALK
================================================ */
.notify-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.notify-bar.show {
    transform: translateY(0);
}

.notify-bar.notify-success {
    background: #1F4E79;
}

.notify-bar.notify-error {
    background: #c94b4b;
}

/* ================================================
   LOGIN SCHERM
================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16395a, #1F4E79 60%, #2f6ba0);
}

.login-box {
    background: white;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    width: 340px;
    max-width: 90vw;
    text-align: center;
}

.login-logo {
    height: 48px;
    margin-bottom: 10px;
}

.login-box h1 {
    font-size: 20px;
    margin: 0 0 4px;
}

.login-sub {
    color: #5a6b7a;
    font-size: 14px;
    margin: 0 0 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.login-form label {
    font-size: 13px;
    font-weight: bold;
    margin-top: 8px;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
}

.login-form .btn-primary {
    margin-top: 16px;
}

.login-error {
    background: #fbeaea;
    color: #c94b4b;
    border: 1px solid #f0c2c2;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
}

.login-hint {
    font-size: 12px;
    color: #8a97a6;
    margin-top: 18px;
    margin-bottom: 0;
}

/* ================================================
   HEADER & TOP NAV
================================================ */
.header {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 15px 20px;
}

.header .logo {
    height: 60px;
    width: auto;
}

.header h1 {
    flex: 1;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #5a6b7a;
}

.btn-link {
    background: none;
    border: none;
    color: #1F4E79;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

/* ================================================
   NAVBAR
================================================ */
.navbar {
    padding: 0 20px;
}

.navbar button[data-tab] {
    background: white;
    color: #1F4E79;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    margin-right: 6px;
    transition: 0.2s;
}

.navbar button[data-tab]:hover {
    background: #e8f0f7;
}

.navbar button[data-tab].active {
    background: #16395a;
    color: white;
}

/* ================================================
   PAGINA STYLING
================================================ */
main#app {
    padding: 20px;
}

.page {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.content {
    padding: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px 20px;
    margin-bottom: 20px;
}

input, select, textarea {
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
}

input[readonly] {
    background: #eef2f6;
    color: #5a6b7a;
    cursor: default;
}

/* ================================================
   BUTTONS
================================================ */
.btn-primary {
    background: #1F4E79;
    color: white;
    padding: 10px 22px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: 0.25s ease;
}

.btn-primary:hover {
    background: #e8f0f7;
    color: #1F4E79;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #1F4E79;
    padding: 10px 22px;
    border-radius: 5px;
    border: 2px solid #1F4E79;
    cursor: pointer;
    font-size: 15px;
}

.btn-secondary:hover {
    background: #e8f0f7;
}

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ================================================
   WERKZAAMHEDEN
================================================ */
.werkzaamheden-table {
    margin-top: 20px;
}

.w-row {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 80px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.w-row.header {
    font-weight: bold;
}

.status {
    cursor: pointer;
    text-align: center;
    font-size: 18px;
}

/* ================================================
   COMPONENTEN — NAVIGATIE
================================================ */
.comp-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.comp-nav button {
    background: white;
    border: 2px solid #1F4E79;
    color: #1F4E79;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.comp-nav button:hover {
    background: #e8f0f7;
}

.comp-nav button.active {
    background: #1F4E79;
    color: white;
}

/* ================================================
   COMPONENTEN — GRID & CARDS
================================================ */
.component-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.card {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    width: fit-content;
    min-width: 220px;
    max-width: 380px;
    flex: 1 0 auto;
}

.merk-header {
    font-weight: bold;
    font-size: 20px;
    color: #1F4E79;
    margin-bottom: 15px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.model-block {
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #d0d7df;
    cursor: pointer;
    transition: 0.2s;
}

.model-block:hover {
    background: #edf4ff;
}

.model-name {
    font-weight: bold;
    margin-bottom: 8px;
    color: #1F4E79;
}

.model-block button {
    background: #1F4E79;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.model-block button:hover {
    background: #16395a;
}

/* ================================================
   MODAL POPUP
================================================ */
.comp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.comp-modal {
    background: white;
    width: 700px;
    max-width: 95%;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
}

.modal-body {
    display: flex;
    gap: 20px;
}

.modal-left img {
    width: 240px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.modal-right {
    flex: 1;
}

#modal_title {
    margin-top: 0;
    color: #1F4E79;
}

#modal_specs div {
    margin-bottom: 4px;
    font-size: 15px;
}

.modal-aantal-label {
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    font-weight: bold;
    color: #1F4E79;
}

.modal-aantal-input {
    width: 90px;
    margin-bottom: 14px;
    display: block;
}

.model-block.selected {
    border-color: #1F4E79;
    background: #e8f0f7;
}

.model-block.selected button {
    background: #16395a;
}

/* ================================================
   OVERZICHT — COMPONENTEN & SYSTEEM
================================================ */
.overzicht-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.overzicht-card {
    width: auto;
    max-width: none;
}

.empty-hint {
    color: #8a97a6;
    font-style: italic;
    margin-top: 6px;
}

.overzicht-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.overzicht-item:last-child {
    border-bottom: none;
}

.overzicht-aantal {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.overzicht-aantal label {
    font-size: 13px;
    color: #5a6b7a;
}

.overzicht-aantal input {
    width: 60px;
    padding: 4px;
}

.btn-remove {
    background: none;
    border: 1px solid #c94b4b;
    color: #c94b4b;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-remove:hover {
    background: #fbeaea;
}

.overzicht-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.overzicht-item-info {
    flex: 1;
}

.overzicht-specs div {
    font-size: 13px;
    color: #445566;
    margin-bottom: 2px;
}

/* ================================================
   SYSTEEM OVERZICHT — SAMENVATTING RIJEN
================================================ */
.overzicht-summary {
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.summary-row span {
    color: #5a6b7a;
}

/* ================================================
   OPGESLAGEN OFFERTES
================================================ */
.offerte-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.offerte-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    flex-wrap: wrap;
}

.offerte-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.offerte-row-info strong {
    font-size: 16px;
}

.offerte-row-info span {
    font-size: 13px;
    color: #5a6b7a;
}

.offerte-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.offerte-row-actions button {
    font-size: 13px;
    padding: 6px 12px;
}

.current-badge {
    display: inline-block;
    background: #1F4E79;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ================================================
   PRINT / PDF-VOORBEELD
================================================ */

/* Geen paginamarges — de eigen padding van .print-page bepaalt de opmaak,
   zodat het er ook goed uitziet als de browser zelf ook geen marges toevoegt. */
@page {
    size: A4;
    margin: 0;
}

.print-area {
    display: none;
}

.print-page {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 30px;
    background: white;
    color: #1F4E79;
    font-family: "Segoe UI", Arial, sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.print-page h1 {
    font-size: 26px;
    letter-spacing: 4px;
    margin-bottom: 0;
}

.print-page h2 {
    font-size: 18px;
    border-bottom: 2px solid #1F4E79;
    padding-bottom: 6px;
    margin-top: 0;
}

.print-banner {
    display: block;
    width: calc(100% + 60px);
    margin: -30px -30px 20px -30px;
}

.print-logo {
    height: 32px;
    margin-bottom: 16px;
}

.print-page-header {
    margin-bottom: 18px;
}

.print-page-header img {
    height: 34px;
    width: auto;
    display: block;
}

.print-cover-footer-block {
    margin-top: auto;
}

.print-address-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 10px;
    font-size: 9px;
    color: #1F4E79;
}

.print-address-table td {
    padding: 2px 8px 2px 0;
    line-height: 1.6;
    white-space: nowrap;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
    font-size: 13px;
}

.print-table td {
    padding: 6px 4px;
    border-bottom: 1px dotted #1F4E79;
    vertical-align: top;
}

.print-table.blue td {
    border: 1px dotted #1F4E79;
}

.print-table td.label {
    font-weight: bold;
    width: 220px;
}

.print-footer {
    font-size: 10px;
    color: #1F4E79;
    text-align: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #dbe4ee;
}

.print-img-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.print-img-row img {
    max-width: 220px;
    border-radius: 4px;
}

@media print {
    body * {
        visibility: hidden;
    }
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }
    .print-page {
        page-break-after: always;
        max-width: none;
        box-shadow: none;
        /* Volledige A4-hoogte (297mm), er zijn geen @page-marges meer die
           ervan afgetrokken moeten worden. Bij korte inhoud vult dit precies
           één pagina en staat de footer daardoor onderaan; bij lange inhoud
           (bv. veel componenten) groeit de sectie gewoon door naar een
           volgende pagina, zonder iets af te snijden. */
        min-height: 1122px;
    }
    .print-page:last-child {
        page-break-after: auto;
    }
}
