* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.site-header {
    background: #111827;
    color: white;
    padding: 10px 16px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
}

.topnav {
    display: flex;
    gap: 16px;
}

.topnav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
}

.topnav a:hover {
    text-decoration: underline;
}

.logout-link {
    color: #fecaca;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    font-size: 26px;
    color: white;
}

/* Flash messages */
.flash-container {
    padding: 8px 16px;
}
.flash {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}
.flash-info { background: #e0f2fe; color: #0f172a; }
.flash-success { background: #dcfce7; color: #14532d; }
.flash-warning { background: #fef9c3; color: #78350f; }
.flash-danger { background: #fee2e2; color: #7f1d1d; }

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #6b7280;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #2563eb;
    color: white;
    text-decoration: none;
}
.btn:hover {
    background: #1d4ed8;
}
.btn-secondary {
    background: #6b7280;
}
.btn-secondary:hover {
    background: #4b5563;
}
.btn-danger {
    background: #dc2626;
}
.btn-danger:hover {
    background: #b91c1c;
}
.btn-small {
    padding: 4px 10px;
    font-size: 13px;
}

/* Forms */
form label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="date"],
form input[type="time"],
form input[type="number"],
form textarea,
form select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    margin-top: 4px;
}
form textarea {
    resize: vertical;
}

.form-section {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.form-section h2 {
    margin-top: 0;
    font-size: 16px;
}

.form-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* Claims list table */
.table-wrapper {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 10px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
th, td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
th {
    text-align: left;
    background: #f9fafb;
}

/* Top buttons on index */
.top-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.top-btn {
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* Planning */
.planning-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.planning-toolbar-center {
    display: flex;
    align-items: center;
    gap: 4px;
}
.planning-range-label {
    font-size: 13px;
    font-weight: 500;
}
.planning-grid {
    display: grid;
    gap: 8px;
}
.planning-view-30days {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.planning-view-week {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.planning-day-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}
.planning-day-header {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #4b5563;
}
.planning-day-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.planning-slot {
    display: flex;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    text-decoration: none;
    color: #111827;
    font-size: 12px;
}
.planning-slot:hover {
    background: #dbeafe;
}
.planning-slot-time {
    font-weight: 600;
    min-width: 40px;
}
.planning-slot-title {
    font-weight: 600;
}

/* Damage image */
.damage-image-wrapper {
    position: relative;
    max-width: 400px;
}
.damage-image-wrapper img {
    width: 100%;
    display: block;
}
#damage_overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}
.damage-x {
    position: absolute;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
}
.damage-x::before,
.damage-x::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 2px;
    background: black;
}
.damage-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.damage-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* WOK badge */
.wok-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.wok-badge.wok-yes {
    background: #fee2e2;
    border-color: #fecaca;
    color: #7f1d1d;
}
.wok-badge.wok-no {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #14532d;
}

/* Auth forms */
.auth-form {
    max-width: 360px;
    margin: 20px auto;
    background: white;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.auth-links {
    margin-top: 10px;
    font-size: 13px;
}
.auth-links a {
    color: #2563eb;
}

/* Photo grid */
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.photo-item {
    width: 120px;
}
.photo-item img {
    width: 100%;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .topnav {
        display: none;
        position: absolute;
        right: 12px;
        top: 48px;
        background: #111827;
        flex-direction: column;
        padding: 10px;
        border-radius: 8px;
        gap: 6px;
        z-index: 999;
    }
    .topnav.open {
        display: flex;
    }
    .hamburger {
        display: block;
    }
    .planning-grid {
        grid-template-columns: 1fr !important;
    }
}


/* FOOTER */
.site-footer {
    background: #222;
    color: white;
    padding: 12px 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
}

.site-footer .footer-inner {
    opacity: 0.8;
}



/* LOGIN LAYOUT */
.login-body {
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 0px 15px rgba(0,0,0,0.15);
    text-align: center;
}

.login-logo {
    width: 140px;
    margin-bottom: 10px;
    opacity: 0.95;
}

.login-box h2 {
    margin-bottom: 20px;
}

.login-box label {
    text-align: left;
    display: block;
    margin-top: 12px;
    margin-bottom: 3px;
    font-weight: bold;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.btn.full-width {
    width: 100%;
    margin-top: 18px;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.login-links {
    margin-top: 20px;
}

.login-links a {
    color: #0066cc;
    text-decoration: none;
}

/* Reset layout for login page */
.login-body header,
.login-body footer,
.login-body .site-header,
.login-body .site-footer {
    display: none !important;
}

.login-body .main-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* --- Schadeformulier grid layout --- */

.claim-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px 24px;
    align-items: flex-start;
}

/* elk blok */
.claim-form-grid .form-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* acties onderaan over volledige breedte */
.claim-form-grid .form-section-full {
    grid-column: 1 / -1;
}

/* op kleine schermen gewoon één kolom onder elkaar */
@media (max-width: 768px) {
    .claim-form-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Lightbox voor foto's --- */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: 10px;
    right: 10px;
}

.lightbox-prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* --- Visuele schade: auto + X-jes --- */

.damage-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.damage-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* overlay moet over de hele auto liggen én klikbaar zijn */
#damage_overlay,
#damage_overlay_detail {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto; /* heel belangrijk! */
}

/* de X zelf moet ook klikbaar zijn */
.damage-x {
    position: absolute;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
}

/* stijl van de X */
.damage-x::before,
.damage-x::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 18px;
    background: red;
    transform-origin: center;
}

.damage-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.damage-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.customer-results {
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    max-height: 180px;
    overflow-y: auto;
    display: none;
    font-size: 13px;
    z-index: 10;
    position: relative;
}
.customer-result-item {
    padding: 6px 8px;
    cursor: pointer;
}
.customer-result-item:hover {
    background: #eff6ff;
}




