@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #ffffff;
    --bg-secondary: #f7f7f7;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #6b7280;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --green: #059669;
    --green-light: #d1fae5;
    --orange: #d97706;
    --orange-light: #fef3c7;
    --red: #dc2626;
    --red-light: #fee2e2;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 10px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 48px 0 40px;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}
.header h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.header p { font-size: 16px; opacity: 0.85; max-width: 600px; }
.badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 0;
}
.nav-item {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Main content */
.main { max-width: 960px; margin: 0 auto; padding: 32px 24px 80px; }

/* Sections */
.section { display: none; }
.section.active { display: block; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-header div { flex: 1; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.section-desc { color: var(--text-secondary); font-size: 15px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    transition: all 0.15s;
    font-family: inherit;
}
.btn:hover { background: var(--bg-secondary); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: white; color: var(--red); border-color: var(--red-light); }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; font-size: 16px; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.card-title { font-size: 17px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); }

/* Database tables */
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-table th {
    text-align: left; padding: 10px 14px; background: var(--bg-secondary);
    font-weight: 600; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.db-table td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.db-table tr:last-child td { border-bottom: none; }
.db-table tr.clickable { cursor: pointer; transition: background 0.1s; }
.db-table tr.clickable:hover { background: #f9fafb; }

/* Tags */
.tag {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tag-blue { background: var(--accent-light); color: var(--accent); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-orange { background: var(--orange-light); color: var(--orange); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-gray { background: #f3f4f6; color: #6b7280; }

.tag-clickable { cursor: pointer; transition: opacity 0.15s; }
.tag-clickable:hover { opacity: 0.8; }

/* Progress bars */
.progress-bar { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

/* ═══ Q1 ROADMAP ═══ */
.q1-roadmap { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.q1-roadmap-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.q1-roadmap-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.q1-timeline { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 20px; }
.q1-timeline::before {
    content: ''; position: absolute; top: 16px; left: 36px; right: 36px;
    height: 4px; background: #e5e7eb; border-radius: 2px; z-index: 0;
}
.q1-track-fill {
    position: absolute; top: 16px; left: 36px; height: 4px;
    background: linear-gradient(90deg, var(--green), var(--green));
    border-radius: 2px; z-index: 1; transition: width 0.6s ease;
}
.q1-step { display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; cursor: pointer; position: relative; flex: 1; }
.q1-step-dot {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; border: 3px solid #e5e7eb; background: white; transition: all 0.2s;
}
.q1-step-dot.todo { border-color: #d1d5db; color: #9ca3af; }
.q1-step-dot.bezig { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }
.q1-step-dot.klaar { border-color: var(--green); color: white; background: var(--green); }
.q1-step-label { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; max-width: 110px; line-height: 1.3; }
.q1-step-status { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.q1-step-status.todo { color: #9ca3af; }
.q1-step-status.bezig { color: var(--orange); }
.q1-step-status.klaar { color: var(--green); }
.q1-step:hover .q1-step-dot { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* Q1 Checklist popup */
.q1-checklist-popup {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    margin-top: 8px; background: white; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 220px; z-index: 50;
    white-space: nowrap;
}
.q1-checklist-popup.open { display: block; }
.q1-checklist-popup::before {
    content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px; background: white; border-left: 1px solid var(--border); border-top: 1px solid var(--border);
}
.q1-check-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; border-radius: 4px; }
.q1-check-item:hover { background: rgba(0,0,0,0.03); }
.q1-check-box {
    width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 3px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.q1-check-box.checked { background: var(--green); border-color: var(--green); }
.q1-check-box.checked::after { content: '\2713'; color: white; font-size: 10px; font-weight: 700; }
.q1-check-text { flex: 1; }
.q1-check-item.checked .q1-check-text { text-decoration: line-through; color: var(--text-secondary); }

/* Vesting */
.vesting-chart { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.vesting-person { flex: 1; min-width: 240px; background: var(--bg-secondary); border-radius: 8px; padding: 20px; }
.vesting-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.vesting-role { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.vesting-segment { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.vesting-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vesting-pct { font-weight: 700; margin-left: auto; font-size: 14px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kanban-col { background: var(--bg-secondary); border-radius: 8px; padding: 14px; min-height: 120px; transition: background 0.15s; }
.kanban-col.drag-over { background: #e8edfb; }
.kanban-col-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.kanban-col-title .col-count {
    margin-left: auto; background: rgba(0,0,0,0.06); padding: 1px 8px;
    border-radius: 10px; font-size: 10px; font-weight: 600;
}
.kanban-col-title .col-add {
    margin-left: 4px; width: 20px; height: 20px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; color: var(--text-secondary);
    transition: all 0.1s; background: transparent; border: none; font-weight: 600;
}
.kanban-col-title .col-add:hover { background: rgba(0,0,0,0.08); color: var(--text); }
.kanban-card {
    background: white; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px; margin-bottom: 8px; font-size: 13px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); cursor: grab;
    transition: box-shadow 0.15s, transform 0.15s;
}
.kanban-card:hover { box-shadow: var(--shadow-lg); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }
.kanban-card-name { font-weight: 500; margin-bottom: 6px; }
.kanban-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.kanban-card-progress {
    font-size: 11px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px; margin-top: 6px;
}
.kanban-card.expanded {
    cursor: default;
    border-left: 3px solid var(--accent);
    padding: 14px 16px;
}
.kanban-card-checklist {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.kanban-checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; font-size: 13px; cursor: pointer;
    border-radius: 4px; transition: background 0.1s;
}
.kanban-checklist-item:hover { background: rgba(0,0,0,0.03); }
.kanban-checklist-item .kanban-check-box {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-radius: 3px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.kanban-checklist-item .kanban-check-box.checked {
    background: var(--green);
    border-color: var(--green);
}
.kanban-checklist-item .kanban-check-box.checked::after {
    content: '\2713'; color: white; font-size: 10px; font-weight: 700;
}
.kanban-checklist-item .kanban-check-text { flex: 1; }
.kanban-checklist-item.checked .kanban-check-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.kanban-card-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.kanban-card-actions button {
    font-size: 11px; padding: 4px 10px;
    border-radius: 4px; border: 1px solid var(--border);
    background: white; cursor: pointer;
    transition: all 0.1s; font-family: inherit;
}
.kanban-card-actions button:hover { background: var(--bg-secondary); }
.kanban-card-actions .kanban-edit-btn {
    background: var(--accent-light);
    color: var(--accent);
    border-color: transparent;
}
.kanban-card-actions .kanban-edit-btn:hover {
    background: #bfdbfe;
}
.kanban-card-actions .kanban-save-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.kanban-card-actions .kanban-save-btn:hover {
    background: #1d4ed8;
}

/* Metrics */
.metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.metric-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.metric-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.metric-value { font-size: 28px; font-weight: 800; margin: 4px 0; letter-spacing: -0.5px; }
.metric-sub { font-size: 12px; color: var(--text-secondary); }

/* Info/tip boxes */
.tip {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
    padding: 14px 18px; font-size: 13px; margin: 16px 0; display: flex; gap: 10px;
}
.tip-icon { font-size: 16px; flex-shrink: 0; }
.info-box {
    background: var(--accent-light); border: 1px solid #bfdbfe;
    border-radius: 8px; padding: 14px 18px; font-size: 13px; margin: 16px 0;
}

/* Property list */
.prop-list { display: grid; gap: 2px; }
.prop-row {
    display: grid; grid-template-columns: 180px 1fr; gap: 16px;
    padding: 8px 0; border-bottom: 1px solid #f9fafb; font-size: 13px;
}
.prop-label { color: var(--text-secondary); font-weight: 500; }

/* Changelog */
.changelog-entry {
    background: var(--bg-secondary); border-radius: 8px; padding: 20px;
    margin-bottom: 12px; position: relative;
}
.changelog-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.changelog-section { margin-bottom: 10px; }
.changelog-section:last-child { margin-bottom: 0; }
.changelog-section strong { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; display: block; margin-bottom: 4px; }
.changelog-section p { font-size: 13px; color: var(--text-secondary); padding-left: 16px; margin-bottom: 2px; }
.changelog-delete {
    position: absolute; top: 12px; right: 12px;
    width: 24px; height: 24px; border-radius: 4px; border: none;
    background: transparent; cursor: pointer; font-size: 14px;
    color: var(--text-secondary); display: flex; align-items: center;
    justify-content: center; transition: all 0.1s;
}
.changelog-delete:hover { background: var(--red-light); color: var(--red); }
.changelog-repo-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 99px; margin-left: 8px; vertical-align: middle;
}
.changelog-repo-tag.refundely { background: #dcfce7; color: #16a34a; }
.changelog-repo-tag.command-center { background: #dbeafe; color: #2563eb; }
.changelog-auto-badge {
    font-size: 10px; font-weight: 500; color: var(--text-secondary);
    background: var(--bg-tertiary, #f1f5f9); padding: 1px 6px;
    border-radius: 4px; margin-left: 6px; vertical-align: middle;
    opacity: 0.7;
}
.changelog-filters {
    display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.changelog-filter-btn {
    font-size: 12px; font-weight: 500; padding: 4px 12px;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-secondary); color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
}
.changelog-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.changelog-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══ MODAL ═══ */
.modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 1000;
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
    background: white; border-radius: 12px; padding: 28px;
    width: 100%; max-width: 520px; max-height: 85vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-field { margin-bottom: 16px; }
.modal-field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.modal-field input, .modal-field select, .modal-field textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
    background: white; color: var(--text); transition: border-color 0.15s;
}
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.modal-field textarea { resize: vertical; min-height: 80px; }
.modal-field .range-wrap { display: flex; align-items: center; gap: 12px; }
.modal-field input[type="range"] {
    flex: 1; padding: 0; border: none; height: 6px; -webkit-appearance: none;
    background: #e5e7eb; border-radius: 3px; outline: none;
}
.modal-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    background: var(--accent); border-radius: 50%; cursor: pointer;
}
.modal-field .range-val { font-size: 14px; font-weight: 700; min-width: 36px; text-align: right; }
.modal-hint { display: inline-block; font-size: 11px; color: var(--text-secondary); margin-left: 6px; cursor: help; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn { flex: 1; justify-content: center; padding: 10px 16px; }
.modal-actions .btn-danger { flex: 0; padding: 10px 16px; }

/* ═══ TOGGLE & CHECKLIST EDITOR ═══ */
.modal-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; cursor: pointer; user-select: none;
}
.toggle-switch {
    position: relative; display: inline-block; width: 40px; height: 22px;
}
.toggle-switch input[type="checkbox"] {
    opacity: 0; width: 0; height: 0;
}
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #ccc; border-radius: 22px; transition: background 0.2s;
}
.toggle-slider::before {
    content: ""; position: absolute; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: white; border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--green);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}
.checklist-editor {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; background: var(--bg-secondary);
}
.checklist-editor-item {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.checklist-editor-item:last-child { margin-bottom: 0; }
.checklist-editor-item input[type="text"] {
    flex: 1; padding: 6px 10px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; font-family: inherit;
}
.checklist-editor-actions {
    display: flex; gap: 4px;
}
.checklist-editor-actions button {
    width: 26px; height: 26px; padding: 0; border-radius: 4px;
    border: 1px solid var(--border); background: white;
    cursor: pointer; font-size: 12px; display: flex;
    align-items: center; justify-content: center;
    transition: all 0.15s; font-family: inherit;
}
.checklist-editor-actions button:hover { background: var(--bg-secondary); }
.checklist-editor-actions button.delete-btn { color: var(--red); }
.checklist-editor-actions button.delete-btn:hover { background: var(--red-light); }
.checklist-editor-actions button:disabled {
    opacity: 0.3; cursor: not-allowed;
}
.checklist-editor-add {
    margin-top: 8px; width: 100%; padding: 6px 12px;
    border: 1px dashed var(--border); background: white;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; font-family: inherit;
    color: var(--text-secondary);
}
.checklist-editor-add:hover {
    background: var(--bg-secondary); border-color: var(--accent);
    color: var(--accent);
}

/* ═══ TOAST ═══ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--text); color: white; padding: 12px 20px;
    border-radius: 8px; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ═══ EMPTY STATE ═══ */
.empty-state {
    text-align: center; padding: 40px 20px; color: var(--text-secondary);
}
.empty-state-icon { font-size: 32px; margin-bottom: 8px; }
.empty-state-text { font-size: 14px; }

/* ═══ TABLE SCROLL WRAPPER ═══ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
.table-scroll > .db-table,
.table-scroll > .sc-table { min-width: 580px; }
/* ═══ CRM ═══ */
.crm-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.crm-toolbar input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: white; color: var(--text); }
.crm-toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: white; color: var(--text); cursor: pointer; }
.crm-toolbar input:focus, .crm-toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Drawer */
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 500; }
.drawer-overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; width: 500px; max-width: 96vw; height: 100vh; background: white; box-shadow: -8px 0 32px rgba(0,0,0,0.12); z-index: 501; transition: transform 0.3s ease, visibility 0.3s; overflow-y: auto; display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; }
.drawer.open { transform: translateX(0); visibility: visible; }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; background: white; z-index: 1; }
.drawer-back { padding: 6px 12px; border: 1px solid var(--border); background: white; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.drawer-back:hover { background: var(--bg-secondary); }
.drawer-company { font-size: 17px; font-weight: 700; flex: 1; }
.drawer-body { padding: 24px; flex: 1; }
.drawer-section { margin-bottom: 24px; }
.drawer-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.drawer-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.drawer-stat { background: var(--bg-secondary); border-radius: 8px; padding: 12px; text-align: center; }
.drawer-stat-val { font-size: 20px; font-weight: 800; }
.drawer-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.drawer-timeline { list-style: none; }
.drawer-timeline li { padding: 8px 0; border-bottom: 1px solid #f9fafb; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.drawer-timeline li:last-child { border-bottom: none; }
.drawer-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; }
.drawer-tl-date { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

/* ═══ ANALYTICS ═══ */
.analytics-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.analytics-period { display: flex; gap: 6px; }
.period-btn { padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; background: white; color: var(--text-secondary); font-family: inherit; transition: all 0.15s; }
.period-btn:hover { border-color: var(--accent); color: var(--accent); }
.period-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.analytics-source-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-secondary); margin-bottom: 10px; }
.analytics-source-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.analytics-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; margin-bottom: 24px; }
.analytics-chip { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.analytics-chip-src { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.analytics-chip-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.analytics-chip-value { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.1; }
.analytics-chip-delta { font-size: 11px; font-weight: 600; margin-top: 3px; }
.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.analytics-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.analytics-grid-2 > .card { min-width: 0; }
.chart-wrap { position: relative; }
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.funnel-label-col { font-size: 13px; min-width: 170px; }
.funnel-bar-bg { flex: 1; height: 22px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.funnel-bar-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.8s ease; }
.funnel-pct-col { font-size: 12px; font-weight: 700; color: var(--text-secondary); min-width: 70px; text-align: right; }
.sc-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.sc-table th { text-align: left; padding: 8px 10px; background: var(--bg-secondary); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.sc-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; }
.sc-table tr:last-child td { border-bottom: none; }

/* ═══ FINANCE ═══ */
.finance-cat-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.finance-cat-bar div { transition: width 0.6s ease; }
.finance-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12px; }
.finance-legend-item { display: flex; align-items: center; gap: 6px; }
.finance-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ═══ PROPOSALS ═══ */
.proposals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proposal-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow 0.2s, border-color 0.2s; cursor: pointer; position: relative; }
.proposal-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.proposal-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.proposal-card-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; }
.proposal-card-cost { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.proposal-card-cost span { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.proposal-card-section { margin-bottom: 10px; }
.proposal-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-secondary); margin-bottom: 3px; }
.proposal-card-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.proposal-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.proposal-status-voorgesteld { border-left: 3px solid var(--orange); }
.proposal-status-goedgekeurd { border-left: 3px solid var(--green); }
.proposal-status-actief { border-left: 3px solid var(--accent); }
.proposal-status-afgewezen { border-left: 3px solid var(--red); opacity: 0.6; }
.proposal-activate-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border: 1px solid var(--green); background: var(--green-light); color: var(--green); border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.proposal-activate-btn:hover { background: var(--green); color: white; }

/* ═══ IDEAS ═══ */
.ideas-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.ideas-toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: white; color: var(--text); cursor: pointer; }
.ideas-toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.idea-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow 0.2s, border-color 0.2s; cursor: pointer; position: relative; }
.idea-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.idea-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.idea-card-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; flex: 1; }
.idea-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.idea-vote-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--border); background: white; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; color: var(--text-secondary); }
.idea-vote-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.idea-vote-select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; font-family: inherit; background: white; cursor: pointer; color: var(--text-secondary); }
.idea-vote-btn.voted { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.idea-card-author { font-size: 11px; color: var(--text-secondary); margin-left: auto; }
.idea-status-nieuw { border-left: 3px solid var(--text-secondary); }
.idea-status-in-bespreking { border-left: 3px solid var(--orange); }
.idea-status-goedgekeurd { border-left: 3px solid var(--green); }
.idea-status-afgewezen { border-left: 3px solid var(--red); opacity: 0.6; }
.idea-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.idea-comment { display: flex; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.idea-comment:last-child { margin-bottom: 0; }
.idea-comment-author { font-weight: 600; color: var(--text); white-space: nowrap; }
.idea-comment-text { color: var(--text-secondary); flex: 1; }
.idea-comment-date { font-size: 11px; color: var(--text-secondary); white-space: nowrap; opacity: 0.7; }
.idea-add-comment { display: flex; gap: 6px; margin-top: 10px; }
.idea-add-comment input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; }
.idea-add-comment input:focus { outline: none; border-color: var(--accent); }
.idea-add-comment select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; background: white; }
.idea-add-comment button { padding: 6px 12px; border: none; background: var(--accent); color: white; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.idea-add-comment button:hover { background: #1d4ed8; }

/* ═══ BESLUITVOERING ═══ */
.decisions-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.decisions-toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: white; color: var(--text); cursor: pointer; }
.decisions-toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.decisions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.decision-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); transition: box-shadow 0.2s, border-color 0.2s;
    border-left: 4px solid var(--accent); position: relative;
}
.decision-card:hover { box-shadow: var(--shadow-lg); }
.decision-card.urgency-hoog { border-left-color: var(--red); }
.decision-card.urgency-normaal { border-left-color: var(--accent); }
.decision-card.urgency-laag { border-left-color: #9ca3af; }
.decision-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.decision-card-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; flex: 1; cursor: pointer; }
.decision-card-title:hover { color: var(--accent); }
.decision-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.decision-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.decision-options { margin-bottom: 14px; }
.decision-option { margin-bottom: 8px; }
.decision-option-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.decision-option-text { font-size: 13px; font-weight: 500; }
.decision-option-pct { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.decision-vote-bar { height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.decision-vote-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.4s ease; }
.decision-vote-fill.winner { background: var(--green); }
.decision-option-vote-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--border);
    background: white; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.15s; color: var(--text-secondary); margin-top: 4px;
}
.decision-option-vote-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.decision-option-vote-btn.voted { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.decision-chosen { background: var(--green-light); border-color: var(--green); border-radius: 6px; padding: 8px 10px; }
.decision-chosen .decision-vote-fill { background: var(--green); }
.decision-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.decision-card-author { font-size: 11px; color: var(--text-secondary); margin-left: auto; }

/* ═══ ROADMAP TABS ═══ */
.roadmap-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.roadmap-tab { padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; background: white; color: var(--text-secondary); font-family: inherit; transition: all 0.15s; }
.roadmap-tab:hover { border-color: var(--accent); color: var(--accent); }
.roadmap-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ═══ RESPONSIVE — TABLET (must be after all component CSS) ═══ */
@media (max-width: 768px) {
    /* Header */
    .header { padding: 32px 0 28px; }
    .header h1 { font-size: 24px; }
    .header p { font-size: 14px; }
    .badge { font-size: 11px; margin-bottom: 12px; }

    /* Nav with fade indicators */
    .nav-inner { padding: 0 16px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
    .nav-inner::-webkit-scrollbar { display: none; }
    .nav { position: relative; }
    .nav::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 40px; background: linear-gradient(90deg, transparent, white); pointer-events: none; z-index: 101; }
    .nav-item { padding: 12px 14px; font-size: 12px; min-height: 44px; display: flex; align-items: center; }

    /* Main */
    .main { padding: 24px 16px 80px; }

    /* Section headers */
    .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .section-title { font-size: 20px; }
    .section-desc { font-size: 13px; }

    /* Cards */
    .card { padding: 18px; margin-bottom: 16px; }
    .card-header { gap: 10px; margin-bottom: 12px; }
    .card-icon { width: 36px; height: 36px; font-size: 18px; }
    .card-title { font-size: 15px; }

    /* Kanban */
    .kanban { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Vesting */
    .vesting-chart { flex-direction: column; }
    .vesting-person { min-width: unset; padding: 16px; }

    /* Tables — horizontal scroll */
    .table-scroll { margin: 0 -18px; padding: 0 18px; }

    /* Property grid */
    .prop-row { grid-template-columns: 120px 1fr; gap: 10px; padding: 6px 0; }

    /* Modal */
    .modal { margin: 12px; max-height: 92vh; padding: 22px; border-radius: 10px; }
    .modal-title { font-size: 18px; }

    /* Drawer */
    .drawer { width: 100%; max-width: 100vw; }
    .drawer-header { padding: 16px; }
    .drawer-body { padding: 16px; }
    .drawer-stat-grid { grid-template-columns: repeat(2, 1fr); }

    /* Metrics */
    .metric-value { font-size: 24px; }
    .metric-card { padding: 16px; }

    /* Analytics */
    .analytics-grid-2 { grid-template-columns: 1fr; gap: 16px; }
    .analytics-chips { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .analytics-chip { padding: 12px; }
    .analytics-chip-value { font-size: 18px; }
    .analytics-header-row { gap: 10px; }
    .funnel-label-col { min-width: 120px; font-size: 12px; }
    .funnel-pct-col { min-width: 55px; font-size: 11px; }

    /* Finance */
    .proposals-grid { grid-template-columns: 1fr; }
    .finance-legend { gap: 8px 14px; font-size: 11px; }

    /* Ideas */
    .ideas-grid { grid-template-columns: 1fr; }
    .ideas-toolbar select { flex: 1; min-width: 0; }

    /* Q1 Roadmap */
    .q1-timeline { flex-direction: column; gap: 16px; padding: 0; }
    .q1-timeline::before { display: none; }
    .q1-track-fill { display: none; }
    .q1-step { flex-direction: row; gap: 12px; }
    .q1-step-label { text-align: left; max-width: none; }
    .q1-checklist-popup { left: 0; transform: none; }

    /* Besluitvoering */
    .decisions-grid { grid-template-columns: 1fr; }
    .decisions-toolbar select { flex: 1; min-width: 0; }

    /* Roadmap tabs */
    .roadmap-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: none; scrollbar-width: none; flex-wrap: nowrap; padding-bottom: 2px; }
    .roadmap-tabs::-webkit-scrollbar { display: none; }
    .roadmap-tab { flex-shrink: 0; }

    /* CRM toolbar */
    .crm-toolbar { gap: 8px; }
    .crm-toolbar input { min-width: unset; width: 100%; }
    .crm-toolbar select { flex: 1; min-width: 0; }

    /* Toast */
    .toast-container { bottom: 16px; right: 16px; left: 16px; }
    .toast { font-size: 13px; }

    /* Buttons — better touch targets */
    .btn { min-height: 40px; padding: 9px 16px; }
    .btn-sm { min-height: 36px; padding: 7px 12px; }
}

/* ═══ RESPONSIVE — SMALL MOBILE ═══ */
@media (max-width: 480px) {
    .header { padding: 24px 0 20px; }
    .header h1 { font-size: 22px; }
    .header-inner { padding: 0 16px; }

    .main { padding: 20px 14px 80px; }

    .kanban { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { padding: 14px; }
    .metric-value { font-size: 22px; }
    .metric-label { font-size: 11px; }

    .card { padding: 14px; }

    .analytics-chips { grid-template-columns: 1fr 1fr; gap: 8px; }
    .analytics-chip { padding: 10px 12px; }
    .analytics-chip-value { font-size: 16px; }
    .analytics-chip-label { font-size: 10px; }
    .analytics-chip-src { font-size: 9px; }

    .period-btn { padding: 6px 12px; font-size: 12px; }

    .nav-item { padding: 10px 12px; font-size: 11px; }

    .section-title { font-size: 18px; }

    .proposal-card { padding: 16px; }
    .proposal-card-name { font-size: 14px; }
    .proposal-card-cost { font-size: 16px; }

    /* Funnel */
    .funnel-label-col { min-width: 100px; font-size: 11px; }
    .funnel-bar-bg { height: 18px; }
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    padding: 60px 24px;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}
.login-field {
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.login-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
}
.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}
.login-forgot-link {
    text-align: center;
    margin-top: 16px;
}
.login-forgot-link a {
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}
.login-forgot-link a:hover {
    text-decoration: underline;
}
.login-success {
    background: var(--green-light);
    color: var(--green);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.nav-spacer {
    flex: 1;
}
.nav-logout {
    margin: 10px 0;
    white-space: nowrap;
}

@media print {
    .nav { display: none; }
    .section { display: block !important; page-break-inside: avoid; margin-bottom: 40px; }
    .header { background: #1e3a5f !important; -webkit-print-color-adjust: exact; }
}

