*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f8fa;
    color: #333;
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: white;
    border-bottom: 2px solid #e8d5f5;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    white-space: nowrap;
}

.topbar-search input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
    font-size: 14px;
    outline: none;
    max-width: 400px;
}

.topbar-search input:focus {
    border-color: #e8d5f5;
    background: white;
}

.topbar-badge {
    background: #e8d5f5;
    color: #333;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.app-body {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #eee;
    padding: 16px;
    overflow-y: auto;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    flex-shrink: 0;
}

.sidebar-section { margin-bottom: 20px; }

.sidebar-title {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: bold;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #555;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 2px;
    font-family: inherit;
    transition: background 0.15s;
    box-sizing: border-box;
}

.sidebar-item:hover { background: #f5f5f5; }
.sidebar-item.active { background: #e8d5f5; color: #333; font-weight: 600; }

.sidebar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-count {
    color: #aaa;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.sidebar-item.active .sidebar-count { color: #7a5fa0; }

.sidebar-parent.expanded { background: #f3e8fb; }
.sidebar-parent.expanded:hover { background: #ecdcf5; }
.sidebar-chevron {
    color: #999;
    font-size: 11px;
    width: 12px;
    flex-shrink: 0;
    text-align: center;
    transition: color 0.15s;
}
.sidebar-parent.expanded .sidebar-chevron { color: #7a5fa0; }

.sidebar-subitems {
    border-left: 2px solid #e8d5f5;
    margin: 2px 0 10px 14px;
    padding-left: 2px;
}

.sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    color: #555;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1px;
    user-select: none;
    box-sizing: border-box;
    transition: background 0.15s;
    white-space: nowrap;
    position: relative;
}
.sidebar-subitem:hover { background: #f5f5f5; }
.sidebar-subitem.active { background: #e8d5f5; color: #333; font-weight: 600; }

.sidebar-subitem input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.sub-check {
    width: 15px;
    height: 15px;
    border: 1.5px solid #c8a8e8;
    border-radius: 3px;
    flex-shrink: 0;
    background: white;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
}
.sidebar-subitem:hover .sub-check { border-color: #b591d6; }
.sidebar-subitem input:checked + .sub-check {
    background: #b591d6;
    border-color: #b591d6;
}
.sidebar-subitem input:checked + .sub-check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.sub-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub-count {
    color: #aaa;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.sidebar-subitem.active .sub-count { color: #7a5fa0; }

.main-content { flex: 1; padding: 20px; }

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.list-toolbar .result-count { font-size: 14px; color: #666; }
.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}
.sort-control select {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}
.sort-control select:focus { border-color: #e8d5f5; background: white; }

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.pattern-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.pattern-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-thumbnail {
    height: 160px;
    background: linear-gradient(135deg, #e8d5f5 0%, #f0e6fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.card-thumbnail .placeholder-icon { font-size: 48px; opacity: 0.6; }

.card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: white;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card-body { padding: 12px; }

.card-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta { color: #888; font-size: 11px; margin-bottom: 8px; }

.card-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8d5f5;
    color: #555;
}

.detail-container { max-width: 900px; margin: 0 auto; padding: 24px; }

.detail-back {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
    display: inline-block;
}

.detail-header { display: flex; gap: 24px; margin-bottom: 24px; }

.detail-image {
    width: 300px;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8d5f5 0%, #f0e6fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; }
.detail-title { font-size: 24px; margin-bottom: 4px; }
.detail-original-title {
    color: #999;
    font-size: 13px;
    font-style: italic;
    margin-bottom: 12px;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8fa;
    padding: 20px;
}
.login-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 360px;
}
.login-card h1 { font-size: 20px; margin-bottom: 24px; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.login-card input[type="text"], .login-card input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.login-card input:focus { border-color: #b591d6; background: #faf5fe; }
.login-card button {
    margin-top: 8px;
    padding: 10px;
    background: #b591d6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.login-card button:hover { background: #a07ec5; }
.login-error {
    background: #fde8e8;
    color: #b13a3a;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}
.login-back {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #888;
    font-size: 13px;
    text-decoration: none;
}
.login-back:hover { color: #555; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}
.topbar-user form { display: inline; }
.topbar-user button, .topbar-user a {
    background: none;
    border: none;
    padding: 4px 8px;
    color: #888;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
}
.topbar-user button:hover, .topbar-user a:hover { color: #555; background: #f5f5f5; }

.detail-meta-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.detail-meta-label { font-weight: 600; min-width: 100px; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary { background: #e8d5f5; color: #333; font-weight: 600; }
.btn-secondary { background: #f5f5f5; color: #555; }

.category-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.pdf-viewer {
    width: 100%;
    height: 600px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state-icon { font-size: 64px; margin-bottom: 16px; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
    margin-top: 16px;
    border-top: 1px solid #eee;
}

.pagination-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.pagination-btn:hover:not(:disabled) { background: #f5f5f5; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-info { font-size: 14px; color: #666; }

/* === Admin pattern form === */
.form-container {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 16px;
}
.form-container h1 { margin-top: 8px; }
.form-back { display: inline-block; margin-bottom: 16px; color: #555; }
.form-container label {
    display: block;
    margin: 16px 0;
}
.form-container label > span {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.form-container input[type=text],
.form-container input[type=url],
.form-container select,
.form-container textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    box-sizing: border-box;
}
.form-container textarea { resize: vertical; }
.form-container input[type=file] {
    margin-top: 4px;
}
.form-existing {
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}
.form-hint {
    font-size: 12px;
    color: #777;
    margin: 6px 0 2px;
}

.card-difficulty {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef3ff;
    color: #44557a;
}
.form-warning {
    background: #fff7d6;
    border: 1px solid #e0c46c;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
}
.form-error {
    background: #ffe6e6;
    border: 1px solid #e08585;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
    color: #8a1f1f;
}
.form-error a { margin-left: 8px; color: #8a1f1f; text-decoration: underline; }
.form-success {
    background: #e8f5e8;
    border: 1px solid #6cb86c;
    color: #1f6f1f;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.form-actions .btn-danger {
    margin-left: auto;
    background: #c84141;
    color: white;
    border: none;
}
.topbar-add {
    background: #2d8a4f;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-right: 8px;
}
.topbar-add:hover { background: #246e3f; }

/* === Scrapers admin page === */
.scrapers-page { padding: 18px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.scrapers-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.scrapers-head h1 { font-size: 22px; }
.scrapers-summary { color: #888; font-size: 13px; }

.scrapers-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid #eee; border-radius: 8px; overflow: hidden; font-size: 13px; }
.scrapers-table th { text-align: left; padding: 10px 12px; color: #7a5fa0; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; background: #fafaff; border-bottom: 1px solid #eee; }
.scrapers-table th.num, .scrapers-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.scrapers-table td { padding: 10px 12px; border-bottom: 1px solid #f3f3f6; vertical-align: middle; }
.scrapers-table tr:last-child td { border-bottom: none; }
.scrapers-table td.name { font-weight: 600; }
.scrapers-table td.empty { color: #aaa; font-style: italic; }
.scrapers-table .ok { color: #2e7a3a; font-weight: 600; }
.scrapers-table .err { color: #c0392b; font-weight: 600; }
.scrapers-table .warn { color: #b07d18; font-weight: 600; }
.scrapers-table .running { color: #b07d18; font-weight: 600; }
.scrapers-table .warn { color: #c87f0a; font-weight: 600; }
.scrapers-table .num.pos { color: #2e7a3a; font-weight: 600; }
.scrapers-table .num.zero { color: #bbb; }
.scrapers-table tr.err > td { background: #fdf6f5; }
.scrapers-table tr.running > td { background: #fffbe6; }
.scrapers-table tr.err-row > td { background: #fdf6f5; border-bottom: 1px solid #f3f3f6; }
.scrapers-table tr.stale-yellow > td { background: #fffde8; }
.scrapers-table tr.stale-orange > td { background: #fff3e0; }
.scrapers-table tr.stale-red > td { background: #ffebee; }
.scrapers-table .err-msg { color: #c0392b; font-size: 12px; font-style: italic; }

.live-banner { background: #fffbe6; border: 1px solid #f0d97a; color: #7a5e1c; font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.live-banner .spin, .run-btn .spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spd-spin 1s linear infinite; }
@keyframes spd-spin { to { transform: rotate(360deg); } }

.run-btn { background: #e8d5f5; color: #4a3b6b; border: none; padding: 5px 12px; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.run-btn:hover:not(:disabled) { background: #dcbff0; }
.run-btn.busy { background: #f3f0d3; color: #7a5e1c; cursor: not-allowed; }
.run-btn.queued, .run-btn.disabled { background: #efefef; color: #888; cursor: not-allowed; }

.admin-menu { position: relative; display: inline-block; }
.admin-btn { background: white; border: 1px solid #ddd; padding: 5px 12px; border-radius: 5px; font-size: 13px; cursor: pointer; font-family: inherit; }
.admin-btn:hover, .admin-btn.open { border-color: #e8d5f5; background: #f3e8fb; }
.admin-dropdown { position: absolute; top: 32px; right: 0; background: white; border: 1px solid #e8d5f5; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.08); padding: 4px; min-width: 170px; z-index: 50; }
.admin-item { display: block; padding: 7px 12px; font-size: 13px; color: #333; text-decoration: none; border-radius: 4px; background: none; border: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.admin-item:hover { background: #f5f5f5; }
.admin-logout { border-top: 1px solid #eee; margin-top: 4px; padding-top: 4px; }

/* === Pattern detail — multi-PDF === */
.pdf-list { margin: 16px 0 12px; }
.pdf-row { background: white; border: 1px solid #eee; border-radius: 6px; padding: 9px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.pdf-row:hover { border-color: #ddd; }
.pdf-row.active { border-color: #e8d5f5; background: #f9f3fd; }
.pdf-row .icon { font-size: 16px; }
.pdf-row .name { flex: 1; }
.pdf-row .name .title { font-weight: 600; }
.pdf-row .size { color: #888; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pdf-row .open { background: #e8d5f5; color: #4a3b6b; padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.pdf-row.active .open { background: #d4b8ec; }

.empty-pdf { margin: 16px 0; padding: 28px; background: white; border: 1px dashed #e8d5f5; border-radius: 6px; text-align: center; color: #888; }
.empty-pdf-icon { font-size: 32px; margin-bottom: 8px; opacity: .6; }
.empty-pdf-sub { font-size: 12.5px; margin-top: 6px; }
.empty-pdf-sub a { color: #7a5fa0; font-weight: 600; text-decoration: none; }

/* === PatternForm — multi-PDF sectie === */
.pdf-section { border: 1px solid #e8d5f5; border-radius: 6px; padding: 12px; background: white; margin: 14px 0; }
.pdf-section h3 { font-size: 13px; margin: 0 0 8px; color: #4a3b6b; }

.pdf-row-form { background: #faf7ff; border: 1px solid #ede0f7; border-radius: 5px; padding: 8px 10px; margin-bottom: 6px; display: grid; grid-template-columns: 20px 1fr 80px 24px; gap: 8px; align-items: center; }
.pdf-row-form.staged { background: #f0f8e8; border-color: #c5e2a7; }
.pdf-row-form .icon { font-size: 14px; }
.pdf-row-form .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pdf-row-form .fname { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-row-form .fname .badge { background: #2e7a3a; color: white; font-size: 9px; padding: 1px 5px; border-radius: 2px; margin-left: 4px; text-transform: uppercase; vertical-align: middle; }
.pdf-row-form .desc-input { width: 100%; border: 1px solid #ddd; border-radius: 3px; padding: 4px 6px; font-size: 11.5px; font-family: inherit; background: white; }
.pdf-row-form .size { color: #888; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.rm-btn { background: #fbe4e0; color: #c0392b; border: none; padding: 2px 6px; border-radius: 3px; font-size: 14px; cursor: pointer; line-height: 1; font-weight: 600; }

.add-pdf-label { display: block; margin-top: 6px; }
.add-pdf-label .hidden-file { display: none; }
.add-pdf-btn { display: block; background: white; border: 1px dashed #c8a8e0; color: #7a5fa0; padding: 8px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; width: 100%; text-align: center; font-weight: 600; }
.add-pdf-btn:hover { background: #fbf6ff; }

/* Mobiele PDF-link: standaard verborgen, zichtbaar via media query hieronder */
.pdf-open-mobile {
    display: none;
}

/* Mobiele Filters-knop: standaard verborgen, zichtbaar via media query hieronder */
.mobile-filter-toggle {
    display: none;
}

/* =============================================
   RESPONSIVE — mobiel en tablet
   Geen bestaande desktop-stijlen gewijzigd.
   ============================================= */

/* --- Tablet (601px – 900px) --- */
@media (max-width: 900px) {
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mobiel (0 – 600px) --- */
@media (max-width: 600px) {

    /* Topbar: wrap naar twee rijen */
    .topbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .topbar-brand {
        flex: 1;
        font-size: 16px;
    }

    .topbar-search {
        flex: 0 0 100%;
    }

    .topbar-search input {
        max-width: 100%;
        width: 100%;
        padding: 10px 14px;
    }

    .topbar-badge {
        font-size: 12px;
        padding: 6px 10px;
    }

    .admin-btn {
        padding: 8px 12px;
        min-height: 36px;
    }

    /* App-body: filterknop + paneel boven content */
    .app-body {
        flex-direction: column;
    }

    /* Uitklapbare Filters-knop (sieradenradar-patroon) */
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: calc(100% - 24px);
        margin: 10px 12px 0;
        min-height: 44px;
        background: #7a5fa0;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-filter-toggle .filter-count {
        background: rgba(255, 255, 255, .25);
        border-radius: 10px;
        padding: 1px 8px;
        font-size: 12px;
    }

    /* Sidebar: ingeklapt verborgen; uitgeklapt een verticaal paneel
       (zelfde verticale lijst als desktop, maar volle breedte) */
    .sidebar {
        display: none;
    }

    .sidebar.open {
        display: block;
        width: 100%;
        height: auto;
        min-height: unset;
        position: static;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 12px;
    }

    /* Grotere tap-targets in het paneel */
    .sidebar-item {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .sidebar-subitem {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-thumbnail {
        height: 120px;
    }

    .card-body {
        padding: 8px;
    }

    .card-title {
        font-size: 12px;
    }

    .card-meta {
        font-size: 10px;
    }

    .main-content {
        padding: 12px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
        padding: 20px 0;
    }

    .pagination-info {
        flex: 0 0 100%;
        text-align: center;
        font-size: 13px;
        order: 3;
    }

    .detail-container {
        padding: 16px;
    }

    .detail-header {
        flex-direction: column;
        gap: 16px;
    }

    .detail-image {
        width: 100%;
        height: 200px;
    }

    .detail-title {
        font-size: 20px;
    }

    .detail-meta-label {
        min-width: 80px;
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .pdf-row {
        padding: 12px;
        min-height: 44px;
    }

    .pdf-row .open {
        padding: 6px 10px;
        font-size: 12px;
    }

    .pdf-viewer {
        height: 400px;
    }

    .pdf-open-mobile {
        display: block;
        text-align: center;
        padding: 10px;
        background: #f5f0fc;
        border: 1px solid #e8d5f5;
        border-radius: 6px;
        color: #4a3b6b;
        font-weight: 600;
        font-size: 14px;
        text-decoration: none;
        margin-bottom: 8px;
        min-height: 44px;
        line-height: 24px;
    }

    .login-card button {
        min-height: 44px;
        padding: 12px;
    }

    .scrapers-page {
        padding: 12px;
    }

    .scrapers-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}

.cat-fieldset { border: 1px solid #e0d0ee; border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
.cat-fieldset legend { font-size: 13px; color: #555; padding: 0 6px; }
.cat-group-title { font-size: 11px; text-transform: uppercase; color: #999; margin: 8px 0 4px; }
.cat-check { display: inline-flex; align-items: center; gap: 5px; margin: 2px 10px 2px 0; font-size: 13px; }
.form-error-inline { color: #c0392b; font-size: 12px; margin-top: 6px; }
.card-body .card-tag { margin: 2px 4px 0 0; }

/* === Categorieën op detailpagina (pills + chip-editor) === */
.detail-cat-content { display: inline-block; }
.cat-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cat-edit-btn {
    background: none; border: none; cursor: pointer; color: #7a5fa0;
    font-size: 14px; line-height: 1; padding: 6px; border-radius: 6px;
}
.cat-edit-btn:hover { background: #f3e8fb; }
.cat-saved { color: green; font-size: 12px; margin-left: 4px; }

.cat-editor { display: flex; flex-direction: column; gap: 10px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #b591d6; color: white; font-size: 12px;
    padding: 3px 4px 3px 10px; border-radius: 12px;
}
.cat-chip-x {
    background: none; border: none; color: white; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 0 5px; border-radius: 50%; opacity: 0.75;
}
.cat-chip-x:hover:not(:disabled) { opacity: 1; background: rgba(255,255,255,0.25); }
.cat-chip-x:disabled { opacity: 0.35; cursor: not-allowed; }

.cat-add { position: relative; }
.cat-add-btn {
    background: #f5f5f5; border: 1px dashed #c8a8e8; color: #7a5fa0;
    border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.cat-add-btn:hover { background: #f3e8fb; }
.cat-dropdown {
    position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 50;
    background: white; border: 1px solid #ddd; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12); padding: 6px;
    max-height: 280px; overflow-y: auto; min-width: 220px;
}
.cat-dropdown-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.cat-dropdown-item:hover { background: #f3e8fb; }
.cat-dropdown-empty { padding: 6px 10px; font-size: 12px; color: #999; }
.cat-done { align-self: flex-start; }
@media (max-width: 600px) { .cat-done { width: 100%; } }

/* ===== Landingspagina ===== */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.landing { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.landing-topbar { display:flex; align-items:center; justify-content:space-between; padding:16px 0; }
.landing-brand { font-weight:700; font-size:1.25rem; text-decoration:none; color:#7a5fa0; }
.landing-nav a { text-decoration:none; color:#7a5fa0; font-weight:600; }
.hero { text-align:center; padding:48px 16px; background:#f9f4fd; border-radius:16px; margin-bottom:32px; }
.hero-title { font-size:2.25rem; margin:0 0 12px; color:#3a2d4a; }
.hero-sub { font-size:1.1rem; color:#5a4f66; max-width:640px; margin:0 auto 24px; }
.hero-cta { display:inline-block; background:#7a5fa0; color:#fff; padding:12px 28px; border-radius:999px; text-decoration:none; font-weight:600; }
.hero-cta:focus-visible { outline:2px solid #3a2d4a; outline-offset:2px; }
.hero-search { display:flex; max-width:480px; margin:20px auto 0; gap:8px; }
.hero-search input { flex:1; padding:10px 14px; border:1px solid #d9c7ec; border-radius:999px; font-size:1rem; }
.hero-search input:focus-visible { outline:2px solid #7a5fa0; outline-offset:2px; border-color:#7a5fa0; }
.hero-search button { background:#7a5fa0; color:#fff; border:none; border-radius:999px; padding:0 18px; cursor:pointer; }
.hero-search button:focus-visible { outline:2px solid #3a2d4a; outline-offset:2px; }
.cat-section, .usp-section, .popular-section { margin:40px 0; }
.cat-section h2, .usp-section h2, .popular-section h2 { font-size:1.5rem; color:#3a2d4a; }
.cat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.cat-tile { display:flex; flex-direction:column; align-items:center; gap:6px; padding:24px; background:#fff; border:1px solid #e8d5f5; border-radius:12px; text-decoration:none; color:#3a2d4a; }
.cat-tile:focus-visible { outline:2px solid #7a5fa0; outline-offset:2px; }
.cat-tile-emoji { font-size:2rem; }
.cat-tile-name { font-weight:600; }
.cat-tile-count { font-size:.85rem; color:#7a5fa0; }
.usp-row { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.usp { text-align:center; padding:16px; }
.usp-icon { font-size:1.8rem; }
.landing-footer { display:flex; justify-content:space-between; padding:24px 0; border-top:1px solid #e8d5f5; color:#5a4f66; }
.landing-footer a { color:#7a5fa0; }
@media (max-width:640px) {
    .hero-title { font-size:1.6rem; }
    .cat-grid { grid-template-columns:repeat(2,1fr); }
    .usp-row { grid-template-columns:1fr; }
}
.popular-grid { margin-top:16px; }
.popular-sub { color:#5a4f66; margin:4px 0 0; }
.popular-more { display:inline-block; margin-top:12px; color:#7a5fa0; font-weight:600; text-decoration:none; }
@media (max-width:640px) {
    .popular-grid { display:flex; overflow-x:auto; gap:12px; scroll-snap-type:x mandatory; }
    .popular-grid > * { flex:0 0 70%; scroll-snap-align:start; }
}

.pdf-download-btn { margin-bottom:10px; }

.breadcrumbs ol { display:flex; flex-wrap:wrap; gap:6px; list-style:none; padding:0; margin:0 0 12px; font-size:.9rem; }
.breadcrumbs li::after { content:"›"; margin-left:6px; color:#b591d6; }
.breadcrumbs li:last-child::after { content:""; }
.breadcrumbs a { color:#7a5fa0; text-decoration:none; }

.skip-link { position:absolute; left:-9999px; top:0; background:#7a5fa0; color:#fff; padding:8px 14px; border-radius:0 0 8px 0; z-index:1000; }
.skip-link:focus { left:0; }
.pattern-card:focus-visible, .sidebar-item:focus-visible { outline:2px solid #7a5fa0; outline-offset:2px; }

/* ===== Actieve filter-chips (/patronen) ===== */
.active-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 16px; }
.filter-chip { display:inline-flex; align-items:center; gap:6px; background:#e8d5f5; color:#3a2d4a; border:1px solid #d9c7ec; border-radius:999px; padding:5px 12px; font-size:.9rem; cursor:pointer; }
.filter-chip:hover { background:#d9c7ec; }
.filter-chip:focus-visible { outline:2px solid #7a5fa0; outline-offset:2px; }
.filter-chip .chip-x { font-size:1.1rem; line-height:1; color:#7a5fa0; font-weight:700; }
.filter-clear-all { background:none; border:none; color:#7a5fa0; cursor:pointer; font-size:.85rem; text-decoration:underline; padding:5px 4px; }
.filter-clear-all:hover { color:#5a3f80; }
.filter-clear-all:focus-visible { outline:2px solid #7a5fa0; outline-offset:2px; }

/* "Selecteer alles"-rij in de filtergroepen */
.sidebar-selectall .sub-name { font-weight:600; color:#7a5fa0; }
.sidebar-selectall { border-bottom:1px solid #efe6f8; margin-bottom:4px; padding-bottom:6px; }
