/* ===== Thomit Urenregistratie - Stylesheet ===== */

:root {
    --bg-primary: #0c1222;
    --bg-secondary: #151d30;
    --bg-tertiary: #1a2540;
    --bg-card: #182035;
    --bg-hover: #1f2b45;
    --border: #263354;
    --border-light: #2a3a5c;
    --text-primary: #e8ecf4;
    --text-secondary: #a0aec0;
    --text-muted: #6b7a94;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-subtle: rgba(59, 130, 246, 0.12);
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.12);
    --info: #06b6d4;
    --info-subtle: rgba(6, 182, 212, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

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

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

/* ===== LOGIN PAGES ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0a0f1e 100%);
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .logo-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.login-logo h1 { font-size: 1.3rem; font-weight: 600; color: var(--text-primary); }

.login-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.qr-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.qr-code {
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.secret-box {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.secret-box small { color: var(--text-muted); }

.secret-code {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
    font-weight: 600;
}

.link-muted {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.link-muted:hover { color: var(--text-secondary); }

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

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.app-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-nav { flex: 1; padding: 0 0.75rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent-primary); }
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-actions .btn { flex: 1; justify-content: center; }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    max-width: calc(100% - 260px);
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

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

.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-nav span {
    font-weight: 600;
    min-width: 130px;
    text-align: center;
}

/* ===== TABS & FILTERS ===== */
.view-tabs, .user-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn, .filter-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn:hover, .filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active, .filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.stat-card.highlight { border-color: var(--accent-primary); }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

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

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

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

select { cursor: pointer; }
select option { background: var(--bg-secondary); }

.input-code {
    text-align: center;
    font-size: 1.5rem !important;
    letter-spacing: 0.3em;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.inline-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.inline-form input { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

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

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:hover { background: var(--bg-hover); }

.nowrap { white-space: nowrap; }
.notes-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }

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

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-blue { background: var(--accent-subtle); color: var(--accent-primary); }
.badge-green { background: var(--success-subtle); color: var(--success); }
.badge-yellow { background: var(--warning-subtle); color: var(--warning); }
.badge-red { background: var(--danger-subtle); color: var(--danger); }

/* ===== ALERTS ===== */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--danger-subtle);
    color: #fca5a5;
    border: 1px solid #7f1d1d;
}

.alert-success {
    background: var(--success-subtle);
    color: #6ee7b7;
    border: 1px solid #064e3b;
}

.alert-info {
    background: var(--info-subtle);
    color: #67e8f9;
    border: 1px solid #164e63;
}

.alert-warning {
    background: var(--warning-subtle);
    color: #fcd34d;
    border: 1px solid #78350f;
}

.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.success { color: var(--success); }

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filters .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

.filters .btn { align-self: flex-end; }

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.quick-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.5rem;
}

.favorite-btn {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-sm { max-width: 400px; }

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

.modal-header h2 { font-size: 1.15rem; margin: 0; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ===== SETTINGS ===== */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.settings-label { font-weight: 600; margin-bottom: 0.25rem; }
.settings-desc { font-size: 0.8rem; color: var(--text-muted); }

.info-box {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ===== USER INFO ===== */
.user-info {
    display: flex;
    align-items: center;
}

/* ===== AUDIT LOG ===== */
.audit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.audit-item:last-child { border-bottom: none; }

.audit-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    min-width: 100px;
}

.audit-action { flex: 1; }

/* ===== LIST ITEMS ===== */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

/* ===== CHART ===== */
.bar-chart {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    height: 160px;
    padding: 1rem 0;
    justify-content: center;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 120px;
}

.bar {
    width: 24px;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    cursor: pointer;
}

.bar-thomas { background: var(--accent-primary); }
.bar-omed { background: var(--success); }

.bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }

/* ===== MOBILE ===== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .form-row-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open { transform: translateX(0); }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
        padding-top: 4.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .filters { flex-direction: column; }
    .filters .form-group { min-width: 100%; width: 100%; }
    .filters .btn { width: 100%; }
    
    .form-row-2, .form-row-4 { grid-template-columns: 1fr; }
    
    .modal { padding: 1.25rem; }
    
    .quick-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .export-buttons {
        width: 100%;
    }
    
    .export-buttons .btn { flex: 1; }
}

/* ===== UTILITIES ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== LOADING ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
