:root{
    font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color:#1f2937;
    background:#f5f5f4;
    --nav:#111827;
    --primary:#6d28d9;
    --primary-hover:#5b21b6;
    --border:#e5e7eb;
    --muted:#6b7280;
}

*{box-sizing:border-box}
body{margin:0;background:#f5f5f4}

.topbar{
    position:sticky;
    top:0;
    z-index:20;
    display:flex;
    align-items:center;
    gap:22px;
    min-height:56px;
    padding:0 22px;
    background:var(--nav);
    color:white;
    box-shadow:0 1px 0 rgba(255,255,255,.08);
}

.brand{
    color:white;
    text-decoration:none;
    font-weight:800;
    letter-spacing:-.02em;
    white-space:nowrap;
}

.main-nav{
    display:flex;
    align-items:center;
    gap:4px;
    min-width:0;
}

.main-nav a,
.user-nav a{
    color:white;
    text-decoration:none;
    border-radius:9px;
    padding:9px 11px;
    line-height:1;
    white-space:nowrap;
}

.main-nav a:hover,
.user-nav a:hover{background:rgba(255,255,255,.1)}

.user-nav{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}

.user-nav span{opacity:.9}
.nav-toggle{display:none}
.nav-toggle-label{display:none}

main{
    width:min(1100px,calc(100% - 36px));
    margin:36px auto;
}

h1{
    margin:0;
    font-size:clamp(32px,5vw,48px);
    line-height:1.05;
    letter-spacing:-.04em;
}

.page-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:22px;
}

.page-subtitle{
    margin:8px 0 0;
    color:var(--muted);
}

.card{
    background:white;
    border:1px solid var(--border);
    border-radius:18px;
    padding:24px;
    margin:0 0 18px;
    box-shadow:0 2px 8px rgba(17,24,39,.06);
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:14px;
}

.stat{font-size:42px;font-weight:800;letter-spacing:-.04em}

.table-wrap{
    width:100%;
    overflow-x:auto;
    border:1px solid var(--border);
    border-radius:16px;
    background:white;
    box-shadow:0 1px 3px rgba(17,24,39,.04);
}

table{
    width:100%;
    min-width:720px;
    border-collapse:collapse;
    background:white;
}

th,td{
    padding:13px 14px;
    border-bottom:1px solid #eee;
    text-align:left;
    vertical-align:middle;
}

tr:last-child td{border-bottom:0}
th{background:#f3f4f6;font-weight:800}

input,select,textarea{
    width:100%;
    padding:11px 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:white;
    font:inherit;
}

label{font-weight:700;font-size:14px}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}

.btn,button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:40px;
    width:auto;
    max-width:max-content;
    background:var(--primary);
    color:white;
    border:0;
    border-radius:999px;
    padding:10px 16px;
    font:inherit;
    font-weight:700;
    line-height:1;
    text-decoration:none;
    cursor:pointer;
    box-shadow:0 1px 2px rgba(17,24,39,.12);
}

.btn:hover,button:hover{background:var(--primary-hover)}
.btn.secondary{background:#374151}
.btn.secondary:hover{background:#1f2937}
.btn.light{background:#eef0f3;color:#111827;box-shadow:none}
.btn.light:hover{background:#e5e7eb}

.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.table-actions{justify-content:flex-end}
.muted{color:var(--muted)}
.danger{color:#b91c1c}
.right{text-align:right}

.invoice{background:white;padding:44px;max-width:800px;margin:0 auto}.invoice h1{margin-top:0}

@media (max-width:760px){
    .topbar{
        display:grid;
        grid-template-columns:1fr auto;
        gap:0 12px;
        padding:0 16px;
        min-height:60px;
    }

    .brand{font-size:18px}

    .nav-toggle-label{
        display:flex;
        flex-direction:column;
        justify-content:center;
        gap:5px;
        width:42px;
        height:42px;
        border-radius:10px;
        cursor:pointer;
    }

    .nav-toggle-label span{
        display:block;
        width:24px;
        height:2px;
        margin-left:auto;
        background:white;
        border-radius:99px;
        transition:transform .18s ease, opacity .18s ease;
    }

    .main-nav,
    .user-nav{
        grid-column:1 / -1;
        display:none;
        margin:0;
        padding:8px 0 14px;
        width:100%;
        border-top:1px solid rgba(255,255,255,.12);
    }

    .main-nav{flex-direction:column;align-items:stretch;gap:2px}
    .user-nav{align-items:flex-start;gap:6px;flex-direction:column}

    .main-nav a,
    .user-nav a{
        width:100%;
        padding:12px 10px;
    }

    .user-nav span{padding:10px 10px 0;color:#d1d5db}

    .nav-toggle:checked ~ .main-nav,
    .nav-toggle:checked ~ .user-nav{display:flex}

    .nav-toggle:checked + .nav-toggle-label span:nth-child(1){transform:translateY(7px) rotate(45deg)}
    .nav-toggle:checked + .nav-toggle-label span:nth-child(2){opacity:0}
    .nav-toggle:checked + .nav-toggle-label span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

    main{width:min(100% - 28px,1100px);margin:28px auto}

    .page-header{
        align-items:stretch;
        flex-direction:column;
    }

    .page-header .btn{
        width:100%;
        max-width:none;
    }

    .card{border-radius:16px;padding:20px}
    table{min-width:680px}
    .invoice{padding:24px}
}

@media print{
    .topbar,.no-print{display:none}
    main{margin:0;max-width:none;width:100%}
    .invoice{box-shadow:none;border:0}
    .card{border:0;box-shadow:none}
}


.form-section-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin:22px 0 10px;
    flex-wrap:wrap;
}
.form-section-title h2{
    margin:0;
    font-size:22px;
}
.check-row{
    display:inline-flex;
    align-items:center;
    gap:10px;
    font-weight:700;
    color:#1f2937;
    background:#f3f4f6;
    border:1px solid #e5e7eb;
    border-radius:999px;
    padding:10px 14px;
    cursor:pointer;
    user-select:none;
}
.check-row input{
    width:18px;
    height:18px;
    accent-color:#6d28d9;
}
input.is-readonly{
    background:#f9fafb;
    color:#6b7280;
}
.form-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin-top:8px;
}

@media (max-width: 760px){

    .form-section-title{
        align-items:flex-start;
    }
    .check-row{
        width:100%;
        border-radius:14px;
    }
}

.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    cursor: pointer;
    user-select: none;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-ui {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #d9dde6;
    box-shadow: inset 0 0 0 1px #c9ced8;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 auto;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.switch-row input:checked + .switch-ui {
    background: #6d28d9;
    box-shadow: inset 0 0 0 1px #6d28d9;
}

.switch-row input:checked + .switch-ui::after {
    transform: translateX(22px);
}

.switch-label {
    font-weight: 700;
    color: #1f2937;
}

.switch-row:focus-within .switch-ui {
    outline: 3px solid rgba(109, 40, 217, 0.22);
    outline-offset: 3px;
}

.switch-field {
    padding-top: 28px;
}

.invoice-meta-web {
    padding-top: 55px;
}

@media (max-width: 760px) {
    .invoice-meta-web {
        padding-top: 0;
    }
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-chip.concept {
    background: #eef0f3;
    color: #374151;
}

.status-chip.verzonden {
    background: #ffedd5;
    color: #c2410c;
}

.status-chip.betaald {
    background: #dcfce7;
    color: #166534;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.search-form input[type="search"] {
    max-width: 360px;
}

.search-form .btn {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input[type="search"],
    .search-form .btn {
        width: 100%;
        max-width: none;
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    color: #374151;
    font-weight: 700;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-actions .btn {
        width: 100%;
        max-width: none;
    }
}
