/* Pro dashboard (dashboard.html) */

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --primary: #6366f1;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
}
.dash-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.95);
}
.dash-topbar__brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}
.dash-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-shell {
    display: flex;
    min-height: calc(100vh - 57px);
}
aside {
    width: 300px;
    border-right: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-shrink: 0;
}
main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}
.data-cards-host {
    min-width: 0;
}
h1, h2 {
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
}
main > h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.dash-title .text-primary,
.text-primary {
    color: var(--primary);
}
.label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
#session-list {
    flex: 1;
    overflow-y: auto;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    min-height: 80px;
}
.dash-hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
}
.dash-hint code {
    font-size: 11px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
}
.session-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.session-item:hover {
    background: var(--border);
}
.btn-refresh {
    margin-top: 20px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
}
.btn-refresh:hover {
    filter: brightness(1.1);
}
.btn-back {
    margin-top: 10px;
    display: block;
    text-align: center;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
}
.btn-back:hover {
    background: #475569;
}
.btn-refresh--top,
.btn-back--top {
    margin-top: 0;
    width: auto;
    min-width: 130px;
}
.dash-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
.dash-page .dash-shell {
    flex: 1;
    min-height: 0;
}
.dash-main {
    flex: 1;
    padding: 32px 40px 48px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, #1e1b4b 0%, var(--bg) 42%);
}
.dash-nav-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.dash-nav-link:hover {
    color: var(--text);
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--border);
}
.dash-aside__logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.dash-aside__footer {
    margin-top: auto;
    padding-top: 16px;
}
.dash-status {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: #34d399;
    line-height: 1.4;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 22px;
    box-sizing: border-box;
}
.card--stat {
    padding: 16px 18px;
}
.card--chart {
    padding: 24px;
}
.card--gradient {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    border-color: transparent;
}
.card-header {
    margin-bottom: 16px;
}
.card-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 6px 0 8px;
    letter-spacing: -0.02em;
}
.card-sub {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}
.card-sub code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
}
.card-sub--accent {
    color: #a5b4fc !important;
    margin-top: 6px !important;
}
.card--parallel-block {
    margin-top: 8px;
}
.parallel-coords-host {
    min-height: 260px;
    margin-top: 8px;
}
.parallel-empty {
    font-size: 13px;
    color: var(--muted);
    margin: 24px 16px;
}
.dash-details {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}
.dash-details__summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}
.dash-details__body {
    margin-top: 10px;
}
.dash-details__body p {
    margin: 0 0 10px;
}
.dash-details__body p:last-child {
    margin-bottom: 0;
}
.dash-filters {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.dash-filters--dim-strip {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}
.dash-filters--dim-strip .dash-cluster-control {
    flex: 1 1 220px;
    max-width: 420px;
}
.dimension-charts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.dimension-chart-cell {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 10px 6px;
    min-width: 0;
}
.dimension-chart-cell__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.dimension-chart-cell__canvas {
    position: relative;
    height: 200px;
}
@media (max-width: 1200px) {
    .dimension-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .dimension-charts-grid {
        grid-template-columns: 1fr;
    }
}
.dash-cluster-control {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.dash-module-select {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.dash-module-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    margin: 8px 0 0;
}
.dash-module-hint code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
}
.dash-cluster-control__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dash-cluster-control__hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: #64748b;
}
.dash-cluster-control__row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}
.dash-cluster-control__range {
    flex: 1;
    min-width: 0;
    accent-color: var(--primary);
}
.dash-cluster-control__value {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    min-width: 1.5rem;
}
.cluster-color-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    min-height: 22px;
}
.cluster-swatch {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.parallel-svg {
    display: block;
    border-radius: 12px;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 6px;
}
.stat-value--accent {
    color: #34d399;
}
.label--on-dark {
    color: rgba(255, 255, 255, 0.75);
}
.stat-value--on-dark {
    color: #fff;
}
.main-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 24px;
    align-items: start;
}
.right-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}
.chart-container {
    position: relative;
    height: 340px;
    margin-top: 8px;
}
.chart-container--radar {
    height: 260px;
}
.explainer {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.2);
    padding: 14px 16px;
    border-radius: 12px;
    margin: 16px 0 0;
}
.explainer strong {
    color: var(--text);
}
.archetype-info {
    margin-top: 18px;
    text-align: center;
}
.archetype-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px;
}
.archetype-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}
.fullstory-hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.45;
    margin: 10px 0 0;
}
.fullstory-hint[hidden] {
    display: none !important;
}
.btn-fullstory {
    margin-top: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.65);
    background: rgba(99, 102, 241, 0.15);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-fullstory:hover {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(129, 140, 248, 0.9);
}
.btn-fullstory[hidden] {
    display: none !important;
}
.card--hook {
    border: 1px dashed rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.06);
}
.label--hook {
    color: var(--primary);
}
.hook-copy {
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
}
.btn-hook {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-hook:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}
.session-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
    border-bottom: none;
}
.session-item:hover {
    background: #334155;
}
.session-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}
.session-meta {
    opacity: 0.65;
    font-size: 11px;
    margin-top: 4px;
}
@media (max-width: 960px) {
    .dash-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .dash-topbar__actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .dash-shell {
        flex-direction: column;
        min-height: auto;
        overflow: auto;
    }
    aside {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Info modal (dashboard “How this works”) */
.btn-dash-info {
    margin-top: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.btn-dash-info:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.45);
}
.btn-dash-info:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.dash-modal {
    max-width: min(720px, calc(100vw - 24px));
    width: 100%;
    max-height: min(85vh, 900px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.dash-modal::backdrop {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(4px);
}
.dash-modal__inner {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}
.dash-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.dash-modal__eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 6px;
}
.dash-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.dash-modal__lede {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}
.dash-modal__close-form {
    margin: 0;
    flex-shrink: 0;
}
.dash-modal__close {
    margin: 0;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.dash-modal__close:hover {
    background: var(--border);
}
.dash-modal__close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.dash-modal__body {
    padding: 18px 22px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #cbd5e1;
}
.dash-modal__section {
    margin-bottom: 20px;
}
.dash-modal__section:last-child {
    margin-bottom: 8px;
}
.dash-modal__h {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}
.dash-modal__section p {
    margin: 0 0 12px;
}
.dash-modal__section p:last-child {
    margin-bottom: 0;
}
.dash-modal__section code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    color: #e2e8f0;
}
.dash-modal__list {
    margin: 0;
    padding-left: 1.15rem;
}
.dash-modal__list li {
    margin-bottom: 10px;
}
.dash-modal__list li:last-child {
    margin-bottom: 0;
}
.dash-modal__footer {
    padding: 14px 22px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.dash-modal__footer form {
    margin: 0;
    display: flex;
    justify-content: flex-end;
}
.dash-modal__cta {
    min-width: 120px;
}
