:root {
    --bg: #0b1220;
    --bg-soft: #10182b;
    --panel: rgba(18, 24, 40, 0.88);
    --panel-strong: #141d31;
    --panel-hover: #1a2540;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #f5f7fb;
    --muted: #9eabc3;
    --muted-strong: #c7d0e2;

    --primary: #5b8cff;
    --primary-hover: #7aa0ff;
    --primary-soft: rgba(91, 140, 255, 0.16);

    --accent: #f3c969;
    --accent-soft: rgba(243, 201, 105, 0.12);

    --success: #33c27f;
    --danger: #e35d6a;
    --warning: #d9a93a;

    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.18);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.32);

    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius: 20px;
    --radius-lg: 24px;
    --sidebar-width: 290px;
    --topbar-height: 76px;
    --container: 1240px;
}

/* =========================
   RESET
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(91, 140, 255, 0.18), transparent 28%),
        radial-gradient(circle at right top, rgba(243, 201, 105, 0.08), transparent 22%),
        linear-gradient(180deg, #09101c 0%, #0b1220 100%);
    line-height: 1.5;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================
   ADMIN SHELL
========================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(20, 29, 49, 0.96) 0%, rgba(12, 18, 31, 0.98) 100%);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 18px 18px;
    overflow-y: auto;
    z-index: 1200;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
    border-radius: 999px;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo span {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-logo strong {
    font-size: 1.28rem;
    line-height: 1.15;
    color: var(--text);
    font-weight: 800;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-title {
    display: block;
    padding: 0 10px 4px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 0.96rem;
    font-weight: 650;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.sidebar-nav a.is-active {
    color: #fff;
    background: linear-gradient(180deg, rgba(91, 140, 255, 0.22), rgba(91, 140, 255, 0.11));
    border-color: rgba(91, 140, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 16, 0.58);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 1100;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.main-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 28px;
    background: rgba(11, 18, 32, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-title {
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.01em;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.15;
}

.topbar-user__name {
    font-size: 0.95rem;
    font-weight: 750;
    color: var(--text);
}

.topbar-user__role {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.hamburger {
    display: none;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    transition: 0.2s ease;
}

.hamburger:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--border-strong);
}

/* =========================
   CONTENT WRAPPERS
========================= */

.page-wrap {
    width: min(100% - 40px, var(--container));
    margin: 32px auto 18px;
}

.hero,
.content-card,
.auth-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.018));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.content-card {
    padding: 30px;
}

.hero {
    padding: 48px;
    min-height: 420px;
    display: flex;
    align-items: center;
}

.hero__content {
    max-width: 760px;
}

.auth-section {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 34px;
}

.section-heading {
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 8px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(243, 201, 105, 0.22);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* =========================
   TYPOGRAPHY
========================= */

h1,
h2,
h3 {
    margin: 0 0 14px;
    line-height: 1.08;
    color: var(--text);
}

h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 850;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.24rem;
    font-weight: 800;
}

h3 {
    font-size: 1.02rem;
    font-weight: 760;
}

p {
    margin: 0;
    line-height: 1.75;
    color: var(--muted);
    font-size: 1rem;
}

/* =========================
   BUTTONS
========================= */

.hero__actions,
.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-weight: 750;
    transition: 0.2s ease;
    cursor: pointer;
}

.btn--primary {
    background: linear-gradient(180deg, var(--primary) 0%, #4f7af0 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(91, 140, 255, 0.22);
}

.btn--primary:hover {
    background: linear-gradient(180deg, var(--primary-hover) 0%, #628cfb 100%);
    transform: translateY(-1px);
}

.btn--ghost {
    background: rgba(255,255,255,0.02);
    border-color: var(--border);
    color: var(--text);
}

.btn--ghost:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-strong);
}

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

.btn--danger:hover {
    filter: brightness(1.06);
}

.btn--warning {
    background: var(--warning);
    color: #111;
}

.btn--warning:hover {
    filter: brightness(1.06);
}

.btn--small {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
}

/* =========================
   FORMS
========================= */

.form-grid {
    margin-top: 24px;
}

.form-row {
    margin: 0;
}

.form-row + .form-row {
    margin-top: 18px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.form-grid-2 .form-row {
    margin: 0;
}

label {
    display: block;
    min-height: 24px;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 650;
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 44px;
    background-color: rgba(255,255,255,0.035);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f5f7fb' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.1l3.71-3.87a.75.75 0 111.08 1.04l-4.24 4.42a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

select option {
    background: #141c2e;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(91, 140, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
    background: rgba(255,255,255,0.05);
}

input::placeholder,
textarea::placeholder {
    color: #8c97ac;
}

.checkbox-row {
    display: flex;
    align-items: end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-weight: 650;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
    transform: scale(1.12);
    accent-color: var(--primary);
}

/* =========================
   FLASHES
========================= */

.flash {
    width: min(100% - 40px, var(--container));
    margin: 16px auto 0;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.flash--error {
    background: rgba(227, 93, 106, 0.16);
    border: 1px solid rgba(227, 93, 106, 0.3);
    color: #ffd6db;
}

.flash--success {
    background: rgba(51, 194, 127, 0.16);
    border: 1px solid rgba(51, 194, 127, 0.28);
    color: #d8ffeb;
}

/* =========================
   GENERIC COMPONENTS
========================= */

.empty-state {
    padding: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.02);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-tile {
    display: block;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    transition: 0.2s ease;
}

.admin-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(91, 140, 255, 0.35);
    background: rgba(91, 140, 255, 0.06);
}

.admin-tile h2 {
    margin-bottom: 8px;
}

.table-wrap {
    overflow-x: auto;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    margin-top: auto;
    padding: 24px 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.site-footer__brand,
.site-footer__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-footer__brand strong {
    color: var(--text);
    font-size: 0.98rem;
}

.site-footer__brand span,
.site-footer__meta span {
    color: var(--muted);
    font-size: 0.9rem;
}

/* =========================
   FLASH UPGRADE
========================= */

.flash {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;

    width: min(100% - 40px, 520px);
    margin: 16px auto;

    padding: 16px 18px;
    border-radius: 16px;

    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);

    font-weight: 600;

    box-shadow: 0 18px 40px rgba(0,0,0,0.25);

    animation: flash-in 0.4s ease;
    overflow: hidden;
}

/* kleuren */
.flash--success {
    background: linear-gradient(180deg, rgba(51,194,127,0.18), rgba(51,194,127,0.08));
    border-color: rgba(51,194,127,0.35);
}

.flash--error {
    background: linear-gradient(180deg, rgba(227,93,106,0.18), rgba(227,93,106,0.08));
    border-color: rgba(227,93,106,0.35);
}

/* icon */
.flash__icon {
    font-size: 1.2rem;
}

/* text */
.flash__content {
    flex: 1;
    line-height: 1.5;
}

/* progress bar */
.flash__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(255,255,255,0.2);
    transform-origin: left;
    animation: flash-progress 3s linear forwards;
}

/* hide animatie */
.flash.is-hiding {
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.4s ease;
}

/* hover effect */
.flash:hover {
    transform: translateY(-2px);
}

/* animaties */
@keyframes flash-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flash-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .hamburger {
        display: inline-flex;
    }

    .page-wrap {
        width: min(100% - 24px, var(--container));
        margin-top: 24px;
    }

    .flash {
        width: min(100% - 24px, var(--container));
    }
}

@media (max-width: 760px) {
    .hero {
        padding: 26px;
        min-height: auto;
    }

    .content-card,
    .auth-card {
        padding: 22px;
    }

    .admin-grid,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .site-footer {
        padding: 18px 16px;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .topbar-user {
        display: none;
    }
}