/* ============================================================
   BeslotenChat — huisstijl
   Palette: goud #c4a77d | donkergrijs #2d2d2d | achtergrond #f7f4ef
   Mobiel-eerst, geen externe fonts/CDN's
   ============================================================ */

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

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7f4ef;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: #a8874f;
    text-decoration: none;
}

a:hover,
a:focus {
    color: #8f6f3e;
    text-decoration: underline;
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    flex: 1 0 auto;
}

/* ---------- Topbalk / navigatie ---------- */

.topbar {
    background: #2d2d2d;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.topbar-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    margin-right: auto;
}

.logo:hover {
    text-decoration: none;
}

.logo-gold {
    color: #c4a77d;
}

.logo-dark {
    color: #e9e6e1;
}

.nav-toggle-check {
    display: none;
}

.nav-toggle {
    display: inline-block;
    background: transparent;
    border: 1px solid #c4a77d;
    color: #c4a77d;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.nav-toggle:hover {
    background: rgba(196, 167, 125, 0.15);
}

.main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0 0.25rem;
}

.nav-toggle-check:checked ~ .main-nav {
    display: flex;
}

.main-nav a {
    color: #e9e6e1;
    padding: 0.55rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    display: block;
}

.main-nav a:hover,
.main-nav a:focus {
    color: #c4a77d;
    text-decoration: none;
}

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1.25rem 1rem;
    color: #8a8378;
    font-size: 0.85rem;
    border-top: 1px solid #e6dfd4;
}

/* ---------- Kaarten / panels ---------- */

.card {
    background: #fff;
    border: 1px solid #e6dfd4;
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(45, 45, 45, 0.06);
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

/* ---------- Koppen ---------- */

h1 {
    font-size: 1.6rem;
    color: #2d2d2d;
}

h2 {
    font-size: 1.3rem;
    color: #2d2d2d;
}

/* ---------- Formulieren ---------- */

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #d5ccc0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 1rem;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #c4a77d;
    box-shadow: 0 0 0 3px rgba(196, 167, 125, 0.25);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #c4a77d;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.checkbox-row label {
    margin-bottom: 0;
    font-weight: 400;
}

.form-hint {
    font-size: 0.85rem;
    color: #8a8378;
    margin-top: 0.25rem;
}

/* ---------- Knoppen ---------- */

.btn {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    background: #fff;
    color: #2d2d2d;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn:focus {
    background: #2d2d2d;
    color: #fff;
    text-decoration: none;
}

.btn-primary {
    background: #c4a77d;
    border-color: #c4a77d;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #b0966b;
    border-color: #b0966b;
    color: #fff;
}

.btn-danger {
    background: #fff;
    border-color: #c0392b;
    color: #c0392b;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #c0392b;
    color: #fff;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Icon-knop (admin-acties) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #d5ccc0;
    border-radius: 6px;
    background: #fff;
    color: #2d2d2d;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
}

.icon-btn:hover,
.icon-btn:focus {
    border-color: #c4a77d;
    color: #a8874f;
    background: #faf7f1;
    text-decoration: none;
}

.icon-btn.danger:hover,
.icon-btn.danger:focus {
    border-color: #c0392b;
    color: #c0392b;
    background: #fdf3f2;
}

/* ---------- Meldingen ---------- */

.alert-error {
    background: #fdf0ee;
    border: 1px solid #e3b7b0;
    border-left: 4px solid #c0392b;
    color: #8c2f24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #f1f8ef;
    border: 1px solid #b9dcc0;
    border-left: 4px solid #3e8e51;
    color: #2c6b3c;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* ---------- Login-scherm ---------- */

.login-wrapper {
    max-width: 420px;
    margin: 3rem auto;
}

.login-card {
    background: #fff;
    border: 1px solid #e6dfd4;
    border-radius: 12px;
    padding: 2rem 1.75rem;
    box-shadow: 0 4px 16px rgba(45, 45, 45, 0.08);
}

.login-card .login-logo {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-card .login-logo .logo-gold {
    color: #c4a77d;
}

.login-card .login-logo .logo-dark {
    color: #2d2d2d;
}

.login-card p.login-intro {
    text-align: center;
    color: #8a8378;
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.login-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
}

/* ---------- Gesprekkenlijst ---------- */

.conversation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e6dfd4;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: #333;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.conversation-item:hover,
.conversation-item:focus {
    border-color: #c4a77d;
    box-shadow: 0 2px 8px rgba(196, 167, 125, 0.2);
    text-decoration: none;
}

.conversation-item .conversation-name {
    font-weight: 600;
    color: #2d2d2d;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item .conversation-time {
    font-size: 0.8rem;
    color: #8a8378;
    white-space: nowrap;
}

.type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f0e9dc;
    color: #8f6f3e;
    border: 1px solid #e0d4bd;
    white-space: nowrap;
}

.admin-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #2d2d2d;
    color: #c4a77d;
    white-space: nowrap;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* ---------- Avatars ---------- */

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c4a77d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}

.avatar-groot {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.profiel-foto-huidig {
    margin-bottom: 1rem;
}

.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 85%;
    align-self: flex-start;
}

.message-wrapper.own {
    align-self: flex-end;
}

.message-wrapper .message {
    max-width: 100%;
    min-width: 0;
}

.deelnemer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

/* ---------- Chatvenster ---------- */

.chat-messages {
    background: #fff;
    border: 1px solid #e6dfd4;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.message {
    max-width: 78%;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ddd6ca;
    align-self: flex-start;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.message.own {
    background: #c4a77d;
    border-color: #c4a77d;
    color: #fff;
    align-self: flex-end;
}

.message-meta {
    font-size: 0.72rem;
    color: #8a8378;
    margin-bottom: 0.15rem;
}

.message.own .message-meta {
    color: rgba(255, 255, 255, 0.85);
}

.chat-form {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
}

.chat-form textarea {
    flex: 1 1 auto;
    resize: vertical;
    min-height: 2.6rem;
    max-height: 10rem;
}

.chat-form .btn,
.chat-form .btn-primary {
    flex-shrink: 0;
}

/* ---------- Tabellen (admin) ---------- */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.92rem;
}

table.data-table th,
table.data-table td {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid #ece5d9;
    vertical-align: middle;
}

table.data-table th {
    background: #f2ede4;
    color: #2d2d2d;
    font-weight: 700;
    white-space: nowrap;
}

table.data-table tbody tr:hover {
    background: #faf7f1;
}

tr.row-inactive {
    background: #f0f0f0;
    color: #9a9a9a;
}

tr.row-inactive td {
    color: #9a9a9a;
}

.status-actief {
    color: #3e8e51;
    font-weight: 600;
}

.status-inactief {
    color: #c0392b;
    font-weight: 600;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell form {
    display: inline;
}

/* ---------- Modals ---------- */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 45, 45, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    border-top: 4px solid #c4a77d;
    max-width: 440px;
    width: 100%;
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal h3 {
    margin-top: 0;
    color: #2d2d2d;
}

.modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* ---------- Hulp-elementen ---------- */

.text-muted {
    color: #8a8378;
}

.text-small {
    font-size: 0.85rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin: 0;
}

.empty-state {
    text-align: center;
    color: #8a8378;
    padding: 2.5rem 1rem;
}

/* ---------- Desktop / bredere schermen ---------- */

@media (min-width: 700px) {
    .nav-toggle {
        display: none;
    }

    .main-nav {
        display: flex;
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        padding: 0;
    }

    .main-nav a {
        padding: 0.4rem 0.7rem;
        border-bottom: none;
        border-radius: 6px;
    }

    .main-nav a:hover,
    .main-nav a:focus {
        background: rgba(196, 167, 125, 0.15);
    }

    .container {
        padding-top: 2rem;
    }

    .login-wrapper {
        margin-top: 4.5rem;
    }
}
