/* Dashboard Styles */
.dashboard-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.dashboard-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 240px;
    max-width: 400px;
}

.dashboard-fy-select {
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
}

.dashboard-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-section h3 {
    margin-top: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--swimlane-bg);
    border-radius: 0;
}

.summary-label {
    font-weight: 600;
}

.summary-value {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.greeting {
    /* Issue 125: anchor the page in editorial display type.
       The previous 1.75rem (~28px) read as a section label;
       a clamp 32→52px Karelia headline pairs with the 2px navy
       rule beneath it (layout.css .page-header) to give /index
       and the dashboard a real editorial spine. font-weight 400
       is the brand's heading weight (colors_and_type.css). */
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 400;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--nri-navy);
}

.greeting-sub {
    margin: 0.5rem 0 0;
    color: var(--text-color-light);
    /* Slight comfort lift on the sub: now sits under a larger
       headline, so a 16px subhead reads as the secondary tier. */
    font-size: var(--fs-body);
    max-width: 60ch;
}

/* Enhanced Dashboard Styles */
.dashboard-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.section-desc {
    color: var(--text-color-muted);
    margin-bottom: 1.5rem;
}

.solution-card {
    display: block;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.solution-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.solution-desc {
    font-size: 0.9rem;
    color: var(--text-color-muted);
    margin: 0.25rem 0 0;
}

.solution-budget-viz {
    margin-bottom: 1.5rem;
}

.viz-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-color-muted);
    margin-bottom: 0.5rem;
}

.progress-container {
    height: 10px;
    background: var(--swimlane-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
}

.progress-container.large {
    height: 24px;
    border-radius: 4px;
}

.progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}

/* The % value sits BESIDE the bar, not overlaid inside it: a 10px track
   can't legibly host ~12px text, and a centred white overlay vanished on
   the unfilled (light) portion of the track. The bar grows; the value
   reads against the card surface. */
.progress-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.progress-row .progress-container {
    flex: 1;
    margin-bottom: 0;
}

.progress-container.multi-metric {
    background: #ffffff;
}

.progress-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: width 0.3s ease;
}

.progress-layer.approved {
    background: #ffffff;
    z-index: 1;
}

.progress-layer.allocated.capex {
    background: var(--nri-green);
    z-index: 2;
}

.progress-layer.allocated.opex {
    background: var(--nri-orange);
    z-index: 2;
}

.progress-layer.spent {
    background: var(--nri-blue);
    z-index: 3;
}

.progress-triple-text {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-color-muted);
}

.progress-triple-spent {
    color: var(--nri-blue);
}

.progress-triple-allocated.capex {
    color: var(--nri-green);
}

.progress-triple-allocated.opex {
    color: var(--nri-orange);
}

.progress-triple-approved {
    /* The "approved" bar segment is the white base track, but a white
       legend label is invisible on the white card surface. Render the
       approved total in the body navy — it reads as the baseline figure
       the spent/allocated amounts are measured against. */
    color: var(--text-color);
}

.progress-text {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.solution-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--swimlane-bg);
    border-radius: 0;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-color-muted);
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-note {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-color-muted);
}

.init-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dashboard-init-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-init-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.init-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.init-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.init-card-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-color-muted);
    margin-top: 0.5rem;
}

.projection-info {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.projection-dataset-note {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-color-muted);
}

/* The duplicate .badge definition that previously lived here was
   collapsed into components.css in issue #111. Slice #112 introduced
   the canonical .status-pill[data-status="..."] selector in
   components.css that subsumed the four legacy status palettes
   (.status-tag, .health-*, .result-tag, .outcome-tag, and
   .exec-rag-rectangle); their old rules are gone. */

.impact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.impact-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.impact-list li:last-child {
    border-bottom: none;
}

/* Login page (issue #117). The only screen unauthenticated users
   see: a full-bleed NRI Navy surface with the white monogram
   anchored top-left, welcome copy anchored left in the upper-third
   of the viewport, a URL line-lockup near the bottom, and the
   footer at the bottom-left. No card chrome, no centred wrapper,
   no text-align: center — the brand rule is left-aligned headlines
   + body throughout. */
.page-login {
    background-color: var(--nri-navy);
    color: var(--nri-white);
    min-height: 100vh;
    margin: 0;
    padding: 5% clamp(1.5rem, 5vw, 4rem);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 2rem;
}

.page-login .login-header {
    display: block;
}

.page-login .login-logo {
    display: block;
    width: 130px;
    height: auto;
}

.page-login .login-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 560px;
    padding-top: 4vh;
}

.page-login h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--nri-white);
}

.page-login p {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body);
    color: var(--nri-white);
    opacity: 0.92;
}

.page-login .login-url-lockup {
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid currentColor;
    width: 100%;
    opacity: 0.85;
}

.page-login .login-url-lockup .lockup {
    color: var(--nri-white);
    word-break: break-all;
}

.page-login .login-footer {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-caption);
    color: var(--nri-white);
    opacity: 0.7;
}

/* Executive page (issues 062 → 102 → 116). The body class is the
   *only* selector that paints the page background; the navbar partial
   keeps its own colours so the chrome stays consistent across pages.
   Slice #116 swapped the executive-demo mock literal (#0E2A4E) for
   the brand NRI Navy token. */
.page-executive {
    background-color: var(--nri-navy);
    color: var(--nri-white);
    margin: 0;
    min-height: 100vh;
}

/* Executive page (issue 102 → 116) — summary bar, tile grid, RAG
   pill, and legend. All selectors are scoped under `.exec-page` so
   they cannot bleed into the kanban / dashboard / admin pages. The
   RAG indicator uses the canonical .status-pill[data-status="..."]
   selector (issue #112) rendered inline at the top of each
   exec-summary / exec-tile content area; the legacy
   .exec-rag-rectangle side-block is gone. Slice #116 redrew the
   surface palette around var(--exec-surface) and the heading /
   label / value type from the brand type scale. */
.exec-page {
    padding: 2rem clamp(1rem, 4vw, 3rem);
    color: var(--nri-white);
    max-width: 1400px;
    margin: 0 auto;
}

.exec-summary {
    display: flex;
    align-items: stretch;
    background-color: var(--exec-surface);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 2rem;
}

.exec-summary-text {
    flex: 1 1 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Top row of the summary bar / each tile — heading on the left, the
   RAG .status-pill on the right (issue #112 replaces the legacy
   right-edge .exec-rag-rectangle side-block). */
.exec-summary-top,
.exec-tile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.exec-summary-heading {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 400;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--nri-white);
    margin: 0;
}

.exec-summary-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
}

.exec-summary-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exec-summary-metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.exec-summary-label {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
}

.exec-summary-value {
    font-family: var(--font-display);
    font-size: var(--fs-h4);
    font-weight: 700;
    color: var(--nri-white);
    font-variant-numeric: tabular-nums;
}

.exec-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 800px) {
    .exec-tile-grid {
        grid-template-columns: 1fr;
    }
}

.exec-tile {
    display: flex;
    align-items: stretch;
    background-color: var(--exec-surface);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease;
}

.exec-tile:hover,
.exec-tile:focus-visible {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    outline: none;
}

.exec-tile-text {
    flex: 1 1 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exec-tile-heading {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 400;
    line-height: var(--lh-subhead);
    color: var(--nri-white);
    margin: 0;
}

.exec-tile-metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.exec-tile-label {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
}

.exec-tile-value {
    font-family: var(--font-display);
    font-size: var(--fs-h4);
    font-weight: 700;
    color: var(--nri-white);
    font-variant-numeric: tabular-nums;
}

.exec-legend {
    background-color: var(--exec-surface);
    border-radius: 0;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.exec-legend-heading {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 0.75rem 0;
}

.exec-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.exec-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--nri-white);
    font-size: var(--fs-body-sm);
}

.exec-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.exec-legend-swatch--green { background-color: var(--nri-green); }
.exec-legend-swatch--yellow { background-color: var(--nri-yellow); }
.exec-legend-swatch--red { background-color: var(--nri-red); }

.exec-status {
    min-height: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--fs-body-sm);
}

.exec-empty {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-body);
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 0;
}

/* Org view picker (issue #134) — BU-Owner-only org filter in the
   kanban toolbar. Populated + toggled by org_view_picker.ts. Empty
   selection means "show every org" (the default). Replaced the old
   slice-#063 "no organization assigned" dead-end hint, which is gone. */
.org-view-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.9rem;
}
.org-view-picker-label {
    font-weight: 600;
    color: var(--text-color-muted);
}
.org-view-picker-option {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

/* MCP Access page (slice #071) — uses existing dashboard-section frame */
.mcp-download-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.5rem;
    margin: 1rem 0 1.25rem;
}

.mcp-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mcp-meta-label {
    color: var(--text-color-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mcp-meta-value {
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
}

.mcp-meta-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 500;
}

.mcp-download-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.mcp-download-error {
    margin: 0.75rem 0 0;
    color: var(--danger-color);
    font-size: 0.9rem;
}

.mcp-install-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mcp-install-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: var(--swimlane-bg);
    border-radius: 0;
    padding: 0.85rem 1rem;
}

.mcp-step-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.mcp-use-cases {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mcp-use-cases li {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background-color: var(--swimlane-bg);
    border-radius: 0;
    padding: 0.75rem 1rem;
}

.mcp-use-case-title {
    font-weight: 600;
    color: var(--text-color);
}

.mcp-use-case-prompt,
.mcp-tool-prompt {
    display: block;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    color: var(--text-color);
    white-space: pre-wrap;
}

.mcp-tool-list {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.mcp-tool-list dt {
    font-weight: 700;
    color: var(--text-color);
    margin-top: 0.35rem;
}

.mcp-tool-list dt code {
    color: var(--primary-color);
    background: none;
    padding: 0;
}

.mcp-tool-list dd {
    margin: 0.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mcp-tool-returns {
    color: var(--text-color-muted);
    font-size: 0.9rem;
}

/* --- Slice #072: API key panel + reveal modal ----------------------- */

.mcp-apikey-view[hidden] {
    display: none;
}

.mcp-apikey-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
    margin: 0.5rem 0 1rem;
}

.mcp-apikey-empty-hint,
.mcp-apikey-regen-hint {
    color: var(--text-color-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.mcp-apikey-modal-content {
    max-width: 640px;
}

.mcp-apikey-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background-color: var(--swimlane-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--danger-color);
    border-radius: 0;
    padding: 0.85rem 1rem;
    color: var(--text-color);
    margin: 0;
}

.mcp-apikey-warning i {
    color: var(--danger-color);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.mcp-apikey-reveal-label {
    font-weight: 600;
    margin-top: 0.5rem;
}

.mcp-apikey-reveal-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mcp-apikey-reveal-input {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.95rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.mcp-apikey-copy-status {
    color: var(--text-color-muted);
    font-size: 0.85rem;
    min-height: 1.1em;
    margin: 0;
}

/* Verify connection (issue 169 C) */
.mcp-verify-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 520px;
}

.mcp-verify-input {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.95rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.mcp-verify-result {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
    border-left: 4px solid var(--border-color);
    background-color: var(--swimlane-bg);
}

/* Distinguishable status styling so the reason is clear at a glance,
   not just in the words: ok=green, warn=amber, error=red. */
.mcp-verify-pending {
    color: var(--text-color-muted);
    border-left-color: var(--text-color-muted);
}

.mcp-verify-ok {
    color: var(--text-color);
    border-left-color: var(--status-light-success);
}

.mcp-verify-warn {
    color: var(--text-color);
    border-left-color: var(--status-light-saving);
}

.mcp-verify-error {
    color: var(--danger-color);
    border-left-color: var(--danger-color);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-color-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

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

