body {
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    margin: 0;
    color: #111827;
}
.box {
    max-width: 420px;
    margin: 70px auto;
    background: white;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
h1 { font-size: 48px; margin: 0 0 20px; }
label { display: block; font-weight: bold; margin-top: 14px; }
input, select, textarea {
    width: 100%;
    padding: 11px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 8px;
}
button {
    margin-top: 12px;
    padding: 11px 14px;
    background: #111827;
    color: white;
    border: 0;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.error { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 8px; }
.message { background: #e0f2fe; color: #075985; padding: 10px; border-radius: 8px; }
header {
    background: #111827;
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { font-size: 56px; margin: 0; }
header a { color: white; margin-left: 16px; }
nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: white;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}
nav button { margin-top: 0; }
.content {
    max-width: 1200px;
    margin: 24px auto;
    background: white;
    padding: 24px;
    border-radius: 14px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { border: 1px solid #ddd; border-radius: 12px; padding: 16px; background: #fafafa; }
.row {
    display: grid;
    grid-template-columns: 2fr auto 1fr 2fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 10px;
    margin: 8px 0;
}
.cat {
    margin-top: 0;
    background: #111827;
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
}
.category-block {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 14px;
    padding: 12px;
    margin: 24px 0;
}
.naar-cat { background: #fff7ed; border-color: #fb923c; }
.naar-cat .cat { background: #9a3412; }
.ster { color: #dc2626; font-weight: bold; font-size: 24px; }
.gevraagd { border-left: 6px solid #dc2626; }
.stekene-title {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    color: #111827;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 14px;
}
.sgw-title {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    color: #831843;
    background: #fce7f3;
    border: 2px solid #ec4899;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 14px;
}
.schema-title {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    color: #065f46;
    background: #d1fae5;
    border: 2px solid #10b981;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    text-transform: uppercase;
}
.settings-title.danger {
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    color: #7f1d1d;
    background: #fee2e2;
    border: 2px solid #ef4444;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}
.qty {
    display: grid;
    grid-template-columns: 42px 56px 42px;
    gap: 5px;
    align-items: center;
    width: max-content;
}
.qtybtn { margin-top: 0; padding: 10px 0; font-size: 22px; line-height: 1; }
.qty input { margin-top: 0; text-align: center; padding: 10px 4px; font-size: 18px; }
.tht-label { font-weight: 800; display: grid; gap: 4px; margin-top: 0; }
.ignore-label { font-weight: normal; display: flex; align-items: center; gap: 8px; margin-top: 0; }
.ignore-label input { width: auto; }
.checked-box {
    margin-top: 22px;
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #ddd;
    border-radius: 10px;
}
.opmerking-box {
    margin: 16px 0;
    background: #eef2ff;
    border: 2px solid #6366f1;
    border-radius: 12px;
    padding: 14px;
}
.opmerking-box h3 { margin-top: 0; }
.small-top-note { font-size: 13px; color: #6b7280; margin-top: -6px; margin-bottom: 12px; }
.stock-product {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
}
.stock-head {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: center;
}
.extra-tht-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    padding: 10px;
    margin: 8px 0;
}
hr { border: 0; border-top: 1px solid #ddd; margin: 28px 0; }
@media (max-width: 800px) {
    header { display: block; }
    header h1 { font-size: 42px; }
    .row, .stock-head, .extra-tht-row { grid-template-columns: 1fr; }
    nav button { flex: 1 1 45%; }
    .content { margin: 10px; padding: 14px; }
    .qty { grid-template-columns: 46px 64px 46px; }
}

@media print {
    header, nav, button, .ignore-label {
        display: none !important;
    }
    body {
        background: white;
    }
    .content {
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
}

.tht-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tht-popup-card {
    background: #fee2e2;
    border: 6px solid #dc2626;
    color: #7f1d1d;
    border-radius: 24px;
    padding: 34px;
    max-width: 640px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 70px rgba(0,0,0,.35);
}

.tht-popup-title {
    font-size: 52px;
    font-weight: 1000;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.tht-popup-card p {
    font-size: 24px;
    font-weight: 700;
}

.tht-popup-card button {
    font-size: 20px;
    padding: 16px 22px;
    margin: 10px;
}

.promo-box {
    background: #fff1f2;
    border: 2px solid #fb7185;
    color: #881337;
    padding: 14px;
    border-radius: 12px;
    margin: 14px 0;
}
.promo-box h3 {
    margin-top: 0;
}

.last-update-box {
    background: #ecfeff;
    border: 2px solid #06b6d4;
    color: #164e63;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    margin: 12px 0;
}

.stock-request-card {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1e3a8a;
}

.autosave-status {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 10px;
    border-radius: 10px;
    margin: 12px 0;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.snel-box {
    background: #f8fafc;
    border: 2px dashed #64748b;
    padding: 14px;
    border-radius: 14px;
    margin: 14px 0;
}

.dots-btn {
    float: right;
    margin-top: -4px;
    background: #374151;
    padding: 6px 12px;
    border-radius: 999px;
}

.subgroep-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.subgroep-tags span {
    background: #e0e7ff;
    color: #3730a3;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.subgroep-panel {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    margin: 0 0 10px 0;
}

.product-row {
    grid-template-columns: 2fr auto auto;
}

.subgroep-tags span button {
    margin: 0 0 0 6px;
    padding: 2px 7px;
    background: #991b1b;
    color: white;
    border-radius: 999px;
    font-size: 12px;
}

.ruimte-block {
    background: #f0fdf4;
    border-color: #22c55e;
}
.ruimte-block .cat {
    background: #166534;
}
.ruimte-block small {
    color: #dcfce7;
    font-size: 14px;
}

.ruimte-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.ruimte-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: center;
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px;
}
@media (max-width: 800px) {
    .ruimte-item {
        grid-template-columns: 1fr;
    }
}

.request-list-btn {
    background: #facc15 !important;
    color: #111827 !important;
    border: 2px solid #eab308 !important;
    font-weight: 900 !important;
}
.request-list-btn:hover {
    background: #eab308 !important;
}

.product-search-box {
    margin: 14px 0;
}
.product-search-box input {
    width: 100%;
    max-width: 520px;
    padding: 12px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px;
}

.barcode-btn {
    background: #0f766e !important;
    margin-right: 10px;
    margin-bottom: 8px;
}
.barcode-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,.72);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.barcode-card {
    width: min(620px, 100%);
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
}
.barcode-card video {
    width: 100%;
    max-height: 60vh;
    background: black;
    border-radius: 12px;
}
.barcode-highlight {
    outline: 5px solid #facc15 !important;
    background: #fef9c3 !important;
    transition: .2s;
}

.product-search-box {
    margin: 14px 0 18px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
}
.product-search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 900;
}
.product-search-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.product-search-actions input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 2px solid #94a3b8;
    border-radius: 9px;
    font-size: 16px;
}
.barcode-btn {
    background: #0f766e !important;
    color: white !important;
    white-space: nowrap;
}
#barcode-reader {
    width: 100%;
    min-height: 260px;
    overflow: hidden;
    border-radius: 12px;
    background: #111827;
}
.barcode-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
[data-search-name][hidden],
.category-block[hidden] {
    display: none !important;
}
@media (max-width: 700px) {
    .product-search-actions {
        flex-direction: column;
    }
}
