:root {
    --bg-main: #070707;
    --bg-card: #121212;
    --bg-sidebar: #0a0a0a;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --text-main: #ffffff;
    --text-secondary: #888888;
    --border: #222222;
    --success: #10b981;
    --danger: #ef4444;
    --btn-text: #000000;
}

body.light-mode {
    --bg-main: #f4f5f7;
    --bg-card: #ffffff;
    --bg-sidebar: #111111;
    --text-main: #111827;
    --text-secondary: #4b5563;
    --border: #e5e7eb;
    --btn-text: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; transition: background 0.3s ease, color 0.3s ease; }

/* SINGLE PAGE VIEW MANAGEMENT */
.view { display: none !important; }
.view.active { display: block !important; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* MOBIELE TOPBAR & OVERLAY */
.mobile-top-bar { display: none; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1040; }
.close-sidebar-mobile { display: none; }

/* Sidebar & Navigatie */
.sidebar { width: 250px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 25px 0 0 0; z-index: 1050; transition: transform 0.3s ease; }
.logo { padding: 0 25px 30px; display: flex; align-items: center; justify-content: space-between; }
#custom-logo-container { width: 100%; display: flex; align-items: center; justify-content: flex-start; }
#custom-brand-logo { max-height: 48px; max-width: 190px; object-fit: contain; }
.logo-text { font-size: 26px; font-weight: 800; letter-spacing: 2px; line-height: 1; color: #ffffff; }
.logo-text span { color: var(--accent); }

nav { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 0 15px; }
nav a { color: var(--text-secondary); text-decoration: none; padding: 12px 15px; display: flex; align-items: center; gap: 15px; border-radius: 8px; transition: all 0.2s; font-size: 0.9em; font-weight: 500; }
nav a:hover { color: #ffffff; background: rgba(255,255,255,0.05); }
nav a.active { color: var(--accent); border: 1px solid var(--accent); background: rgba(245, 158, 11, 0.08); font-weight: 600; }

.user-profile { padding: 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 15px; cursor: pointer; transition: background 0.2s; }
.user-profile:hover { background: rgba(255,255,255,0.02); }
.avatar { width: 35px; height: 35px; border-radius: 50%; background: var(--accent); color: var(--btn-text); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.8em; }
.user-info { display: flex; flex-direction: column; }
.user-info .name { font-size: 0.85em; font-weight: 600; color: #fff; }
.user-info .company { font-size: 0.75em; color: var(--text-secondary); }

/* Main Content & Cards */
.main-content { flex: 1; overflow-y: auto; padding: 40px 50px; }
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.dash-header h1 { font-size: 1.8em; margin-bottom: 5px; }
.subtitle { color: var(--text-secondary); margin-bottom: 25px; font-size: 0.9em; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 30px; margin-bottom: 25px; transition: background 0.3s ease, border-color 0.3s ease; }

/* Setup Stepper */
.setup-card { padding: 25px 30px; }
.setup-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.progress-bar { width: 100%; height: 6px; background: #222; border-radius: 3px; margin-bottom: 25px; }
body.light-mode .progress-bar { background: #e5e7eb; }
.progress { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.stepper-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.step-item { background: #1a1a1a; border: 1px solid var(--border); padding: 12px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; transition: border 0.2s; }
body.light-mode .step-item { background: #ffffff; border-color: #e5e7eb; }
.step-item.completed i { color: var(--success); }
.step-item.active { border-color: var(--accent); cursor: pointer; }
.step-item.active i { color: var(--accent); }
.step-item.locked { opacity: 0.4; }
.step-item h4 { font-size: 0.78em; line-height: 1.3; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #27272a; transition: .3s; border-radius: 34px; border: 1px solid var(--border); }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: #ffffff; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--accent); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(24px); background-color: var(--btn-text); }

/* Stats & Production Grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-box { background: var(--bg-card); border: 1px solid var(--border); padding: 25px; border-radius: 12px; }
.stat-label { color: var(--text-secondary); font-size: 0.85em; margin-bottom: 10px; }
.stat-box h2 { font-size: 2.2em; margin-bottom: 10px; }
.trend { font-size: 0.8em; font-weight: 500; }
.trend.positive { color: var(--success); }
.trend.neutral { color: var(--text-secondary); }

.production-card { display: flex; gap: 15px; background: #1a1a1a; padding: 10px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 10px; cursor: pointer; transition: border 0.2s; }
body.light-mode .production-card { background: #f9fafb; }
.production-card:hover { border-color: var(--accent); }
.prod-img { width: 80px; height: 60px; border-radius: 6px; }
.prod-info { display: flex; flex-direction: column; justify-content: center; }
.prod-info h5 { font-size: 0.9em; margin-bottom: 3px; }
.prod-info p { font-size: 0.75em; color: var(--text-secondary); }

/* Review Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 15px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; }
.column-header h4 { font-size: 0.9em; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.item-count { background: #222; padding: 3px 8px; border-radius: 12px; font-size: 0.7em; color: var(--text-secondary); }

.review-card { background: var(--bg-card); border: 1px solid var(--border); padding: 15px; border-radius: 12px; margin-bottom: 15px; transition: transform 0.2s, opacity 0.3s; }
.review-card:hover { border-color: var(--accent); }
.review-thumbnail { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 6px; position: relative; cursor: pointer; overflow: hidden; margin-bottom: 15px; display: flex; align-items: center; justify-content: center;}
.time-badge { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.85); padding: 3px 8px; border-radius: 4px; font-size: 0.75em; font-weight: bold; color: #fff; }
.type-badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--btn-text); padding: 2px 6px; border-radius: 4px; font-size: 0.7em; font-weight: 800; text-transform: uppercase; }

.inline-feedback { display: flex; gap: 10px; margin-bottom: 15px; }
.inline-feedback input { background: #1a1a1a; border: 1px solid #333; padding: 10px; border-radius: 6px; color: white; font-size: 0.85em; width: 100%; margin-bottom:0;}
body.light-mode .inline-feedback input { background: #f9fafb; color: #111; border-color: #ddd; }
.inline-feedback button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 10px; }

.filter-btn-group { display: flex; gap: 10px; }

/* Calendar & Grids */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-top: 20px; }
.analytics-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
.academy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* Forms & Buttons */
input, textarea, select { width: 100%; background: #1a1a1a; border: 1px solid var(--border); color: white; padding: 12px; border-radius: 6px; margin-bottom: 15px; font-size: 0.9em; }
body.light-mode input, body.light-mode textarea, body.light-mode select { background: #ffffff; color: #111; border-color: #d1d5db; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--text-secondary); margin-bottom: 8px; font-size: 0.85em; }
.form-section { border-bottom: 1px solid var(--border); margin-bottom: 30px; padding-bottom: 10px; }

.btn-primary { background: var(--accent); color: var(--btn-text); border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9em; transition: 0.2s; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); width: 100%; padding: 10px; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 0.85em; font-weight: 600;}
.btn-outline:hover, .btn-outline.active-filter { border-color: var(--accent); color: var(--accent); background: rgba(245, 158, 11, 0.05); }

/* Close Buttons */
.close-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-secondary); width: 32px; height: 32px; border-radius: 50%; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-btn:hover { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }

/* Upload Dropzone */
.upload-dropzone { border: 2px dashed var(--border); padding: 40px 20px; border-radius: 12px; text-align: center; cursor: pointer; background: rgba(255,255,255,0.01); transition: all 0.3s ease; }
.upload-dropzone:hover { border-color: var(--accent); background: rgba(245, 158, 11, 0.03); }

/* Floating Tutorial Card */
.tutorial-floating-card { position: fixed; bottom: 30px; left: 280px; width: 380px; background: #141414; border: 1px solid var(--accent); box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 20px rgba(245, 158, 11, 0.2); border-radius: 12px; padding: 20px; z-index: 999; animation: popIn 0.3s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Modals & Auth Screen */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-card); width: 100%; max-width: 700px; padding: 30px; border-radius: 12px; border: 1px solid var(--border); }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }
.video-container { aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }

#auth-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #050505; z-index: 2000; }
.auth-box { width: 100%; max-width: 350px; text-align: center; }
.auth-switch { margin-top: 20px; font-size: 0.85em; color: var(--text-secondary); }
.auth-switch span { color: var(--accent); cursor: pointer; }

/* AI Chat Widget */
.ai-bottom-container { position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; align-items: center; z-index: 50; }
.ai-tooltip { background: #333; color: #fff; padding: 8px 14px; border-radius: 20px; font-size: 0.8em; margin-bottom: 10px; opacity: 0; transform: translateY(10px); transition: all 0.4s ease; pointer-events: none; }
.ai-tooltip.show { opacity: 1; transform: translateY(0); }
.ai-pill { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); border: none; color: var(--btn-text); font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.3s; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.ai-pill:hover { transform: scale(1.1); }

.ai-chat { position: fixed; bottom: 100px; right: 30px; width: 380px; border: 1px solid var(--border); border-radius: 12px; display: none; flex-direction: column; background: var(--bg-card); box-shadow: 0 10px 40px rgba(0,0,0,0.8); z-index: 60; overflow: hidden; }
.chat-header { padding: 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-messages { height: 300px; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.message { padding: 10px 14px; border-radius: 8px; font-size: 0.85em; line-height: 1.4; max-width: 85%; word-wrap: break-word; }
.message.ai { background: #1a1a1a; align-self: flex-start; color: #fff; }
body.light-mode .message.ai { background: #f3f4f6; color: #111; }
.message.user { background: var(--accent); color: var(--btn-text); font-weight: 500; align-self: flex-end; }
.chat-input { display: flex; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { margin-bottom: 0; border-radius: 6px 0 0 6px; border-right: none; }
.chat-input button { background: var(--accent); border: none; color: var(--btn-text); padding: 0 15px; border-radius: 0 6px 6px 0; cursor: pointer; }


/* ==========================================
   MOBIELE OPTIMALISATIE & RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 1024px) {
    .stepper-grid-6 { grid-template-columns: repeat(3, 1fr); }
    .calendar-grid { grid-template-columns: repeat(4, 1fr); }
    .kanban { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    
    /* Mobiele Topbar */
    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 60px;
        background: var(--bg-sidebar);
        padding: 0 20px;
        border-bottom: 1px solid var(--border);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1030;
    }
    .mobile-menu-btn {
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 1.3em;
        cursor: pointer;
    }
    .mobile-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--accent);
        color: var(--btn-text);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.75em;
    }

    /* Mobiele Sidebar Slide-In */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .close-sidebar-mobile {
        display: block;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5em;
        cursor: pointer;
    }

    /* Main Content Adjustments */
    .main-content {
        padding: 80px 20px 40px;
    }
    .dash-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    .dash-header .btn-primary {
        width: 100%;
    }

    /* Layout Grids naar Single Column */
    .stepper-grid-6 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
    .analytics-charts-grid { grid-template-columns: 1fr; }
    .academy-grid { grid-template-columns: 1fr; }
    .calendar-grid { grid-template-columns: repeat(2, 1fr); }

    .setup-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Review & Filter Knoppen */
    .filter-btn-group {
        width: 100%;
        justify-content: space-between;
    }
    .filter-btn-group button {
        padding: 8px 5px;
        font-size: 0.75em;
    }

    /* Tutorial & AI Widgets op Mobiel */
    .tutorial-floating-card {
        left: 15px;
        right: 15px;
        width: auto;
        bottom: 20px;
    }
    .ai-chat {
        left: 15px;
        right: 15px;
        width: auto;
        bottom: 90px;
    }
    .ai-bottom-container {
        bottom: 20px;
        right: 20px;
    }
}

/* HORIZONTAAL SCROLLBARE PRODUCTIEKAARTEN OP DASHBOARD */
.production-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}
.production-scroll-container::-webkit-scrollbar {
    width: 4px;
}
.production-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* MATRIX ANALYTICS STYLING */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}
.matrix-card {
    background: #1a1a1a;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
}
body.light-mode .matrix-card {
    background: #f9fafb;
}
.matrix-card h5 {
    color: var(--accent);
    font-size: 0.9em;
    margin-bottom: 8px;
}
.matrix-card p {
    font-size: 0.8em;
    color: var(--text-secondary);
    line-height: 1.5;
}