/* Dashboard, auth en algemene UI van het platform */
:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --ink: #1c1c1a;
    --muted: #6b6a65;
    --line: #e4e2dc;
    --accent: #2d5bff;
    --accent-ink: #ffffff;
    --accent-soft: #e8edff;
    --green: #1e7f4f;
    --amber: #a1620b;
    --red: #c23b2a;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 20, 15, .04), 0 4px 16px rgba(20, 20, 15, .05);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: conic-gradient(from 210deg, var(--accent), #8a5cff, #ff7a59, var(--accent)); }
.topbar-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar-nav form { margin: 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head form { margin: 0; }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; border-color: #cfccc3; background: #fbfaf8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1f48e0; border-color: #1f48e0; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-button.danger { color: var(--red); font-size: 13px; }

/* Forms */
.form { display: grid; gap: 14px; }
.form-wide { max-width: 760px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
    width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 400 15px var(--font); color: var(--ink);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: 8px 0 0 8px; }
.input-suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: #f2f1ed; color: var(--muted); font-weight: 400; white-space: nowrap; }
.input-sm { width: 80px !important; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form-inline label { font-weight: 500; font-size: 13px; }
.form-inline input:not([type=checkbox]) { height: 36px; }
.help { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.error { margin: -6px 0 0; font-size: 13px; color: var(--red); }

/* Cards & flash */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.flash { padding: 12px 16px; border-radius: 8px; background: #e7f5ec; color: #14532d; margin-bottom: 20px; font-size: 14px; }
.flash-error { background: #fbeae7; color: #7f1d1d; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #efede8; color: var(--muted); font-size: 12px; font-weight: 600; vertical-align: 1px; }
.badge-green { background: #e3f3e9; color: var(--green); }
.badge-amber { background: #fbf0dc; color: var(--amber); }

/* Auth */
.auth-body { background: radial-gradient(1200px 600px at 10% -10%, #e5ebff 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ffe9e0 0, transparent 60%), var(--bg); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 24px; }
.auth-card .form { margin-top: 22px; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* Dashboard */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.site-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.site-card-swatch { height: 110px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); }
.site-card-swatch span { font-size: 40px; font-weight: 800; color: rgba(255,255,255,.9); }
.site-card-body { padding: 16px 18px 4px; flex: 1; }
.site-card-body h2 { margin: 0; }
.site-card-body h2 a { color: var(--ink); }
.site-card-body p { margin: 4px 0; }
.site-card-actions { padding: 12px 18px 18px; }

/* Nieuwe site: templates */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.template-option { position: relative; display: grid !important; gap: 4px !important; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400 !important; }
.template-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.template-option input { position: absolute; opacity: 0; }
.template-preview { display: grid; gap: 5px; padding: 8px; height: 110px; margin-bottom: 6px; border-radius: 6px; background: #f4f3ef; }
.tp-bar { height: 8px; width: 40%; border-radius: 3px; background: #d8d5cd; }
.tp-hero { border-radius: 4px; background: var(--c); }
.tp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; height: 22px; }
.tp-row i { border-radius: 3px; background: #e2dfd7; }

/* Site beheren */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.two-col .card + .card { margin-top: 0; }
.page-list { list-style: none; margin: 0 0 16px; padding: 0; }
.page-list > li { border-top: 1px solid var(--line); }
.page-list > li:first-child { border-top: 0; }
.page-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.row-actions { display: flex; gap: 6px; }
.page-settings { padding: 4px 0 16px; display: grid; gap: 10px; }
.add-page { padding-top: 14px; border-top: 1px solid var(--line); }
.add-page input { flex: 1; min-width: 180px; }
.danger-zone { margin-top: 32px; font-size: 14px; color: var(--muted); }
.danger-zone summary { cursor: pointer; }
.danger-zone .form { max-width: 420px; margin-top: 12px; }

@media (max-width: 800px) {
    .two-col { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
    .topbar-nav .muted { display: none; }
    .container { padding: 24px 16px 48px; }
    .page-row { flex-direction: column; align-items: flex-start; }
}
