/* ===== PsyHAG — Professional Member Database Styles ===== */

:root {
    --color-primary: #1a2332;
    --color-primary-light: #243044;
    --color-accent: #6c63ff;
    --color-accent-soft: #8b85ff;
    --color-bg: #f4f5f7;
    --color-white: #ffffff;
    --color-text: #2d3748;
    --color-text-muted: #718096;
    --color-border: #e2e8f0;
    --color-success: #38a169;
    --color-warning: #d69e2e;
    --color-danger: #e53e3e;
    --sidebar-width: 250px;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    color: #cbd5e0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.2s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 0.5px;
}

.sidebar-subtitle {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-section {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-white);
}

.sidebar-link.active {
    background: rgba(108, 99, 255, 0.1);
    color: var(--color-white);
    border-left-color: var(--color-accent);
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e0;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.sidebar-logout {
    font-size: 0.8rem;
    padding: 0.35rem 0;
}

/* ===== Top bar (mobile) ===== */
.topbar {
    padding: 0.75rem 1rem;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== Cards & Containers ===== */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

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

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

/* ===== Stats cards ===== */
.stat-card {
    padding: 1.25rem;
    border-radius: 8px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
}

/* ===== Tables ===== */
.table-container {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table thead th {
    background: #f8f9fb;
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table thead th a {
    color: inherit;
    text-decoration: none;
}

.table thead th a:hover {
    color: var(--color-primary);
}

.table tbody td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.table tbody tr:hover {
    background: #f8f9fb;
}

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

/* ===== Badges ===== */
.badge-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-actief { background: #c6f6d5; color: #22543d; }
.badge-inactief { background: #fefcbf; color: #744210; }
.badge-opgezegd { background: #fed7d7; color: #742a2a; }
.badge-opleiding { background: #bee3f8; color: #2a4365; }
.badge-actief_betalend { background: #c6f6d5; color: #22543d; }
.badge-actief_niet_betalend { background: #fefcbf; color: #744210; }
.badge-erelid { background: #e9d8fd; color: #44337a; }
.badge-niet_actief { background: #fed7d7; color: #742a2a; }
.badge-gepland { background: #bee3f8; color: #2a4365; }
.badge-bevestigd { background: #c6f6d5; color: #22543d; }
.badge-afgelopen { background: #e2e8f0; color: #4a5568; }
.badge-geannuleerd { background: #fed7d7; color: #742a2a; }
.badge-aangemeld { background: #bee3f8; color: #2a4365; }
.badge-betaald { background: #c6f6d5; color: #22543d; }
.badge-aanwezig { background: #e9d8fd; color: #44337a; }

/* ===== Buttons ===== */
.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: #5a52e0;
    border-color: #5a52e0;
}

.btn-outline-primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-outline-primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* ===== Forms ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.15);
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    max-width: 220px;
}

/* ===== Detail page ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 0.5rem 0;
}

.detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.detail-value {
    color: var(--color-text);
    font-weight: 500;
}

/* ===== Login ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

/* ===== Member photo ===== */
.member-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
}

.member-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 2rem;
    border: 3px solid var(--color-border);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .filter-bar .form-control,
    .filter-bar .form-select {
        max-width: none;
        flex: 1;
        min-width: 150px;
    }
}

/* ===== Utilities ===== */
.text-accent { color: var(--color-accent); }
.bg-accent-soft { background: rgba(108, 99, 255, 0.08); }
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}