/* ============================================================
   WijsThuis Beheer — gedeelde stylesheet
   Volgt de huisstijl van de marketingsite (donker & premium)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --teal: #3DA5B8;
    --teal-light: #67afb7;
    --green: #22C55E;
    --green-light: #82db5c;
    --red: #f87171;
    --red-dark: #dc2626;

    --bg: #0a0f16;
    --bg-raised: #0f1620;
    --sidebar-bg: #0d131c;
    --card-bg: rgba(255, 255, 255, 0.035);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(103, 175, 183, 0.45);

    --text-primary: #f2f6f9;
    --text-secondary: #a7b3c2;
    --text-muted: #6b7889;

    --gradient-brand: linear-gradient(120deg, var(--teal-light), var(--green-light));
    --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.35);
    --radius: 14px;

    --font-display: 'Outfit', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 50% 35% at 85% 0%, rgba(61, 165, 184, 0.08), transparent),
        radial-gradient(ellipse 40% 30% at 10% 100%, rgba(34, 197, 94, 0.05), transparent);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

::selection {
    background: rgba(61, 165, 184, 0.4);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

a {
    color: var(--teal-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Admin-layout: sidebar + main ===== */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    padding: 24px 18px;
    border-right: 1px solid var(--card-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.sidebar h2 {
    font-size: 1.05rem;
    margin-bottom: 24px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 26px;
    padding: 4px 6px;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-brand img {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.15;
}

.sidebar-brand .brand-text em {
    font-style: normal;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand .brand-text small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.sidebar nav a {
    display: block;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.93rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar nav a.active {
    background: linear-gradient(120deg, rgba(61, 165, 184, 0.16), rgba(34, 197, 94, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(61, 165, 184, 0.3);
    padding: 10px 13px;
}

.sidebar-divider {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--card-border);
}

.main {
    margin-left: 250px;
    flex: 1;
    padding: 32px 36px;
    min-width: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
}

.header h1 {
    font-size: 1.7rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 7px 14px;
    border-radius: 100px;
}

/* ===== Knoppen ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--gradient-brand);
    color: #06130b;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.2);
}

.btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.3);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-brand);
    color: #06130b;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary,
.btn.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--card-border-hover);
    filter: none;
}

.btn-danger,
.btn.btn-danger {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.4);
    color: var(--red);
    box-shadow: none;
}

.btn-danger:hover,
.btn.btn-danger:hover {
    background: rgba(220, 38, 38, 0.25);
    filter: none;
}

/* ===== Statistiekkaarten (dashboard) ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-border-hover);
}

.stat-card h3 {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.stat-card .number {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card.warning {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.05);
}

.stat-card.warning:hover {
    border-color: rgba(220, 38, 38, 0.6);
}

.stat-card .number.warning {
    background: none;
    -webkit-text-fill-color: var(--red);
    color: var(--red);
}

/* ===== Secties & tabellen ===== */
.recent-section,
.table-container,
.section,
.detail-container,
.form-container,
.content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 22px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.recent-section h3,
.section h3 {
    font-size: 1.05rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.subsection-title {
    margin: 22px 0 10px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-container,
.recent-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    white-space: nowrap;
}

th:first-child, td:first-child {
    white-space: normal;
}

th {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(103, 175, 183, 0.25);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.92rem;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: rgba(61, 165, 184, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

td a {
    font-weight: 500;
}

.stock-low {
    color: var(--red);
    font-weight: 700;
}

.stock-ok {
    color: var(--green-light);
    font-weight: 600;
}

/* ===== Formulieren ===== */
.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h2 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: var(--teal-light);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--teal-light);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(10, 15, 22, 0.55);
    border: 1.5px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7889' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

select option {
    background: var(--bg-raised);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(61, 165, 184, 0.14);
}

input[type="checkbox"],
input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--green);
    cursor: pointer;
}

.checkbox-item,
.checkbox-group,
.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

.checkbox-item label,
.checkbox-group label,
.radio-item label {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-top: 4px;
}

.conditional-field {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    border-left: 2px solid rgba(61, 165, 184, 0.4);
    background: rgba(61, 165, 184, 0.05);
    border-radius: 0 10px 10px 0;
}

.conditional-field.show {
    display: block;
}

.help-text,
.field-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.required {
    color: var(--red);
}

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

/* ===== Detailweergaven ===== */
.field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 24px;
}

.field {
    min-width: 0;
}

.field-label,
.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.field-value,
.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-word;
}

.field-value .empty,
.field-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

.detail-row {
    display: flex;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .detail-label {
    flex: 0 0 180px;
    margin-bottom: 0;
    align-self: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Meldingen ===== */
.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #fca5a5;
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.success {
    background: rgba(34, 197, 94, 0.09);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green-light);
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.info {
    text-align: center;
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Inloggen & verificatie ===== */
body.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background-image:
        radial-gradient(ellipse 55% 45% at 70% 20%, rgba(61, 165, 184, 0.12), transparent),
        radial-gradient(ellipse 45% 35% at 20% 85%, rgba(34, 197, 94, 0.07), transparent);
}

.login-container,
.verify-container,
.error-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-card);
}

.error-container {
    text-align: center;
    max-width: 520px;
}

.error-container h1 {
    margin-bottom: 14px;
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand img {
    height: 60px;
    width: auto;
    margin-bottom: 14px;
}

.auth-brand h1 {
    font-size: 1.5rem;
}

.auth-brand h1 span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.page-auth h1:not(.auth-brand h1) {
    text-align: center;
    margin-bottom: 26px;
    font-size: 1.5rem;
}

body.page-auth .btn {
    width: 100%;
    padding: 13px;
}

/* ===== Publieke intake-pagina's ===== */
body.page-public .container {
    display: block;
    max-width: 860px;
    margin: 0 auto;
    padding: 50px 24px 70px;
    min-height: auto;
}

body.page-public .header {
    display: block;
    text-align: center;
    border-bottom: none;
    margin-bottom: 36px;
    padding-bottom: 0;
}

body.page-public .header h1 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    margin-bottom: 10px;
}

body.page-public .header p {
    color: var(--text-secondary);
    font-size: 1.02rem;
}

body.page-public .section {
    margin-bottom: 20px;
}

body.page-public .form-container {
    padding: 30px 32px;
}

/* Intake succespagina */
.success-box {
    background: var(--card-bg);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 20px;
    padding: 44px 40px;
    text-align: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-card);
}

.checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(61, 165, 184, 0.2), rgba(34, 197, 94, 0.16));
    border: 1.5px solid rgba(34, 197, 94, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--green-light);
}

.success-box h1 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.success-box p {
    color: var(--text-secondary);
}

.email-highlight {
    color: var(--teal-light);
    font-weight: 600;
}

.next-steps {
    text-align: left;
    margin: 26px auto 0;
    max-width: 480px;
    background: rgba(61, 165, 184, 0.06);
    border: 1px solid rgba(61, 165, 184, 0.22);
    border-radius: 14px;
    padding: 22px 26px;
}

.next-steps h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--teal-light);
}

.next-steps ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

.next-steps li {
    margin-bottom: 8px;
    font-size: 0.93rem;
}

.contact-info {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-info a {
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        padding: 18px;
    }

    .main {
        margin-left: 0;
        padding: 22px 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .detail-row {
        flex-direction: column;
        gap: 2px;
    }

    .detail-row .detail-label {
        flex: none;
    }

    .header h1 {
        font-size: 1.4rem;
    }
}
