/* ============================================================
   CHURNGUARD AI
   CUSTOMER RETENTION DECISION INTELLIGENCE
   ============================================================ */

/* ============================================================
   GLOBAL THEME VARIABLES (LIGHT / DARK SYSTEM)
   ============================================================ */

:root {
  --bg-primary: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --border-color: #dfe6ef;
  --border-focus: #1f6feb;
  --text-primary: #182230;
  --text-secondary: #475569;
  --text-muted: #8a97a8;
  --card-shadow: 0 2px 5px rgba(20, 34, 54, 0.025);
  --accent-blue: #1f6feb;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --border-color: #334155;
  --border-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
}

/* Global Theme Override Rules */
[data-theme="dark"] body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .main-content {
  background: var(--bg-primary) !important;
}

[data-theme="dark"] .topbar {
  border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .form-group-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .intervention-card,
[data-theme="dark"] .economics-card,
[data-theme="dark"] .roi-panel,
[data-theme="dark"] .simulation-layout,
[data-theme="dark"] .forecast-summary-item,
[data-theme="dark"] .decision-terminal {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-card-title,
[data-theme="dark"] .panel-header,
[data-theme="dark"] .roi-panel-header {
  border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .intervention-reason,
[data-theme="dark"] .intervention-meta div,
[data-theme="dark"] .intervention-economics div,
[data-theme="dark"] .roi-intervention-card,
[data-theme="dark"] .sim-box {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .theme-switch-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
}

/* Theme Switch Button */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #d9e2ee;
  background: #ffffff;
  color: #526174;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-switch-btn:hover {
  border-color: #1f6feb;
}

/* Clean Decision Terminal */
.decision-terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.decision-terminal-header {
  padding: 16px 22px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.decision-terminal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  padding: 22px;
}

@media (max-width: 900px) {
  .decision-terminal-body {
    grid-template-columns: 1fr;
  }
}   

/* ============================================================
   RESET
   ============================================================ */

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


html {
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f4f7fb;
    color: #182230;

    line-height: 1.5;
}


button,
input,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
    text-decoration: none;
}


/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell {
    min-height: 100vh;
    display: flex;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: 260px;
    min-height: 100vh;

    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;

    background: #101827;
    color: #ffffff;

    border-right: 1px solid #202c3e;

    z-index: 100;
}


.brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 26px 22px;

    border-bottom: 1px solid #202c3e;
}


.brand-mark {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background: #1f6feb;

    font-size: 14px;
    font-weight: 800;

    letter-spacing: 0.04em;
}


.brand-text h1 {
    font-size: 17px;
    line-height: 1.1;
}


.brand-text span {
    display: block;

    margin-top: 4px;

    color: #8d9bad;

    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}


.sidebar-nav {
    flex: 1;

    padding: 22px 14px;
}


.nav-item {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 11px 12px;

    margin-bottom: 5px;

    border-radius: 9px;

    color: #9ca9ba;

    font-size: 13px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.nav-item:hover {
    background: #182337;
    color: #ffffff;
}


.nav-item.active {
    background: #1b4f91;
    color: #ffffff;
}


.nav-icon {
    width: 26px;

    color: #66758a;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.08em;
}


.nav-item.active .nav-icon {
    color: #a9d0ff;
}


.sidebar-footer {
    padding: 18px;

    border-top: 1px solid #202c3e;
}


.system-status {
    display: flex;
    align-items: center;

    gap: 10px;
}


.system-status strong {
    display: block;

    color: #dce4ef;

    font-size: 11px;
}


.system-status span:not(.status-dot) {
    color: #718096;

    font-size: 10px;
}


.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    flex-shrink: 0;

    border-radius: 50%;
}


.status-online {
    background: #36c991;
}


.status-checking {
    background: #f0b429;
}


.status-offline {
    background: #e05252;
}


.version {
    margin-top: 14px;

    color: #566478;

    font-size: 10px;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    width: calc(100% - 260px);

    margin-left: 260px;

    min-height: 100vh;

    padding: 0 42px 60px;
}


/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
    min-height: 170px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 35px 0;

    border-bottom: 1px solid #dce3ec;
}


.eyebrow {
    margin-bottom: 7px;

    color: #1f6feb;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.12em;
}


.topbar h2 {
    font-size: 30px;
    line-height: 1.15;

    letter-spacing: -0.025em;
}


.page-description {
    max-width: 650px;

    margin-top: 8px;

    color: #68778b;

    font-size: 13px;
}


.topbar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 9px;
}


.environment-badge {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 7px 11px;

    border: 1px solid #d9e2ee;
    border-radius: 20px;

    background: #ffffff;

    color: #526174;

    font-size: 11px;
    font-weight: 700;
}


.request-id {
    color: #8996a7;

    font-family: monospace;

    font-size: 9px;
}


/* ============================================================
   ALERT
   ============================================================ */

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 22px;

    padding: 13px 16px;

    border: 1px solid #efc9c9;
    border-radius: 9px;

    background: #fff6f6;

    color: #a33b3b;

    font-size: 12px;
    font-weight: 600;
}


.alert button {
    border: 0;

    background: transparent;

    color: inherit;

    font-size: 20px;
}


.hidden {
    display: none !important;
}


/* ============================================================
   DASHBOARD SECTIONS
   ============================================================ */

.dashboard-section {
    padding-top: 48px;
}


.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.section-heading > div {
    display: flex;
    align-items: flex-start;

    gap: 13px;
}


.section-number {
    min-width: 29px;

    padding-top: 4px;

    color: #1f6feb;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.08em;
}


.section-heading h3 {
    font-size: 19px;
    line-height: 1.2;
}


.section-heading p {
    margin-top: 4px;

    color: #758397;

    font-size: 12px;
}


.section-badge {
    padding: 5px 9px;

    border-radius: 5px;

    background: #eaf2ff;

    color: #2765ad;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}


/* ============================================================
   FORMS
   ============================================================ */

.profile-form {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


.form-group-card {
    padding: 20px;

    border: 1px solid #dfe6ef;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 2px 5px rgba(20, 34, 54, 0.025);
}


.form-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;

    padding-bottom: 11px;

    border-bottom: 1px solid #edf1f6;
}


.form-card-title h4 {
    font-size: 13px;
}


.form-card-title span {
    color: #9aa6b6;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 17px;
}


.field {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.field-wide {
    grid-column: span 2;
}


.field label {
    display: flex;
    justify-content: space-between;

    margin-bottom: 7px;

    color: #46566a;

    font-size: 11px;
    font-weight: 700;
}


.field label span {
    color: #9aa6b6;

    font-size: 9px;
    font-weight: 600;
}


.field input,
.field select {
    width: 100%;

    min-height: 40px;

    padding: 9px 11px;

    border: 1px solid #d6dee9;
    border-radius: 7px;

    outline: none;

    background: #fbfcfe;
    color: #1d2a3a;

    font-size: 12px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.field input:focus,
.field select:focus {
    border-color: #5291e8;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(31, 111, 235, 0.08);
}


.field small {
    margin-top: 4px;

    color: #9aa6b6;

    font-size: 9px;
}


.form-actions {
    display: flex;
    justify-content: flex-end;

    gap: 10px;

    padding-top: 5px;
}


.button {
    min-height: 42px;

    padding: 0 19px;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 800;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}


.button:hover {
    transform: translateY(-1px);
}


.button:disabled {
    opacity: 0.65;

    cursor: not-allowed;

    transform: none;
}


.button-primary {
    border: 1px solid #1f6feb;

    background: #1f6feb;
    color: #ffffff;

    box-shadow:
        0 4px 10px rgba(31, 111, 235, 0.15);
}


.button-primary:hover {
    background: #185fcf;
}


.button-secondary {
    border: 1px solid #d4dce7;

    background: #ffffff;

    color: #59687a;
}


.button-spinner {
    width: 14px;
    height: 14px;

    display: inline-block;

    margin-left: 8px;

    vertical-align: middle;

    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}


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


/* ============================================================
   METRIC CARDS
   ============================================================ */

.metric-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}


.metric-card {
    min-height: 145px;

    padding: 20px;

    border: 1px solid #dfe6ef;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 2px 5px rgba(20, 34, 54, 0.025);
}


.metric-label {
    color: #738196;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}


.metric-value {
    margin-top: 13px;

    color: #172536;

    font-size: 29px;
    font-weight: 800;

    line-height: 1;
}


.metric-description {
    margin-top: 10px;

    color: #8a97a8;

    font-size: 10px;
}


.risk-card {
    display: flex;
    flex-direction: column;
}


.risk-badge {
    display: inline-flex;
    align-items: center;

    width: fit-content;

    margin-top: 13px;

    padding: 6px 10px;

    border-radius: 5px;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 0.04em;
}


.risk-neutral {
    background: #edf1f5;
    color: #667384;
}


.risk-critical {
    background: #ffe7e7;
    color: #b43232;
}

.risk-high {
    background: #ffebe0;
    color: #c05621;
}

.risk-moderate {
    background: #fff1d8;
    color: #9a6411;
}


.risk-low,
.risk-healthy {
    background: #e4f7ee;
    color: #247752;
}


/* ============================================================
   PANELS
   ============================================================ */

.panel {
    padding: 20px;

    border: 1px solid #dfe6ef;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 2px 5px rgba(20, 34, 54, 0.025);
}


.chart-panel {
    min-height: 360px;
}


.chart-placeholder {
    min-height: 320px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: #8693a5;
}


.placeholder-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    margin-bottom: 12px;

    border: 1px solid #dce5ef;
    border-radius: 50%;

    background: #f8fafc;

    color: #5e7795;

    font-size: 20px;
}


.chart-placeholder h4 {
    color: #506075;

    font-size: 13px;
}


.chart-placeholder p {
    max-width: 380px;

    margin-top: 5px;

    font-size: 11px;
}


/* ============================================================
   TWO COLUMN
   ============================================================ */

.two-column-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 13px;

    margin-bottom: 4px;

    border-bottom: 1px solid #edf1f6;
}


.panel-header h4 {
    font-size: 13px;
}


.panel-header span {
    color: #9aa6b6;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
}


.driver-list {
    min-height: 160px;

    padding-top: 10px;
}


.empty-state {
    min-height: 130px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: #a0abba;
}


.empty-state > span {
    margin-bottom: 8px;

    font-size: 21px;
}


.empty-state p {
    max-width: 300px;

    font-size: 10px;
}


.empty-state.large {
    min-height: 190px;
}


/* ============================================================
   INTERVENTION INTELLIGENCE PORTFOLIO
   ============================================================ */

.interventions-content {
    width: 100%;
}

.intervention-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.intervention-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--border-color, #dfe6ef);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.intervention-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.intervention-rank {
    font-size: 12px;
    font-weight: 800;
    color: #1f6feb;
    background: #eff6ff;
    padding: 3px 8px;
    border-radius: 6px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.priority-urgent {
    background: #fee2e2;
    color: #991b1b;
}

.priority-high {
    background: #ffedd5;
    color: #9a3412;
}

.priority-medium,
.priority-standard {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #dcfce7;
    color: #166534;
}

.intervention-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #0f172a;
    font-weight: 800;
}

.intervention-category {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.intervention-reason {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    border-radius: 8px;
    margin-bottom: 14px;
}

.intervention-reason strong,
.intervention-action strong {
    font-size: 11px;
    color: #334155;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.intervention-reason p,
.intervention-action p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
}

.intervention-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.intervention-meta div,
.intervention-economics div {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    border-radius: 8px;
}

.intervention-meta span,
.intervention-economics span {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.intervention-meta strong,
.intervention-economics strong {
    display: block;
    font-size: 11px;
    color: #0f172a;
    font-weight: 700;
}

.intervention-economics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.intervention-action {
    padding-top: 12px;
    border-top: 1px solid #edf1f6;
}

.intervention-disclaimer {
    margin-top: 16px;
    font-size: 11px;
    line-height: 1.5;
    color: #94a3b8;
    font-style: italic;
}

@media (max-width: 900px) {
    .intervention-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .intervention-meta,
    .intervention-economics {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SIMULATION
   ============================================================ */

.simulation-panel {
    min-height: 240px;
}


.simulation-intro {
    display: flex;
    align-items: center;

    gap: 13px;

    padding-bottom: 18px;

    border-bottom: 1px solid #edf1f6;
}


.simulation-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: #eef5ff;

    color: #3976c7;

    font-weight: 900;
}


.simulation-intro h4 {
    font-size: 13px;
}


.simulation-intro p {
    margin-top: 3px;

    color: #8390a0;

    font-size: 10px;
}


.simulation-placeholder {
    min-height: 100px;

    display: grid;
    place-items: center;

    color: #9aa6b6;

    font-size: 11px;
}


/* ============================================================
   ECONOMICS
   ============================================================ */

.economics-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}


/* ============================================================
   EXECUTIVE FINAL DECISION PANEL
   ============================================================ */

.decision-dashboard {
    width: 100%;
}

.decision-hero {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.decision-status-block,
.decision-priority-block,
.decision-risk-block {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
}

.decision-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 8px;
}

.decision-status,
.decision-priority {
    font-size: 15px;
    font-weight: 800;
}

.status-ready,
.status-recommend_intervention {
    color: #166534;
}

.status-consider_intervention {
    color: #92400e;
}

.status-human_review_required {
    color: #991b1b;
}

.status-monitor_and_review {
    color: #1d4ed8;
}

.status-no_targeted_intervention {
    color: #6b7280;
}

.decision-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.decision-recommendation-panel {
    padding: 26px;
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
}

.decision-recommendation-panel h3 {
    margin: 8px 0 12px;
    font-size: 24px;
    line-height: 1.3;
    color: #0f172a;
    font-weight: 800;
}

.decision-recommendation-panel p {
    margin: 0;
    color: #4b5563;
    line-height: 1.65;
    font-size: 13px;
}

.selected-decision-intervention {
    padding: 24px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.selected-intervention-heading span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 7px;
}

.selected-intervention-heading strong {
    display: block;
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 20px;
}

.selected-intervention-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.selected-intervention-details div {
    padding: 13px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #edf1f6;
}

.selected-intervention-details span {
    display: block;
    font-size: 10px;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

.selected-intervention-details strong {
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
}

.selected-action-text {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.selected-action-text strong {
    font-size: 11px;
    text-transform: uppercase;
    color: #334155;
    letter-spacing: 0.03em;
}

.selected-action-text p {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

.no-selected-intervention {
    padding: 22px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.no-selected-intervention strong {
    display: block;
    font-size: 14px;
    color: #334155;
    margin-bottom: 4px;
}

.no-selected-intervention p {
    margin-bottom: 0;
    color: #6b7280;
    font-size: 12px;
}

.decision-disclaimer {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    font-size: 11px;
    line-height: 1.6;
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 1000px) {
    .decision-hero,
    .selected-intervention-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .decision-hero,
    .selected-intervention-details {
        grid-template-columns: 1fr;
    }

    .decision-recommendation-panel h3 {
        font-size: 20px;
    }
}


/* ============================================================
   FOOTER
   ============================================================ */

.app-footer {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    margin-top: 70px;
    padding-top: 20px;

    border-top: 1px solid #dce3ec;

    color: #9aa6b6;

    font-size: 9px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {

    .form-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


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


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

}


@media (max-width: 900px) {

    .sidebar {
        width: 76px;
    }


    .brand {
        justify-content: center;

        padding: 20px 10px;
    }


    .brand-text,
    .sidebar-footer,
    .nav-item span:not(.nav-icon) {
        display: none;
    }


    .sidebar-nav {
        padding: 18px 9px;
    }


    .nav-item {
        justify-content: center;

        padding: 13px 5px;
    }


    .nav-icon {
        width: auto;
    }


    .main-content {
        width: calc(100% - 76px);

        margin-left: 76px;

        padding-left: 25px;
        padding-right: 25px;
    }


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


    .topbar {
        align-items: flex-start;

        flex-direction: column;
    }


    .topbar-meta {
        align-items: flex-start;
    }

}


@media (max-width: 650px) {

    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }


    .topbar h2 {
        font-size: 24px;
    }


    .form-grid,
    .metric-grid,
    .two-column-grid,
    .intervention-grid {
        grid-template-columns: 1fr;
    }


    .field-wide {
        grid-column: auto;
    }


    .form-actions {
        flex-direction: column-reverse;
    }


    .button {
        width: 100%;
    }


    .section-heading {
        flex-direction: column;
    }


    .app-footer {
        flex-direction: column;
    }

}

/* ============================================================
   DYNAMIC RESULT COMPONENTS
   ============================================================ */

.driver-row {
    display: flex;
    flex-direction: column;

    gap: 3px;

    padding: 11px 0;

    border-bottom: 1px solid #edf1f6;
}


.driver-row:last-child {
    border-bottom: 0;
}


.driver-row strong {
    color: #3b4b5f;

    font-size: 11px;
}


.driver-row span {
    color: #8996a7;

    font-size: 10px;
}


.decision-content {
    min-height: 190px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 9px;
}


.decision-content h4 {
    font-size: 17px;
}


.decision-content p {
    max-width: 700px;

    color: #778598;

    font-size: 11px;
}

.decision-recommendation-panel h3 {
    margin: 8px 0 12px;
    font-size: clamp(16px, 4vw, 24px);
    line-height: 1.3;
    color: #0f172a;
    font-weight: 800;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ============================================================
   FORECAST SUMMARY (STEP 4)
   ============================================================ */

.forecast-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.forecast-summary-item {
    padding: 18px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    background: var(--card-background, #ffffff);
}

.forecast-summary-item span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 7px;
}

.forecast-summary-item strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

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

@media (max-width: 600px) {
    .forecast-summary {
        grid-template-columns: 1fr;
    }
}

#forecast-chart {
    width: 100%;
    min-height: 380px;
}


/* ============================================================
   WHAT-IF SIMULATION (STEP 5)
   ============================================================ */

.section-header {
    margin-bottom: 20px;
}

.section-eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #1f6feb;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #101827;
    line-height: 1.2;
}

.section-header p {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    background: #ffffff;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 5px rgba(20, 34, 54, 0.025);
}

.simulation-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 20px;
    border-right: 1px solid #edf1f6;
}

.simulation-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.simulation-control label {
    font-size: 11px;
    font-weight: 700;
    color: #46566a;
}

.simulation-control select {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #d6dee9;
    border-radius: 7px;
    background: #fbfcfe;
    color: #1d2a3a;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.simulation-control select:focus {
    border-color: #1f6feb;
    background: #ffffff;
}

.simulation-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary {
    border: 1px solid #1f6feb;
    background: #1f6feb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #185fcf;
}

.btn-secondary {
    border: 1px solid #d4dce7;
    background: #ffffff;
    color: #59687a;
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.simulation-result {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.simulation-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #8693a5;
}

.simulation-empty .empty-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 18px;
    margin-bottom: 12px;
    color: #64748b;
}

.simulation-empty h3 {
    font-size: 15px;
    color: #475569;
}

.simulation-empty p {
    max-width: 320px;
    font-size: 11px;
    margin-top: 4px;
}

.sim-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.sim-box {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #dfe6ef;
    background: #f8fafc;
}

.sim-box.sim-scenario {
    background: #ffffff;
    border-color: #bfdbfe;
}

.sim-box h5 {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.sim-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #edf1f6;
    font-size: 12px;
}

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

.sim-delta-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.sim-delta-positive {
    background: #ecfdf5;
    color: #059669;
}

.sim-delta-negative {
    background: #fef2f2;
    color: #dc2626;
}

.sim-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    border-top: 1px solid #edf1f6;
    padding-top: 10px;
    margin-top: 14px;
}

@media (max-width: 950px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }
    .simulation-controls {
        border-right: none;
        border-bottom: 1px solid #edf1f6;
        padding-right: 0;
        padding-bottom: 20px;
    }
    .sim-comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   RETENTION ECONOMICS & ROI (STEP 6)
   ============================================================ */

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

.economics-card {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color, #dfe6ef);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(20, 34, 54, 0.025);
}

.economics-card span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.economics-card strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #101827;
    margin-bottom: 4px;
}

.economics-card small {
    font-size: 10px;
    color: #94a3b8;
}

.roi-panel {
    background: #ffffff;
    border: 1px solid var(--border-color, #dfe6ef);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 5px rgba(20, 34, 54, 0.025);
}

.roi-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #edf1f6;
    padding-bottom: 12px;
}

.roi-panel-header h3 {
    font-size: 16px;
    color: #0f172a;
    margin: 0;
}

.roi-intervention-card {
    padding: 20px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.roi-intervention-card h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #1e293b;
}

.roi-intervention-card p {
    font-size: 12px;
    color: #475569;
    margin: 0 0 16px;
}

.roi-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.roi-details div {
    padding: 14px;
    background: #ffffff;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
}

.roi-details span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.roi-details strong {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.economics-disclaimer {
    margin-top: 16px;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    .economics-grid,
    .roi-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .economics-grid,
    .roi-details {
        grid-template-columns: 1fr;
    }

    .roi-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.sidebar-nav a {
    position: relative;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.sidebar-nav a:hover {
    transform: translateX(2px);
}

.sidebar-nav a.active {
    font-weight: 700;
}

.sidebar-nav a.active::before {
    content: "";

    position: absolute;

    left: 0;

    top: 8px;

    bottom: 8px;

    width: 3px;

    border-radius: 3px;

    background: currentColor;
}

button.is-loading {
    cursor: wait;

    opacity: 0.75;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* ============================================================
   API STATUS INDICATORS (STEP 9.8)
   ============================================================ */

.status-online,
.api-online {
    background: #16a34a !important;
}

.status-offline,
.api-offline {
    background: #dc2626 !important;
}

.status-checking,
.api-checking {
    background: #f59e0b !important;
}