:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #111827;
    --brand2: #374151;
    --ok-bg: #f0fdf4;
    --ok-bd: #22c55e33;
    --warn-bg: #fffbeb;
    --warn-bd: #f59e0b33;
    --err-bg: #fef2f2;
    --err-bd: #ef444433;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Topbar */
header {
    background: var(--brand);
    color: #fff;
    padding: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
}

/* Layout */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    margin-bottom: 14px;
}

h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

h3 {
    margin: 12px 0 8px;
    font-size: 16px;
}

.muted {
    color: var(--muted);
}

.notice,
.ok,
.danger {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    margin: 10px 0;
}

.notice {
    background: var(--warn-bg);
    border-color: var(--warn-bd);
}

.ok {
    background: var(--ok-bg);
    border-color: var(--ok-bd);
}

.danger {
    background: var(--err-bg);
    border-color: var(--err-bd);
}

/* Form */
label {
    display: block;
    font-weight: 650;
    margin: 10px 0 6px;
}

input,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 16px;
    background: #fff;
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 0;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
}

.btn.secondary {
    background: var(--brand2);
}

.btn.ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--line);
}

/* Grids */
.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

/* Cards grid (overzicht) */
.cards-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 760px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.beer-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.beer-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.beer-title a {
    color: inherit;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
}

.beer-title a:hover {
    text-decoration: underline;
}

.beer-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

/* Key/value rows */
.kv {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.kv-row:first-child {
    border-top: 0;
}

.kv-k {
    font-weight: 800;
}

.kv-v {
    text-align: right;
    overflow-wrap: anywhere;
}

@media (min-width: 860px) {
    .grid.two {
        grid-template-columns: 1fr 1fr;
    }

    .grid.three {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Table */
.table-wrap {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    /* op mobiel kan je scrollen */
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f3f4f6;
    font-weight: 750;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2ff;
    white-space: nowrap;
}

.pill.green {
    background: #dcfce7;
}

.pill.red {
    background: #fee2e2;
}

/* Scanner */
.scanner-shell {
    width: 100%;
    max-width: 420px;
    margin: 0;
}

.scanner-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0b1220;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
}

/* ✅ Niet spiegelen + iOS fixes */
.scanner-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
    /* <— FIX spiegelbeeld */
    -webkit-transform: none !important;
    display: block;
}

/* Overlay rechthoek */
.scan-reticle {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-reticle::before {
    content: "";
    width: 72%;
    height: 32%;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 12px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .22);
}

/* Small text */
small {
    color: var(--muted);
}

/* Links in meldingen */
.notice a,
.ok a,
.danger a {
    color: inherit;
    font-weight: 700;
}