:root {
    --nx-obsidian: #0B0D0F;
    --nx-cloud: #F4F5F7;
    --nx-slate: #A7ADB7;
    --nx-radius: 14px;

    /* Sprout Social's own verified brand hex values -- used here directly
       per request, not just "inspired by". Their system is a RANGE of
       greens (light to deep) paired with a soft neutral and a dark
       charcoal, not one flat green. */
    --nx-accent: #2BB656;        /* primary -- buttons, active states, links */
    --nx-accent-hover: #0CA750;  /* deeper -- hover/pressed */
    --nx-accent-light: #75DD66;  /* light tint -- chart fills, secondary series */
    --nx-accent-soft: rgba(43, 182, 86, 0.14);

    /* The logo dot now uses --nx-accent (green) instead of red. */
    --nx-signal: var(--nx-accent);

    --nx-success: #2BB656;
    --nx-danger: #E5484D;
    --nx-warning: #E8A23D;
}

html[data-theme="dark"] {
    --nx-bg: var(--nx-obsidian);
    --nx-sidebar-bg: #060807;
    --nx-surface: #131715;
    --nx-surface-2: #1a1f1c;
    --nx-border: #242a27;
    --nx-text: var(--nx-cloud);
    --nx-muted: var(--nx-slate);
}

html[data-theme="light"] {
    /* Sprout's actual neutral pairing: a soft off-white (not stark white)
       and a dark charcoal (not pure black) -- this is what makes their
       green read as blended rather than flat. */
    --nx-bg: #F3F4F4;
    --nx-sidebar-bg: #ffffff;
    --nx-surface: #ffffff;
    --nx-surface-2: #e9ece9;
    --nx-border: #dde1dd;
    --nx-text: #364141;
    --nx-muted: #626e6e;
}

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

body {
    min-height: 100vh;
    background: var(--nx-bg);
    color: var(--nx-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    transition: background 0.25s ease, color 0.25s ease;
}

button {
    font: inherit;
}

a {
    color: inherit;
}

/* ---------- shared brand lockup ---------- */

.nx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nx-brand-mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    object-fit: contain;
}

.nx-brand-text {
    display: flex;
    flex-direction: column;
}

.nx-brand-name {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

.nx-brand-tagline {
    margin-top: 2px;
    color: var(--nx-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ---------- shared theme toggle (used in top-right of auth pages) ---------- */

.nx-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    background: var(--nx-surface);
    color: var(--nx-text);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: 0.2s ease;
}

.nx-theme-toggle:hover {
    border-color: var(--nx-accent);
}

.nx-theme-toggle svg {
    width: 15px;
    height: 15px;
    color: var(--nx-accent);
}


/* ============================================================
   APP CHROME (sidebar, main layout, cards, metrics, nav)
   Shared by dashboard.html, profile.html, billing.html
   ============================================================ */
/* =========================
   SIDEBAR
   ========================= */

.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    background: var(--nx-sidebar-bg);
    border-right: 1px solid var(--nx-border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.brand {
    padding: 0 6px 30px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--nx-muted);
    text-align: left;
    padding: 11px 14px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13.5px;
    transition: 0.2s ease;
}

.nav-item:hover {
    color: var(--nx-text);
    background: var(--nx-surface-2);
}

a.nav-item {
    display: block;
    text-decoration: none;
}

.nav-secondary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--nx-border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item.active {
    color: var(--nx-text);
    background: var(--nx-accent-soft);
    box-shadow: inset 2px 0 0 var(--nx-accent);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--nx-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-account {
    padding: 8px 4px 4px;
    font-size: 12px;
    color: var(--nx-muted);
}

.sidebar-account strong {
    display: block;
    color: var(--nx-text);
    font-size: 13px;
}

.theme-toggle,
.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    background: var(--nx-surface);
    color: var(--nx-text);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: 0.2s ease;
}

.theme-toggle:hover,
.logout-btn:hover {
    border-color: var(--nx-accent);
}

.theme-toggle-icon {
    width: 16px;
    height: 16px;
    color: var(--nx-accent);
}


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

main {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 42px 48px 70px;
}

.page {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 34px;
}

.page-header h1 {
    margin-top: 4px;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.2px;
}

.page-description {
    margin-top: 8px;
    color: var(--nx-muted);
    font-size: 14px;
}

.eyebrow {
    color: var(--nx-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
}


/* =========================
   METRICS
   ========================= */

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

.metric-card {
    min-height: 135px;
    padding: 22px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.metric-label {
    color: var(--nx-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.1px;
}

.metric-value {
    margin-top: 22px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
}

.metric-value.small {
    font-size: 21px;
    letter-spacing: -0.4px;
}


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

.section-card,
.platform-card,
.insight-card,
.recommendation-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.section-card {
    padding: 26px;
    margin-bottom: 20px;
}

.section-card h2 {
    margin-top: 5px;
    font-size: 19px;
    letter-spacing: -0.4px;
}


/* =========================
   PLATFORM BARS
   ========================= */

.platform-row {
    display: grid;
    grid-template-columns: 90px 1fr 90px;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    font-size: 13px;
}

.platform-row > span:last-child {
    text-align: right;
    color: var(--nx-muted);
}

.platform-bar {
    height: 7px;
    overflow: hidden;
    background: var(--nx-surface-2);
    border-radius: 99px;
}

.bar-fill {
    height: 100%;
    width: 0;
    background: var(--nx-accent);
    border-radius: 99px;
    transition: width 0.6s ease;
}


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

.content-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 18px 0;
    border-bottom: 1px solid var(--nx-border);
}

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

.content-row strong {
    display: block;
    font-size: 14px;
}

.content-row small {
    display: block;
    margin-top: 4px;
    color: var(--nx-muted);
    font-size: 12px;
}


/* =========================
   AUDIENCE
   ========================= */

.behaviour-row {
    display: flex;
    justify-content: space-between;
    padding: 17px 0;
    border-bottom: 1px solid var(--nx-border);
    font-size: 13px;
}

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

.behaviour-row strong {
    color: var(--nx-accent);
}


/* =========================
   PLATFORM CARDS
   ========================= */

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.platform-card {
    padding: 25px;
}

.platform-card h2 {
    margin-top: 17px;
    font-size: 29px;
    letter-spacing: -1px;
}

.platform-card > span {
    color: var(--nx-muted);
    font-size: 12px;
}

.platform-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 28px 0;
    padding: 18px 0;
    border-top: 1px solid var(--nx-border);
    border-bottom: 1px solid var(--nx-border);
}

.platform-details small,
.platform-details strong {
    display: block;
}

.platform-details small {
    color: var(--nx-muted);
    font-size: 10px;
}

.platform-details strong {
    margin-top: 4px;
    font-size: 13px;
}

.platform-card > p:last-child {
    color: var(--nx-muted);
    font-size: 12px;
}

.platform-card > p:last-child strong {
    color: var(--nx-text);
}


/* =========================
   INSIGHTS
   ========================= */

.insight-card,
.recommendation-card {
    padding: 25px;
    margin-bottom: 14px;
}

.insight-card h2,
.recommendation-card h2 {
    margin-top: 13px;
    font-size: 18px;
    letter-spacing: -0.4px;
}

.insight-card p,
.recommendation-card p {
    max-width: 780px;
    margin-top: 9px;
    color: var(--nx-muted);
    font-size: 13px;
}

.insight-card small {
    display: block;
    margin-top: 18px;
    color: var(--nx-accent);
    font-size: 11px;
}

.priority {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--nx-accent-soft);
    color: var(--nx-accent);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* =========================
   SETTINGS
   ========================= */

.setting-row {
    display: flex;
    justify-content: space-between;
    padding: 19px 0;
    border-bottom: 1px solid var(--nx-border);
    font-size: 13px;
}

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

.setting-row span {
    color: var(--nx-muted);
}

.setting-row strong {
    font-weight: 500;
}


/* =========================
   AUTH GATE OVERLAY
   ========================= */

#authGate {
    position: fixed;
    inset: 0;
    background: var(--nx-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    font-size: 13px;
    color: var(--nx-muted);
}


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

@media (max-width: 1000px) {

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

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

}

@media (max-width: 700px) {

    .sidebar {
        width: 210px;
    }

    main {
        width: calc(100% - 210px);
        margin-left: 210px;
        padding: 30px 20px;
    }

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

    .page-header h1 {
        font-size: 28px;
    }

}


/* ============================================================
   SETTINGS FORM (business profile)
   ============================================================ */

.settings-form {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.settings-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-form .field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--nx-muted);
}

.settings-form input,
.settings-form select {
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid var(--nx-border);
    background: var(--nx-bg);
    color: var(--nx-text);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.settings-form input:focus,
.settings-form select:focus {
    border-color: var(--nx-accent);
}

.settings-save {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 6px;
    padding: 11px 20px;
    border-radius: 9px;
    border: 0;
    background: var(--nx-accent);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.settings-save:hover {
    background: var(--nx-accent-hover);
}

.settings-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-save-status {
    grid-column: 1 / -1;
    font-size: 12.5px;
    color: var(--nx-accent);
}

@media (max-width: 700px) {
    .settings-form {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   CHARTS
   ============================================================ */

.chart-box {
    margin-top: 22px;
    height: 220px;
    position: relative;
}

.chart-box-tall {
    height: 260px;
}

.chart-box-doughnut {
    height: 220px;
    max-width: 260px;
}

.audience-behaviour-layout {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.audience-behaviour-layout #audienceBehaviour {
    flex: 1;
    min-width: 220px;
}

@media (max-width: 700px) {
    .audience-behaviour-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .chart-box-doughnut {
        max-width: 100%;
    }
}
