/* ==========================================================================
   De Vondst — modern dashboard
   ========================================================================== */

:root {
    --bg:        #f3f4f7;
    --surface:   #ffffff;
    --surface-2: #fafbfc;
    --ink:       #0f1115;
    --ink-2:     #3a3f47;
    --muted:     #7c8493;
    --line:      #e6e8ee;
    --line-2:    #eef0f4;

    --accent:      #5b6cff;
    --accent-deep: #4453e8;
    --accent-soft: #eef0ff;
    --violet:      #8b5cf6;

    --ok:     #12a150;
    --ok-soft:#e8f7ee;
    --warn:   #b45309;
    --warn-soft:#fdf3e3;
    --danger: #dc2626;
    --danger-soft:#fdecec;

    --radius: 16px;
    --radius-sm: 10px;

    --shadow-xs: 0 1px 2px rgba(15, 17, 21, .04);
    --shadow-sm: 0 1px 3px rgba(15, 17, 21, .06), 0 1px 2px rgba(15, 17, 21, .04);
    --shadow-md: 0 8px 24px -12px rgba(15, 17, 21, .18), 0 2px 6px rgba(15, 17, 21, .04);

    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.022em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--line-2); padding: 2px 6px; border-radius: 6px; }

.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.wrap.narrow { width: min(820px, calc(100% - 48px)); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- koppen ---------- */
.site-head {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; }
.wordmark.small { font-size: .98rem; }
.mark { color: var(--accent); }
.site-nav { display: flex; gap: 22px; font-size: .9rem; color: var(--ink-2); }
.site-nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.is-active { border-color: var(--accent); color: var(--ink); }
.site-nav .nav-admin { color: var(--muted); font-size: .82rem; }

/* ---------- shell ---------- */
.admin-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.admin-side {
    background: #0e1117;
    color: #a7b0c0;
    padding: 22px 16px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.admin-side .wordmark { color: #fff; padding: 6px 10px 22px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a {
    padding: 10px 12px; border-radius: 10px;
    font-size: .9rem; color: #a7b0c0;
    transition: background .15s ease, color .15s ease;
}
.admin-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-side nav a.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.nav-count {
    display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 8px;
    border-radius: 999px; background: rgba(255,255,255,.16); color: #fff;
    font-size: .7rem; text-align: center; line-height: 20px;
}

.admin-main { padding: 34px 40px 80px; max-width: 1120px; }
.admin-title { font-size: 1.75rem; margin-bottom: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- kpi's ---------- */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 12px; margin-bottom: 22px;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    display: flex; flex-direction: column; gap: 6px;
}
.kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
    border-color: transparent;
    box-shadow: 0 10px 26px -14px rgba(91,108,255,.85);
}
.kpi-accent .kpi-label { color: rgba(255,255,255,.72); }
.kpi-accent .kpi-value { color: #fff; }

/* ---------- filterchips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    font-size: .84rem; font-weight: 500; color: var(--ink-2);
    transition: all .15s ease;
}
.chip:hover { border-color: #cfd4de; box-shadow: var(--shadow-xs); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-n { font-size: .74rem; opacity: .55; }

/* ---------- tabellen ---------- */
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 8px; }
.admin-table th {
    text-align: left; font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
    padding: 10px 12px; border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.admin-table th:first-child { border-top-left-radius: 12px; }
.admin-table th:last-child { border-top-right-radius: 12px; }
.admin-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    background: var(--surface);
}
.admin-table tbody tr:hover td { background: #fafbff; }
.admin-table tr.is-sold td { color: var(--muted); background: #fbfbfc; }
.admin-table tr.is-selected td { background: var(--accent-soft); }
.admin-table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.cell-img { width: 58px; }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }
.thumb-ph { display: inline-grid; place-items: center; font-weight: 700; color: rgba(15,17,21,.35); }
.cell-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }

/* ---------- badges ---------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}
.badge-available { background: var(--ok-soft); color: var(--ok); }
.badge-reserved  { background: var(--warn-soft); color: var(--warn); }
.badge-sold      { background: #eef0f4; color: #5b6270; }
.badge-missing   { background: var(--warn-soft); color: var(--warn); margin-left: 8px; }

/* ---------- knoppen ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(91,108,255,.8); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cfd4de; }
.mini {
    display: inline-flex; align-items: center;
    font-size: .78rem; font-weight: 500; padding: 5px 10px;
    border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); cursor: pointer;
}
.mini:hover { border-color: #cfd4de; background: var(--surface-2); }
.mini.danger { color: var(--danger); border-color: #f3c9c9; background: var(--danger-soft); }
.inline { display: inline; }

/* ---------- formulieren ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.stack input[type=text], .stack input[type=url], .stack input[type=password], .stack input[type=file],
.stack textarea, .stack select {
    font: inherit; font-size: .92rem; padding: 10px 12px;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.stack input:focus, .stack textarea:focus, .stack select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* inline velden */
.cost-input, .sale-input {
    font: inherit; font-size: .9rem; padding: 6px 9px;
    border-radius: 8px; border: 1px solid transparent; background: transparent;
    color: var(--ink); text-align: right;
    transition: all .15s ease;
}
.cost-input { width: 80px; }
.sale-input { width: 88px; border-color: var(--line); background: var(--surface); }
.cost-input:hover { border-color: var(--line); background: var(--surface); }
.cost-input:focus, .sale-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.sale-input.needs-input { border-color: #f0c98a; background: var(--warn-soft); }
.cost-input.is-saving, .sale-input.is-saving { opacity: .5; }
.cost-input.is-saved, .sale-input.is-saved { border-color: var(--ok); background: var(--ok-soft); }
.hint { display: block; font-size: .7rem; color: var(--muted); margin-top: 2px; }

/* ---------- meldingen ---------- */
.alert { background: var(--danger-soft); color: var(--danger); padding: 11px 15px; border-radius: var(--radius-sm); font-size: .88rem; }
.note { background: var(--ok-soft); color: var(--ok); padding: 11px 15px; border-radius: var(--radius-sm); font-size: .88rem; }

/* ---------- import / sync ---------- */
.pw-box { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 18px; }
.pw-box summary { cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.pw-box .stack { margin-top: 16px; }
.import-sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---------- maandgrafiek ---------- */
.small-title { font-size: 1.05rem; margin: 34px 0 16px; }
.month-chart {
    display: flex; align-items: flex-end; gap: 8px;
    height: 180px; padding: 14px 14px 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.month-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.month-bar {
    background: linear-gradient(180deg, var(--accent) 0%, var(--violet) 100%);
    border-radius: 6px 6px 2px 2px; min-height: 4px;
    transition: filter .15s ease;
}
.month-col:hover .month-bar { filter: brightness(1.1); }
.month-bar.is-leeg { background: var(--line-2); }
.month-label { text-align: center; font-size: .68rem; color: var(--muted); padding-bottom: 8px; }

/* ---------- dubbels ---------- */
.dupes { display: flex; flex-direction: column; gap: 12px; }
.dupe {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow-xs);
}
.dupe-side { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dupe-side strong { display: block; font-size: .92rem; font-weight: 600; }
.dupe-side span { display: block; margin-top: 2px; }
.dupe-img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }

/* ---------- platform / datums ---------- */
.plat {
    display: inline-block; padding: 3px 9px; margin-right: 4px;
    border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep);
    font-size: .74rem; font-weight: 600; white-space: nowrap;
}
.plat:hover { background: #e3e6ff; }
.dates { display: block; margin-top: 3px; font-size: .75rem; }
.removed { color: var(--danger); font-weight: 600; }
.live-diff { display: inline-block; margin-top: 2px; font-size: .73rem; font-weight: 600; color: var(--warn); }

/* ---------- login ---------- */
.admin-body { background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
    width: min(400px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 34px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; gap: 16px;
}
.login-card h1 { font-size: 1.5rem; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.login-card input {
    font: inherit; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface);
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- voet ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; font-size: .82rem; color: var(--muted); }
.foot-mark { color: var(--accent); }
.foot-links { display: flex; gap: 18px; }

/* ---------- leeg ---------- */
.empty { padding: 46px 0; color: var(--muted); font-size: .95rem; }

/* ---------- responsief ---------- */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; padding: 16px; }
    .admin-side nav { flex-direction: row; flex-wrap: wrap; }
    .admin-main { padding: 24px 18px 60px; }
    .row2 { grid-template-columns: 1fr; }
    .dupe { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .kpis { grid-template-columns: 1fr 1fr; }
    .admin-table { font-size: .84rem; }
    .admin-table th, .admin-table td { padding: 8px 8px; }
}

/* ---------- verfijning: tabel niet laten afbreken ---------- */
.admin-table { font-size: .88rem; }
.admin-table td, .admin-table th { padding: 9px 10px; }
.cell-price, .cell-profit, .cell-plat, .cell-actions { white-space: nowrap; }
.cell-price { min-width: 96px; }
.cell-actions { flex-wrap: nowrap; }
.admin-table td strong { font-weight: 600; }

/* inkoopveld herkenbaar als veld */
.cost-input {
    border-bottom: 1px dashed #d5d9e2;
    border-radius: 6px;
    background: transparent;
    min-width: 66px;
}
.cost-input:hover { border-bottom-color: var(--accent); background: var(--surface); }

/* compactere status- en platformchips in de tabel */
.admin-table .badge { padding: 3px 8px; font-size: .68rem; }
.admin-table .plat { font-size: .7rem; padding: 3px 8px; }
.admin-table .mini { padding: 4px 9px; font-size: .74rem; }

/* ---------- verkoopvenster ---------- */
.modal {
    border: 0; padding: 0; background: transparent;
    max-width: 420px; width: calc(100% - 32px);
}
.modal::backdrop {
    background: rgba(15, 17, 21, .45);
    backdrop-filter: blur(3px);
}
.modal-form {
    background: var(--surface);
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; gap: 14px;
}
.modal-title { font-size: 1.25rem; }
.modal-sub { font-size: .86rem; color: var(--muted); margin-top: -8px; }
.modal-label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.modal-label input {
    font: inherit; font-size: 1rem; padding: 10px 12px;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--surface);
}
.modal-label input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-hint { font-size: .78rem; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- waarschuwingsbanner ---------- */
.banner {
    background: linear-gradient(180deg, #fff8ec 0%, #fffdf8 100%);
    border: 1px solid #f3d9a8;
    border-left: 4px solid var(--warn);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-xs);
}
.banner-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.banner-icon {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    background: var(--warn); color: #fff; font-weight: 800; font-size: .85rem;
    display: grid; place-items: center;
}
.banner-head strong { display: block; font-size: 1rem; }
.banner-sub { display: block; font-size: .84rem; color: var(--ink-2); margin-top: 2px; }
.banner-list { display: flex; flex-direction: column; gap: 8px; }
.banner-item {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid #f0e3c8; border-radius: 10px;
    padding: 8px 12px;
}
.banner-title { font-weight: 600; font-size: .9rem; }
.banner-meta { font-size: .78rem; color: var(--muted); margin-right: auto; }
.banner-hint { font-size: .76rem; color: var(--muted); margin-top: 10px; }

/* ---------- ingelogd als ---------- */
.admin-side nav { flex: 0 0 auto; }
.who {
    margin-top: auto;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 14px 12px;
    background: rgba(255,255,255,.05);
    border-radius: 12px;
}
.who-dot {
    flex: none; width: 9px; height: 9px; margin-top: 6px;
    border-radius: 50%; background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,.18);
}
.who-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: #6f7a8c; }
.who-name { display: block; font-size: .95rem; color: #fff; margin-top: 2px; }
.who-role { display: block; font-size: .74rem; color: #8b95a7; margin-top: 1px; }

/* twee rijen kpi's */
.kpis + .kpis { margin-top: -10px; }

/* ==========================================================================
   Mobiel: kaarten in plaats van een brede tabel
   ========================================================================== */

@media (max-width: 900px) {
    /* zijbalk wordt een compacte bovenbalk */
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: sticky; top: 0; z-index: 40;
        height: auto; flex-direction: row; align-items: center; gap: 8px;
        padding: 10px 12px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .admin-side::-webkit-scrollbar { display: none; }
    .admin-side .wordmark { padding: 0 8px 0 2px; font-size: .95rem; white-space: nowrap; }
    .admin-side nav { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
    .admin-side nav a {
        padding: 9px 12px; white-space: nowrap;
        background: rgba(255,255,255,.06);
        font-size: .84rem;
    }
    .admin-side nav a.is-on { background: var(--accent); }
    .who {
        margin: 0 0 0 auto; padding: 6px 10px; background: transparent;
        flex: none; align-items: center;
    }
    .who-dot { margin-top: 0; }
    .who-label { display: none; }
    .who-name { font-size: .82rem; }
    .who div { display: flex; align-items: center; }

    .admin-main { padding: 18px 14px 90px; }
    .admin-title { font-size: 1.35rem; margin-bottom: 14px; }

    /* kpi's: twee per rij */
    .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .kpi { padding: 12px 13px; border-radius: 13px; }
    .kpi-value { font-size: 1.18rem; }
    .kpi-label { font-size: .64rem; }

    /* filters: horizontaal schuiven */
    .chips {
        flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
        margin-inline: -14px; padding-inline: 14px;
        scrollbar-width: none;
    }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: none; min-height: 38px; padding: 8px 14px; }

    /* tabel → kaarten */
    .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; width: 100%; }
    .list-table thead { display: none; }
    .list-table { border-spacing: 0; margin-top: 10px; }
    .list-table tr {
        position: relative;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 16px;
        margin-bottom: 10px;
        padding: 12px 12px 10px 74px;
        box-shadow: var(--shadow-xs);
    }
    .list-table tr.is-sold { opacity: .72; }
    .list-table td {
        border: 0; padding: 4px 0; background: transparent !important;
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        min-height: 32px;
    }
    .list-table td::before {
        content: attr(data-label);
        flex: none;
        font-size: .68rem; font-weight: 600; letter-spacing: .07em;
        text-transform: uppercase; color: var(--muted);
    }
    /* afbeelding linksboven, titel ernaast */
    .list-table .cell-img {
        position: absolute; left: 12px; top: 12px;
        width: 50px; padding: 0;
    }
    .list-table .cell-img::before { content: none; }
    .list-table .thumb { width: 50px; height: 50px; border-radius: 12px; }
    .list-table td:nth-child(2) { display: block; padding: 0 0 8px; min-height: 0; }
    .list-table td:nth-child(2)::before { content: none; }
    .list-table .dates { margin-top: 4px; }

    /* acties onderaan, volle breedte */
    .list-table .cell-actions {
        justify-content: flex-start; flex-wrap: wrap;
        gap: 8px; margin-top: 8px; padding-top: 8px;
        border-top: 1px solid var(--line-2);
    }
    .list-table .cell-actions::before { content: none; }
    .list-table .mini { min-height: 40px; padding: 9px 14px; font-size: .82rem; flex: 1; justify-content: center; }
    .list-table .badge, .list-table .plat { font-size: .72rem; padding: 4px 10px; }

    /* invoervelden groot genoeg om te tikken */
    .cost-input, .sale-input {
        width: auto; min-width: 96px; min-height: 40px;
        font-size: 1rem; text-align: right;
        border: 1px solid var(--line); background: var(--surface);
    }

    /* overige tabellen: horizontaal schuiven */
    .tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-inline: -14px; padding-inline: 14px; }
    .tscroll .admin-table { min-width: 520px; }

    /* venster als ondervel */
    .modal { max-width: 100%; width: 100%; margin: 0 0 0 0; }
    .modal[open] { display: flex; align-items: flex-end; height: 100%; max-height: 100%; }
    .modal-form { width: 100%; border-radius: 20px 20px 0 0; padding: 22px 18px 26px; }
    .modal-label input { min-height: 46px; font-size: 1rem; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; min-height: 48px; }

    /* banner */
    .banner { padding: 13px 14px; }
    .banner-item { flex-direction: column; align-items: stretch; gap: 6px; }
    .banner-meta { margin-right: 0; }

    /* dubbels */
    .dupe { padding: 12px; }
    .dupe .btn { width: 100%; min-height: 44px; }

    /* formulieren */
    .stack { max-width: 100%; }
    .stack input[type=text], .stack input[type=url], .stack input[type=password],
    .stack select, .stack textarea { min-height: 44px; font-size: 1rem; }
    .btn { min-height: 46px; }
    .month-chart { height: 140px; }
    .site-foot .foot-inner { flex-direction: column; gap: 6px; }
}

@media (max-width: 380px) {
    .kpis { grid-template-columns: 1fr; }
    .list-table tr { padding-left: 12px; }
    .list-table .cell-img { position: static; width: auto; margin-bottom: 8px; }
}

/* mobiel: breedtes strak houden */
@media (max-width: 900px) {
    html, body { overflow-x: hidden; max-width: 100%; }
    .admin-main { max-width: 100vw; }
    .list-table td { flex-wrap: wrap; }
    .list-table td::before { min-width: 78px; }
    .cost-input, .sale-input { width: 110px; min-width: 0; max-width: 45vw; }
    .list-table tr { overflow: hidden; }
}

/* mobiel: kpi-kolommen mogen krimpen */
@media (max-width: 900px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi { min-width: 0; }
    .kpi-value { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-side nav { min-width: 0; flex: 1 1 auto; }
}

@media (max-width: 900px) {
    .admin-side { gap: 6px; }
    .admin-side nav {
        flex: 1 1 auto; min-width: 0;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-left: 4px;
    }
    .admin-side nav::-webkit-scrollbar { display: none; }
}

/* ==========================================================================
   MODERNISERING — eigen lettertype, diepere kleuren, meer detail
   ========================================================================== */

:root {
    --bg:        #f5f6fa;
    --surface:   #ffffff;
    --surface-2: #fbfbfd;
    --ink:       #0b0e14;
    --ink-2:     #39404b;
    --muted:     #77808f;
    --line:      #e7e9f0;
    --line-2:    #f0f2f7;

    --accent:      #5b6cff;
    --accent-deep: #4353e0;
    --accent-soft: #eceeff;
    --violet:      #8b5cf6;
    --accent-grad: linear-gradient(135deg, #5b6cff 0%, #7c5cf6 55%, #a855f7 100%);

    --radius:   18px;
    --radius-sm: 11px;

    --shadow-xs: 0 1px 2px rgba(11, 14, 20, .05);
    --shadow-sm: 0 2px 6px rgba(11, 14, 20, .05), 0 1px 2px rgba(11, 14, 20, .04);
    --shadow-md: 0 18px 40px -24px rgba(11, 14, 20, .28), 0 4px 12px -6px rgba(11, 14, 20, .08);
    --shadow-glow: 0 14px 34px -18px rgba(91, 108, 255, .85);

    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { background: var(--bg); }

body {
    font-family: var(--sans);
    font-feature-settings: "cv11", "ss01";
    letter-spacing: -.011em;
    background:
        radial-gradient(900px 420px at 82% -8%, rgba(139, 92, 246, .10), transparent 70%),
        radial-gradient(700px 380px at 8% -12%, rgba(91, 108, 255, .12), transparent 72%),
        var(--bg);
    background-attachment: fixed;
}

::selection { background: rgba(91, 108, 255, .22); }

* { scrollbar-width: thin; scrollbar-color: #ccd2e0 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccd2e0; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bccd; background-clip: content-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- zijbalk ---------- */
.admin-side {
    background: linear-gradient(180deg, #0b0f18 0%, #0a0d14 60%, #090b11 100%);
    border-right: 1px solid rgba(255,255,255,.05);
    padding: 20px 14px 16px;
}
.admin-side .wordmark {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 20px;
    font-size: 1.02rem; font-weight: 750; letter-spacing: -.03em;
    color: #fff;
}
.admin-side .wordmark .mark {
    display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--accent-grad);
    box-shadow: 0 8px 20px -8px rgba(124, 92, 246, .9);
    font-size: .8rem; color: #fff;
}

.admin-side nav { gap: 3px; }
.admin-side nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: .885rem; font-weight: 500;
    color: #9aa3b4;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.admin-side nav a .ni {
    width: 19px; height: 19px; flex: none;
    opacity: .78;
    transition: opacity .16s ease;
}
.admin-side nav a:hover {
    background: rgba(255,255,255,.055);
    color: #fff;
}
.admin-side nav a:hover .ni { opacity: 1; }
.admin-side nav a.is-on {
    background: var(--accent-grad);
    color: #fff; font-weight: 600;
    box-shadow: 0 10px 24px -14px rgba(124, 92, 246, .95);
}
.admin-side nav a.is-on .ni { opacity: 1; }
.nav-count {
    margin-left: auto;
    background: rgba(255,255,255,.18);
    font-size: .68rem; line-height: 19px; min-width: 19px;
}

/* avatar onderaan */
.who {
    margin-top: auto;
    padding: 12px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    display: flex; align-items: center; gap: 10px;
}
.who-avatar {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-grad);
    color: #fff; font-weight: 700; font-size: .9rem;
    box-shadow: 0 6px 16px -8px rgba(124,92,246,.9);
}
.who-label { display: block; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: #5f6879; }
.who-name { display: block; font-size: .92rem; color: #fff; margin-top: 1px; }
.who-dot { display: none; }

/* ---------- werkruimte ---------- */
.admin-main { padding: 36px 44px 90px; }

.admin-title {
    font-size: 1.85rem; font-weight: 750; letter-spacing: -.035em;
    margin-bottom: 22px;
}

.kpis { gap: 14px; margin-bottom: 24px; }
.kpi {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 17px 19px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label { font-size: .68rem; letter-spacing: .1em; color: var(--muted); }
.kpi-value { font-size: 1.62rem; font-weight: 720; letter-spacing: -.04em; }
.kpi-accent {
    background: var(--accent-grad);
    box-shadow: var(--shadow-glow);
}
.kpi-accent:hover { box-shadow: 0 20px 44px -20px rgba(124,92,246,.95); }

/* ---------- filters ---------- */
.chip {
    border-radius: 11px;
    padding: 8px 15px;
    font-weight: 550;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip.is-on {
    background: var(--ink);
    border-color: var(--ink);
    box-shadow: 0 8px 18px -10px rgba(11,14,20,.7);
}

/* ---------- tabel als kaart ---------- */
.admin-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-collapse: separate;
    border-spacing: 0;
}
.admin-table th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    font-size: .67rem; letter-spacing: .1em;
    position: sticky; top: 0; z-index: 2;
    backdrop-filter: blur(6px);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .14s ease; }
.admin-table tbody tr:hover td { background: #f8f9ff; }
.admin-table tr.is-sold td { background: #fafbfc; }
.admin-table .thumb { border-radius: 11px; box-shadow: var(--shadow-xs); }

/* ---------- knoppen ---------- */
.btn { border-radius: 12px; font-weight: 600; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.btn-primary {
    background: var(--accent-grad);
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); }
.mini { border-radius: 9px; box-shadow: var(--shadow-xs); transition: all .14s ease; }
.mini:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- invoer ---------- */
.stack input, .stack select, .stack textarea, .login-card input, .modal-label input {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.stack input:focus, .stack select:focus, .stack textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91,108,255,.13);
}
.cost-input { border-bottom: 1px dashed #d6dbe7; border-radius: 8px; }
.cost-input:hover { border-bottom-color: var(--accent); }

/* ---------- badges, platform, chart ---------- */
.badge { border-radius: 999px; font-weight: 600; }
.plat { border-radius: 8px; background: var(--accent-soft); color: var(--accent-deep); }
.month-chart { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.month-bar { border-radius: 7px 7px 3px 3px; }
.dupe, .banner { border-radius: var(--radius); }

/* ---------- login ---------- */
.login-card {
    border-radius: 24px;
    box-shadow: 0 30px 70px -40px rgba(11,14,20,.45), var(--shadow-sm);
    border: 1px solid rgba(231,233,240,.9);
}

/* ---------- entree ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.admin-main > * { animation: fadeUp .34s cubic-bezier(.22,.8,.3,1) both; }
.admin-main > *:nth-child(2) { animation-delay: .04s; }
.admin-main > *:nth-child(3) { animation-delay: .08s; }
.admin-main > *:nth-child(4) { animation-delay: .12s; }
.admin-main > *:nth-child(n+5) { animation-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
    .admin-main > * { animation: none; }
    * { transition: none !important; }
}

/* tabel niet laten uitpuilen */
.admin-main { overflow-x: hidden; }
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.table-wrap .admin-table {
    border: 0; border-radius: 0; box-shadow: none;
    min-width: 900px;
}
.list-table td strong { display: block; max-width: 260px; }

/* ==========================================================================
   Zijbalk terug naar de eenvoudige versie — de rest blijft modern
   ========================================================================== */

.admin-side {
    background: #0e1117;
    border-right: 0;
    padding: 22px 16px;
}

/* logo: platte tekst met een ruitje */
.admin-side .wordmark {
    padding: 6px 10px 22px;
    font-size: 1.02rem;
    font-weight: 750;
    letter-spacing: -.03em;
}
.admin-side .wordmark .mark {
    display: inline-block;
    width: auto; height: auto;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--accent);
    font-size: .95rem;
    line-height: 1;
}

/* menu: platte tekst, geen icoontjes */
.admin-side nav { gap: 2px; }
.admin-side nav a {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    color: #a7b0c0;
    background: none;
    box-shadow: none;
}
.admin-side nav a .ni { display: none; }
.admin-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-side nav a.is-on {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: none;
}

/* ingelogd als: groen bolletje */
.who {
    background: transparent;
    border: 0;
    padding: 6px 10px;
    margin-top: auto;
    gap: 10px;
    align-items: flex-start;
}
.who-avatar { display: none; }
.who-dot {
    display: block;
    flex: none;
    width: 9px; height: 9px; margin-top: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,.16);
}
.who-label { font-size: .64rem; letter-spacing: .09em; color: #5f6879; }
.who-name { font-size: .9rem; color: #fff; }

/* tabel: vaste kolombreedtes zodat alles past */
.list-table { table-layout: fixed; min-width: 0; width: 100%; }
.list-table th:nth-child(1), .list-table td:nth-child(1) { width: 56px; }
.list-table th:nth-child(3), .list-table td:nth-child(3) { width: 84px; }
.list-table th:nth-child(4), .list-table td:nth-child(4) { width: 96px; }
.list-table th:nth-child(5), .list-table td:nth-child(5) { width: 92px; }
.list-table th:nth-child(6), .list-table td:nth-child(6) { width: 104px; }
.list-table th:nth-child(7), .list-table td:nth-child(7) { width: 100px; }
.list-table th:nth-child(8), .list-table td:nth-child(8) { width: 178px; }
.list-table td { padding: 11px 10px; }
.list-table .cell-actions { gap: 6px; }
.list-table .mini { padding: 5px 9px; font-size: .74rem; }
.table-wrap .admin-table { min-width: 0; }

/* ==========================================================================
   MOBIEL — definitief (moet als laatste staan, anders overschrijft de
   modernisering hierboven deze regels)
   ========================================================================== */
@media (max-width: 900px) {
    html, body { overflow-x: hidden; max-width: 100%; }

    /* bovenbalk */
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: sticky; top: 0; z-index: 40;
        height: auto; flex-direction: row; align-items: center; gap: 6px;
        padding: 10px 12px;
        overflow-x: hidden;
    }
    .admin-side .wordmark { padding: 0 6px 0 0; font-size: .95rem; flex: none; }
    .admin-side .wordmark .mark { font-size: .85rem; }
    .admin-side nav {
        flex: 1 1 auto; min-width: 0;
        flex-direction: row; flex-wrap: nowrap; gap: 6px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .admin-side nav::-webkit-scrollbar { display: none; }
    .admin-side nav a {
        white-space: nowrap; padding: 8px 11px; font-size: .83rem;
        background: rgba(255,255,255,.055);
    }
    .admin-side nav a.is-on { background: var(--accent); }
    .who {
        flex: none; margin: 0; padding: 0 2px; gap: 6px; align-items: center;
        background: none; border: 0;
    }
    .who-dot { margin-top: 0; width: 8px; height: 8px; }
    .who-label { display: none; }
    .who-name { font-size: .78rem; color: #dfe4ee; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* werkruimte */
    .admin-main { padding: 20px 14px 90px; max-width: 100vw; overflow-x: hidden; }
    .admin-title { font-size: 1.4rem; margin-bottom: 16px; }

    /* kpi's */
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
    .kpi { min-width: 0; padding: 12px 13px; border-radius: 14px; }
    .kpi:hover { transform: none; }
    .kpi-label { font-size: .6rem; letter-spacing: .07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kpi-value { font-size: clamp(.95rem, 4.6vw, 1.2rem); letter-spacing: -.03em; white-space: nowrap; }

    /* filters */
    .chips {
        flex-wrap: nowrap; overflow-x: auto; gap: 7px;
        margin: 0 -14px 4px; padding: 0 14px 8px;
        scrollbar-width: none;
    }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: none; min-height: 38px; padding: 8px 13px; font-size: .82rem; }
    .chip:hover { transform: none; }

    /* tabel → kaarten */
    .table-wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
    .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; width: 100%; }
    .table-wrap .admin-table, .list-table { min-width: 0; table-layout: auto; }
    .list-table thead { display: none; }
    .list-table tr {
        position: relative;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 16px;
        margin-bottom: 10px;
        padding: 12px 12px 10px 74px;
        box-shadow: var(--shadow-sm);
        animation: none;
    }
    .list-table td {
        border: 0; padding: 4px 0; background: transparent !important;
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        min-height: 30px; white-space: normal;
    }
    .list-table td::before {
        content: attr(data-label);
        flex: none; min-width: 74px;
        font-size: .66rem; font-weight: 600; letter-spacing: .07em;
        text-transform: uppercase; color: var(--muted);
    }
    .list-table .cell-img {
        position: absolute; left: 12px; top: 12px;
        width: 50px !important; padding: 0;
    }
    .list-table .cell-img::before { content: none; }
    .list-table .thumb { width: 50px; height: 50px; border-radius: 12px; }
    .list-table td:nth-child(2) { display: block; padding: 0 0 8px; min-height: 0; }
    .list-table td:nth-child(2)::before { content: none; }
    .list-table td strong { max-width: none; }
    .list-table .cell-actions {
        justify-content: stretch; flex-wrap: nowrap; gap: 8px;
        margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2);
    }
    .list-table .cell-actions::before { content: none; }
    .list-table .mini { flex: 1; justify-content: center; min-height: 40px; padding: 9px 12px; font-size: .82rem; }
    .list-table .mini:hover { transform: none; }

    /* invoervelden */
    .cost-input, .sale-input {
        width: 110px; min-width: 0; max-width: 45vw; min-height: 40px;
        font-size: 1rem; border: 1px solid var(--line); background: var(--surface);
    }

    /* overige tabellen */
    .tscroll { overflow-x: auto; margin-inline: -14px; padding-inline: 14px; }
    .tscroll .admin-table { min-width: 520px; }

    /* venster */
    .modal { max-width: 100%; width: 100%; margin: 0; }
    .modal[open] { display: flex; align-items: flex-end; height: 100%; max-height: 100%; }
    .modal-form { width: 100%; border-radius: 20px 20px 0 0; padding: 22px 18px 26px; }
    .modal-label input { min-height: 46px; font-size: 1rem; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; min-height: 48px; }

    .banner { padding: 13px 14px; }
    .banner-item { flex-direction: column; align-items: stretch; gap: 6px; }
    .banner-meta { margin-right: 0; }
    .dupe .btn { width: 100%; min-height: 44px; }
    .stack { max-width: 100%; }
    .stack input, .stack select, .stack textarea { min-height: 44px; font-size: 1rem; }
    .btn { min-height: 46px; }
    .month-chart { height: 150px; }
}

@media (max-width: 900px) {
    .list-table td { flex-wrap: nowrap; }
    .list-table td::before { min-width: 70px; }
    .list-table .cell-actions { flex-wrap: nowrap; }
}

@media (max-width: 900px) {
    /* vaste kolombreedtes van de desktop uitschakelen */
    .list-table th, .list-table td { width: auto !important; }
    .list-table td { width: 100% !important; }
    .list-table .cell-img { width: 50px !important; position: absolute; }
}
