/* ============================================
   Muziekschool Boekingssysteem — Stijlen
   ============================================ */

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

:root {
    --primary: #6B21A8;
    --primary-light: #8B5CF6;
    --primary-dark: #581C87;
    --secondary: #06B6D4;
    --secondary-light: #22D3EE;
    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #10B981;
    --success-bg: #ECFDF5;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

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

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--header-height);
}

.sidebar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--border-light);
    color: var(--text);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}

.nav-link svg,
.nav-link .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-link.active svg,
.nav-link.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.sidebar-user-name {
    font-weight: 500;
    color: var(--text);
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Top Bar === */
.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: var(--text);
}

.hamburger:hover {
    background: var(--border-light);
}

.hamburger svg {
    width: 22px;
    height: 22px;
    display: block;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* === Page Content === */
.page-content {
    padding: 24px;
    flex: 1;
}

/* === Cards === */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* === Dashboard Stats === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card-sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* === Tables === */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

table th,
table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--border-light);
    white-space: nowrap;
}

table tr:hover {
    background: var(--border-light);
}

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

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-muted {
    background: var(--border-light);
    color: var(--text-muted);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

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

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

.btn-danger:hover {
    background: #DC2626;
    color: #fff;
}

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

.btn-success:hover {
    background: #059669;
    color: #fff;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 6px 8px;
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* === Flash Messages === */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.flash-error {
    background: var(--danger-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.flash-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.flash-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* === Action Buttons in Table === */
.actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 16px;
}

/* === Login Page === */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.auth-logo {
    display: block;
    max-height: 60px;
    width: auto;
    margin: 0 auto 24px;
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
}

.auth-error {
    background: var(--danger-bg);
    color: #991B1B;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    border: 1px solid #FECACA;
}

/* === Mobile Overlay === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

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

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

    .sidebar-overlay.open {
        display: block;
    }

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

    .hamburger {
        display: block;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

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

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .actions {
        flex-direction: column;
        gap: 4px;
    }

    .actions .btn-sm {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px 20px;
    }
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.tab:hover {
    color: var(--text);
    border-bottom-color: var(--border);
}

.tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* === Settings Logo Preview === */
.settings-logo-preview {
    max-height: 50px;
    width: auto;
    margin-bottom: 8px;
    display: block;
}

/* === Utilities === */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
