/* ============================================================
   VoorraadBeheer CMS – Dark Industrial Theme
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #0d0f12;
    --sidebar-border: #1e2228;
    --brand-accent: #f59e0b;
    --brand-accent-dim: rgba(245,158,11,0.15);
    --surface-1: #111318;
    --surface-2: #161a20;
    --surface-3: #1c2128;
    --text-primary: #e8eaf0;
    --text-secondary: #8892a4;
    --text-muted: #525c6e;
    --border-color: #1e2530;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;
    --topbar-height: 60px;
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface-1);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .user-info .user-avatar { margin: 0; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--sidebar-border);
}
.brand-icon {
    width: 36px; height: 36px;
    background: var(--brand-accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #000; font-size: 18px; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 15px; color: var(--text-primary); white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

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

.nav-section {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 12px 16px 4px;
    white-space: nowrap;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-item:hover { background: var(--surface-3); color: var(--text-primary); }
.nav-item.active {
    background: var(--brand-accent-dim);
    color: var(--brand-accent);
    border-left-color: var(--brand-accent);
    font-weight: 500;
}
.nav-item i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-accent);
    color: #000; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
    color: var(--text-muted); font-size: 18px;
    text-decoration: none; flex-shrink: 0;
    transition: color 0.15s;
}
.btn-logout:hover { color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; display: flex; flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}
.main-content.expanded { margin-left: 64px; }

.topbar {
    height: var(--topbar-height);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
}
.btn-toggle-sidebar {
    background: none; border: none; color: var(--text-secondary);
    font-size: 22px; cursor: pointer; padding: 4px;
    transition: color 0.15s;
}
.btn-toggle-sidebar:hover { color: var(--text-primary); }
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar-date { font-size: 13px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 24px; flex: 1; }

/* ---- CARDS ---- */
.card {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.card-header {
    background: var(--surface-3);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: border-color 0.2s, transform 0.15s;
}
.stat-card:hover { border-color: var(--brand-accent); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.amber  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stat-icon.green  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.stat-icon.red    { background: rgba(239,68,68,0.15);   color: #ef4444; }
.stat-icon.blue   { background: rgba(56,189,248,0.15);  color: #38bdf8; }
.stat-icon.purple { background: rgba(168,85,247,0.15);  color: #a855f7; }

.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; font-family: 'JetBrains Mono', monospace; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- TABLES ---- */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
    font-size: 13.5px;
}
.table th {
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    border-color: var(--border-color);
    white-space: nowrap;
}
.table td { border-color: var(--border-color); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--surface-3); }

/* ---- FORMS ---- */
.form-control, .form-select {
    background: var(--surface-3);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    background: var(--surface-3);
    border-color: var(--brand-accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.input-group-text { background: var(--surface-3); border-color: var(--border-color); color: var(--text-muted); }

/* ---- BUTTONS ---- */
.btn-primary { background: var(--brand-accent); border-color: var(--brand-accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: #d97706; border-color: #d97706; color: #000; }
.btn-outline-primary { border-color: var(--brand-accent); color: var(--brand-accent); }
.btn-outline-primary:hover { background: var(--brand-accent); color: #000; }
.btn { font-size: 13.5px; }

/* ---- BADGES ---- */
.badge { font-size: 11px; font-weight: 500; }

/* ---- MONO TEXT ---- */
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ---- ALERT ---- */
.alert { font-size: 14px; }

/* ---- DIFFERENCE DISPLAY ---- */
.diff-positive { color: var(--success); font-family: 'JetBrains Mono', monospace; }
.diff-negative { color: var(--danger); font-family: 'JetBrains Mono', monospace; }
.diff-zero { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--brand-accent);
    background: var(--brand-accent-dim);
}
.upload-zone i { font-size: 40px; color: var(--text-muted); margin-bottom: 12px; }

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-1);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(245,158,11,0.05) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(56,189,248,0.03) 0%, transparent 60%);
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 40px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 42px; color: var(--brand-accent); }
.login-logo h1 { font-size: 22px; font-weight: 700; margin-top: 8px; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { width: 0; border: none; }
    .sidebar.mobile-open { width: var(--sidebar-width); }
    .main-content { margin-left: 0; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-1); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2c3341; }

/* ---- PAGE HEADERS ---- */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; margin: 0; }
.page-header p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ---- PROGRESS BARS ---- */
.progress { background: var(--surface-3); }

/* ---- VOORRAAD INDICATOR ---- */
.voorraad-bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 4px; }
.voorraad-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
