/* ============================================== */
/* Eircodex Design System v3 — Sidebar Dark Mode  */
/* Inspired by Linear / Vercel / Raycast           */
/* ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Background layers */
    --bg-base: #0a0a0b;
    --bg-surface: #111113;
    --bg-elevated: #1a1a1f;
    --bg-hover: #222228;
    --bg-active: #2a2a32;
    --bg-sidebar: #111113;

    /* Borders */
    --border: #1e1e24;
    --border-light: #2a2a32;
    --border-focus: #6366f1;

    /* Text */
    --text-primary: #ececef;
    --text-secondary: #8b8b96;
    --text-tertiary: #5c5c66;
    --text-muted: #42424a;

    /* Accent — indigo */
    --accent: #818cf8;
    --accent-dim: #6366f1;
    --accent-bright: #a5b4fc;
    --accent-bg: rgba(99, 102, 241, 0.1);
    --accent-bg-strong: rgba(99, 102, 241, 0.18);

    /* Semantic */
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);

    /* ── Entity type colors (unified across all pages) ── */

    /* Features — indigo */
    --entity-feature: #818cf8;
    --entity-feature-bg: rgba(129, 140, 248, 0.1);

    /* Component sub-types */
    --type-ui: #60a5fa;
    --type-ui-bg: rgba(96, 165, 250, 0.1);
    --type-service: #a78bfa;
    --type-service-bg: rgba(167, 139, 250, 0.1);
    --type-data: #fbbf24;
    --type-data-bg: rgba(251, 191, 36, 0.1);
    --type-infra: #94a3b8;
    --type-infra-bg: rgba(148, 163, 184, 0.1);
    --type-shared: #f472b6;
    --type-shared-bg: rgba(244, 114, 182, 0.1);

    /* Areas — emerald */
    --entity-area: #34d399;
    --entity-area-bg: rgba(52, 211, 153, 0.1);

    /* Data Models / Entities — amber */
    --entity-datamodel: #fbbf24;
    --entity-datamodel-bg: rgba(251, 191, 36, 0.1);

    /* Integrations — cyan */
    --entity-integration: #22d3ee;
    --entity-integration-bg: rgba(34, 211, 238, 0.1);

    /* User Roles — rose */
    --entity-role: #fb7185;
    --entity-role-bg: rgba(251, 113, 133, 0.1);

    /* User Stories — sky */
    --entity-story: #38bdf8;
    --entity-story-bg: rgba(56, 189, 248, 0.1);

    /* Tasks — lime */
    --entity-task: #a3e635;
    --entity-task-bg: rgba(163, 230, 53, 0.1);

    /* Documents — slate */
    --entity-document: #94a3b8;
    --entity-document-bg: rgba(148, 163, 184, 0.1);

    /* Tech Stack — violet */
    --entity-tech: #c084fc;
    --entity-tech-bg: rgba(192, 132, 252, 0.1);

    /* Architecture — fuchsia */
    --entity-arch: #e879f9;
    --entity-arch-bg: rgba(232, 121, 249, 0.1);

    /* Phase accents */
    --phase-foundation: #2dd4bf;
    --phase-core: #60a5fa;
    --phase-advanced: #a78bfa;
    --phase-integration: #e879f9;
    --phase-polish: #fb7185;
    --phase-final: #34d399;

    /* Priority */
    --priority-critical: #f87171;
    --priority-high: #fb923c;
    --priority-medium: #fbbf24;
    --priority-low: #71717a;

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed: 0px;
    --content-max: 1600px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;

    /* Type */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.375rem;
    --text-3xl: 1.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* ============================================== */
/* BASE                                            */
/* ============================================== */

body {
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-bright); }

h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
h3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.4; }
h4 { font-size: var(--text-lg); font-weight: 600; }

code, pre { font-family: var(--mono); font-size: var(--text-sm); }

pre {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    overflow-x: auto;
}

p { color: var(--text-secondary); }

/* ============================================== */
/* APP LAYOUT — Sidebar + Main                     */
/* ============================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================== */
/* SIDEBAR                                         */
/* ============================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.sidebar-header {
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-version {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.nav-group {
    margin-bottom: var(--sp-2);
}

.nav-group-label {
    padding: var(--sp-2) var(--sp-5) var(--sp-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 6px var(--sp-5);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.12s;
    cursor: pointer;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-bright);
    background: var(--accent-bg);
    border-left-color: var(--accent);
}

.nav-item-icon {
    width: 18px;
    text-align: center;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.nav-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item-count {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: var(--sp-3) var(--sp-5);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ============================================== */
/* MAIN CONTENT                                    */
/* ============================================== */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-container {
    max-width: var(--content-max);
    width: 100%;
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-8) var(--sp-16);
}

/* ============================================== */
/* PAGE HEADER                                     */
/* ============================================== */

.page-header {
    margin-bottom: var(--sp-8);
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}

.page-subtitle {
    font-size: var(--text-base);
    color: var(--text-tertiary);
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--sp-4);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); }

/* ============================================== */
/* SECTION                                         */
/* ============================================== */

.section {
    margin-bottom: var(--sp-10);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    transition: color 0.15s;
}

.section-link:hover { color: var(--accent); }

/* ============================================== */
/* STAT CARDS                                      */
/* ============================================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-8);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-5);
    transition: border-color 0.15s, background 0.15s;
    text-decoration: none;
    display: block;
}

.stat-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.stat-card-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--sp-1);
}

/* Accent stripe on stat cards — generic */
.stat-card[data-accent="indigo"] { border-top: 2px solid var(--accent); }
.stat-card[data-accent="blue"] { border-top: 2px solid var(--type-ui); }
.stat-card[data-accent="purple"] { border-top: 2px solid var(--type-service); }
.stat-card[data-accent="orange"] { border-top: 2px solid var(--type-data); }
.stat-card[data-accent="green"] { border-top: 2px solid var(--success); }
.stat-card[data-accent="pink"] { border-top: 2px solid var(--type-shared); }
.stat-card[data-accent="gray"] { border-top: 2px solid var(--type-infra); }
.stat-card[data-accent="teal"] { border-top: 2px solid #2dd4bf; }

/* Accent stripe on stat cards — entity types */
.stat-card[data-accent="feature"] { border-top: 2px solid var(--entity-feature); }
.stat-card[data-accent="area"] { border-top: 2px solid var(--entity-area); }
.stat-card[data-accent="datamodel"] { border-top: 2px solid var(--entity-datamodel); }
.stat-card[data-accent="integration"] { border-top: 2px solid var(--entity-integration); }
.stat-card[data-accent="role"] { border-top: 2px solid var(--entity-role); }
.stat-card[data-accent="story"] { border-top: 2px solid var(--entity-story); }
.stat-card[data-accent="task"] { border-top: 2px solid var(--entity-task); }
.stat-card[data-accent="document"] { border-top: 2px solid var(--entity-document); }
.stat-card[data-accent="tech"] { border-top: 2px solid var(--entity-tech); }
.stat-card[data-accent="arch"] { border-top: 2px solid var(--entity-arch); }

/* ============================================== */
/* CARDS                                           */
/* ============================================== */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.card-clickable {
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.card-clickable:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}

.card-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--sp-3);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: var(--sp-3);
}

/* Card grids */
.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-4);
    align-items: stretch;
}

.card-grid-3 > .card, .card-grid-3 > a { display: flex; flex-direction: column; }
.card-grid-3 > .card .card-desc, .card-grid-3 > a .card-desc { flex: 1; }

.card-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--sp-4);
    align-items: stretch;
}

.card-grid-2 > .card, .card-grid-2 > a { display: flex; flex-direction: column; }
.card-grid-2 > .card .card-desc, .card-grid-2 > a .card-desc { flex: 1; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-6);
    align-items: start;
}

.two-col > .card, .two-col > a { display: flex; flex-direction: column; }

/* ============================================== */
/* BADGES                                          */
/* ============================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-neutral {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.badge-accent {
    background: var(--accent-bg);
    color: var(--accent-bright);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* Component type badges */
.badge-ui { background: var(--type-ui-bg); color: var(--type-ui); }
.badge-service { background: var(--type-service-bg); color: var(--type-service); }
.badge-data { background: var(--type-data-bg); color: var(--type-data); }
.badge-infrastructure { background: var(--type-infra-bg); color: var(--type-infra); }
.badge-shared { background: var(--type-shared-bg); color: var(--type-shared); }

/* Entity type badges (unified deep-link colors) */
.badge-feature { background: var(--entity-feature-bg); color: var(--entity-feature); }
.badge-area { background: var(--entity-area-bg); color: var(--entity-area); }
.badge-datamodel { background: var(--entity-datamodel-bg); color: var(--entity-datamodel); }
.badge-integration { background: var(--entity-integration-bg); color: var(--entity-integration); }
.badge-role { background: var(--entity-role-bg); color: var(--entity-role); }
.badge-story { background: var(--entity-story-bg); color: var(--entity-story); }
.badge-task { background: var(--entity-task-bg); color: var(--entity-task); }
.badge-document { background: var(--entity-document-bg); color: var(--entity-document); }
.badge-tech { background: var(--entity-tech-bg); color: var(--entity-tech); }
.badge-arch { background: var(--entity-arch-bg); color: var(--entity-arch); }

/* Complexity badges */
.badge-complexity-low { background: var(--success-bg); color: var(--success); }
.badge-complexity-medium { background: var(--warning-bg); color: var(--warning); }
.badge-complexity-high { background: var(--error-bg); color: var(--error); }

/* Priority badges */
.badge-priority-critical { background: rgba(248,113,113,0.15); color: #f87171; }
.badge-priority-high { background: rgba(251,146,60,0.15); color: #fb923c; }
.badge-priority-medium { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-priority-low { background: rgba(113,113,122,0.15); color: #a1a1aa; }

/* MoSCoW classification badges */
.badge-moscow-must_have { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-moscow-should_have { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-moscow-could_have { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-moscow-wont_have { background: rgba(113,113,122,0.15); color: #a1a1aa; }

/* Target release badge */
.badge-release { background: rgba(139,92,246,0.15); color: #8b5cf6; }

/* ============================================== */
/* ARCHITECTURE BAR                                */
/* ============================================== */

.arch-bar {
    display: flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 48px;
    border: 1px solid var(--border);
}

.arch-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s, filter 0.15s;
    cursor: pointer;
}

.arch-bar-segment:hover { opacity: 0.85; color: #fff; }

.arch-bar-segment.type-ui { background: rgba(96, 165, 250, 0.25); color: var(--type-ui); }
.arch-bar-segment.type-service { background: rgba(167, 139, 250, 0.25); color: var(--type-service); }
.arch-bar-segment.type-data { background: rgba(251, 191, 36, 0.25); color: var(--type-data); }
.arch-bar-segment.type-infrastructure { background: rgba(148, 163, 184, 0.25); color: var(--type-infra); }
.arch-bar-segment.type-shared { background: rgba(244, 114, 182, 0.25); color: var(--type-shared); }

.arch-bar-label { opacity: 0.9; }
.arch-bar-count { font-weight: 700; }

/* ============================================== */
/* COMPACT LIST                                    */
/* ============================================== */

.compact-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.compact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border);
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}

.compact-list-item:last-child { border-bottom: none; }

.compact-list-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.compact-list-name {
    font-weight: 500;
    color: var(--text-primary);
}

.compact-list-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.12s;
}

.compact-list-more:hover { color: var(--accent); }

/* ============================================== */
/* OVERVIEW-SPECIFIC                               */
/* ============================================== */

.overview-hero {
    margin-bottom: var(--sp-8);
}

.overview-hero-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--sp-3);
    letter-spacing: -0.03em;
}

.overview-hero-desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
}

.overview-meta-row {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    flex-wrap: wrap;
}

.overview-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.overview-meta-chip strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Audience summaries (tabs) */
.summary-tabs {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.summary-tab-buttons {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-1);
    gap: var(--sp-1);
}

.summary-tab-btn {
    flex: 1;
    padding: var(--sp-3) var(--sp-4);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.summary-tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* Executive — blue tint */
.summary-tab-btn.active:nth-child(1),
.summary-tab-btn[data-tab="executive"].active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
}

/* PM — amber tint */
.summary-tab-btn.active:nth-child(2),
.summary-tab-btn[data-tab="pm"].active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}

/* Developer — emerald tint */
.summary-tab-btn.active:nth-child(3),
.summary-tab-btn[data-tab="dev"].active {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25);
}

.summary-tab-pane {
    display: none;
    padding: var(--sp-6);
}

.summary-tab-pane.active {
    display: block;
}

/* Executive pane accent */
#sum-executive.active { border-left: 3px solid #60a5fa; }
/* PM pane accent */
#sum-pm.active { border-left: 3px solid #fbbf24; }
/* Developer pane accent */
#sum-dev.active { border-left: 3px solid #34d399; }

.summary-tab-pane p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: var(--text-base);
}

.summary-tab-pane p + p {
    margin-top: var(--sp-4);
}

/* ============================================== */
/* TECH STACK PREVIEW                              */
/* ============================================== */

.tech-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-3);
}

.tech-preview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    display: block;
}

.tech-preview-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.tech-preview-category {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: var(--sp-2);
}

.tech-preview-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

.tech-preview-tag {
    font-size: var(--text-xs);
    padding: 2px 6px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.tech-preview-more {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: 2px 4px;
}

/* ============================================== */
/* AREAS PREVIEW                                   */
/* ============================================== */

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-3);
}

.area-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.area-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ============================================== */
/* TABLES                                          */
/* ============================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:hover td { background: var(--bg-hover); }

/* ============================================== */
/* TABS (generic)                                  */
/* ============================================== */

.tab-container { margin-bottom: var(--sp-6); }

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-4);
}

.tab-button {
    padding: var(--sp-2) var(--sp-4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.tab-button:hover { color: var(--text-secondary); }

.tab-button.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================== */
/* AUDIENCE TAB OVERRIDES (backward compat)        */
/* ============================================== */

.audience-summaries-section {
    margin-top: var(--sp-6);
}

.audience-summaries-section h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--sp-4);
}

.audience-tabs-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.audience-tab-buttons {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-1);
    gap: var(--sp-1);
}

.audience-tab-button {
    flex: 1;
    padding: var(--sp-3) var(--sp-4);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.audience-tab-button:hover { color: var(--text-secondary); background: var(--bg-hover); }

.audience-tab-button.active:nth-child(1) {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.audience-tab-button.active:nth-child(2) {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}

.audience-tab-button.active:nth-child(3) {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25);
}

.audience-tab-pane { display: none; padding: var(--sp-6); }
.audience-tab-pane.active { display: block; }

#summary-executive.active { border-left: 3px solid #60a5fa; }
#summary-project_manager.active { border-left: 3px solid #fbbf24; }
#summary-developer.active { border-left: 3px solid #34d399; }

.audience-summary-content h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--sp-3);
    color: var(--text-primary);
}

.audience-summary-content p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.audience-summary-content p + p {
    margin-top: var(--sp-4);
}

/* ============================================== */
/* FOOTER                                          */
/* ============================================== */

.footer {
    padding: var(--sp-8) 0;
    border-top: 1px solid var(--border);
    margin-top: var(--sp-12);
    text-align: center;
}

.footer p {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer strong { color: var(--text-tertiary); }

/* ============================================== */
/* EMPTY STATE                                     */
/* ============================================== */

.empty-state {
    text-align: center;
    padding: var(--sp-12) var(--sp-8);
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: var(--sp-4);
    opacity: 0.5;
}

/* ============================================== */
/* UTILITY CLASSES                                 */
/* ============================================== */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================== */
/* LEGACY COMPAT (keep pages working during migration) */
/* ============================================== */

/* Old top-nav layout: wrap in app-layout if sidebar exists */
.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-8);
}

/* Old header (hidden when sidebar is used) */
.header {
    border-bottom: 1px solid var(--border);
    padding: var(--sp-6) var(--sp-8);
    margin-bottom: var(--sp-6);
    background: var(--bg-surface);
}

.header-content {
    max-width: var(--content-max);
    margin: 0 auto;
}

.header h1 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--sp-1);
}

.subtitle {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Old navigation (still works for non-migrated pages) */
.navigation, .navigation-three-row {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
}

.nav-row {
    display: flex;
    gap: var(--sp-1);
    flex-wrap: wrap;
}

.nav-row-primary { border-bottom: 1px solid var(--border); padding-bottom: var(--sp-2); }
.nav-row-secondary { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }

.nav-link {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-elevated);
}

.nav-link.active {
    color: var(--accent-bright) !important;
    background: var(--accent-bg);
}

/* Old stat card styles (gradient) */
.stats-dashboard { margin-bottom: var(--sp-8); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-3);
}

.stat-card-link {
    text-decoration: none;
    display: block;
}

/* Gradient stat cards (backward compat) */
.stat-card.gradient-indigo { border-top: 2px solid var(--accent); }
.stat-card.gradient-blue { border-top: 2px solid var(--type-ui); }
.stat-card.gradient-purple { border-top: 2px solid var(--type-service); }
.stat-card.gradient-orange { border-top: 2px solid var(--type-data); }
.stat-card.gradient-green { border-top: 2px solid var(--success); }
.stat-card.gradient-teal { border-top: 2px solid #2dd4bf; }
.stat-card.gradient-pink { border-top: 2px solid var(--type-shared); }
.stat-card.gradient-gray { border-top: 2px solid var(--type-infra); }

.stat-icon { font-size: 1.25rem; margin-bottom: var(--sp-2); }
.stat-value { font-size: var(--text-3xl); font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; }
.stat-label { font-size: var(--text-sm); color: var(--text-tertiary); margin-top: var(--sp-1); }

/* Old section headers */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}

.view-all-link {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}
.view-all-link:hover { color: var(--accent); }

/* Old card grid */
.overview-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-4);
}

.overview-feature-card .card-body h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}

.card-tags {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-top: var(--sp-3);
}

/* Old arch bar */
.arch-type-bar {
    display: flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 48px;
    border: 1px solid var(--border);
}

.arch-type-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s;
    flex: 1;
}

.arch-type-segment:hover { opacity: 0.85; color: #fff; }
.arch-type-ui { background: var(--type-ui); }
.arch-type-service { background: var(--type-service); }
.arch-type-data { background: var(--type-data); }
.arch-type-infrastructure { background: var(--type-infra); }
.arch-type-shared { background: var(--type-shared); }

/* Old two-col layout */
.overview-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-6);
    margin-bottom: var(--sp-8);
}

/* Old project overview section */
.project-overview { margin-bottom: var(--sp-8); }
.overview-content { /* wrapper */ }
.overview-main { /* main col */ }
.overview-description h3 {
    font-size: var(--text-2xl);
    margin-bottom: var(--sp-3);
}
.overview-description p { margin-bottom: var(--sp-3); }

.overview-details {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    flex-wrap: wrap;
}

.detail-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.detail-icon { color: var(--text-tertiary); }
.detail-icon svg { display: block; }
.detail-label { font-size: var(--text-xs); color: var(--text-tertiary); }
.detail-value { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; }

.app-type { text-transform: uppercase; letter-spacing: 0.04em; font-size: var(--text-xs); }

.complexity-badge { font-weight: 600; }
.complexity-high { color: var(--error); }
.complexity-medium { color: var(--warning); }
.complexity-low { color: var(--success); }

/* Tech stack modern (overview section) */
.tech-stack-modern { margin-top: var(--sp-6); }
.tech-stack-header, .areas-header, .arch-design-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}
.tech-stack-header h3, .areas-header h3, .arch-design-header h3 { font-size: var(--text-xl); }
.tech-stack-link-header, .areas-link-header, .arch-design-link-header {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}
.tech-stack-link-header:hover, .areas-link-header:hover, .arch-design-link-header:hover { color: var(--accent); }

.tech-stack-cards { /* wrapper */ }
.tech-overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.tech-overview-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-6);
}

.tech-stat-item { text-align: center; }
.tech-stat-number { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
.tech-stat-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.tech-stat-divider { width: 1px; height: 32px; background: var(--border); }

.tech-categories-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-3);
}

.tech-category-link {
    text-decoration: none;
    display: block;
}

.tech-category-modern {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    transition: border-color 0.15s, background 0.15s;
}

.tech-category-modern:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.category-name {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: var(--sp-2);
}

.category-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

.tech-preview-tag.clickable { cursor: pointer; }
.tech-preview-tag.clickable:hover { border-color: var(--accent); color: var(--accent); }

/* Areas modern */
.areas-modern { margin-top: var(--sp-6); }
.areas-summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.areas-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-6);
}

.area-stat-item { text-align: center; }
.area-stat-number { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
.area-stat-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.area-stat-divider { width: 1px; height: 32px; background: var(--border); }

.areas-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-3);
}

.area-preview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-3) var(--sp-4);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    display: block;
}

.area-preview-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.area-preview-content {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.area-preview-icon { font-size: var(--text-lg); }
.area-preview-name { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; }

/* Architecture & Design modern */
.arch-design-modern { margin-top: var(--sp-6); }
.arch-design-cards { /* wrapper */ }
.arch-design-overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.arch-design-overview-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-6);
}

.arch-design-stat-item { text-align: center; }
.arch-design-stat-number { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
.arch-design-stat-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.arch-design-stat-divider { width: 1px; height: 32px; background: var(--border); }

.arch-design-categories-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-3);
}

.arch-design-category-link {
    text-decoration: none;
    display: block;
}

.arch-design-category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    transition: border-color 0.15s, background 0.15s;
}

.arch-design-category-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.arch-design-category-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}

.arch-design-category-items {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================== */
/* RESPONSIVE                                      */
/* ============================================== */

@media (max-width: 1024px) {
    .two-col,
    .overview-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
    }

    .sidebar.open {
        transform: translateX(0);
        width: 240px;
    }

    .main-content {
        margin-left: 0;
    }

    .page-container {
        padding: var(--sp-4);
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid-3 {
        grid-template-columns: 1fr;
    }

    .arch-bar {
        height: auto;
        flex-wrap: wrap;
    }

    .arch-bar-segment {
        padding: var(--sp-2) var(--sp-3);
    }
}

/* Prism.js overrides — let the theme handle colors, just fix sizing/spacing */
pre[class*="language-"] {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--mono) !important;
    font-size: var(--text-sm) !important;
    line-height: 1.7 !important;
    margin: 0 !important;
    padding: var(--sp-4) !important;
    white-space: pre-wrap !important;
    word-break: break-word;
}

code[class*="language-"] {
    font-family: var(--mono) !important;
    font-size: var(--text-sm) !important;
    text-shadow: none !important;
}

/* HTTP method badges */
.badge-http-get { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.badge-http-post { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.badge-http-put { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-http-patch { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.badge-http-delete { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.badge-http-ws { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.badge-http-event { background: rgba(232, 121, 249, 0.15); color: #e879f9; }
