/* ==========================================================================
   FoundersPath AI — Component Library v3.0
   ========================================================================== */

/* ==========================================================================
   Sidebar Components
   ========================================================================== */
.sidebar-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s4);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--s2);
    min-width: 0;
    overflow: hidden;
}

.logo img { border-radius: var(--r-sm); }

.logo-name {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

/* === Nav Links === */
.nav-links {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--s2) var(--s2) var(--s4);
}

.nav-links li { margin-bottom: 1px; }

.nav-category {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-4);
    letter-spacing: 0.8px;
    margin: var(--s4) 0 var(--s2) var(--s3);
    display: block;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 9px var(--s3);
    border-radius: var(--r-md);
    color: var(--text-3);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--t-fast) var(--ease);
    position: relative;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a svg {
    flex-shrink: 0;
    transition: transform var(--t-fast);
    opacity: 0.7;
}

.nav-links a:hover {
    background: var(--bg-hover);
    color: var(--text-1);
    text-decoration: none;
}
.nav-links a:hover svg { transform: scale(1.08); opacity: 1; }

.nav-links a.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
}
.nav-links a.active svg { opacity: 1; color: var(--accent); }

.nav-links a.active::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--gradient-brand);
    border-radius: 0 var(--r-full) var(--r-full) 0;
}

/* === Nav Badge === */
.nav-badge {
    margin-left: auto;
    font-size: 9px; font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    text-transform: uppercase; letter-spacing: 0.4px;
}

/* === Sidebar Footer === */
.sidebar-footer {
    padding: var(--s3) var(--s3) var(--s4);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--text-xs);
    color: var(--text-4);
    padding: var(--s2) var(--s3);
}

.btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-3);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
}
.btn-support:hover { border-color: var(--border-accent); color: var(--accent); background: var(--accent-light); }

.credits { font-size: var(--text-xs); color: var(--text-4); padding: 0 var(--s3); display: flex; flex-direction: column; gap: 2px; }
.credits a { color: var(--text-4); }
.credits a:hover { color: var(--accent); }

/* ==========================================================================
   Topbar Components
   ========================================================================== */
.project-selector {
    display: flex;
    align-items: center;
    gap: var(--s2);
    min-width: 0;
    flex: 1;
    max-width: 320px;
}

#active-project-select {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-1);
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 7px 10px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--t-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
#active-project-select:hover { border-color: var(--border-strong); }
#active-project-select:focus { border-color: var(--border-focus); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: 9px 18px;
    border-radius: var(--r-md);
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    border: none;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm { padding: 6px 14px; font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn-lg { padding: 12px 28px; font-size: var(--text-md); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
}
.btn-primary:hover { background: #017fb0; box-shadow: var(--accent-glow-sm); }

.btn-gradient {
    background: var(--gradient-brand);
    color: #fff;
    border: 1px solid transparent;
}
.btn-gradient:hover { opacity: 0.9; box-shadow: var(--accent-glow); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-1); border-color: rgba(255,255,255,0.2); }

.btn-ghost {
    background: transparent;
    color: var(--text-3);
    border: none;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-3);
    border: none;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-1); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s5);
    transition: all var(--t-fast) var(--ease);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

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

/* === Metric Cards === */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s5);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    transition: all var(--t-fast);
}
.metric-card:hover { border-color: var(--border-strong); }
.metric-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: var(--text-3xl); font-weight: 800; font-family: var(--font-display); color: var(--text-1); letter-spacing: -0.02em; }
.metric-sub { font-size: var(--text-xs); color: var(--text-3); }

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s4);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: var(--s4); }

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: var(--s2);
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-1);
    font-family: var(--font);
    font-size: var(--text-sm);
    padding: 10px var(--s3);
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    appearance: none;
    resize: vertical;
}
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(1,156,212,0.12);
}
.form-control::placeholder { color: var(--text-4); }

textarea.form-control { min-height: 100px; line-height: 1.6; }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-hint { font-size: var(--text-xs); color: var(--text-4); margin-top: var(--s1); }

.form-check { display: flex; align-items: center; gap: var(--s2); cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.2px;
}
.badge-accent { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-3); border: 1px solid var(--border); }

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--s16) var(--s8);
    color: var(--text-3);
}
.empty-state svg { margin-bottom: var(--s5); opacity: 0.3; }
.empty-state h3 { font-size: var(--text-lg); color: var(--text-2); margin-bottom: var(--s2); }
.empty-state p { font-size: var(--text-sm); color: var(--text-3); max-width: 360px; margin: 0 0 var(--s5); }

/* ==========================================================================
   Lean Canvas Component
   ========================================================================== */
.lean-canvas-grid {
    display: flex;
    gap: var(--s4);
    min-height: 300px;
}
.canvas-col {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    flex: 1;
}
.canvas-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--s4);
}
.canvas-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--s2);
}
.canvas-block-header h4 {
    font-size: var(--text-sm);
    color: var(--text-2);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.canvas-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: var(--text-sm);
    resize: none;
    outline: none;
    min-height: 80px;
}

/* ==========================================================================
   Roadmap Component
   ========================================================================== */
.roadmap-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s4);
    height: calc(100vh - 200px);
    overflow-x: auto;
}
.roadmap-col {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.roadmap-col .col-header {
    padding: var(--s4);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface-hover);
}
.roadmap-col .col-header h4 {
    margin: 0;
    font-size: var(--text-sm);
}
.task-list {
    flex: 1;
    padding: var(--s3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}
.roadmap-task {
    padding: var(--s3);
    cursor: grab;
}
.roadmap-task:active {
    cursor: grabbing;
}
.task-title {
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--s2);
}
.task-meta {
    display: flex;
    gap: var(--s2);
}
.task-badge {
    font-size: 10px;
    background: var(--glass);
    padding: 2px 6px;
    border-radius: var(--r-sm);
    color: var(--text-3);
    border: 1px solid var(--border);
}

/* ==========================================================================
   Tables & Planners (DB Schema, API Planner)
   ========================================================================== */
.data-table-container {
    overflow-x: auto;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--text-sm);
}
.data-table th, .data-table td {
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--bg-surface-hover);
    color: var(--text-2);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.data-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Wireframe & Tech Stack Grids
   ========================================================================== */
.wireframe-grid, .tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s4);
}
.wireframe-card, .tech-stack-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

/* ==========================================================================
   Docs Component
   ========================================================================== */
.docs-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px;
}
.docs-section {
    margin-top: var(--s6);
}
.docs-section h2 {
    font-size: var(--text-lg);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--s2);
    margin-bottom: var(--s3);
    color: var(--text-1);
    display: flex;
    align-items: center;
}
.docs-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}
.docs-section li {
    padding-left: var(--s4);
    position: relative;
    line-height: 1.6;
    color: var(--text-2);
}
.docs-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s4);
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-2xl);
    padding: var(--s8);
    width: 100%;
    max-width: 560px;
    position: relative;
    animation: modalIn 220ms var(--ease-bounce) forwards;
    box-shadow: var(--shadow-xl);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
    position: absolute; top: var(--s4); right: var(--s4);
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--r-md);
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-3); cursor: pointer;
    transition: all var(--t-fast);
}
.modal-close-btn:hover { color: var(--text-1); background: var(--bg-hover); }

/* ==========================================================================
   Daily Popup
   ========================================================================== */
.daily-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9500;
    display: flex; align-items: center; justify-content: center;
    padding: var(--s4);
}

.daily-popup-box {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-2xl);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    position: relative;
    animation: modalIn 280ms var(--ease-bounce) forwards;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(1,156,212,0.1);
    text-align: center;
}

.daily-popup-close {
    position: absolute; top: 16px; right: 16px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--r-md); width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); cursor: pointer; transition: all var(--t-fast);
}
.daily-popup-close:hover { color: var(--text-1); }

.daily-popup-logo { margin-bottom: var(--s4); }
.daily-popup-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; margin-bottom: var(--s3); }
.daily-popup-desc { font-size: var(--text-md); color: var(--text-3); line-height: 1.6; margin-bottom: var(--s6); }

.daily-popup-steps {
    display: flex; flex-direction: column; gap: var(--s3);
    margin-bottom: var(--s6); text-align: left;
}
.popup-step {
    display: flex; align-items: center; gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--r-md); font-size: var(--text-sm); color: var(--text-2);
}
.popup-step-num {
    width: 24px; height: 24px; border-radius: var(--r-full);
    background: var(--accent-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-xs); font-weight: 800; flex-shrink: 0;
    border: 1px solid var(--accent-border);
}
.daily-popup-privacy { font-size: var(--text-xs); color: var(--text-4); margin-top: var(--s3); }

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed; bottom: var(--s5); right: var(--s5);
    z-index: 9999;
    display: flex; flex-direction: column; gap: var(--s2);
    pointer-events: none;
}

.toast {
    display: flex; align-items: center; gap: var(--s3);
    padding: 12px 18px;
    border-radius: var(--r-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm); font-weight: 500;
    color: var(--text-1);
    pointer-events: all;
    animation: toastIn 0.3s var(--ease-bounce) forwards;
    min-width: 240px; max-width: 360px;
    backdrop-filter: blur(16px);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.fade-out {
    animation: toastOut 0.3s var(--ease) forwards;
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-warning { border-left: 3px solid var(--warning); }

/* ==========================================================================
   Command Palette
   ========================================================================== */
.command-palette-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px var(--s3);
    border-radius: var(--r-md);
    font-size: var(--text-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--t-fast);
}
.command-palette-item:hover, .command-palette-item.active-item {
    background: var(--bg-active);
    color: var(--accent);
}
.command-palette-item-key {
    margin-left: auto;
    font-size: var(--text-xs);
    background: rgba(255,255,255,0.07);
    padding: 2px 7px;
    border-radius: var(--r-sm);
    color: var(--text-3);
}

/* ==========================================================================
   Progress Bars
   ========================================================================== */
.progress-bar {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: var(--r-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--r-full);
    transition: width 0.6s var(--ease);
}

/* === Progress Item === */
.progress-item {
    display: flex; align-items: center; gap: var(--s3);
    font-size: var(--text-sm);
}
.progress-item-label { flex: 1; color: var(--text-2); }
.progress-item-val { font-size: var(--text-xs); color: var(--text-3); min-width: 30px; text-align: right; }

/* ==========================================================================
   Validate (Questions) Layout
   ========================================================================== */
.validate-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--s5);
    height: 100%;
    min-height: 0;
}

.sections-nav {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow-y: auto;
    padding: var(--s3) var(--s2);
    height: fit-content;
    max-height: calc(100vh - var(--topbar-h) - 48px);
    position: sticky;
    top: 0;
}

.section-nav-item {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 8px var(--s3);
    border-radius: var(--r-md);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    margin-bottom: 1px;
}
.section-nav-item:hover { background: var(--bg-hover); color: var(--text-2); }
.section-nav-item.active { background: var(--bg-active); color: var(--accent); font-weight: 600; }

.section-nav-check {
    width: 14px; height: 14px;
    border-radius: var(--r-full);
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px;
    transition: all var(--t-fast);
}
.section-nav-item.done .section-nav-check {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.question-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s6);
    min-height: 500px;
}

.question-header {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s5);
    padding-bottom: var(--s4);
    border-bottom: 1px solid var(--border);
}

.question-section-num {
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    background: var(--accent-light);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-sm); font-weight: 800;
    border: 1px solid var(--accent-border);
    flex-shrink: 0;
}

.question-nav-buttons {
    display: flex; gap: var(--s2); margin-top: var(--s6);
    padding-top: var(--s4); border-top: 1px solid var(--border);
    align-items: center; justify-content: space-between;
}

@media (max-width: 767px) {
    .validate-layout { grid-template-columns: 1fr; }
    .sections-nav { display: none; }
}

/* ==========================================================================
   Reports
   ========================================================================== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s4);
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t-fast);
}
.report-card:hover { border-color: var(--border-strong); }

.report-card-header {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: background var(--t-fast);
}
.report-card-header:hover { background: var(--bg-card-hover); }

.report-card-body {
    padding: var(--s5);
    font-size: var(--text-sm);
    color: var(--text-2);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* SWOT Grid */
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.swot-cell { padding: var(--s4); border-radius: var(--r-md); border: 1px solid; }
.swot-strengths { background: var(--success-bg); border-color: rgba(16,185,129,0.2); }
.swot-weaknesses { background: var(--warning-bg); border-color: rgba(245,158,11,0.2); }
.swot-opportunities { background: var(--info-bg); border-color: var(--accent-border); }
.swot-threats { background: var(--danger-bg); border-color: rgba(239,68,68,0.2); }

/* ==========================================================================
   Lean Canvas
   ========================================================================== */
.lean-canvas {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    gap: 1px;
    background: var(--border);
}
.canvas-cell {
    background: var(--bg-card);
    padding: var(--s4);
    min-height: 160px;
    transition: background var(--t-fast);
}
.canvas-cell:hover { background: var(--bg-card-hover); }
.canvas-cell h4 {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: var(--s3);
    font-weight: 700;
}
.canvas-cell textarea {
    width: 100%; border: none; background: transparent;
    color: var(--text-1); font-family: var(--font); font-size: var(--text-sm);
    line-height: 1.6; resize: none; outline: none; min-height: 100px;
}

@media (max-width: 1024px) { .lean-canvas { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .lean-canvas { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   Roadmap
   ========================================================================== */
.roadmap-timeline { display: flex; flex-direction: column; gap: var(--s4); position: relative; }
.roadmap-timeline::before {
    content: '';
    position: absolute; left: 19px; top: 0; bottom: 0;
    width: 1px; background: var(--border);
}
.milestone {
    display: flex; gap: var(--s4);
    padding-left: var(--s2);
    position: relative;
}
.milestone-dot {
    width: 16px; height: 16px;
    border-radius: var(--r-full);
    border: 2px solid var(--accent);
    background: var(--bg-base);
    flex-shrink: 0; margin-top: 4px; z-index: 1;
}
.milestone-dot.done { background: var(--accent); }
.milestone-content {
    flex: 1;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s4) var(--s5);
}

/* ==========================================================================
   Pitch Deck
   ========================================================================== */
.pitchdeck-slide {
    width: 960px;
    height: 540px; /* 16:9 Aspect Ratio */
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: var(--r-md);
    overflow: hidden;
    position: relative;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.slide-infographic svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s4);
}

.slide-card {
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--t-fast);
    border: 2px solid transparent;
}
.slide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.slide-card.active { border-color: var(--accent); }

.slide-preview {
    height: 160px;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    padding: var(--s4);
    text-align: center;
    line-height: 1.5;
    color: var(--text-2);
}

.slide-label {
    padding: 10px var(--s4);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    font-size: var(--text-xs); font-weight: 600;
    color: var(--text-3);
    display: flex; align-items: center; gap: var(--s2);
}

/* ==========================================================================
   AI Chat
   ========================================================================== */
.chat-layout {
    display: flex; flex-direction: column;
    height: calc(100vh - var(--topbar-h) - 40px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--s5);
    display: flex; flex-direction: column; gap: var(--s4);
}

.chat-message {
    display: flex; gap: var(--s3);
    max-width: 85%;
    animation: msgIn 200ms var(--ease-out) forwards;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar {
    width: 32px; height: 32px; border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-xs); font-weight: 800; flex-shrink: 0;
    border: 1px solid var(--border);
}
.chat-avatar.ai { background: var(--accent-light); color: var(--accent); border-color: var(--accent-border); }
.chat-avatar.user { background: var(--bg-elevated); color: var(--text-2); }

.chat-bubble {
    padding: var(--s3) var(--s4);
    border-radius: var(--r-lg);
    font-size: var(--text-sm); line-height: 1.65;
    color: var(--text-1);
    max-width: 100%;
    word-break: break-word;
}
.chat-message.ai .chat-bubble {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-bottom-left-radius: var(--r-xs);
}
.chat-message.user .chat-bubble {
    background: var(--accent-light); border: 1px solid var(--accent-border);
    border-bottom-right-radius: var(--r-xs);
}

.chat-input-bar {
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--border);
    display: flex; gap: var(--s3); align-items: flex-end;
}
.chat-input-bar textarea {
    flex: 1;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--r-lg); color: var(--text-1);
    font-family: var(--font); font-size: var(--text-sm);
    padding: 10px var(--s4); outline: none; resize: none;
    min-height: 44px; max-height: 140px;
    transition: border-color var(--t-fast);
}
.chat-input-bar textarea:focus { border-color: var(--border-focus); }

/* ==========================================================================
   Validate Component
   ========================================================================== */
.validate-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--s6);
    height: 100%;
    min-height: calc(100vh - var(--topbar-h) - var(--s10) - var(--s4));
}

.sections-nav {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s2);
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: fit-content;
    max-height: calc(100vh - var(--topbar-h) - var(--s10) - var(--s4));
}

.sections-nav ul {
    display: flex;
    flex-direction: column;
}

.sections-nav li {
    padding: var(--s2) var(--s3);
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-3);
    font-weight: 500;
    transition: all var(--t-fast);
    margin-bottom: 2px;
}

.sections-nav li span {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.sections-nav li:hover {
    background: var(--bg-hover);
    color: var(--text-1);
}

.sections-nav li.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
}

.question-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s6);
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: var(--s5);
    margin-top: var(--s5);
}

.question-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s5);
}

.question-text {
    font-weight: 600;
    margin-bottom: var(--s3);
    font-size: var(--text-md);
    color: var(--text-1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-bottom: var(--s2);
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-group label {
    font-size: var(--text-sm);
    color: var(--text-2);
    cursor: pointer;
}

@media (max-width: 992px) {
    .validate-layout {
        grid-template-columns: 1fr;
    }
    .sections-nav {
        position: relative;
        max-height: 250px;
    }
}

/* ==========================================================================
   Pitch Deck Component
   ========================================================================== */
.pitchdeck-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--s6);
    height: 100%;
    min-height: calc(100vh - var(--topbar-h) - var(--s10) - var(--s4));
}

.pitchdeck-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s4);
    overflow-y: auto;
    position: sticky;
    top: 0;
    max-height: calc(100vh - var(--topbar-h) - var(--s10) - var(--s4));
}

.settings-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-4);
    margin-bottom: var(--s3);
}

.slide-list-item {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 8px 10px;
    border-radius: var(--r-md);
    cursor: pointer;
    margin-bottom: 2px;
    transition: all var(--t-fast);
    border: 1px solid transparent;
}
.slide-list-item:hover { background: var(--bg-hover); }
.slide-list-item.active { 
    background: var(--bg-active); 
    border-color: var(--accent-border);
    color: var(--accent);
}

.slide-list-item-num {
    width: 20px; height: 20px;
    border-radius: var(--r-sm);
    background: var(--border);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.slide-list-item.active .slide-list-item-num {
    background: var(--accent); color: #fff;
}

.pitchdeck-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pitchdeck-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.pitchdeck-canvas-area {
    flex: 1;
    background: #0f1014;
    padding: var(--s5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    min-height: 400px;
}

.pitchdeck-slide {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #ffffff; /* Base background, overridden by inline styles */
}

/* Visual Editor Styles */
.slide-title-editable,
.slide-content-editable {
    outline: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.slide-title-editable:hover,
.slide-content-editable:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.slide-title-editable:focus,
.slide-content-editable:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px var(--accent);
}

[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,0.4);
    font-style: italic;
    cursor: text;
}

.dropdown-menu {
    position: absolute;
    top: 100%; right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 100;
    padding: 4px;
}
.dropdown-menu.hidden { display: none !important; }
.dropdown-item {
    display: flex; align-items: center; width: 100%;
    padding: 8px 12px; border: none; background: transparent;
    text-align: left; font-size: var(--text-sm); color: var(--text-2);
    cursor: pointer; border-radius: var(--r-sm); transition: background var(--t-fast);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-1); }

.full-width { width: 100%; }

@media (max-width: 992px) {
    .pitchdeck-layout { grid-template-columns: 1fr; height: auto; }
    .pitchdeck-sidebar { position: relative; max-height: 400px; }
}

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-sections { display: flex; flex-direction: column; gap: var(--s4); max-width: 720px; }
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s6);
}
.settings-card h3 {
    font-size: var(--text-md); margin-bottom: var(--s2);
    display: flex; align-items: center; gap: var(--s2);
}
.settings-card p { margin-bottom: var(--s5); }
.settings-divider { height: 1px; background: var(--border); margin: var(--s4) 0; }

/* API Key Input Group */
.api-key-group {
    display: flex; gap: var(--s2); align-items: center;
}
.api-key-group .form-control { font-family: monospace; font-size: var(--text-xs); letter-spacing: 0.5px; }

/* ==========================================================================
   Knowledge Base / Docs
   ========================================================================== */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--s5); }
.docs-nav {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s3) var(--s2);
    height: fit-content; position: sticky; top: 0;
}
.docs-content-area {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s6);
}
.docs-content-area h2 { font-size: var(--text-xl); margin-bottom: var(--s4); }
.docs-content-area p { font-size: var(--text-md); line-height: 1.75; color: var(--text-2); }
.docs-content-area ul li {
    font-size: var(--text-md); color: var(--text-2); line-height: 1.7;
    padding: var(--s1) 0; padding-left: var(--s4); position: relative;
}
.docs-content-area ul li::before {
    content: ''; position: absolute; left: 0; top: 50%;
    width: 6px; height: 6px; margin-top: -3px;
    border-radius: var(--r-full); background: var(--accent);
}

@media (max-width: 767px) { .docs-layout { grid-template-columns: 1fr; } }

/* ==========================================================================
   Quill Editor Overrides
   ========================================================================== */
.ql-toolbar.ql-snow {
    background: var(--bg-surface);
    border-color: var(--border) !important;
    border-radius: var(--r-md) var(--r-md) 0 0;
}
.ql-container.ql-snow {
    border-color: var(--border) !important;
    border-radius: 0 0 var(--r-md) var(--r-md);
}
.ql-snow .ql-stroke {
    stroke: var(--text-2) !important;
}
.ql-snow .ql-fill {
    fill: var(--text-2) !important;
}
.ql-snow .ql-picker {
    color: var(--text-2) !important;
}
.ql-snow .ql-picker-options {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

/* ==========================================================================
   Stagger animations
   ========================================================================== */
.stagger-item {
    animation: staggerIn 300ms var(--ease-out) both;
}
.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 60ms; }
.stagger-item:nth-child(3) { animation-delay: 120ms; }
.stagger-item:nth-child(4) { animation-delay: 180ms; }
.stagger-item:nth-child(5) { animation-delay: 240ms; }
.stagger-item:nth-child(6) { animation-delay: 300ms; }
@keyframes staggerIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
