/* ================================================================
   FORGE Growth Intelligence Dashboard
   Complete Design System & Component Styles
   ================================================================
   Design language: Linear / Stripe / Mixpanel caliber
   Dark theme with FORGE gold accent
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   ---------------------------------------------------------------- */
:root {
    /* Backgrounds */
    --bg: #09090b;
    --bg-card: #141416;
    --bg-card-hover: #1a1a1e;
    --bg-sidebar: #0c0c0e;
    --bg-elevated: #1e1e22;

    /* Borders */
    --border: #27272a;
    --border-hover: #3f3f46;

    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;

    /* Brand */
    --accent: #d4a84b;
    --accent-dim: rgba(212, 168, 75, 0.15);

    /* Semantic */
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --orange: #f59e0b;
    --orange-dim: rgba(245, 158, 11, 0.15);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --purple: #a855f7;

    /* Chart palette */
    --chart-1: #d4a84b;
    --chart-2: #3b82f6;
    --chart-3: #22c55e;
    --chart-4: #a855f7;
    --chart-5: #f59e0b;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Sidebar */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 56px;
}


/* ----------------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-dim);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}


/* ----------------------------------------------------------------
   3. Utility Classes
   ---------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.highlight {
    color: var(--accent);
}


/* ----------------------------------------------------------------
   4. App Shell & Layout
   ---------------------------------------------------------------- */
.app {
    display: flex;
    min-height: 100vh;
}

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
}

.sidebar.collapsed ~ .main {
    margin-left: var(--sidebar-collapsed-width);
}

.content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}


/* ----------------------------------------------------------------
   5. Sidebar
   ---------------------------------------------------------------- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width 0.2s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sync-label,
.sidebar.collapsed .nav-badge {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 8px;
}

.sidebar-brand {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.brand-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent);
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.nav-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.nav-badge {
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
}

.sync-dot.connected {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.sync-dot.error {
    background: var(--red);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.sync-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-settings-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-settings-btn:hover {
    color: var(--text-primary);
}


/* ----------------------------------------------------------------
   6. Top Bar
   ---------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.last-updated {
    font-size: 11px;
    color: var(--text-tertiary);
}


/* ----------------------------------------------------------------
   7. Date Range Pills
   ---------------------------------------------------------------- */
.date-range-group {
    display: flex;
    gap: 2px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 2px;
}

.range-pill {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.range-pill.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 500;
}

.range-pill:hover:not(.active) {
    color: var(--text-primary);
}


/* ----------------------------------------------------------------
   8. Buttons
   ---------------------------------------------------------------- */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    opacity: 0.9;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-success {
    background: var(--green);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-full {
    width: 100%;
    margin-top: 16px;
}


/* ----------------------------------------------------------------
   9. Sections
   ---------------------------------------------------------------- */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
}

.section-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ----------------------------------------------------------------
   10. Health Banner
   ---------------------------------------------------------------- */
.health-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
}

.health-banner.healthy {
    background: var(--green-dim);
}

.health-banner.warning {
    background: var(--orange-dim);
}

.health-banner.critical {
    background: var(--red-dim);
}

.health-banner.unknown {
    background: var(--bg-elevated);
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-banner.healthy .health-dot {
    background: var(--green);
}

.health-banner.warning .health-dot {
    background: var(--orange);
}

.health-banner.critical .health-dot {
    background: var(--red);
}

.health-banner.unknown .health-dot {
    background: var(--text-tertiary);
}


/* ----------------------------------------------------------------
   11. Metric Cards
   ---------------------------------------------------------------- */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.metrics-row.compact .metric-value {
    font-size: 20px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
    overflow: hidden;
}

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

.metric-card.hero {
    border-left: 3px solid var(--accent);
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-change {
    font-size: 12px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: var(--green);
}

.metric-change.negative {
    color: var(--red);
}

.metric-target {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.metric-sparkline {
    height: 32px;
    width: 100%;
    margin-top: 12px;
}

.metric-sparkline svg {
    width: 100%;
    height: 100%;
    display: block;
}


/* ----------------------------------------------------------------
   12. Charts
   ---------------------------------------------------------------- */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    overflow: hidden;
}

.chart-card.wide {
    grid-column: span 1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-body {
    height: 280px;
    position: relative;
}

.chart-body.compact {
    height: 200px;
}

.chart-body canvas,
.chart-body svg {
    width: 100%;
    height: 100%;
}


/* ----------------------------------------------------------------
   13. Funnel
   ---------------------------------------------------------------- */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.funnel-stage {
    position: relative;
}

.funnel-bar {
    height: 40px;
    background: linear-gradient(90deg, var(--accent-dim), rgba(212, 168, 75, 0.05));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding-left: 16px;
    padding-right: 16px;
    justify-content: space-between;
    transition: width 0.4s ease;
}

.funnel-val {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.funnel-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.funnel-rate {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 2px 0;
}


/* ----------------------------------------------------------------
   14. Tables
   ---------------------------------------------------------------- */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.table-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.empty-row td {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.filter-select {
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    border-color: var(--accent);
}


/* ----------------------------------------------------------------
   15. North Star Grid
   ---------------------------------------------------------------- */
.northstar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.northstar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color 0.15s ease;
}

.northstar-card:hover {
    border-color: var(--border-hover);
}

.ns-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.ns-name {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.ns-target {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ns-value {
    font-size: 24px;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.2;
}

.ns-bar {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.ns-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.ns-fill.on-track {
    background: var(--green);
}

.ns-fill.at-risk {
    background: var(--orange);
}

.ns-fill.below {
    background: var(--red);
}


/* ----------------------------------------------------------------
   16. Persona Cards
   ---------------------------------------------------------------- */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.persona-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s ease;
}

.persona-card:hover {
    border-color: var(--border-hover);
}

.persona-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.persona-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.persona-pct {
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.persona-val {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.persona-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.persona-target-line {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}


/* ----------------------------------------------------------------
   17. Intelligence Cards
   ---------------------------------------------------------------- */
.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.intel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s ease;
}

.intel-card:hover {
    border-color: var(--border-hover);
}

.intel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.intel-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.intel-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.intel-status.positive {
    background: var(--green-dim);
    color: var(--green);
}

.intel-status.negative {
    background: var(--red-dim);
    color: var(--red);
}

.intel-status.neutral {
    background: var(--orange-dim);
    color: var(--orange);
}

.intel-metrics {
    display: flex;
    gap: 24px;
}

.intel-metric {
    flex: 1;
}

.intel-mlabel {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.intel-mval {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.intel-impact {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.intel-ilabel {
    color: var(--text-secondary);
}

.intel-ival {
    font-weight: 500;
    margin-left: 4px;
}

.intel-ival.positive {
    color: var(--green);
}

.intel-ival.negative {
    color: var(--red);
}


/* ----------------------------------------------------------------
   18. Integration Cards
   ---------------------------------------------------------------- */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.integration-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s ease;
}

.integration-card:hover {
    border-color: var(--border-hover);
}

.int-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.int-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.int-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.int-status.healthy {
    background: var(--green-dim);
    color: var(--green);
}

.int-status.stale {
    background: var(--orange-dim);
    color: var(--orange);
}

.int-status.outdated {
    background: var(--red-dim);
    color: var(--red);
}

.int-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.int-detail + .int-detail {
    border-top: 1px solid var(--border);
}

.int-label {
    color: var(--text-secondary);
}


/* ----------------------------------------------------------------
   19. Sequence Grid
   ---------------------------------------------------------------- */
.sequence-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.seq-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: background 0.15s ease;
}

.seq-card:hover {
    background: var(--bg-card-hover);
}

.seq-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.seq-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.seq-rate {
    font-size: 20px;
    font-weight: 600;
    margin: 8px 0;
    color: var(--text-primary);
    line-height: 1.2;
}

.seq-status {
    width: 100%;
    height: 3px;
    border-radius: 2px;
}

.seq-status.good {
    background: var(--green);
}

.seq-status.fair {
    background: var(--orange);
}

.seq-status.poor {
    background: var(--red);
}


/* ----------------------------------------------------------------
   20. Alerts
   ---------------------------------------------------------------- */
.alerts-section {
    margin-top: 24px;
}

.alert-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--red-dim);
    color: var(--red);
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--blue);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: background 0.15s ease;
}

.alert-item:hover {
    background: var(--bg-card-hover);
}

.alert-item.critical {
    border-left-color: var(--red);
}

.alert-item.warning {
    border-left-color: var(--orange);
}

.alert-item.info {
    border-left-color: var(--blue);
}

.alert-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.alert-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}


/* ----------------------------------------------------------------
   21. Insights
   ---------------------------------------------------------------- */
.insight-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.insight-tab {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.insight-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.insight-tab.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.insight-empty, .friction-empty, .review-empty {
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 16px;
    text-align: center;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.15s ease;
}

.insight-card:hover {
    border-color: var(--border-hover);
}

.insight-card.priority-high {
    border-left-color: var(--red);
}

.insight-card.priority-medium {
    border-left-color: var(--orange);
}

.insight-card.priority-low {
    border-left-color: var(--green);
}

.insight-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.insight-body {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.insight-data {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.insight-datum {
    font-size: 11px;
    color: var(--text-tertiary);
}

.insight-datum .value {
    color: var(--text-primary);
    font-weight: 500;
}


/* ----------------------------------------------------------------
   22. Feedback Summary
   ---------------------------------------------------------------- */
.feedback-summary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.fb-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fb-summary-card:hover {
    border-color: var(--border-hover);
}

.fb-summary-card.active {
    border-color: var(--accent);
}

.fb-sum-count {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.fb-sum-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 500;
}


/* ----------------------------------------------------------------
   23. Reviews
   ---------------------------------------------------------------- */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
}

.review-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.review-stars {
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 1px;
}

.review-author {
    font-size: 12px;
    color: var(--text-tertiary);
}

.review-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}

.avg-rating {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}


/* ----------------------------------------------------------------
   24. Modals
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 8px;
}

.modal-body {
    margin-top: 8px;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}

.form-group {
    margin-top: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}


/* ----------------------------------------------------------------
   25. Heatmap Table Cells
   ---------------------------------------------------------------- */
.heatmap-table {
    width: 100%;
    border-collapse: collapse;
}

.heatmap-table th {
    padding: 8px 12px;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.heatmap-table td {
    padding: 6px 8px;
    font-size: 12px;
}

.heatmap-table td.heat {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    border-radius: 2px;
}

.heatmap-table td.heat-0 {
    background: transparent;
    color: var(--text-tertiary);
}

.heatmap-table td.heat-1 {
    background: rgba(34, 197, 94, 0.08);
    color: var(--green);
}

.heatmap-table td.heat-2 {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.heatmap-table td.heat-3 {
    background: rgba(34, 197, 94, 0.25);
    color: var(--green);
}

.heatmap-table td.heat-4 {
    background: rgba(34, 197, 94, 0.40);
    color: #fff;
}

.heatmap-table td.heat-5 {
    background: var(--green);
    color: #fff;
}


/* ----------------------------------------------------------------
   26. Detail Panel
   ---------------------------------------------------------------- */
.detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 16px;
    overflow: hidden;
}

.detail-panel-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.detail-panel-body {
    padding: 20px;
}

.detail-field {
    margin-bottom: 16px;
}

.detail-field p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 4px 0 0;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    gap: 24px;
}

.detail-stat {
    flex: 1;
}

.detail-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.detail-stat-val {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}


/* ----------------------------------------------------------------
   27. Power Calculator
   ---------------------------------------------------------------- */
.power-calc {
    padding: 20px;
}

.power-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.power-result {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    text-align: center;
}

.power-result-value {
    font-size: 36px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}

.power-result-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 500;
}

.power-result-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}


/* ----------------------------------------------------------------
   28. Friction Grid
   ---------------------------------------------------------------- */
.friction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.friction-list {
    padding: 12px 16px;
}

.friction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.friction-row:last-child {
    border-bottom: none;
}

.friction-row-name {
    color: var(--text-secondary);
}

.friction-row-val {
    font-weight: 500;
    color: var(--text-primary);
}


/* ----------------------------------------------------------------
   29. Toast Notifications
   ---------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 13px;
    min-width: 280px;
    color: var(--text-primary);
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast.success {
    border-left: 3px solid var(--green);
}

.toast.error {
    border-left: 3px solid var(--red);
}

.toast.warning {
    border-left: 3px solid var(--orange);
}

.toast.info {
    border-left: 3px solid var(--blue);
}

/* Status badges for tables */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.status-badge.active, .status-badge.running {
    background: var(--green-dim);
    color: var(--green);
}

.status-badge.trial {
    background: var(--blue-dim);
    color: var(--blue);
}

.status-badge.cancelled, .status-badge.killed {
    background: var(--red-dim);
    color: var(--red);
}

.status-badge.completed, .status-badge.shipped {
    background: var(--accent-dim);
    color: var(--accent);
}

.status-badge.billing_issue {
    background: var(--orange-dim);
    color: var(--orange);
}

/* ----------------------------------------------------------------
   30. Animations
   ---------------------------------------------------------------- */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.refreshing svg {
    animation: spin 1s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    display: inline-block;
    height: 1em;
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

.skeleton-text.sm {
    width: 40px;
}

.skeleton-text.md {
    width: 60px;
}

.skeleton-text.lg {
    width: 80px;
}


/* ----------------------------------------------------------------
   31. Sparklines
   ---------------------------------------------------------------- */
.sparkline {
    display: inline-block;
    vertical-align: middle;
}

.sparkline svg {
    display: block;
}

.sparkline-line {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-line.up {
    stroke: var(--green);
}

.sparkline-line.down {
    stroke: var(--red);
}

.sparkline-line.flat {
    stroke: var(--text-tertiary);
}


/* ----------------------------------------------------------------
   32. Legacy / Compat Sections
   ----------------------------------------------------------------
   These classes support the existing dashboard.html sections
   that may not yet use the new naming conventions.
   ---------------------------------------------------------------- */

/* Hero section (overview page) */
.hero {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.hero-metric {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: -1px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.hero-context {
    font-size: 14px;
    color: var(--text-secondary);
}

.hero-change {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
}

.hero-change.positive {
    background: var(--green-dim);
    color: var(--green);
}

.hero-change.negative {
    background: var(--red-dim);
    color: var(--red);
}

.hero-change.neutral {
    background: rgba(161, 161, 170, 0.15);
    color: var(--text-secondary);
}

/* Health status (overview) */
.health-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 100px;
    margin-bottom: 12px;
}

.health-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Pillars grid */
.pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pillar-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pillar-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

.pillar-status.attention {
    background: var(--orange);
}

.pillar-status.critical {
    background: var(--red);
}

.pillar-status.unknown {
    background: var(--text-tertiary);
}

.pillar-value {
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.pillar-context {
    font-size: 11px;
    color: var(--text-secondary);
}

.pillar-trend {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    opacity: 0.3;
}

/* Attention items */
.attention-section {
    margin-bottom: 24px;
}

.attention-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.attention-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--bg);
    flex-shrink: 0;
}

.attention-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attention-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--orange);
    cursor: pointer;
    transition: all 0.15s ease;
}

.attention-item:hover {
    background: var(--bg-card-hover);
}

.attention-item.critical {
    border-left-color: var(--red);
}

.attention-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attention-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.attention-item-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.attention-item-action {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

.attention-empty {
    padding: 32px;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.attention-empty-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Funnel (legacy) */
.funnel-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.funnel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.funnel-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 48px;
    width: var(--funnel-width, 100%);
    margin: 0 auto;
    transition: width 0.4s ease-out;
}

.funnel-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--accent-dim) 0%, rgba(212, 168, 75, 0.05) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 168, 75, 0.15);
}

.funnel-stage-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.funnel-left {
    display: flex;
    flex-direction: column;
}

.funnel-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.funnel-rate-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.funnel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    color: var(--text-tertiary);
    font-size: 12px;
}

.funnel-arrow-icon {
    transform: rotate(90deg);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 24px;
}

.empty-state-steps {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.empty-state-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.step-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* North Star section (legacy) */
.northstar-section {
    margin-bottom: 24px;
}

.northstar-metric {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.northstar-metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.northstar-metric-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.northstar-metric-target {
    font-size: 10px;
    color: var(--text-tertiary);
}

.northstar-metric-value {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.northstar-metric-value.on-track {
    color: var(--green);
}

.northstar-metric-value.at-risk {
    color: var(--orange);
}

.northstar-metric-value.below-target {
    color: var(--red);
}

.northstar-progress {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.northstar-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.northstar-progress-bar.on-track {
    background: var(--green);
}

.northstar-progress-bar.at-risk {
    background: var(--orange);
}

.northstar-progress-bar.below-target {
    background: var(--red);
}

.northstar-info {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Persona section (legacy) */
.persona-section {
    margin-bottom: 24px;
}

.persona-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.persona-metric-value {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.persona-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.persona-target {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.persona-card.template-warrior {
    border-left: 3px solid var(--chart-1);
}

.persona-card.guided-beginner {
    border-left: 3px solid var(--chart-2);
}

.persona-card.serious-athlete {
    border-left: 3px solid var(--chart-3);
}

.persona-card.comeback-lifter {
    border-left: 3px solid var(--chart-4);
}

/* Friction section (legacy) */
.friction-section {
    margin-bottom: 24px;
}

.friction-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.friction-card-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.friction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.friction-item + .friction-item {
    margin-top: 6px;
}

.friction-item-name {
    font-size: 13px;
    color: var(--text-primary);
}

.friction-item-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--orange);
}

.friction-item-value.critical {
    color: var(--red);
}

/* Intelligence section (legacy) */
.intelligence-section {
    margin-bottom: 24px;
}

.intelligence-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.intelligence-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.intelligence-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.intelligence-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.intelligence-status.positive {
    background: var(--green-dim);
    color: var(--green);
}

.intelligence-status.negative {
    background: var(--red-dim);
    color: var(--red);
}

.intelligence-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.intelligence-metric {
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

.intelligence-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.intelligence-metric-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.intelligence-comparison {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.intelligence-comparison-label {
    color: var(--text-secondary);
}

.intelligence-comparison-value {
    color: var(--text-primary);
    font-weight: 500;
}

.intelligence-comparison-value.positive {
    color: var(--green);
}

/* Heatmap section (legacy) */
.heatmap-section {
    margin-bottom: 24px;
}

.heatmap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    overflow-x: auto;
}

.heatmap-header {
    display: flex;
    padding-left: 80px;
    margin-bottom: 8px;
}

.heatmap-header-cell {
    flex: 1;
    min-width: 50px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.heatmap-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.heatmap-label {
    width: 80px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.heatmap-cells {
    display: flex;
    flex: 1;
    gap: 2px;
}

.heatmap-cell {
    flex: 1;
    min-width: 50px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    transition: transform 0.1s ease;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 1;
}

.heatmap-cell[data-intensity="0"] {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
}

.heatmap-cell[data-intensity="1"] {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
}

.heatmap-cell[data-intensity="2"] {
    background: rgba(34, 197, 94, 0.2);
    color: var(--green);
}

.heatmap-cell[data-intensity="3"] {
    background: rgba(34, 197, 94, 0.35);
    color: #fff;
}

.heatmap-cell[data-intensity="4"] {
    background: rgba(34, 197, 94, 0.55);
    color: #fff;
}

.heatmap-cell[data-intensity="5"] {
    background: var(--green);
    color: #fff;
}

.heatmap-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Filters bar (legacy) */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.filter-pills {
    display: flex;
    gap: 4px;
}

.filter-pill {
    padding: 5px 10px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.filter-pill:hover {
    background: var(--border);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent);
    color: var(--bg);
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* Insights tabs & enhanced cards (legacy) */
.insights-section {
    margin-bottom: 24px;
}

.insights-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 3px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.insights-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.insights-tab:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.insights-tab.active {
    background: var(--accent);
    color: var(--bg);
}

.insight-card-enhanced {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 3px solid transparent;
}

.insight-card-enhanced.priority-high {
    border-left-color: var(--red);
}

.insight-card-enhanced.priority-medium {
    border-left-color: var(--orange);
}

.insight-card-enhanced.priority-low {
    border-left-color: var(--green);
}

.insight-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insight-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.insight-icon.opportunity {
    background: var(--green-dim);
}

.insight-icon.warning {
    background: var(--orange-dim);
}

.insight-icon.info {
    background: var(--accent-dim);
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-detail {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.insight-metric {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.insight-category {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.insight-action {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border-left: 2px solid var(--accent);
}

.insight-action strong {
    color: var(--accent);
}

.insight-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.insight-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.insight-btn.primary {
    background: var(--accent);
    color: var(--bg);
}

.insight-btn.primary:hover {
    filter: brightness(1.1);
}

.insight-btn.secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.insight-btn.secondary:hover {
    color: var(--text-primary);
}

.insight-data-point {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.insight-data-point.positive {
    color: var(--green);
}

.insight-data-point.negative {
    color: var(--red);
}

.insight-data-point.neutral {
    color: var(--accent);
}

.insights-empty {
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Reviews section (legacy) */
.reviews-section {
    margin-bottom: 24px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    border-left: 3px solid var(--text-tertiary);
    transition: border-color 0.15s ease;
}

.review-card.negative {
    border-left-color: var(--red);
}

.review-card.positive {
    border-left-color: var(--green);
}

.review-card.feature {
    border-left-color: var(--accent);
}

.review-rating {
    font-size: 12px;
    color: var(--text-secondary);
}

.review-rating .star {
    color: var(--accent);
}

.review-date {
    font-size: 10px;
    color: var(--text-tertiary);
}

.review-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.review-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.review-tag {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.review-tag.bug {
    background: var(--red-dim);
    color: var(--red);
}

.review-tag.feature {
    background: var(--accent-dim);
    color: var(--accent);
}

.review-tag.praise {
    background: var(--green-dim);
    color: var(--green);
}

.reviews-empty {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.reviews-empty-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Refresh button (legacy) */
.refresh-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.refresh-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.refresh-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
}

/* Header (legacy — single-page dashboard compat) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-lg);
}

.nav-link {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.header-link {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.header-link:hover {
    color: var(--text-primary);
}

/* Dashboard container (legacy single-page) */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
}


/* ----------------------------------------------------------------
   33. Feedback Inbox (Full Section)
   ---------------------------------------------------------------- */
.feedback-inbox-section {
    margin-bottom: 24px;
}

.feedback-header-actions {
    display: flex;
    gap: 8px;
}

.feedback-export-btn {
    font-size: 11px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.feedback-export-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.feedback-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.feedback-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-filters .filter-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.feedback-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.feedback-summary-card:hover {
    border-color: var(--border-hover);
}

.feedback-summary-card.active {
    border-color: var(--accent);
}

.feedback-summary-count {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-summary-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.feedback-summary-new {
    font-size: 10px;
    color: var(--accent);
    margin-top: 4px;
}

.feedback-by-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 16px;
}

.feedback-area-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.feedback-area-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-area-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.feedback-area-item:last-child {
    border-bottom: none;
}

.feedback-area-name {
    font-size: 12px;
    color: var(--text-primary);
}

.feedback-area-breakdown {
    font-size: 11px;
    color: var(--text-secondary);
}

.feedback-area-empty {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 8px;
}

.feedback-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.feedback-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.feedback-table-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-batch-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feedback-apply-btn {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.feedback-apply-btn:hover {
    opacity: 0.9;
}

.feedback-table {
    width: 100%;
    border-collapse: collapse;
}

.feedback-table th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.feedback-table td {
    font-size: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.feedback-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.feedback-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.feedback-col-select {
    width: 40px;
    text-align: center;
}

.feedback-col-category {
    width: 80px;
}

.feedback-col-urgency {
    width: 80px;
}

.feedback-col-subject {
    min-width: 200px;
}

.feedback-col-area {
    width: 120px;
}

.feedback-col-time {
    width: 80px;
}

.feedback-col-actions {
    width: 60px;
    text-align: center;
}

.feedback-category-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.feedback-category-badge.bug {
    background: var(--red-dim);
    color: var(--red);
}

.feedback-category-badge.feature {
    background: var(--accent-dim);
    color: var(--accent);
}

.feedback-category-badge.question {
    background: var(--blue-dim);
    color: var(--blue);
}

.feedback-category-badge.praise {
    background: var(--green-dim);
    color: var(--green);
}

.feedback-category-badge.other {
    background: rgba(161, 161, 170, 0.15);
    color: var(--text-secondary);
}

.feedback-urgency-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.feedback-urgency-badge.blocker {
    background: var(--red);
    color: white;
}

.feedback-urgency-badge.major {
    background: var(--orange);
    color: var(--bg);
}

.feedback-urgency-badge.minor {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.feedback-urgency-badge.cosmetic {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
}

.feedback-subject-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feedback-area-badge {
    font-size: 10px;
    color: var(--text-secondary);
}

.feedback-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.feedback-expand-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.feedback-expand-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.feedback-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.feedback-empty-row td {
    border-bottom: none;
}

.feedback-load-more {
    padding: 12px;
    text-align: center;
    display: none;
}

.feedback-load-more.visible {
    display: block;
}

.feedback-load-btn {
    font-size: 12px;
    padding: 8px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.feedback-load-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Feedback detail panel */
.feedback-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.feedback-detail-panel.hidden {
    display: none;
}

.feedback-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.feedback-detail-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.feedback-detail-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s ease;
}

.feedback-detail-close:hover {
    color: var(--text-primary);
}

.feedback-detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.feedback-detail-category,
.feedback-detail-area,
.feedback-detail-urgency,
.feedback-detail-time {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.feedback-detail-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    white-space: pre-wrap;
}

.feedback-detail-contact {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.feedback-detail-contact:empty {
    display: none;
}

.feedback-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.feedback-action-btn {
    font-size: 11px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.feedback-action-btn:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.feedback-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-detail-notes {
    margin-top: 16px;
}

.feedback-detail-notes label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.feedback-detail-notes textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease;
}

.feedback-detail-notes textarea:focus {
    border-color: var(--accent);
}

.feedback-save-notes {
    margin-top: 8px;
    font-size: 11px;
    padding: 6px 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.feedback-save-notes:hover {
    opacity: 0.9;
}


/* ----------------------------------------------------------------
   34. Responsive Breakpoints
   ---------------------------------------------------------------- */

/* Large screens: charts stack */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Medium screens: sidebar collapses, grids adjust */
@media (max-width: 900px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar .brand-text,
    .sidebar .nav-item span,
    .sidebar .sync-label,
    .sidebar .nav-badge {
        display: none;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 10px;
    }

    .sidebar .sidebar-brand {
        justify-content: center;
        padding: 20px 8px;
    }

    .main {
        margin-left: var(--sidebar-collapsed-width);
    }

    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .persona-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .intelligence-grid {
        grid-template-columns: 1fr;
    }

    .integration-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .power-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .pillars {
        grid-template-columns: repeat(2, 1fr);
    }

    .friction-grid {
        grid-template-columns: 1fr;
    }

    .sequence-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .northstar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* Small screens: single columns */
@media (max-width: 600px) {
    .content {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }

    .feedback-summary-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .feedback-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .sequence-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .persona-grid {
        grid-template-columns: 1fr;
    }

    .pillars {
        grid-template-columns: 1fr;
    }

    .integration-grid {
        grid-template-columns: 1fr;
    }

    .northstar-grid {
        grid-template-columns: 1fr;
    }

    .hero-metric {
        font-size: 36px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-divider {
        display: none;
    }

    .heatmap-header {
        padding-left: 60px;
    }

    .heatmap-label {
        width: 60px;
        font-size: 10px;
    }

    .heatmap-cell {
        min-width: 40px;
        font-size: 10px;
    }

    .feedback-filters {
        flex-direction: column;
        gap: 12px;
    }

    .feedback-col-urgency,
    .feedback-col-area {
        display: none;
    }

    .feedback-detail-panel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .feedback-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .feedback-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .feedback-batch-actions {
        display: none;
    }

    .sequence-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small (iPhone SE class) */
@media (max-width: 375px) {
    .hero-metric {
        font-size: 32px;
    }

    .pillar-value {
        font-size: 24px;
    }

    .metric-value {
        font-size: 22px;
    }

    .filter-pill {
        padding: 8px 10px;
        min-width: 38px;
    }

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

/* Touch-friendly targets (mobile) */
@media (max-width: 768px) {
    .dashboard {
        padding: 12px 16px;
    }

    .filter-pill {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .pillar {
        padding: 18px;
        min-height: 100px;
    }

    .pillar-value {
        font-size: 28px;
    }

    .detail-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 24px;
    }

    .insight-btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .insights-tab {
        min-height: 44px;
        padding: 12px 16px;
    }

    .funnel {
        padding: 12px;
    }

    .funnel-stage {
        padding: 10px 12px;
        min-height: 44px;
    }

    .funnel-value {
        font-size: 18px;
    }

    .funnel-arrow {
        padding: 4px 0;
    }

    .hero {
        padding: 16px 0;
    }

    .hero-metric {
        font-size: 40px;
    }

    .attention-item {
        padding: 14px 16px;
        min-height: 60px;
    }

    .northstar-metric {
        padding: 16px;
    }

    .northstar-metric-value {
        font-size: 24px;
    }

    .feedback-table {
        font-size: 11px;
    }

    .nav-item {
        min-height: 44px;
    }
}


/* ----------------------------------------------------------------
   35. Safe Area (notched devices)
   ---------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-top)) {
    .dashboard {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .content {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }

    .toast-container {
        bottom: max(24px, env(safe-area-inset-bottom));
        right: max(24px, env(safe-area-inset-right));
    }
}


/* ----------------------------------------------------------------
   36. Print Styles
   ---------------------------------------------------------------- */
@media print {
    .sidebar,
    .topbar,
    .toast-container,
    .modal-overlay,
    .btn,
    .feedback-detail-panel {
        display: none !important;
    }

    .main {
        margin-left: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .metric-card,
    .chart-card,
    .table-card,
    .persona-card,
    .intel-card,
    .integration-card,
    .northstar-card,
    .pillar,
    .intelligence-card,
    .friction-card {
        border: 1px solid #ddd;
        background: #fff;
        color: #000;
    }

    .metric-value,
    .persona-val,
    .intel-mval,
    .detail-stat-val,
    .pillar-value,
    .hero-metric {
        color: #000;
    }

    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}


/* ----------------------------------------------------------------
   35. Insight Actions & Impact (Next Best Action)
   ---------------------------------------------------------------- */
.insight-action {
    cursor: pointer;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid var(--border);
}

.insight-action:hover .insight-action-text {
    text-decoration: underline;
}

.insight-action-text {
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
}

.insight-action-arrow {
    color: var(--text-tertiary);
    font-size: 11px;
}

.insight-impact {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

.insight-impact.revenue {
    color: var(--green);
}

.insight-impact.retention {
    color: var(--blue);
}

.insight-impact.acquisition {
    color: var(--orange);
}

.insight-score {
    font-size: 10px;
    opacity: 0.6;
    margin-left: 8px;
    font-weight: 400;
}


/* ----------------------------------------------------------------
   36. Keyword Signal Badges
   ---------------------------------------------------------------- */
.signal-scale {
    color: var(--green);
    font-weight: 500;
    font-size: 12px;
}

.signal-monitor {
    color: var(--orange);
    font-weight: 500;
    font-size: 12px;
}

.signal-pause {
    color: var(--red);
    font-weight: 500;
    font-size: 12px;
}

.signal-protect {
    color: var(--accent);
    font-weight: 500;
    font-size: 12px;
}


/* ----------------------------------------------------------------
   37. Budget Tracker
   ---------------------------------------------------------------- */
.budget-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-elevated);
    margin-top: 8px;
}

.budget-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.budget-fill.over {
    background: var(--red);
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.asa-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
