/* ════════════════════════════════════════════════════════════════════════════
   Strategy Workspace — CSS
   Covers: mode switch, strategy navigation, access badges, SWOT grid,
   initiatives, milestones, cascade matrix, upgrade teasers.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar Mode Switch ─────────────────────────────────────────────────── */

/* sidebar-mode-btn lives INSIDE the always-dark sidebar rail. Consume the
   sidebar-scoped semantic tokens (tokens.css §Sidebar) so the button paints
   correctly in both light and dark modes without per-mode override band-aids.
   Deep-dive #411 §3 root-cause fix. */
.sidebar-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    background: var(--sidebar-mode-btn-bg);
    color: var(--sidebar-mode-btn-text);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
}

.sidebar-mode-btn:hover {
    background: var(--sidebar-mode-btn-hover-bg);
    color: var(--sidebar-mode-btn-hover-text);
}

/* ── Strategy Header ─────────────────────────────────────────────────────── */

.strategy-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-light,#dee2e6);
}

.strategy-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-neutral-900);
}

/* ── Strategy Summary Page ───────────────────────────────────────────────── */

.strategy-summary {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.strategy-summary-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.strategy-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* The summary's cards are the kit Card (phase 3); this is only their text. */
.strategy-summary-text {
    margin: 0 0 0.5rem;
    line-height: 1.6;
    color: var(--color-neutral-900);
}

.strategy-summary-link {
    font-size: 0.85rem;
    color: var(--color-brand,#1971c2);
    text-decoration: none;
}

.strategy-summary-link:hover {
    text-decoration: underline;
}

.strategy-summary-goals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.strategy-summary-goal-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.strategy-summary-goal-row h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
}

.strategy-summary-more {
    font-size: 0.85rem;
    color: var(--color-neutral-600,#555);
    padding-left: 0.5rem;
}

/* ── Vision & Mission Editor ─────────────────────────────────────────────── */

.strategy-vm-editor {
    max-width: 720px;
}

.strategy-vm-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.strategy-vm-text {
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
    /* Same dark-mode body-inheritance class as .settings-privacy-card h4. W12 Vision/Mission body. */
    color: var(--color-neutral-900);
}

/* ── Strategic Goals List ────────────────────────────────────────────────── */

.strategy-goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.strategy-toolbar {
    margin-bottom: 1rem;
}

.strategy-goal-description {
    margin: 0.25rem 0 0.5rem;
    color: var(--color-neutral-600,#555);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Why an unaligned strategic goal cannot be cascaded or anchor a goal (Feature GW, GW-5 (a)). */
.strategy-goal-unaligned {
    margin: 0.25rem 0 0.5rem;
    color: var(--color-neutral-700);
    font-size: 0.9rem;
    line-height: 1.5;
}

.strategy-goal-date {
    font-size: 0.8rem;
    color: var(--color-neutral-500,#adb5bd);
}

/* What a strategic goal is on, and when it was archived (Feature LC, #1359): the reason its acts are locked. */
.strategy-goal-on {
    margin: 0.25rem 0 0.5rem;
    color: var(--color-neutral-700);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* The add at the foot of the goals (the data-entry rule: an add sits at the foot of what it adds to). */
/* Goals by year (Feature GS, #1364): the year a kit Card over its goals (Feature GMB's sweep). */
.strategy-goals-year {
    margin-top: var(--space-2);
}

/* Which group's strategic goals the page shows (GMB-3 (a)). */
.strategy-goals-subject {
    margin: var(--space-2) 0;
    color: var(--color-neutral-700);
}

.strategy-goal-built-from {
    margin: 0 0 var(--space-2);
}

.strategy-goal-commitments {
    margin-top: var(--space-3);
}

.strategy-list-foot {
    display: flex;
    margin-top: 0.25rem;
}

.strategy-goal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ── SWOT Grid ───────────────────────────────────────────────────────────── */

.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.swot-quadrant {
    min-height: 200px;
}

/* Feature GMB's sweep (BRD-7): a status colour says a status; the four quadrants are named, never filled by one. */

.swot-quadrant-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── SWOT Cards ──────────────────────────────────────────────────────────── */

/* Each item is the kit Card (phase 3), its surface the kit's in both registers. */
.swot-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.swot-card-description {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--color-neutral-600,#555);
    line-height: 1.4;
}

.swot-card-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* The quadrant's add at its foot: the kit's btn-outline, set at the start of the column. */
.swot-add-btn {
    align-self: flex-start;
}

/* ── Initiative List & Cards ─────────────────────────────────────────────── */

.initiative-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.initiative-list-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.initiative-description {
    margin: 0 0 0.75rem;
    color: var(--color-neutral-600,#555);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Initiative Progress Bar ─────────────────────────────────────────────── */

.initiative-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.initiative-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--color-border-light,#dee2e6);
    border-radius: 3px;
    overflow: hidden;
}

.initiative-progress-fill {
    height: 100%;
    /* #660 By source — structure/strategy meters read NEUTRAL (graphite), not brand-green;
       green is reserved for Culture content so it never collides with the cascade's value-green. */
    background: var(--color-neutral-400);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.initiative-progress-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-neutral-600,#555);
    min-width: 2.5rem;
    text-align: right;
}

.initiative-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-neutral-500,#adb5bd);
    margin-bottom: 0.75rem;
}

.initiative-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light,#dee2e6);
}

/* ── Initiative dialog: the start and target dates side by side ──────────── */

.initiative-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Milestone Timeline ──────────────────────────────────────────────────── */

.milestone-timeline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light,#dee2e6);
}

/* ── Strategy Cascade Matrix ─────────────────────────────────────────────── */

.strategy-cascade-matrix {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.strategy-cascade-source {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md, 6px);
    background: var(--color-surface-raised,#f8f9fa);
    border: 1px solid var(--color-border-light,#dee2e6);
    /* #660 By source — graphite strategic accent rail; the source KIND carries the colour. */
    border-left: 3px solid var(--cascade-goal-accent);
    margin-bottom: 0.75rem;
}

.strategy-cascade-source-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.strategy-cascade-source-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.strategy-cascade-description {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--color-neutral-600,#555);
}

.strategy-cascade-type {
    font-size: 0.75rem;
    color: var(--color-neutral-500,#adb5bd);
    font-weight: 500;
}

/* ── Strategy Upgrade Teasers ────────────────────────────────────────────── */

.strategy-upgrade-teasers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

/* Each teaser is the kit's UnavailableCard (phase 3); the grid above is its layout. */

/* ── Responsive ──────────────────────────────────────────────────────────── */

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

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

    .initiative-dates {
        grid-template-columns: 1fr;
    }

    .strategy-upgrade-teasers {
        grid-template-columns: 1fr;
    }
}

/* ── Strategy Access Management Page ───────────────────────────────────── */

.strategy-access-page {
    margin-top: 1.5rem;
}

.strategy-access-description {
    color: var(--color-neutral-600,#666);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Strategy Placeholder (Enterprise scaffolds) ───────────────────────── */

.strategy-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
    border: 2px dashed var(--color-border-light,#e0e0e0);
    border-radius: var(--radius-lg, 8px);
    background: var(--color-surface-sunken,#fafafa);
}

.strategy-placeholder p {
    font-size: 1.05rem;
    margin: 0.5rem 0;
}

.strategy-placeholder .muted-note {
    color: var(--color-neutral-500,#999);
    font-size: 0.9rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   Strategy Flow Chart (Strategy Map page)
   ════════════════════════════════════════════════════════════════════════════ */

.flow-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1.5rem 0;
}

/* ── Flow layers ── */

.flow-layer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.flow-layer-grouped {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.flow-connector {
    width: 2px;
    height: 2rem;
    border-left: 2px dashed var(--color-border-light,#dee2e6);
}

/* ── Flow groups (goal → initiatives) ── */

.flow-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flow-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-neutral-500,#adb5bd);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flow-group-sublabel {
    font-size: 0.75rem; /* 12 px, a label (BRD-8) */
    color: var(--color-neutral-600,#555);
}

.flow-group-children {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Flow cards ── */

/* Each node is the kit Card (phase 3: Href where it goes somewhere, the vision raised, a
   group sunken); these rules are only its width and its inner column. */
.flow-card {
    text-decoration: none;
    color: inherit;
    min-width: 160px;
    max-width: 280px;
}

.flow-card-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.flow-card-vision {
    min-width: 320px;
    max-width: 600px;
    text-align: center;
}

.flow-card-goal {
    text-align: center;
}

.flow-card-initiative {
    min-width: 140px;
    max-width: 220px;
}

.flow-card-department {
    min-width: 120px;
    max-width: 180px;
    text-align: center;
}

.flow-card-state {
    align-self: center;
}

.flow-card-label {
    font-size: 0.75rem; /* 12 px, a label (BRD-8) */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-neutral-600,#555);
}

.flow-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.flow-card-text {
    font-size: 0.8rem;
    color: var(--color-neutral-600,#555);
    line-height: 1.4;
}

.flow-card-meta {
    font-size: 0.75rem;
    color: var(--color-neutral-500,#adb5bd);
}

/* ── Flow card progress (initiatives) ── */

.flow-card-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flow-card-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--color-border-light,#dee2e6);
    border-radius: 2px;
    overflow: hidden;
}

.flow-card-progress-fill {
    height: 100%;
    background: var(--color-brand,#228be6);
    border-radius: 2px;
}

.flow-card-progress-label {
    font-size: 0.75rem; /* 12 px, a label (BRD-8) */
    font-weight: 600;
    color: var(--color-neutral-600,#555);
    min-width: 2rem;
    text-align: right;
}

/* ── Flow section divider (unlinked initiatives) ── */

.flow-section-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--color-neutral-500,#adb5bd);
    font-size: 0.8rem;
    font-weight: 500;
}

.flow-section-divider::before,
.flow-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border-light,#dee2e6);
}

/* ════════════════════════════════════════════════════════════════════════════
   Summary Widgets (Strategy Summary page)
   ════════════════════════════════════════════════════════════════════════════ */

.strategy-summary-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ── SWOT Summary Widget ── */

.swot-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.swot-summary-quadrant {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem;
    border-radius: var(--radius-sm, 4px);
    gap: 0.15rem;
}

.swot-summary-count {
    font-size: 1.25rem;
    font-weight: 700;
}

.swot-summary-label {
    font-size: 0.75rem; /* 12 px, a label (BRD-8) */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.swot-summary-strength,
.swot-summary-weakness,
.swot-summary-opportunity,
.swot-summary-threat { background: var(--color-neutral-100); color: var(--color-neutral-900); }

/* ── Initiatives Summary Widget ── */

.initiatives-summary-statuses {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.initiatives-summary-progress {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.initiatives-summary-progress-text {
    font-size: 0.8rem;
    color: var(--color-neutral-600,#555);
}

/* ════════════════════════════════════════════════════════════════════════════
   Cascade Department Chips
   ════════════════════════════════════════════════════════════════════════════ */

.cascade-dept-chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.cascade-dept-label {
    font-size: 0.8rem;
    color: var(--color-neutral-600,#555);
    font-weight: 500;
}

.cascade-linked-goal {
    font-size: 0.85rem;
    color: var(--color-neutral-600,#555);
    margin: 0.25rem 0 0;
    font-style: italic;
}

/* ── Responsive: flow chart + summary widgets ── */

@media (max-width: 768px) {
    .flow-layer,
    .flow-layer-grouped {
        flex-direction: column;
        align-items: center;
    }

    .flow-connector {
        display: none;
    }

    .flow-card {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .flow-card-vision {
        min-width: 0;
        max-width: 100%;
    }

    .strategy-summary-widgets {
        grid-template-columns: 1fr;
    }
}
