/* =============================================
   WSC de Brekken ERP — Light Theme
   Huisstijl: #0077be (primair), #c2d3ee (sub)
   ============================================= */

:root {
    --bg-body: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-surface-2: #f7f8fa;
    --bg-surface-3: #eef0f4;
    --bg-hover: #f0f4f8;
    --bg-active: #e8edf3;
    --border: #e0e4ea;
    --border-light: #eaecf0;
    --text: #1a2030;
    --text-muted: #5f6880;
    --text-dim: #9aa0b0;
    --accent: #0077be;
    --accent-hover: #005f99;
    --accent-bg: #c2d3ee;
    --accent-bg-light: rgba(0, 119, 190, 0.08);
    --accent-border: rgba(0, 119, 190, 0.25);
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.15s ease;
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

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

/* === LOGIN === */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-body); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { max-height: 48px; max-width: 260px; width: auto; height: auto; }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; font-size: 14px; font-family: var(--font); color: var(--text); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 119, 190, 0.12); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600; font-family: var(--font); border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1.4; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(0, 119, 190, 0.2); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: 0 4px 12px rgba(0, 119, 190, 0.3); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: #ccd2da; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(220, 38, 38, 0.2); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.3); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; margin-bottom: 20px; border: 1px solid transparent; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(220, 38, 38, 0.15); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(22, 163, 74, 0.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(217, 119, 6, 0.15); }

/* === LAYOUT === */
.app-layout { min-height: 100vh; }

/* Topbar — Brekken blauw */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: #0077be; display: flex; align-items: center; padding: 0 24px; z-index: 200; gap: 16px; }
.topbar-left { display: flex; align-items: center; width: 236px; flex-shrink: 0; }
.topbar-title { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; }
.topbar-center { flex: 1; display: flex; justify-content: flex-end; margin-right: 8px; }
.topbar-search { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 0 14px; width: 100%; max-width: 320px; transition: all 0.2s; }
.topbar-search:focus-within { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.2); }
.topbar-search svg { color: rgba(255,255,255,0.5); flex-shrink: 0; }
.topbar-search input { background: none; border: none; outline: none; color: #fff; font-size: 13.5px; font-family: var(--font); padding: 9px 0; width: 100%; }
.topbar-search input::placeholder { color: rgba(255,255,255,0.5); }
.topbar-search kbd { font-family: var(--font); font-size: 11px; color: rgba(255,255,255,0.5); background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 5px; padding: 2px 7px; white-space: nowrap; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar-page-actions { margin-right: 12px; }
.topbar-icon-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: rgba(255,255,255,0.7); transition: all 0.15s; position: relative; cursor: pointer; }
.topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.topbar-notif-badge { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #0077be; }
.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: 6px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.15); }
.topbar-user-avatar { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.topbar-user-role { font-size: 11px; color: rgba(255,255,255,0.55); }
.topbar-logout-btn { margin-left: 2px; }
.topbar-logout-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* Sidebar — licht, fixed left, below topbar */
.sidebar { width: 260px; background: #fff; border-right: 1px solid #e2e7ef; display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 100; }
.sidebar-brand { padding: 24px 24px 20px; border-bottom: 1px solid #e2e7ef; }
.sidebar-brand img { max-height: 38px; width: auto; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-section { padding: 20px 12px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #9ca8b8; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: #6b7a8d; font-size: 13.5px; font-weight: 500; transition: all 0.2s ease; border-radius: 8px; margin-bottom: 2px; }
.sidebar-link:hover { background: #f7f8fa; color: #3d4c5e; }
.sidebar-link.active { background: rgba(0, 119, 190, 0.05); color: #0077be; font-weight: 600; }
.sidebar-link .sidebar-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #f3f5f8; transition: all 0.2s ease; flex-shrink: 0; }
.sidebar-link:hover .sidebar-icon { background: #edf0f5; }
.sidebar-link.active .sidebar-icon { background: rgba(0, 119, 190, 0.08); }
.sidebar-link svg { width: 17px; height: 17px; opacity: 0.45; flex-shrink: 0; }
.sidebar-link:hover svg { opacity: 0.65; }
.sidebar-link.active svg { opacity: 0.85; color: #0077be; }

/* Collapsible sidebar menu */
.sidebar-collapse-toggle { position: relative; }
.sidebar-collapse-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-dim); background: var(--bg-surface-3); padding: 1px 7px; border-radius: 8px; }
.sidebar-collapse-arrow { margin-left: 4px; opacity: 0.4; transition: transform 0.2s ease; flex-shrink: 0; }
.sidebar-collapse.open .sidebar-collapse-arrow { transform: rotate(180deg); }
.sidebar-submenu { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.sidebar-collapse.open .sidebar-submenu { max-height: 500px; }
.sidebar-sublink { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 58px; font-size: 13px; color: #7a8694; transition: all 0.15s; border-radius: 6px; margin: 1px 12px; text-decoration: none; }
.sidebar-sublink:hover { background: #f7f8fa; color: #3d4c5e; }
.sidebar-sublink.active { background: rgba(0, 119, 190, 0.05); color: #0077be; font-weight: 600; }
.sidebar-subcount { margin-left: auto; font-size: 11px; font-weight: 600; color: #9ca8b8; min-width: 20px; text-align: right; }
.sidebar-sublink.active .sidebar-subcount { color: #0077be; }
.sidebar-subdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.badge-aangemeld-dot { background: #0077be; }
.badge-bevestigd-dot { background: #005f99; }
.badge-betaald-dot { background: #16a34a; }
.badge-ingepland-dot { background: #7c3aed; }
.badge-in_stalling-dot { background: #d97706; }
.badge-werkzaamheden-dot { background: #ea580c; }
.badge-gereed-dot { background: #16a34a; }
.badge-te_water-dot { background: #15803d; }
.badge-afgerond-dot { background: #9ca8b8; }

/* Main content — offset for topbar + sidebar */
.main-content { margin-left: 260px; padding-top: 56px; min-height: 100vh; }
.page-content { padding: 28px; }

/* === CARDS === */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }

/* === TABLES === */
.table-wrapper { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; background: var(--bg-surface-2); }
table.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border-light); color: var(--text-muted); }
table.data-table tr:hover td { background: var(--bg-hover); color: var(--text); }
table.data-table tr:last-child td { border-bottom: none; }

/* === BADGES === */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 11px; font-weight: 700; border-radius: 100px; letter-spacing: 0.3px; white-space: nowrap; }
.badge-aangemeld { background: rgba(0, 119, 190, 0.1); color: #0077be; }
.badge-bevestigd { background: rgba(0, 119, 190, 0.15); color: #005f99; }
.badge-betaald { background: var(--success-bg); color: var(--success); }
.badge-ingepland { background: rgba(124, 58, 237, 0.08); color: #7c3aed; }
.badge-in_stalling { background: var(--warning-bg); color: var(--warning); }
.badge-werkzaamheden { background: rgba(234, 88, 12, 0.08); color: #ea580c; }
.badge-gereed { background: rgba(22, 163, 74, 0.1); color: #16a34a; }
.badge-te_water { background: rgba(22, 163, 74, 0.15); color: #15803d; }
.badge-afgerond { background: rgba(0, 0, 0, 0.05); color: var(--text-dim); }

/* === STAT CARDS === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 6px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* === UTILITIES === */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
