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

:root {
    --color-primary: #3d2e5c;
    --color-primary-light: #4e3d6e;
    --color-accent: #7c6baa;
    --color-accent-soft: #a594d4;
    --color-accent-subtle: rgba(124, 107, 170, 0.08);
    --color-bg: #f7f6fa;
    --color-white: #ffffff;
    --color-text: #1e1833;
    --color-text-muted: #5e5574;
    --color-border: #e8e5f0;
    --color-border-light: #f0eef5;
    --color-success: #4a9d6e;
    --color-warning: #c49532;
    --color-danger: #c45050;
    --sidebar-width: 248px;
    --font-sans: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(45, 38, 64, 0.04);
    --shadow: 0 1px 4px rgba(45, 38, 64, 0.06);
}

/* ===== 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.875rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-primary); }

/* ===== 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-white);
    border-right: 1px solid var(--color-border);
    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.35rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.3px;
}

.sidebar-subtitle {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    margin-top: 1px;
    letter-spacing: 0.2px;
}

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

.sidebar-section {
    padding: 1.15rem 1.25rem 0.3rem;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    color: #3d3455;
    text-decoration: none;
    font-size: 0.84rem;
    border-left: 2.5px solid transparent;
    transition: all 0.12s ease;
    font-weight: 450;
}

.sidebar-link:hover {
    background: var(--color-accent-subtle);
    color: var(--color-primary);
}

.sidebar-link.active {
    background: var(--color-accent-subtle);
    color: var(--color-primary);
    border-left-color: var(--color-accent);
    font-weight: 550;
}

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

.sidebar-link.active i,
.sidebar-link:hover i {
    opacity: 1;
}

.sidebar-footer {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.sidebar-logout {
    font-size: 0.78rem;
    padding: 0.3rem 0;
}

/* ===== Top bar (mobile) ===== */
.topbar {
    padding: 0.7rem 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: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.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.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ===== Stats cards ===== */
.stat-card {
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

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

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

.stat-icon {
    font-size: 1.35rem;
    color: var(--color-accent-soft);
    opacity: 0.8;
}

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

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

.table thead th {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    padding: 0.65rem 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.65rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border-light);
}

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

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

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

.badge-actief { background: #ddf3e4; color: #1e6e3d; }
.badge-inactief { background: #fef6d8; color: #7a5f12; }
.badge-opgezegd { background: #fce0e0; color: #8b2c2c; }
.badge-opleiding { background: #dbeafe; color: #2a4a7a; }
.badge-actief_betalend { background: #ddf3e4; color: #1e6e3d; }
.badge-actief_niet_betalend { background: #fef6d8; color: #7a5f12; }
.badge-erelid { background: #ece4f6; color: #3d2a5e; }
.badge-niet_actief { background: #fce0e0; color: #8b2c2c; }
.badge-gepland { background: #dbeafe; color: #2a4a7a; }
.badge-bevestigd { background: #ddf3e4; color: #1e6e3d; }
.badge-afgelopen { background: #eae8f0; color: #4a4360; }
.badge-geannuleerd { background: #fce0e0; color: #8b2c2c; }
.badge-aangemeld { background: #dbeafe; color: #2a4a7a; }
.badge-betaald { background: #ddf3e4; color: #1e6e3d; }
.badge-aanwezig { background: #ece4f6; color: #3d2a5e; }

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

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

.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(124, 107, 170, 0.3);
}

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

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

/* ===== Forms ===== */
.form-control,
.form-select {
    border-color: var(--color-border);
    border-radius: var(--radius);
    font-size: 0.86rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent-soft);
    box-shadow: 0 0 0 0.2rem rgba(124, 107, 170, 0.12);
}

.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.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    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: linear-gradient(135deg, #f0ecf6 0%, var(--color-bg) 50%, #ede8f4 100%);
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 24px rgba(61, 46, 92, 0.07);
}

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

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

/* ===== Member photo ===== */
.member-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px 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: 2.5px solid var(--color-border);
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--radius);
    font-size: 0.85rem;
    border: none;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    }

    .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: var(--color-accent-subtle); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.35;
}

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