/* =====================================
   GRAVIT – huisstijl
   Kleuren: oranje #FF5A1F, crème #F4EFE8, donkerblauw #14161F,
   lichtblauw #CFE3E6, perzik #FFD9C7, petrol #0F4C5C.
   Lettertype: ITC Avant Garde Gothic (CE Demi + Medium).
   ===================================== */

@font-face {
    font-family: "Avant Garde";
    src: url("branding/fonts/avantgarde-medium.otf") format("opentype");
    font-weight: 400 500;
    font-display: swap;
}

@font-face {
    font-family: "Avant Garde";
    src: url("branding/fonts/avantgarde-ce-demi.otf") format("opentype");
    font-weight: 600 800;
    font-display: swap;
}

/* ---------- Kleuren per thema ---------- */

:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #14161F;
    --stage: #0B0D12;
    --panel: #1B1F29;
    --panel-2: #222734;
    --line: #272C38;
    --line-2: #3B4252;
    --text: #F4EFE8;
    --muted: #AEB8BE;
    --accent: #FF5A1F;
    --on-accent: #14161F;
    --chip-active: #F4EFE8;
    --on-chip-active: #14161F;
    --field: #14161F;
    --danger: #FF8A80;
    --success: #7BD8A0;
    --checker-a: #2A2F3B;
    --checker-b: #222632;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #F4EFE8;
    --stage: #E8E0D5;
    --panel: #FBF8F4;
    --panel-2: #FFFFFF;
    --line: #DDD4C8;
    --line-2: #CFC6BA;
    --text: #14161F;
    --muted: #5A6472;
    --accent: #FF5A1F;
    --on-accent: #14161F;
    --chip-active: #14161F;
    --on-chip-active: #F4EFE8;
    --field: #FFFFFF;
    --danger: #B3261E;
    --success: #1B7A2B;
    --checker-a: #EDE6DC;
    --checker-b: #F7F3EE;
}

/* ---------- Basis ---------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Avant Garde", "Century Gothic", system-ui, sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
}

h1, h2, h3, h4 {
    font-weight: 700;
    margin: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button,
label[for] {
    cursor: pointer;
}

input[type="range"] {
    accent-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Knoppen en velden ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: none;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--muted);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    filter: brightness(1.06);
    border-color: var(--accent);
}

.btn-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--panel);
}

.badge {
    display: none;
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font-size: 16px;
}

.input::placeholder {
    color: var(--muted);
}

.message {
    font-size: 13px;
    color: var(--muted);
}

.message.ok {
    color: var(--success);
}

.message.error {
    color: var(--danger);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ---------- Bovenbalk ---------- */

.topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 60px;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    height: 20px;
    width: auto;
}

.brand-word {
    height: 20px;
    width: auto;
}

.brand-word-dark {
    display: none;
}

:root[data-theme="light"] .brand-word-light {
    display: none;
}

:root[data-theme="light"] .brand-word-dark {
    display: block;
}

.company {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 10px;
    border-left: 1px solid var(--line-2);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.topbar-actions .btn {
    margin-left: 4px;
}

/* ---------- Meldingen ---------- */

.notifications:empty {
    display: none;
}

.notifications {
    flex-shrink: 0;
    padding: 8px 12px 0;
}

.notification-card {
    position: relative;
    max-width: 640px;
    margin: 0 auto 8px;
    padding: 14px 44px 12px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
}

.notification-card .notification-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.notification-card .notification-message {
    white-space: pre-wrap;
    font-size: 14px;
}

.notification-card .notification-date {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.notification-card .notification-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 22px;
    border-radius: 8px;
}

.notification-card .notification-new {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 700;
}

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #25D366;
    color: #0B2414;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

/* =====================================
   EDITOR
   Gsm: foto bovenaan, fotostrook, paneel, tabbalk onderaan.
   Computer (vanaf 900px): foto's links, foto midden, paneel rechts.
   ===================================== */

.app-page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor {
    flex-grow: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "stage"
        "photos"
        "panel";
}

/* ---------- Foto's ---------- */

.photos {
    grid-area: photos;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.photo-list {
    display: flex;
    gap: 10px;
}

.thumb {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    background: var(--panel);
}

.thumb.is-active {
    opacity: 1;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    overflow: visible;
}

.thumb img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
}

.thumb img.thumb-photo {
    object-fit: cover;
}

.add-photo {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 1px dashed var(--line-2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.add-photo:hover {
    border-color: var(--muted);
    color: var(--text);
}

.photo-counter {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- Foto in bewerking ---------- */

.stage-area {
    grid-area: stage;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--stage);
}

.stage {
    position: relative;
    flex-grow: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.editor-frame {
    position: relative;
    flex-shrink: 0;
}

#activePhotoContainer {
    position: absolute !important;
    top: 0;
    left: 0;
    overflow: hidden;
    transform-origin: 0 0;
    border-radius: 2px;
}

#activePhoto {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    z-index: 30;
    background: var(--stage);
}

.empty-state img {
    height: 40px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

body.has-photos .empty-state {
    display: none;
}

.stage-tools {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
}

.stage-tools input[type="range"] {
    width: 160px;
}

body:not(.has-photos) .stage-tools {
    visibility: hidden;
}

/* ---------- Paneel met tabs ---------- */

.panel {
    grid-area: panel;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-top: 1px solid var(--line);
    min-height: 0;
}

.panel-body {
    height: 32vh;
    height: 32dvh;
    overflow-y: auto;
    padding: 14px 14px 16px;
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tabs {
    order: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg);
}

.tab {
    min-height: 60px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tab[aria-selected="true"] {
    color: var(--accent);
    font-weight: 700;
}

.hint {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Categorieën en templates ---------- */

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.chip {
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.chip.is-active {
    background: var(--chip-active);
    border-color: var(--chip-active);
    color: var(--on-chip-active);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.template-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.template-thumb {
    width: 100%;
    height: 130px;
    object-fit: contain;
    border-radius: 8px;
    background: repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) 50% / 16px 16px;
}

.template-card .template-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-card .template-actions .btn {
    width: 100%;
}

/* ---------- Filters ---------- */

.filter-options {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: thin;
}

.filter-option {
    flex-shrink: 0;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.filter-option canvas {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--panel-2);
}

.filter-option.is-selected {
    color: var(--text);
    font-weight: 700;
}

.filter-option.is-selected canvas {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.strength-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.strength-row input[type="range"] {
    flex-grow: 1;
}

.strength-row strong {
    width: 44px;
    text-align: right;
    color: var(--text);
}

.favorites {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.favorite-option {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font-size: 13px;
}

.favorite-option.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.favorite-save {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.favorite-save .input {
    flex: 1 1 100%;
    min-height: 40px;
    font-size: 14px;
}

/* ---------- Tekstvelden ---------- */

.field-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.field-card label {
    font-size: 13px;
    color: var(--muted);
}

.field-card label:first-child {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.field-card input[type="text"] {
    grid-column: 1 / -1;
}

.field-card input,
.field-card select {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font-size: 16px;
    width: 100%;
}

#variableFieldsContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#variableFieldsContainer:empty {
    display: none;
}

#variableFieldsContainer:not(:empty) + .hint {
    display: none;
}

/* ---------- Opslaan-knop op gsm ---------- */

.save-photos-button {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1000;
    min-height: 54px;
    padding: 0 28px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- Gsm: alles compacter, zodat de foto groot blijft ---------- */

@media (max-width: 899px) {

    .topbar {
        min-height: 52px;
        padding: 4px 8px 4px 14px;
    }

    .photos {
        padding: 6px 12px;
        gap: 8px;
    }

    .photo-list {
        gap: 8px;
    }

    .thumb,
    .add-photo {
        width: 44px;
        height: 44px;
    }

    .stage-tools {
        padding: 2px 12px 4px;
        gap: 10px;
    }

    .stage-tools .btn-small {
        min-height: 30px;
    }

    .panel-body {
        height: 25vh;
        height: 25dvh;
        min-height: 150px;
        padding: 12px 12px 14px;
    }

    .tab {
        min-height: 54px;
    }
}

@media (max-width: 599px) {

    .brand-word,
    .company {
        display: none !important;
    }

    .topbar .btn {
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* ---------- Computer en tablet ---------- */

@media (min-width: 900px) {

    .editor {
        grid-template-columns: 112px minmax(0, 1fr) 380px;
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "photos stage panel";
    }

    .photos {
        flex-direction: column;
        align-items: center;
        overflow-x: hidden;
        overflow-y: auto;
        border-top: none;
        border-right: 1px solid var(--line);
        padding: 16px 0;
    }

    .photo-list {
        flex-direction: column;
        gap: 12px;
    }

    .thumb,
    .add-photo {
        width: 72px;
        height: 72px;
    }

    .panel {
        border-top: none;
        border-left: 1px solid var(--line);
    }

    .tabs {
        order: 0;
        border-top: none;
        border-bottom: 1px solid var(--line);
        background: none;
        padding-bottom: 0;
    }

    .tab {
        flex-direction: row;
        min-height: 54px;
        font-size: 14px;
        border-bottom: 2px solid transparent;
    }

    .tab[aria-selected="true"] {
        color: var(--text);
        border-bottom-color: var(--accent);
    }

    .panel-body {
        height: auto;
        min-height: 0;
        flex-grow: 1;
        padding: 18px;
    }

    .stage-tools {
        padding: 12px;
    }
}

/* =====================================
   LOSSE PAGINA'S (login, account)
   ===================================== */

.page {
    min-height: 100vh;
    min-height: 100dvh;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 60px;
    padding: 8px 12px 8px 4px;
    max-width: 720px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 20px;
}

.page-header .brand-mark {
    margin-left: auto;
    height: 18px;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 4px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card h2 {
    font-size: 16px;
}

.details {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
    font-size: 14px;
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
}

.theme-option[aria-checked="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    font-weight: 700;
}

.theme-preview {
    width: 100%;
    height: 62px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--line);
    overflow: hidden;
}

.theme-preview span {
    display: block;
    border-radius: 3px;
}

.theme-preview .line {
    height: 6px;
    width: 70%;
}

.theme-preview .pill {
    height: 10px;
    width: 45%;
    border-radius: 5px;
    background: #FF5A1F;
}

.theme-preview.dark {
    background: #14161F;
}

.theme-preview.dark .line {
    background: #F4EFE8;
}

.theme-preview.light {
    background: #F4EFE8;
}

.theme-preview.light .line {
    background: #14161F;
}

.theme-preview.auto {
    flex-direction: row;
    padding: 0;
    gap: 0;
}

.theme-preview.auto span {
    flex: 1;
    border-radius: 0;
}

.favorite-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.favorite-row:first-child {
    border-top: none;
}

.favorite-row canvas {
    border-radius: 8px;
}

.favorite-row .favorite-text {
    flex: 1 1 140px;
    min-width: 0;
}

.favorite-row .favorite-detail {
    font-size: 13px;
    color: var(--muted);
}

.pin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}

/* ---------- Login ---------- */

.login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.login-logo .brand-mark {
    height: 30px;
}

.login-logo .brand-word {
    height: 30px;
}

.login-tagline {
    margin: 0 0 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--muted);
}

.login-card label {
    font-size: 13px;
    color: var(--muted);
}

.login-card .btn {
    min-height: 50px;
    font-size: 16px;
    margin-top: 6px;
}

/* =====================================
   ADMINPAGINA
   ===================================== */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin .company {
    display: inline !important;
    font-weight: 700;
    color: var(--text);
}

.icon-moon {
    display: none;
}

:root[data-theme="light"] .icon-sun {
    display: none;
}

:root[data-theme="light"] .icon-moon {
    display: block;
}

.admin-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.admin-nav {
    flex: 1 1 200px;
    max-width: 220px;
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.admin-nav a:hover {
    background: var(--panel);
    color: var(--text);
}

.admin-main {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-main .card {
    scroll-margin-top: 80px;
    padding: 20px;
    gap: 16px;
}

.admin-main .card > h2 {
    font-size: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-field > label,
.fieldset legend {
    font-size: 13px;
    color: var(--muted);
}

.fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.fieldset legend {
    padding: 0;
    margin-bottom: 6px;
}

select.input {
    appearance: auto;
}

.textarea {
    min-height: 110px;
    padding: 12px 14px;
    line-height: 1.45;
    resize: vertical;
    font-size: 15px;
}

.file-input {
    padding: 12px;
    border: 1px dashed var(--line-2);
    border-radius: 10px;
    background: var(--field);
    color: var(--muted);
}

.color-input {
    width: 64px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--field);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form .input {
    flex: 1 1 220px;
    width: auto;
}

.sub-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.sub-card h3 {
    font-size: 15px;
}

.optional {
    font-weight: 500;
    font-size: 12px;
    color: var(--muted);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text) !important;
    min-height: 32px;
}

.check input {
    width: 18px;
    height: 18px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.check-list {
    margin-top: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
}

.chips-wrap {
    flex-wrap: wrap;
    overflow: visible;
}

.chips-wrap .chip {
    cursor: default;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    font-size: 14px;
}

.admin-item.is-expired {
    opacity: 0.55;
}

.admin-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    font-size: 12px;
    color: var(--muted);
}

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

.pre-wrap {
    white-space: pre-wrap;
}

.file-name {
    overflow-wrap: anywhere;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.btn-danger {
    color: var(--danger);
}

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

.admin-template .template-thumb {
    height: 160px;
}

.admin-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-fields:empty {
    display: none;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

@media (max-width: 799px) {

    .admin-layout {
        padding: 0 12px 24px;
        gap: 12px;
    }

    .admin-nav {
        position: sticky;
        top: 52px;
        z-index: 40;
        flex: 1 1 100%;
        max-width: none;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -12px;
        padding: 8px 12px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    .admin-nav a {
        flex-shrink: 0;
        min-height: 36px;
        border: 1px solid var(--line-2);
        border-radius: 999px;
        font-size: 13px;
    }

    .admin-main .card {
        scroll-margin-top: 112px;
        padding: 16px;
    }
}

/* =====================================
   LOGIN – wazige kleurverloop-achtergrond
   (oranje, perzik, crème en beige uit de huisstijl)
   ===================================== */

body.login-page {
    background: #F4EFE8;
}

body.login-page::before {
    content: "";
    position: fixed;
    inset: -15%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(38% 42% at 14% 22%, #FF5A1F 0%, rgba(255, 90, 31, 0) 72%),
        radial-gradient(34% 38% at 88% 14%, #FFD9C7 0%, rgba(255, 217, 199, 0) 72%),
        radial-gradient(42% 46% at 82% 84%, #FF7A45 0%, rgba(255, 122, 69, 0) 70%),
        radial-gradient(40% 44% at 22% 88%, #D8CFC3 0%, rgba(216, 207, 195, 0) 72%),
        radial-gradient(30% 34% at 52% 50%, #FBE3D6 0%, rgba(251, 227, 214, 0) 75%),
        #F4EFE8;
    filter: blur(70px);
}

.login-page .login {
    position: relative;
    z-index: 1;
}

.login-page .login-card {
    padding: 28px 24px 24px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--panel) 84%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(20, 22, 31, 0.18);
}

/* Het loginvak is altijd licht, ook in het donkere thema. */
.login-page .login-card {
    --panel: #FBF8F4;
    --panel-2: #FFFFFF;
    --line: #DDD4C8;
    --line-2: #CFC6BA;
    --text: #14161F;
    --muted: #5A6472;
    --field: #FFFFFF;
    --danger: #B3261E;
    color: var(--text);
    color-scheme: light;
}

/* Op de login altijd het donkere woord "Gravit" (ook op de gsm). */
.login-page .login-logo .brand-word-dark {
    display: block !important;
}

.login-page .login-logo .brand-word-light {
    display: none !important;
}

/* ---------- Knop "Admin" (alleen voor de admin) ---------- */

.admin-link[hidden] {
    display: none !important;
}

.admin-link {
    gap: 6px;
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 599px) {

    .admin-link {
        width: 40px;
        padding: 0 !important;
    }

    .admin-link .admin-label {
        display: none;
    }
}

/* Als app op de gsm: niet onder de klok/statusbalk schuiven. */
body {
    padding-top: env(safe-area-inset-top);
}
