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

:root {
    --page-bg: #fafbfc;
    --surface-bg: #ffffff;
    --alt-surface: #f9fbff;
    --subtle-bg: #f8fafc;
    --hover-bg: #f1f5f9;
    --border: #e5ebf3;
    --text-color: #0f172a;
    --muted-text: #475569;
    --primary: #2f6df6;
    --primary-tint: #e8f0ff;
    --btn-bg: #3b82f6;
    --btn-text: #ffffff;
    --nav-active-bg: #dbeafe;
    --nav-active-text: #1d4ed8;
    --logo-start: #3b82f6;
    --logo-end: #1d4ed8;
    --status-todo: #94a3b8;
    --status-progress: #38bdf8;
    --status-test: #a78bfa;
    --status-done: #34d399;
    --danger: #dc2626;
    --danger-tint: #fee2e2;
    --success: #22c55e;
    --success-tint: #dcfce7;
    --warning: #f59e0b;
    --warning-tint: #fef3c7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--logo-start) 0%, var(--logo-end) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--btn-text);
    font-weight: bold;
    font-size: 1.25rem;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.125rem;
}

.header-title p {
    font-size: 0.875rem;
    color: var(--muted-text);
    font-weight: 400;
}

.last-updated {
    font-size: 0.8125rem;
    color: var(--muted-text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.hero-identity-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.hero-identity-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Grooming header button */
.grooming-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-bg);
    color: var(--muted-text);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    align-self: stretch;
}

.grooming-header-btn:hover {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
    background: var(--hover-bg);
}

.grooming-header-btn.active {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
    background: var(--hover-bg);
}

.grooming-header-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    background: #16a34a; /* default green */
}

.grooming-header-badge.hidden {
    display: none;
}

.grooming-header-badge.badge-green {
    background: #16a34a;
}

.grooming-header-badge.badge-amber {
    background: #d97706;
}

.grooming-header-badge.badge-red {
    background: #dc2626;
}

.header-status-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-summary-btn {
    display: none;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.625rem;
    cursor: pointer;
}

.status-summary-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-summary-btn.status-ok {
    background: #ecfdf5;
    border-color: var(--success-tint);
    color: #065f46;
}

.status-summary-btn.status-warn {
    background: var(--warning-tint);
    border-color: var(--warning-tint);
    color: #92400e;
}

.status-summary-btn.status-alert {
    background: var(--danger-tint);
    border-color: #fecaca;
    color: #991b1b;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.nav-tab {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-text);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-tab:hover {
    background: var(--hover-bg);
    color: #334155;
}

.nav-tab.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
}

.nav-tab-settings {
    margin-left: auto;
    padding: 0.45rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-tab-settings svg {
    display: block;
}

/* Release dropdown menu */
.nav-tab-dropdown {
    position: relative;
}

.nav-tab-dropdown > .nav-tab {
    display: flex;
    align-items: center;
}

.nav-tab-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 100;
    padding: 4px 0;
}

.nav-tab-dropdown-menu.open {
    display: block;
}

.nav-tab-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.nav-tab-dropdown-item:hover {
    background: var(--hover-bg);
}

.nav-tab-dropdown-item.active {
    color: var(--nav-active-text);
    background: var(--primary-tint);
}

.nav-tab-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Settings Sub-Tabs */
.settings-sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border, #e5ebf3);
}

.settings-sub-tab {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--muted-text, #475569);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.settings-sub-tab:hover {
    color: var(--text-color, #0f172a);
}

.settings-sub-tab.active {
    color: var(--primary, #2f6df6);
    border-bottom-color: var(--primary, #2f6df6);
}

.settings-sub-content {
    display: none;
}

.settings-sub-content.active {
    display: block;
}

/* Theme & Branding */
.theme-description {
    font-size: 0.875rem;
    color: var(--muted-text, #475569);
    margin-bottom: 1.5rem;
}

.theme-group {
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background: var(--surface-bg, #ffffff);
}

.theme-group legend {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    padding: 0 0.5rem;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

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

.theme-swatch {
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    background: var(--surface-bg, #ffffff);
}

.theme-swatch label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color, #0f172a);
    display: block;
    margin-bottom: 2px;
}

.theme-swatch p {
    font-size: 0.75rem;
    color: var(--muted-text, #475569);
    margin-bottom: 0.625rem;
}

.theme-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-color-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border, #e5ebf3);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
    -webkit-appearance: none;
}

.theme-color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.theme-color-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.theme-hex {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
    padding: 6px 10px;
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 6px;
    background: var(--page-bg, #fafbfc);
    color: var(--text-color, #0f172a);
    text-transform: uppercase;
}

.theme-hex:focus {
    outline: none;
    border-color: var(--primary, #2f6df6);
    box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.15);
}

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

/* Sync Log */
.sync-log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.sync-log-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    margin-bottom: 0.375rem;
}

.sync-status-card {
    margin-bottom: 1rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 10px;
    background: linear-gradient(180deg, var(--surface-bg, #fff) 0%, var(--alt-surface, #f9fbff) 100%);
}

.sync-status-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.sync-status-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sync-status-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text, #475569);
    margin-bottom: 0.25rem;
}

.sync-status-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
}

.sync-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--subtle-bg, #f8fafc);
    color: var(--muted-text, #475569);
}

.sync-status-pill.running {
    background: var(--primary-tint, #e8f0ff);
    color: var(--primary, #2563eb);
}

.sync-status-pill.completed {
    background: var(--success-tint, #dcfce7);
    color: #166534;
}

.sync-status-pill.failed {
    background: var(--danger-tint, #fee2e2);
    color: #991b1b;
}

.sync-status-meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted-text, #475569);
}

.sync-status-progress {
    margin-top: 0.6rem;
    height: 6px;
    background: #e5ebf3;
    border-radius: 3px;
    overflow: hidden;
}

.sync-status-progress.hidden {
    display: none;
}

.sync-status-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--btn-bg);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.sync-status-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.sync-status-count {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border, #e5ebf3);
}

.sync-status-count-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-text, #475569);
    margin-bottom: 0.3rem;
}

.sync-status-count strong {
    font-size: 1.15rem;
    color: var(--text-color, #0f172a);
}

.sync-log-table-wrap {
    overflow-x: auto;
}

.sync-log-table {
    width: 100%;
    border-collapse: collapse;
}

.sync-log-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-text, #475569);
    padding: 0.625rem 1rem;
    border-bottom: 2px solid var(--border, #e5ebf3);
    white-space: nowrap;
}

.sync-log-table td {
    font-size: 0.8125rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border, #e5ebf3);
    color: var(--text-color, #0f172a);
    white-space: nowrap;
}

.sync-log-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sync-log-status-success {
    background: var(--success-tint);
    color: #166534;
}

.sync-log-status-error {
    background: var(--danger-tint);
    color: #991b1b;
}

.sync-log-empty {
    text-align: center;
    color: var(--muted-text, #475569);
    padding: 2rem 1rem !important;
    font-style: italic;
}

/* Sync Modal Options */
.sync-modal-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 8px;
    margin-bottom: 0.625rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    background: var(--surface-bg, #fff);
}

.sync-modal-option:hover {
    border-color: var(--primary, #2563eb);
    background: var(--primary-tint, #e8f0ff);
}

.sync-modal-option.selected {
    border-color: var(--primary, #2563eb);
    background: var(--primary-tint, #e8f0ff);
}

.sync-modal-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--primary, #2563eb);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 2px;
}

.sync-modal-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sync-modal-option-text strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color, #0f172a);
}

.sync-modal-option-text span {
    font-size: 0.8rem;
    color: var(--muted-text, #475569);
    line-height: 1.45;
}

/* Config Panel */
.config-panel {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.config-panel.collapsed .config-content {
    display: none;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.config-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.config-toggle {
    color: var(--muted-text);
    font-size: 0.875rem;
}

.config-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.config-locked {
    background: var(--hover-bg) !important;
    color: var(--muted-text) !important;
    cursor: not-allowed;
    opacity: 0.8;
}

.form-group select {
    cursor: pointer;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.btn-primary:hover {
    background: #2563eb;
}

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

.btn-outline {
    background: var(--surface-bg);
    color: var(--text-color);
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-header-right {
    margin-left: auto;
}

.stats-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

    .sprint-meta-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .sprint-meta-velocity {
        width: 100%;
        align-items: flex-start;
    }
}

.stat-card {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.75rem 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-color: var(--btn-bg);
}

.stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.875rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-points {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--btn-bg);
    background: var(--primary-tint);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    margin-top: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ============================================
   Sprint Hero Widget
   ============================================ */
.sprint-hero {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.hero-identity {}

.hero-sprint-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
}

.hero-sprint-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.hero-sprint-dates {
    font-size: 0.8rem;
    color: var(--muted-text);
}

.hero-countdown {
    text-align: right;
}

.hero-countdown-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--status-progress), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-countdown-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-text);
    margin-top: 0.125rem;
}

/* Hero stats row */
.hero-stats-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.hero-stat {
    flex: 1 1 220px;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hero-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-text);
    margin-top: 0.125rem;
}

.hero-stat-warn .hero-stat-value {
    color: var(--warning);
}

.hero-stat-warn.no-issues {
    opacity: 0.4;
}

/* ---- Delivery Progress tile ---- */
.delivery-progress-tile {
    flex: 2 1 340px !important;
    min-width: 340px;
    text-align: left;
    padding: 0.6rem 0.9rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}
.dp-tile-label {
    display: none;
}
.dp-metrics-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.dp-metric {
    flex: 1;
    text-align: center;
    min-width: 0;
    padding: 0.2rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.dp-metric-clickable:hover {
    background: var(--hover-bg);
}
.dp-qa-line.dp-metric-clickable:hover {
    text-decoration: underline;
}
.dp-metric-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 0.1rem 0;
}
.dp-metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.dp-metric-label {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text);
    margin-top: 0.05rem;
}
.dp-metric-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-text);
    margin-top: 0.05rem;
}
.dp-pipeline {
    margin-top: 0.2rem;
}
.dp-pipeline-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--border);
}
.dp-bar-segment {
    height: 100%;
    transition: width 0.4s ease;
}
.dp-bar-released { background: var(--success, #22c55e); }
.dp-bar-qa       { background: var(--warning, #f59e0b); }
.dp-bar-indev    { background: var(--border, #cbd5e1); }
.dp-qa-line {
    font-size: 0.575rem;
    color: var(--muted-text);
    margin-top: 0.15rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timeline bar */
.hero-timeline {
    margin-bottom: 1.5rem;
}

.hero-timeline-bar {
    position: relative;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: visible;
}

.hero-timeline-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--status-progress), #818cf8);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.hero-timeline-marker {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    background: #818cf8;
    border: 2px solid var(--surface-bg);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.hero-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.7rem;
    color: var(--muted-text);
}

/* Planned/Unplanned progress section */
.hero-progress-section {
    position: relative;
}

.hero-progress-toggle-wrap {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.hero-progress-split-btn {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    color: var(--muted-text);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hero-progress-split-btn:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.hero-progress-combined {
    display: flex;
    gap: 1.5rem;
}

.hero-progress-split {
    display: flex;
    gap: 1.5rem;
}

.hero-progress-col {
    flex: 1;
}

.hero-progress-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
}

.hero-progress-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-text);
    margin-bottom: 0.75rem;
}

.hero-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.hero-status-row:hover {
    background: var(--hover-bg);
}

.hero-status-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--muted-text);
    width: 60px;
    flex-shrink: 0;
}

.hero-status-count {
    font-size: 0.8rem;
    font-weight: 700;
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.hero-status-track {
    flex: 1;
    position: relative;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: visible;
}

.hero-status-ideal-tick {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 1px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
    transition: left 0.4s ease;
}

.hero-status-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.hero-status-fill.todo { background: var(--status-todo); }
.hero-status-fill.progress { background: var(--status-progress); }
.hero-status-fill.test { background: var(--status-test); }
.hero-status-fill.done { background: var(--status-done); }

.hero-status-pts {
    font-size: 0.7rem;
    color: var(--muted-text);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.hero-progress-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--muted-text);
}

.hero-completion {
    font-weight: 600;
    color: var(--status-todo);
}

@media (max-width: 640px) {
    .hero-stats-row {
        grid-template-columns: 1fr;
    }

    .delivery-progress-tile {
        min-width: 0;
    }

    .hero-top {
        flex-direction: column;
        gap: 1rem;
    }
    .hero-countdown {
        text-align: left;
    }
    .hero-progress-section {
        flex-direction: column;
    }
    .hero-progress-combined,
    .hero-progress-split {
        flex-direction: column;
    }
    .hero-progress-divider {
        width: 100%;
        height: 1px;
    }
}

/* Sprint Metadata Header */
.sprint-meta-container {
    margin-bottom: 1rem;
}

.sprint-meta-card {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sprint-meta-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sprint-meta-kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sprint-meta-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

.sprint-meta-sep {
    color: var(--status-todo);
    font-weight: 500;
}

.sprint-meta-dates {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--muted-text);
}

.sprint-meta-arrow {
    color: var(--status-todo);
}

.sprint-meta-velocity {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    align-items: flex-end;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    white-space: nowrap;
}

.sprint-meta-velocity-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sprint-meta-velocity-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.sprint-meta-velocity-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text);
    margin-left: 0.25rem;
}

/* Stats Container */
.stats-container {
    margin-bottom: 1.5rem;
}

/* Two-Column Stats Layout */
.stats-two-column {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.stats-col-left {
    padding: 1.25rem;
    background: var(--subtle-bg);
    border-right: 1px solid var(--border);
}

.stats-summary-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.summary-row.warning-row {
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
}

.summary-row.warning-row:hover {
    background: var(--danger-tint);
}

.summary-label {
    font-size: 0.8125rem;
    color: var(--muted-text);
    font-weight: 500;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.summary-value-sm {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted-text);
}

.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.stats-col-right {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.status-bar-row {
    display: grid;
    grid-template-columns: 70px 35px 1fr 40px;
    gap: 0.75rem;
    align-items: center;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.status-bar-row:hover {
    background: var(--hover-bg);
}

.status-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
}

.status-bar-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

.status-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.status-bar-fill.todo { background: var(--status-todo); }
.status-bar-fill.progress { background: var(--btn-bg); }
.status-bar-fill.test { background: var(--status-test); }
.status-bar-fill.done { background: var(--success); }

.status-bar-pts {
    font-size: 0.75rem;
    color: var(--muted-text);
    text-align: right;
}

/* Issues Panel */
.issues-panel {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: visible;
}

.issues-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.issues-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.issues-view-summary-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nav-active-text);
    background: var(--primary-tint);
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    white-space: nowrap;
}

.issues-view-summary-pill.hidden {
    display: none;
}

.filter-tabs {
    display: flex;
    gap: 0.25rem;
}

.filter-tab {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--muted-text);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-tab:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.filter-tab.active {
    background: var(--nav-active-bg);
    border-color: var(--btn-bg);
    color: #1e40af;
}

.filter-tab .count {
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Filter Controls */
.filter-controls {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--page-bg);
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 20;
    overflow: visible;
}

.stats-header,
.rn-controls,
.rn-controls-left,
.rn-controls-right,
.issues-header,
.settings-panel,
.capacity-panel,
.release-notes-panel,
.stats-panel {
    overflow: visible;
}

.filter-group-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    overflow: visible;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}
.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.875rem;
}
.search-box input:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-box input::placeholder {
    color: #9ca3af;
}
.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #9ca3af;
    pointer-events: none;
}
.search-box .clear-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--muted-text);
}

.clear-filters-link {
    font-size: 0.875rem;
    color: var(--muted-text);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    align-self: flex-end;
}
.clear-filters-link:hover {
    color: #DC2626;
    background: #FEE2E2;
}
.clear-filters-link.hidden {
    display: none;
}
.search-box .clear-search:hover {
    background: #d1d5db;
    color: var(--text-color);
}
.search-box.has-value .clear-search {
    display: flex;
}

.filter-group.search-group {
    margin-left: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    overflow: visible;
}

.filter-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    min-width: 180px;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Multi-select dropdown */
.multi-select {
    position: relative;
    min-width: 220px;
    z-index: 30;
    overflow: visible;
}

.multi-select-trigger {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s;
}

.multi-select-trigger:hover {
    border-color: #9ca3af;
}

.multi-select-trigger.open {
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.multi-select-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted-text);
    transition: transform 0.2s;
}

.multi-select-trigger.open .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--surface-bg);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 300px;
    overflow-y: auto;
    z-index: 4000;
    display: none;
}

.multi-select-search {
    position: sticky;
    top: 0;
    padding: 0.5rem;
    background: var(--surface-bg);
    border-bottom: 1px solid var(--border);
}

.multi-select-search input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    outline: none;
}

.multi-select-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.multi-select-options {
    max-height: 250px;
    overflow-y: auto;
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-option {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.multi-select-option:hover {
    background: #f9fafb;
}

.multi-select-all {
    border-bottom: 1px solid var(--border);
}

.multi-select-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.multi-select-option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    white-space: nowrap;
}

/* Saved Views Dropdown */
.saved-views-container {
    position: relative;
    z-index: 30;
    overflow: visible;
}

.saved-views-trigger {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s;
    white-space: nowrap;
}

.saved-views-trigger:hover {
    border-color: #9ca3af;
}

.saved-views-trigger.open {
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.saved-views-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.saved-views-trigger-text {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-views-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    background: var(--surface-bg);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 4000;
    display: none;
    padding: 0.25rem 0;
}

.saved-views-dropdown.open {
    display: block;
}

.saved-views-list {
    max-height: 240px;
    overflow-y: auto;
}

.saved-views-empty {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--muted-text);
    text-align: center;
}

.saved-view-item {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
    gap: 0.5rem;
}

.saved-view-item:hover {
    background: #f3f4f6;
}

.saved-view-item.active {
    background: rgba(59, 130, 246, 0.08);
    font-weight: 600;
}

.saved-view-item.active::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--btn-bg);
    border-radius: 2px;
    flex-shrink: 0;
}

.saved-view-name {
    flex: 1;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-view-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.saved-view-item:hover .saved-view-delete {
    opacity: 1;
}

.saved-view-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.saved-views-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.saved-views-action {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--btn-bg);
    cursor: pointer;
    transition: background 0.1s;
}

.saved-views-action:hover {
    background: rgba(59, 130, 246, 0.06);
}

.save-view-form {
    padding: 0.5rem 0.75rem;
}

.save-view-form.hidden {
    display: none;
}

.save-view-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    background: var(--surface-bg);
    color: var(--text-color);
    outline: none;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
}

.save-view-input:focus {
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.save-view-buttons {
    display: flex;
    gap: 0.4rem;
}

.save-view-buttons .btn {
    flex: 1;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

/* Table */
#issuesContent,
#helpdeskContent,
#snapshotsContent {
    overflow-x: auto;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1500px;
    table-layout: fixed;
}

th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--page-bg);
    position: relative;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    transition: background 0.15s;
}
th.sortable:hover {
    background: var(--hover-bg);
}
th .sort-indicator {
    margin-left: 4px;
    font-size: 0.625rem;
    color: #9ca3af;
}
th.sorted-asc .sort-indicator::after {
    content: '▲';
    color: var(--btn-bg);
}
th.sorted-desc .sort-indicator::after {
    content: '▼';
    color: var(--btn-bg);
}
th.sortable:not(.sorted-asc):not(.sorted-desc) .sort-indicator::after {
    content: '⇅';
    opacity: 0.5;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}
.resize-handle:hover,
.resize-handle.resizing {
    background: var(--btn-bg);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--hover-bg);
    font-size: 0.875rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f9fafb;
}

.issue-number {
    color: var(--muted-text);
    font-weight: 500;
}

td.issue-title {
    white-space: normal;
    word-break: break-word;
}

.issue-title a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.issue-title a:hover {
    color: var(--btn-bg);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-todo { background: var(--warning-tint); color: #92400e; }
.status-open { background: var(--nav-active-bg); color: #1e40af; }
.status-in-progress { background: #e0e7ff; color: #3730a3; }
.status-in-review { background: #fce7f3; color: #9d174d; }
.status-done { background: var(--success-tint); color: #065f46; }
.status-closed { background: var(--border); color: var(--muted-text); }

/* Per-status colors matching GitHub project board */
.status-chip {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.status-grey { background: var(--border); color: var(--muted-text); }
.status-red { background: var(--danger-tint); color: #991b1b; }
.status-green { background: var(--success-tint); color: #065f46; }
.status-yellow { background: var(--warning-tint); color: #92400e; }
.status-orange { background: #ffedd5; color: #9a3412; }

/* Issue Type chip colors */
.type-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.type-bug-s1 { background: #fecaca; color: #7f1d1d; }  /* Darkest red - Critical */
.type-bug-s2 { background: var(--danger-tint); color: #991b1b; }  /* Medium red */
.type-bug-s3 { background: var(--danger-tint); color: var(--danger); }  /* Light red */
.type-bug { background: var(--danger-tint); color: #991b1b; }     /* Generic bug */
.type-story { background: var(--nav-active-bg); color: #1e40af; }   /* Blue */
.type-spike { background: #f3e8ff; color: #6b21a8; }   /* Purple */
.type-task { background: #e0e7ff; color: #3730a3; }    /* Indigo */
.type-epic { background: var(--warning-tint); color: #92400e; }    /* Amber */
.type-feature { background: var(--success-tint); color: #065f46; } /* Green */
.type-default { background: var(--hover-bg); color: var(--muted-text); } /* Grey */

/* Dashboard Options Dropdown */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}
.dashboard-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-color);
}
.options-dropdown {
    position: relative;
    display: inline-block;
}
.options-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.15s ease;
}
.options-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.options-btn.active {
    background: var(--primary-tint);
    border-color: var(--btn-bg);
    color: var(--nav-active-text);
}
.options-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 100;
    display: none;
}
.options-menu.show {
    display: block;
}
.options-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background 0.1s ease;
}
.options-menu-item:hover {
    background: var(--hover-bg);
}
.options-menu-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--btn-bg);
    cursor: pointer;
}
.options-menu-item label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}
.options-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--btn-bg);
    border-radius: 50%;
    margin-left: 0.25rem;
}
.excluded-count {
    font-size: 0.75rem;
    color: var(--muted-text);
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
}

.label {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.assignees {
    display: flex;
    align-items: center;
}

.assignee-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
}

.assignee-avatar:first-child {
    margin-left: 0;
}

.unassigned {
    color: #9ca3af;
    font-style: italic;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--page-bg);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--muted-text);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--muted-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
}

.page-btn.active {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: var(--btn-text);
}

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

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-text);
}

.rows-per-page select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    font-size: 0.875rem;
    color: var(--text-color);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted-text);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--btn-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error State */
.error {
    background: var(--danger-tint);
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--muted-text);
}

.hidden {
    display: none;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Tab */
#tab-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#tab-settings {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#tab-confidence {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#tab-capacity-drilldown {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#tab-backlog-health {
    max-width: none;
    padding: 0 2rem;
}

.confidence-page-wrap {
    padding-bottom: 1.5rem;
}

.capacity-page-wrap {
    padding-bottom: 1.5rem;
}

.confidence-page-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.confidence-back-btn {
    white-space: nowrap;
}

.confidence-page-card {
    max-width: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-bg);
    overflow: hidden;
}

.capacity-page-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.cap-drilldown-page-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-bg);
    overflow: hidden;
}

.burndown-container {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.burndown-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.burndown-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.burndown-title-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.burndown-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
}

.burndown-controls-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---- Line visibility checkboxes ---- */
.burndown-line-toggles {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--muted-text);
    border-right: 1px solid var(--border);
    padding-right: 0.75rem;
}

.line-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.line-toggle input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--btn-bg);
}

.line-toggle-swatch {
    display: inline-block;
    width: 14px;
    height: 3px;
    border-radius: 2px;
}

.line-toggle-swatch-ideal {
    background: #94a3b8;
    background-image: repeating-linear-gradient(
        90deg,
        #94a3b8 0px, #94a3b8 4px,
        transparent 4px, transparent 7px
    );
}

/* ---- Scope single-select ---- */
.burndown-scope-wrap {
    display: flex;
    align-items: center;
}

.burndown-scope-select {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s;
    min-width: 170px;
}

.burndown-scope-select:hover,
.burndown-scope-select:focus {
    border-color: var(--btn-bg);
    outline: none;
}

.burndown-title-select {
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0;
    padding-right: 1.25rem;
    cursor: pointer;
}

.burndown-title-select:focus {
    outline: none;
}

.burndown-pill-wrap {
    position: relative;
    display: inline-flex;
}

.burndown-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: help;
}

.burndown-pill-callout {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 300;
    min-width: 230px;
    white-space: normal;
}

.burndown-pill-callout::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--surface-bg);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.burndown-pill-wrap:hover .burndown-pill-callout {
    display: block;
}

.pill-callout-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.35rem;
}

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

.pill-callout-list li {
    font-size: 0.72rem;
    color: var(--text-color);
    padding: 0.15rem 0;
    padding-left: 0.75rem;
    position: relative;
}

.pill-callout-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.pill-callout-hint {
    font-size: 0.65rem;
    color: var(--muted-text);
    margin-top: 0.4rem;
    line-height: 1.3;
    border-top: 1px solid var(--border);
    padding-top: 0.35rem;
}

.burndown-pill-dev {
    background: var(--warning-tint);
    border-color: #fcd34d;
    color: #92400e;
}

.burndown-pill-release {
    background: var(--success-tint);
    border-color: #86efac;
    color: #166534;
}

.burndown-toggle {
    display: flex;
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 2px;
}

.toggle-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--muted-text);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-btn.active {
    background: var(--surface-bg);
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.toggle-btn:hover:not(.active) {
    color: #334155;
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.ideal {
    background: #ef4444;
}

.legend-line.actual {
    background: var(--btn-bg);
}

.legend-line.remaining {
    background: var(--warning);
}

.burndown-chart-wrap {
    position: relative;
    width: 100%;
    height: 360px;
}

.burndown-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    cursor: crosshair;
}

.burndown-chart-wrap.is-empty canvas {
    visibility: hidden;
    pointer-events: none;
}

.burndown-tracking-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    text-align: center;
    padding: 1.25rem;
}

.burndown-tracking-empty.hidden {
    display: none;
}

.burndown-tracking-empty-text {
    font-size: 0.9rem;
    color: var(--muted-text);
    margin: 0;
    max-width: 420px;
}

.burndown-track-btn {
    border: 1px solid #ea580c;
    background: #f97316;
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.burndown-track-btn:hover {
    background: #ea580c;
    border-color: #c2410c;
}

.burndown-track-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.burndown-tooltip {
    display: none;
    position: absolute;
    pointer-events: none;
    background: var(--text-color);
    color: var(--hover-bg);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    white-space: nowrap;
    min-width: 160px;
}

.burndown-tooltip .tooltip-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #334155;
    padding-bottom: 4px;
}

.burndown-tooltip .tooltip-date-row .tooltip-date {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.burndown-tooltip .tooltip-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.burndown-tooltip .tooltip-date {
    font-weight: 600;
    font-size: 12px;
    color: var(--border);
    margin-bottom: 4px;
    border-bottom: 1px solid #334155;
    padding-bottom: 4px;
}

.burndown-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.burndown-tooltip .tooltip-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.burndown-tooltip .tooltip-label {
    color: var(--status-todo);
}

.burndown-tooltip .tooltip-value {
    font-weight: 600;
    color: var(--subtle-bg);
}

.burndown-tooltip .tooltip-absence-divider {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 4px 0 3px;
}

.burndown-tooltip .tooltip-absence-row {
    font-size: 0.75rem;
    color: #fca5a5;
    white-space: nowrap;
}

/* ---- Instant insight tooltip (matches burndown tooltip style) ---- */
.insight-tip {
    display: none;
    position: fixed;
    pointer-events: none;
    background: var(--text-color);
    color: var(--hover-bg);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    white-space: normal;
    max-width: 280px;
    word-wrap: break-word;
}

/* ============================================
   What-If Simulator
   ============================================ */
.whatif-simulator {
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem 0.9rem;
    background: var(--subtle-bg);
    border-radius: 0 0 12px 12px;
}

.whatif-simulator.hidden {
    display: none;
}

.whatif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.whatif-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.whatif-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.whatif-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}

.whatif-badge.hidden {
    display: none;
}

.whatif-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.whatif-collapse-btn:hover {
    background: var(--hover-bg);
}

.whatif-chevron {
    transition: transform 0.2s;
}

.whatif-simulator.collapsed .whatif-chevron {
    transform: rotate(-90deg);
}

.whatif-simulator.collapsed .whatif-body {
    display: none;
}

/* ---- Interactive ticket bar ---- */
.whatif-bars-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.whatif-bar-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.whatif-bar-row-inner {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.whatif-bar-row-inner .whatif-ticket-bar-wrap {
    flex: 1;
    min-width: 0;
}

.whatif-row-reset-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dc2626;
    border-radius: 4px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.whatif-row-reset-btn:hover {
    border-color: #b91c1c;
    color: #fff;
    background: #b91c1c;
}

.whatif-bar-dev-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0 2px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.whatif-bar-dev-label .whatif-dev-move-count {
    font-weight: 500;
    font-size: 0.62rem;
    color: var(--muted-text);
}

.whatif-ticket-bar-wrap {
    /* no extra margin when inside bar-row */
}

.whatif-ticket-bar {
    display: flex;
    min-height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--hover-bg);
}

.whatif-bar-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 5px;
    min-width: 4px;
    position: relative;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(255,255,255,0.25);
}

.whatif-bar-section:last-child {
    border-right: none;
}

.whatif-bar-section.empty-section {
    padding: 4px 1px;
    opacity: 0.45;
}

.whatif-bar-section.drop-target {
    opacity: 1;
}

.whatif-bar-section.drag-over {
    box-shadow: inset 0 0 0 2px #3b82f6;
    opacity: 1;
    filter: brightness(1.1);
}

/* During drag, expand empty sections so they become usable drop targets */
.whatif-ticket-bar.dragging .whatif-bar-section.empty-section {
    min-width: 28px;
    opacity: 0.7;
}

.whatif-ticket-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid rgba(0,0,0,0.13);
    border-radius: 5px;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.1s;
    color: #1e293b;
    position: relative;
    z-index: 1;
}

.whatif-ticket-chip:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 3;
}

.whatif-ticket-chip:active {
    cursor: grabbing;
}

.whatif-ticket-chip.dragging {
    opacity: 0.3;
}

/* Planning type text colors */
.whatif-ticket-chip.plan-planned {
    color: #16a34a; /* green */
    font-weight: 700;
}
.whatif-ticket-chip.plan-unplanned {
    color: #dc2626; /* red */
    font-weight: 700;
}
.whatif-ticket-chip.plan-future {
    color: #ea580c; /* orange */
    font-weight: 700;
}

.whatif-ticket-chip.was-moved {
    border-color: var(--origin-color, #8b5cf6);
    box-shadow: 0 0 0 1px var(--origin-color, #8b5cf6);
    background: color-mix(in srgb, var(--origin-color, #8b5cf6) 10%, white 90%);
}

.whatif-ticket-callout {
    position: fixed;
    z-index: 10050;
    width: min(270px, calc(100vw - 20px));
    background: var(--text-color);
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
    padding: 10px 12px;
    pointer-events: auto;
}

.whatif-ticket-callout.hidden {
    display: none;
}

.whatif-ticket-callout-ref {
    font-size: 0.74rem;
    color: var(--muted-text);
    font-weight: 600;
}

.whatif-ticket-callout-avatar {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.whatif-ticket-callout-title {
    display: block;
    font-size: 0.86rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--surface-bg);
    text-decoration: none;
    margin-bottom: 8px;
}

.whatif-ticket-callout-title:hover {
    color: #93c5fd;
}

.whatif-ticket-callout-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.whatif-ticket-callout-footer {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    min-height: 20px;
}

.whatif-ticket-pill {
    font-size: 0.72rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #475569;
    background: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
}

.whatif-ticket-pill.pill-type,
.whatif-ticket-pill.pill-points,
.whatif-ticket-pill.pill-date {
    background: #334155;
}

.whatif-ticket-pill.pill-focus,
.whatif-ticket-pill.pill-unplanned {
    background: var(--danger-tint);
    color: var(--danger);
    border-color: var(--danger);
}

.whatif-ticket-pill.pill-workstream,
.whatif-ticket-pill.pill-source {
    background: var(--primary-tint);
    color: var(--nav-active-text);
    border-color: var(--nav-active-text);
}

.whatif-ticket-pill.pill-planned {
    background: var(--success-tint);
    color: var(--success);
    border-color: var(--success);
}

.whatif-bar-labels {
    display: flex;
    margin-top: 3px;
}

.whatif-bar-label {
    font-size: 0.58rem;
    color: var(--muted-text);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 1px;
    line-height: 1.2;
}

/* ---- Moves list ---- */
/* ---- Controls row ---- */
.whatif-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.whatif-reset-btn,
.whatif-clearall-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--muted-text);
    cursor: pointer;
    transition: all 0.15s;
}

.whatif-reset-btn:hover {
    border-color: #f97316;
    color: #ea580c;
    background: #fff7ed;
}

.whatif-clearall-btn:hover {
    border-color: #ef4444;
    color: #dc2626;
    background: #fef2f2;
}

/* ---- Projection indicator on chart ---- */
.whatif-projection-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: var(--muted-text);
    margin-top: 0.25rem;
}

.whatif-projection-indicator .proj-dash {
    width: 16px;
    height: 0;
    border-top: 2px dashed #8b5cf6;
}

/* ---- Developer Insights Button ---- */
.burndown-insights-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--muted-text);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.burndown-insights-btn:hover {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
    background: var(--hover-bg);
}

.burndown-insights-btn.active {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
    background: var(--hover-bg);
}

/* ---- Developer Insights Side Panel ---- */
.dev-insights-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface-bg);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dev-insights-panel.open {
    transform: translateX(0);
}

.dev-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.dev-insights-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.dev-insights-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.dev-insights-avatar.hidden {
    display: none;
}

.dev-insights-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.dev-insights-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.dev-insights-close:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.dev-insights-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

/* Availability totals divider */
.avail-totals {
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

/* Insight sections */
.insight-section {
    margin-bottom: 1.5rem;
}

.insight-section:last-child {
    margin-bottom: 0;
}

.insight-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-text);
    margin: 0 0 0.6rem 0;
}

/* Working-today badge in Availability header */
.avail-today-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    line-height: 1;
}
.avail-today-on {
    color: #166534;
    background: #dcfce7;
}
.avail-today-off {
    color: #991b1b;
    background: #fee2e2;
}
.avail-today-half {
    color: #92400e;
    background: #fef3c7;
}

/* Risk badge */
.insight-risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.insight-risk-badge.risk-on-track {
    background: var(--success-tint);
    border-color: #86efac;
    color: #166534;
}

.insight-risk-badge.risk-at-risk {
    background: var(--warning-tint);
    border-color: #fcd34d;
    color: #92400e;
}

.insight-risk-badge.risk-off-track {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.insight-risk-reason {
    font-size: 0.75rem;
    color: var(--muted-text);
    margin-top: 0.4rem;
    line-height: 1.4;
}

/* Stat rows */
.insight-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}

.insight-stat-row + .insight-stat-row {
    border-top: 1px solid var(--hover-bg);
}

.insight-stat-label {
    color: var(--muted-text);
}

.insight-label-asterisk {
    color: var(--danger);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-left: 0.12rem;
}

.insight-stat-value {
    font-weight: 600;
    color: var(--text-color);
}

.insight-stat-value.positive {
    color: #16a34a;
}

.insight-stat-value.negative {
    color: #dc2626;
}

.insight-stat-value.neutral {
    color: var(--muted-text);
}

/* Whole-sprint Risk & Focus */
.insight-risk-block {
    padding: 0.45rem 0;
}

.insight-risk-block + .insight-risk-block {
    border-top: 1px solid var(--hover-bg);
}

.insight-risk-label {
    font-size: 0.72rem;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
}

.insight-risk-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.insight-risk-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.insight-risk-main {
    min-width: 0;
    flex: 1;
}

.insight-risk-subtext {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted-text);
    line-height: 1.3;
    margin-top: 0.05rem;
    white-space: normal;
}

.insight-risk-points {
    white-space: nowrap;
}

.insight-risk-item.negative {
    color: #dc2626;
}

.insight-risk-item.positive {
    color: #16a34a;
}

.insight-risk-item.neutral {
    color: var(--text-color);
}

.insight-risk-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.insight-risk-link:hover {
    color: var(--nav-active-text);
    text-decoration: underline;
}

.insight-risk-empty {
    font-size: 0.8rem;
    color: var(--muted-text);
}

.insight-risk-rebalance {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--hover-bg);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.insight-risk-rebalance-label {
    font-size: 0.72rem;
    color: var(--muted-text);
}

.insight-risk-rebalance-text {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-color);
}

/* Mini progress bar */
.insight-progress-wrap {
    margin-top: 0.15rem;
}

.insight-progress-bar {
    height: 6px;
    background: var(--hover-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.3rem;
}

.insight-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.insight-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--muted-text);
    margin-top: 0.2rem;
}

/* Breakdown list */
.insight-breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.8rem;
}

.insight-scope-breakdown {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--hover-bg);
}

.insight-breakdown-item + .insight-breakdown-item {
    border-top: 1px solid var(--hover-bg);
}

.insight-breakdown-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.insight-breakdown-name {
    flex: 1;
    color: var(--text-color);
}

.insight-breakdown-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.78rem;
}

/* No-dev placeholder */
.insight-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted-text);
}

.insight-placeholder svg {
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.insight-placeholder-text {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Journey to Sprint Finish */

/* Hero verdict banner */
.insight-hero {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.insight-hero-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.insight-hero-body {
    flex: 1;
    min-width: 0;
}

.insight-hero-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.insight-hero-verdict {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.hero-action-text {
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.4rem;
    line-height: 1.3;
}

.hero-action-tight {
    opacity: 0.75;
}

/* Hero colour variants */
.insight-hero.journey-complete {
    background: var(--success-tint);
    border-color: #86efac;
    color: #166534;
}

.insight-hero.journey-cruising {
    background: var(--success-tint);
    border-color: #86efac;
    color: #166534;
}

.insight-hero.journey-reachable {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.insight-hero.journey-overloaded {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.hero-action-remove {
    color: inherit;
}

.journey-section {
    border-top: 2px solid var(--border);
    padding-top: 1.25rem;
}

.journey-verdict {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.journey-verdict.journey-complete {
    background: var(--success-tint);
    color: #166534;
    border: 1px solid #86efac;
}

.journey-verdict.journey-cruising {
    background: var(--success-tint);
    color: #166534;
    border: 1px solid #86efac;
}

.journey-verdict.journey-reachable {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.journey-verdict.journey-overloaded {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.journey-speeds {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.journey-speed-row {
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}

.journey-speed-row .insight-stat-label {
    flex: 1;
}

.journey-speed-row + .journey-speed-row {
    border-top: 1px solid var(--hover-bg);
}

.journey-speed-icon {
    width: 1.5rem;
    flex-shrink: 0;
    font-size: 0.85rem;
    text-align: center;
}

.journey-divider {
    height: 1px;
    background: var(--border);
    margin: 0.6rem 0;
}

.journey-action {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.journey-action-positive {
    background: var(--success-tint);
    border: 1px solid #86efac;
    color: #166534;
}

.journey-action-negative {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.journey-action-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.journey-footnote {
    font-size: 0.68rem;
    color: var(--muted-text);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ---- Grooming Side Panel (slides from left) ---- */
.grooming-side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 540px;
    max-width: 92vw;
    height: 100vh;
    background: var(--surface-bg);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grooming-side-panel.open {
    transform: translateX(0);
}

.grooming-side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.grooming-side-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.grooming-side-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.grooming-side-close:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.grooming-side-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.grooming-side-description {
    font-size: 0.78rem;
    color: var(--muted-text);
    margin: 0 1.5rem 0.6rem;
    line-height: 1.45;
}

.grooming-side-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.grooming-quick-status {
    margin-right: auto;
    font-size: 0.74rem;
    color: var(--muted-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.grooming-fetch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.5rem 1.2rem;
    white-space: nowrap;
    flex-shrink: 0;
    width: 152px;
}

.grooming-fetch-label {
    white-space: nowrap;
}

.grooming-quick-btn {
    background: var(--warning);
    color: var(--text-color);
    border: 1px solid color-mix(in srgb, var(--warning) 75%, #000);
}

.grooming-quick-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--warning) 85%, #fff);
}

.grooming-quick-btn .grooming-fetch-spinner {
    border-color: rgba(15, 23, 42, 0.22);
    border-top-color: var(--text-color);
}

.grooming-fetch-spinner {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.grooming-fetch-spinner.hidden {
    visibility: hidden;
    opacity: 0;
    animation-play-state: paused;
}

/* Collapsible section */
.grooming-side-section {
    border-bottom: 1px solid var(--hover-bg);
}

.grooming-side-section:last-child {
    border-bottom: none;
}

.grooming-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.grooming-section-header:hover {
    background: var(--hover-bg);
}

.grooming-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.grooming-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.grooming-section-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    line-height: 1.3;
    min-width: 1.2rem;
    text-align: center;
    background: #16a34a;
}

.grooming-section-count.badge-green {
    background: #16a34a;
}

.grooming-section-count.badge-amber {
    background: #d97706;
}

.grooming-section-count.badge-red {
    background: #dc2626;
}

.grooming-section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grooming-open-all {
    font-size: 0.65rem;
    color: var(--muted-text);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.grooming-open-all:hover {
    color: var(--accent-color);
    background: var(--hover-bg);
    text-decoration: underline;
}

.grooming-section-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--muted-text);
    transition: transform 0.2s ease;
}

.grooming-side-section.collapsed .grooming-section-chevron {
    transform: rotate(-90deg);
}

.grooming-section-body {
    padding: 0 1.5rem 0.65rem 1.5rem;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 600px;
    opacity: 1;
}

.grooming-side-section.collapsed .grooming-section-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Issue rows inside sections (stat-row style) */
.grooming-issue-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.grooming-issue-row + .grooming-issue-row {
    border-top: 1px solid var(--hover-bg);
}

.grooming-issue-check {
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--nav-active-text);
}

.grooming-issue-row.checked .grooming-issue-key,
.grooming-issue-row.checked .grooming-issue-title {
    text-decoration: line-through;
    opacity: 0.65;
}

.grooming-issue-key {
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-color);
}

.grooming-issue-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-text);
    font-size: 0.78rem;
    text-decoration: none;
}

.grooming-issue-title:hover {
    color: var(--nav-active-text);
    text-decoration: underline;
}

/* Success message when section is clear */
.grooming-section-clear {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #16a34a;
    font-weight: 600;
    padding: 0.25rem 0;
}

.grooming-section-clear-icon {
    font-size: 0.9rem;
}

/* Settings Panel */
.settings-panel {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}

.settings-panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.settings-description {
    color: var(--muted-text);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--status-todo);
    margin-top: 0.375rem;
}

.form-hint code {
    background: var(--hover-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-description-tight {
    margin-bottom: 0;
}

.settings-empty-state {
    padding: 1rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    color: var(--muted-text);
    background: var(--hover-bg);
}

.iterations-mirror-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.iterations-mirror-current {
    margin-top: 1rem;
}

.iterations-mirror-expander {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-bg);
    padding: 0.75rem 1rem 1rem;
}

.iterations-mirror-expander summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-color);
    list-style: none;
}

.iterations-mirror-expander summary::-webkit-details-marker {
    display: none;
}

.iterations-mirror-expander summary::after {
    content: '+';
    float: right;
    color: var(--muted-text);
}

.iterations-mirror-expander[open] summary::after {
    content: '-';
}

.iteration-mirror-card {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-bg);
    padding: 1rem 1.1rem;
}

.iteration-mirror-card.is-current {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(47, 109, 246, 0.12);
}

.iteration-mirror-card.is-active {
    background: var(--primary-tint);
}

.iteration-mirror-title-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.iteration-mirror-title {
    font-weight: 700;
    color: var(--text-color);
}

.iteration-mirror-meta {
    margin-top: 0.35rem;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.iteration-mirror-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.iteration-mirror-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.22rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.iteration-mirror-badge.current {
    background: var(--primary-tint);
    color: var(--primary);
}

.iteration-mirror-badge.active {
    background: rgba(34, 197, 94, 0.14);
    color: var(--success);
}

/* ============================================
   Auto-Sync Schedule
   ============================================ */

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--surface-bg);
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Status badge */
.auto-sync-badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    vertical-align: baseline;
    position: relative;
    top: -0.05rem;
}
.auto-sync-badge-off { background: var(--hover-bg); color: var(--muted-text); }
.auto-sync-badge-on  { background: var(--success-tint); color: #065f46; }

/* Schedule card */
.sched-card {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    margin-bottom: 1rem;
    overflow: hidden;
}
.sched-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--subtle-bg);
}
.sched-card-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-height: 1.5rem;
}
.sched-card-icon { font-size: 1.1rem; }
.sched-card-title {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.25;
    display: inline-block;
    vertical-align: baseline;
}
.sched-card-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sched-edit-btn { font-size: 0.75rem !important; padding: 0.25rem 0.65rem !important; }
.sched-card-body {
    padding: 1rem;
    transition: opacity 0.2s;
    background: var(--surface-bg);
}
.sched-card-body.sched-locked {
    opacity: 0.55;
    pointer-events: none;
}

/* Next sync indicator */
.next-sync-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0fdf4;
    font-size: 0.8rem;
    color: #166534;
    border-bottom: 1px solid var(--border);
}
.next-sync-icon { font-size: 0.95rem; }

/* Schedule fields */
.schedule-field {
    margin-bottom: 1.15rem;
}
.schedule-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.45rem;
}

/* Shared select / input styling */
.schedule-select,
.sched-input {
    padding: 0.45rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    max-width: 280px;
}
.schedule-select:focus,
.sched-input:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}
.schedule-select:disabled,
.sched-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Day picker (re-used for week timer) */
.day-picker {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.day-btn {
    width: 44px;
    height: 34px;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: var(--surface-bg);
    color: var(--muted-text);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.day-btn:hover { border-color: var(--status-todo); color: var(--text-color); }
.day-btn.active {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: var(--btn-text);
}
.day-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Type-specific options area */
.sched-type-options {
    min-height: 2rem;
}
.sched-type-options .schedule-field:last-child { margin-bottom: 0; }

/* Inline row for date+time */
.sched-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Save row */
.schedule-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}
.schedule-save-status {
    font-size: 0.8rem;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s;
}
.schedule-save-status.visible { opacity: 1; }

.fetch-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.baseline-override-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-text);
    cursor: pointer;
    padding: 0.25rem 0;
}

.baseline-override-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--warning);
}

.baseline-override-option span {
    user-select: none;
}

.baseline-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--border);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--muted-text);
    cursor: help;
}

.baseline-hint:hover {
    background: #cbd5e1;
    color: var(--muted-text);
}

.btn-secondary {
    background: var(--surface-bg);
    color: var(--muted-text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: var(--text-color);
}

.btn-danger {
    background: var(--danger);
    color: var(--btn-text);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

/* Welcome Card */
.dashboard-welcome {
    margin-top: 2rem;
}

.welcome-card {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.welcome-card p {
    color: var(--muted-text);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.welcome-spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.welcome-spinner.hidden {
    display: none;
}

.welcome-spinner .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* No Data State */
.no-data-state {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    color: var(--muted-text);
}

.no-data-state p {
    margin-bottom: 1.5rem;
}

.data-source {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #ecfdf5;
    border: 1px solid var(--success-tint);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #065f46;
    margin-left: 0;
}

.data-source.fetching {
    background: var(--warning-tint);
    border-color: var(--warning-tint);
    color: #92400e;
}

.data-source-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.data-source.fetching .data-source-dot {
    background: var(--warning);
}

.backend-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-bg);
}

.backend-sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted-text);
}

.backend-sync-badge.shared {
    background: #ecfdf5;
    border-color: var(--success-tint);
    color: #065f46;
}

.backend-sync-badge.shared .backend-sync-dot {
    background: #10b981;
}

.backend-sync-badge.syncing {
    background: #f0f9ff;
    border-color: #bfdbfe;
    color: var(--nav-active-text);
}

.backend-sync-badge.syncing .backend-sync-dot {
    background: var(--btn-bg);
}

.backend-sync-badge.fallback {
    background: var(--warning-tint);
    border-color: var(--warning-tint);
    color: #92400e;
}

.backend-sync-badge.fallback .backend-sync-dot {
    background: var(--warning);
}

/* Header Loading Indicator */
.header-status-area {
    display: flex;
    align-items: center;
}

.header-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--nav-active-text);
}

.header-loading.hidden {
    display: none;
}

.header-loading-text {
    white-space: nowrap;
}

.header-loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #bfdbfe;
    border-top-color: var(--btn-bg);
    border-radius: 50%;
    animation: header-spin 0.8s linear infinite;
}

.header-loading-progress {
    width: 60px;
    height: 4px;
    background: #dbeafe;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.header-loading-progress.active {
    display: block;
}

.header-loading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--btn-bg);
    border-radius: 2px;
    transition: width 0.4s ease;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .header-right {
        order: -1;
        width: 100%;
        justify-content: flex-end;
    }

    .status-summary-btn {
        display: inline-flex;
    }

    .header-status-panel {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 0.4rem);
        z-index: 200;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        min-width: 220px;
        max-width: calc(100vw - 2rem);
        padding: 0.5rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface-bg);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

    .header-status-panel.open {
        display: flex;
    }

    .header-status-area,
    .data-source,
    .backend-sync-badge,
    .header-loading {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .delivery-progress-tile,
    #heroDeliveryProgress {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .hero-stats-row {
        grid-template-columns: 1fr;
    }

    .delivery-progress-tile,
    #heroDeliveryProgress {
        grid-column: auto;
    }
}

.sync-progress-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.25;
    vertical-align: middle;
    height: 1.5rem;
    box-sizing: border-box;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content {
    background: var(--surface-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--status-todo);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-description {
    color: var(--muted-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.column-config-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Two-column modal layout */
.modal-wide {
    max-width: 800px;
    width: 90%;
}

.column-config-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 400px;
    max-height: 500px;
}

.column-config-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-bg);
    overflow: hidden;
}

.available-panel {
    background: var(--page-bg);
}

.column-search-wrapper {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.column-search-wrapper input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--surface-bg);
}

.column-search-wrapper input:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.column-available-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.selected-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text);
    letter-spacing: 0.025em;
    background: var(--subtle-bg);
}

.column-selected-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Available column item (left panel) */
.column-available-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
    color: var(--text-color);
}

.column-available-item:hover {
    background: var(--border);
}

.column-available-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0ea5a9;
}

.column-available-item.selected {
    background: #e0f2f1;
}

/* Selected column item (right panel) */
.column-selected-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.375rem;
    cursor: grab;
    transition: all 0.15s;
    font-size: 0.875rem;
    color: var(--text-color);
}

.column-selected-item:hover {
    background: var(--hover-bg);
    border-color: #cbd5e1;
}

.column-selected-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.column-selected-item.drag-over {
    border-color: #0ea5a9;
    background: #e0f2f1;
}

.column-selected-item.core-column {
    background: #0ea5a9;
    color: var(--btn-text);
    border-color: #0ea5a9;
}

.column-selected-item.core-column .selected-drag-handle,
.column-selected-item.core-column .remove-column-btn {
    color: rgba(255,255,255,0.7);
}

.column-selected-item.core-column .remove-column-btn {
    display: none;
}

.selected-drag-handle {
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
    cursor: grab;
}

.selected-column-label {
    flex: 1;
    font-weight: 500;
}

.remove-column-btn {
    background: none;
    border: none;
    color: var(--status-todo);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.remove-column-btn:hover {
    color: #ef4444;
}

.column-config-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.15s;
}

.column-config-item:hover {
    background: var(--hover-bg);
}

.column-config-item.disabled {
    opacity: 0.5;
}

.column-drag-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    user-select: none;
}

.column-config-item[draggable="true"]:active .column-drag-handle {
    cursor: grabbing;
}

.column-config-item.drag-over {
    border-color: var(--btn-bg);
    background: var(--nav-active-bg);
}

.column-config-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.column-config-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.btn-icon {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    color: var(--muted-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: var(--text-color);
}
/* ============================================
   Stats Tab Styles
   ============================================ */

.stats-panel {
    max-width: 100%;
    padding: 1.5rem;
}

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

.stats-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.stats-actions {
    display: flex;
    gap: 0.75rem;
}

.stats-table-container {
    overflow-x: auto;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 1600px;
}

.stats-table th {
    padding: 0.5rem 0.625rem;
    text-align: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
    white-space: nowrap;
}

.stats-table th[colspan] {
    border-bottom: 1px solid #d1d5db;
    background: var(--hover-bg);
}

.stats-table td {
    padding: 0.5rem 0.625rem;
    text-align: center;
    border-bottom: 1px solid var(--hover-bg);
    color: var(--text-color);
}

.stats-table td:first-child,
.stats-table td:nth-child(2) {
    text-align: left;
    font-weight: 500;
}

.stats-table tbody tr:hover {
    background: #f9fafb;
}

.stats-table td[contenteditable="true"] {
    cursor: text;
    outline: none;
}

.stats-table td[contenteditable="true"]:focus {
    background: var(--nav-active-bg);
    box-shadow: inset 0 0 0 2px var(--btn-bg);
}

.stats-empty {
    padding: 3rem;
    text-align: center;
    color: var(--muted-text);
}

/* Sprint Control Section in Settings */
.sprint-control-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sprint-control-section h2 {
    color: #0c4a6e;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.active-sprint-info {
    background: var(--surface-bg);
    border: 1px solid #e0f2fe;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.active-sprint-info .sprint-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 0.25rem;
}

.active-sprint-info .sprint-dates {
    font-size: 0.875rem;
    color: var(--muted-text);
}

.active-sprint-info .sprint-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.active-sprint-info .sprint-status.tracking {
    background: var(--success-tint);
    color: #166534;
}

.active-sprint-info .sprint-status.pending {
    background: var(--warning-tint);
    color: #92400e;
}

.no-sprint-msg {
    color: var(--muted-text);
    font-size: 0.875rem;
}

.sprint-control-actions {
    display: flex;
    gap: 0.75rem;
}

/* Start Sprint Modal */
.current-sprint-summary {
    background: var(--warning-tint);
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.current-sprint-summary.hidden {
    display: none;
}

.current-sprint-summary h4 {
    color: #92400e;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.current-sprint-summary p {
    color: #78350f;
    font-size: 0.8125rem;
    margin: 0;
}

.sprint-dates-preview {
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-text);
}

.sprint-dates-preview:empty {
    display: none;
}

.finalize-review-section {
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #334155;
}

.finalize-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.finalize-review-item {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
}

.finalize-review-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
}

.finalize-review-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Import Modal */
.import-textarea {
    width: 100%;
    height: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8125rem;
    resize: vertical;
}

.import-textarea:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.import-preview {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    color: #166534;
    font-size: 0.875rem;
}

/* ============================================
   STATS TAB - Velocity Badge & Table Styles
   ============================================ */

.velocity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--btn-bg) 0%, #2563eb 100%);
    color: var(--btn-text);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.velocity-badge strong {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Stats table wrapper - enables horizontal scrolling */
.stats-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    margin: 0;
    padding-bottom: 0.5rem;
}

.stats-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.stats-table-wrapper::-webkit-scrollbar-track {
    background: var(--hover-bg);
    border-radius: 4px;
}

.stats-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--status-todo);
    border-radius: 4px;
}

.stats-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--muted-text);
}

/* Stats table specific styles */
#statsPanel table {
    min-width: 4200px;
    table-layout: auto;
}

#statsPanel th,
#statsPanel td {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    overflow: visible;
    text-overflow: clip;
}

/* Group color bands for stats table */
#statsPanel th.stats-grp-whole-sprint,
#statsPanel td.stats-grp-whole-sprint { background-color: rgba(219, 234, 254, 0.45); }

#statsPanel th.stats-grp-project,
#statsPanel td.stats-grp-project { background-color: rgba(254, 226, 195, 0.45); }

#statsPanel th.stats-grp-change,
#statsPanel td.stats-grp-change { background-color: rgba(220, 252, 231, 0.45); }

#statsPanel th.stats-grp-tech-training,
#statsPanel td.stats-grp-tech-training { background-color: rgba(237, 233, 254, 0.45); }

#statsPanel th.stats-grp-r-d,
#statsPanel td.stats-grp-r-d { background-color: rgba(254, 242, 195, 0.45); }

/* Stronger color for the group header row */
#statsPanel .stats-group-header.stats-grp-whole-sprint { background-color: rgba(219, 234, 254, 0.8); }
#statsPanel .stats-group-header.stats-grp-project { background-color: rgba(254, 226, 195, 0.8); }
#statsPanel .stats-group-header.stats-grp-change { background-color: rgba(220, 252, 231, 0.8); }
#statsPanel .stats-group-header.stats-grp-tech-training { background-color: rgba(237, 233, 254, 0.8); }
#statsPanel .stats-group-header.stats-grp-r-d { background-color: rgba(254, 242, 195, 0.8); }

/* Center-align group headers and numeric data cells */
#statsPanel .stats-group-header { text-align: center; font-weight: 700; }
#statsPanel .text-right { text-align: center; }

#statsPanel .text-right {
    text-align: right;
}

#statsPanel .text-center {
    text-align: center;
}

/* Row edit mode styles */
#statsPanel tr.editing {
    background-color: rgba(59, 130, 246, 0.1);
}

#statsPanel tr.editing td.editable-cell {
    cursor: text;
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px dashed var(--btn-bg);
}

#statsPanel tr.editing td.editable-cell[contenteditable="true"]:focus {
    outline: 2px solid var(--btn-bg);
    outline-offset: -2px;
    background-color: rgba(59, 130, 246, 0.2);
}

#statsPanel .stats-edit-input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--btn-bg);
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    background: #fff;
    color: var(--text-color);
    font: inherit;
}

#statsPanel .stats-edit-input:focus {
    outline: 2px solid rgba(59, 130, 246, 0.25);
    border-color: var(--btn-bg);
}

/* Edit button in actions column */
.stats-row-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.stats-edit-btn,
.stats-save-btn,
.stats-cancel-btn,
.stats-delete-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.stats-edit-btn {
    background: var(--border);
    color: var(--muted-text);
}

.stats-edit-btn:hover {
    background: #cbd5e1;
}

.stats-delete-btn {
    background: var(--danger-tint);
    color: var(--danger);
}

.stats-delete-btn:hover {
    background: #fecaca;
}

.stats-save-btn {
    background: var(--success);
    color: var(--btn-text);
}

.stats-save-btn:hover {
    background: var(--success);
}

.stats-cancel-btn {
    background: var(--hover-bg);
    color: var(--muted-text);
}

.stats-cancel-btn:hover {
    background: var(--border);
}

/* No data state */
.no-data-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--muted-text);
}

.no-data-state p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.no-data-state.hidden {
    display: none;
}

/* Active sprint info styles */
.active-sprint-info {
    padding: 1rem;
    background: var(--text-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.sprint-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--border);
    margin-bottom: 0.25rem;
}

.sprint-dates {
    font-size: 0.875rem;
    color: var(--status-todo);
    margin-bottom: 0.5rem;
}

.sprint-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: help;
}

.sprint-status.tracking {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.sprint-status.pending {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.no-sprint-msg {
    color: var(--status-todo);
    font-style: italic;
}

.sprint-control-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.iteration-selector-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
    max-width: 320px;
}

.iteration-selector-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.iteration-selector-row select {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.65rem 0.8rem;
    background: var(--surface-bg);
    color: var(--text-color);
    font: inherit;
}

/* Toast notification */
.stats-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: var(--btn-text);
    padding: 14px 24px;
    border-radius: 8px;
    z-index: 9998;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 0.9rem;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stats-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* ============================================
   Grooming / Needs Attention Widget
   ============================================ */

.grooming-panel {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.grooming-header-section {
    margin-bottom: 1.5rem;
}

.grooming-header-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.grooming-description {
    color: var(--muted-text);
    font-size: 0.875rem;
}

.grooming-container {
    margin-bottom: 1.5rem;
}

.grooming-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.grooming-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.grooming-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grooming-header h3::before {
    content: '⚠️';
    font-size: 1rem;
}

.grooming-total {
    font-size: 0.8125rem;
    color: var(--muted-text);
    background: var(--hover-bg);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

.grooming-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.grooming-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    justify-content: center;
    white-space: nowrap;
    flex: 1 1 120px;
    box-sizing: border-box;
}

.grooming-item:hover {
    background: var(--hover-bg);
    border-color: #cbd5e1;
}

.grooming-item.has-issues {
    background: var(--warning-tint);
    border-color: var(--warning);
}

.grooming-item.has-issues:hover {
    background: var(--warning-tint);
}

.grooming-item.all-clear {
    background: #f0fdf4;
    border-color: #86efac;
}

.grooming-item.all-clear:hover {
    background: var(--success-tint);
}

.grooming-item.all-clear .grooming-count {
    background: var(--success);
    color: var(--btn-text);
}

.grooming-item.has-issues .grooming-count {
    background: var(--warning);
    color: var(--btn-text);
}

.grooming-label {
    font-size: 0.75rem;
    color: var(--muted-text);
    font-weight: 500;
}

.grooming-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-text);
    background: var(--border);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    min-width: 1.75rem;
    text-align: center;
}

/* Grooming Drilldown Table (inline, full-width) */
.grooming-drilldown {
    margin-top: 1.5rem;
    background: var(--surface-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.grooming-drilldown.hidden {
    display: none;
}

.grooming-drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--subtle-bg);
}

.grooming-drilldown-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.grooming-drilldown-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-text);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

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

.grooming-drilldown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.grooming-drilldown-table thead {
    background: var(--subtle-bg);
    border-bottom: 1px solid var(--border);
}

.grooming-drilldown-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--muted-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grooming-drilldown-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hover-bg);
    vertical-align: middle;
}

.grooming-drilldown-table tbody tr:last-child td {
    border-bottom: none;
}

.grooming-drilldown-table tbody tr:hover {
    background: var(--subtle-bg);
}

.grooming-drilldown-table .col-number {
    width: 80px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--muted-text);
}

.grooming-drilldown-table .col-title {
    min-width: 200px;
}

.grooming-drilldown-table .issue-title-link {
    color: var(--text-color);
    text-decoration: none;
}

.grooming-drilldown-table .issue-title-link:hover {
    color: var(--btn-bg);
    text-decoration: underline;
}

.grooming-drilldown-table .col-missing {
    width: auto;
    white-space: nowrap;
}

.grooming-drilldown-table .issue-link {
    font-weight: 600;
    color: var(--btn-bg);
    text-decoration: none;
}

.grooming-drilldown-table .issue-link:hover {
    text-decoration: underline;
}

/* Missing Element Chips */
.chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.375rem;
    margin-bottom: 0.25rem;
}

.chip-missing {
    background: var(--warning-tint);
    color: #92400e;
    border: 1px solid var(--warning-tint);
}

.chip-blocked {
    background: var(--danger-tint);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.chip-status {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Inactive grooming chip (pre-release not published yet) */
.grooming-item.inactive {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* All-clear empty state */
.grooming-all-clear {
    text-align: center;
    padding: 2.5rem 1rem;
}

.grooming-all-clear-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.grooming-all-clear h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.375rem;
}

.grooming-all-clear p {
    font-size: 0.875rem;
    color: var(--muted-text);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Tense drilldown: highlighted "will" */
.tense-summary {
    font-size: 0.8rem;
    color: var(--muted-text);
    line-height: 1.4;
}

.tense-summary mark {
    background: var(--warning-tint);
    color: #92400e;
    padding: 0.05rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* ============================================
   Sprint Stats Widget
   ============================================ */

.sprint-stats-container {
    margin-bottom: 1.5rem;
}

.sprint-stats-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.sprint-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.sprint-stats-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sprint-stats-header h3::before {
    content: '📈';
    font-size: 1rem;
}

.sprint-stats-status-pill {
    cursor: default;
}

.sprint-stats-table-wrap {
    overflow-x: auto;
}

.sprint-stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.sprint-stats-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.sprint-stats-table th:first-child {
    text-align: left;
}

.sprint-stats-table td {
    padding: 0.75rem;
    text-align: center;
    color: #334155;
    border-bottom: 1px solid var(--hover-bg);
    font-size: 0.875rem;
}

.sprint-stats-table td.sprint-stats-label {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

.sprint-stats-total-row td {
    font-weight: 700;
    background: var(--subtle-bg);
    color: var(--text-color);
}

.sprint-stats-forecast-toggle-wrap {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hover-bg);
}

.sprint-stats-forecast-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.2rem 0;
}

.sprint-stats-forecast-label {
    font-size: 0.82rem;
    font-weight: 600;
}

.sprint-stats-forecast-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--muted-text);
    font-weight: 600;
}

.sprint-stats-forecast-icon {
    font-size: 0.72rem;
    color: var(--muted-text);
}

.sprint-stats-forecast-panel {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--subtle-bg);
    padding: 0.75rem;
}

.sprint-stats-forecast-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sprint-stats-forecast-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.sprint-stats-forecast-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.sprint-stats-forecast-filter label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted-text);
}

.sprint-stats-forecast-filter-select {
    min-width: 170px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.45rem;
}

.sprint-stats-forecast-clear {
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--text-color);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.sprint-stats-forecast-clear:hover {
    background: var(--hover-bg);
}

.sprint-stats-forecast-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sprint-stats-forecast-table-wrap {
    overflow-x: auto;
}

.sprint-stats-forecast-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1160px;
}

.sprint-stats-forecast-table th {
    padding: 0.6rem 0.65rem;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sprint-stats-forecast-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--hover-bg);
    color: var(--text-color);
    font-size: 0.78rem;
    vertical-align: middle;
    white-space: nowrap;
}

.sprint-stats-forecast-table th:nth-child(1),
.sprint-stats-forecast-table td:nth-child(1) {
    width: 84px;
}

.sprint-stats-forecast-table th:nth-child(3),
.sprint-stats-forecast-table td:nth-child(3) {
    width: 52px;
}

.sprint-stats-forecast-table th:nth-child(4),
.sprint-stats-forecast-table td:nth-child(4) {
    width: 130px;
}

.sprint-stats-forecast-table th:nth-child(5),
.sprint-stats-forecast-table td:nth-child(5) {
    width: 130px;
}

.sprint-stats-forecast-table th:nth-child(6),
.sprint-stats-forecast-table td:nth-child(6) {
    width: 130px;
}

.sprint-stats-forecast-table th:nth-child(7),
.sprint-stats-forecast-table td:nth-child(7) {
    width: 170px;
}

.sprint-stats-forecast-table th:nth-child(8),
.sprint-stats-forecast-table td:nth-child(8) {
    width: 165px;
}

.sprint-stats-forecast-table th:nth-child(9),
.sprint-stats-forecast-table td:nth-child(9) {
    width: 120px;
}

.sprint-stats-forecast-issue {
    font-weight: 700;
    color: #334155;
}

.sprint-stats-forecast-title {
    min-width: 420px;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sprint-stats-forecast-planning {
    font-weight: 600;
    color: #334155;
}

.planning-chip {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.planning-chip-planned {
    background: var(--success-tint);
    color: #166534;
}

.planning-chip-unplanned {
    background: var(--danger-tint);
    color: #991b1b;
}

.planning-chip-future {
    background: var(--warning-tint);
    color: #92400e;
}

.planning-chip-specialist {
    background: var(--border);
    color: var(--muted-text);
}

.sprint-stats-forecast-workstream {
    font-weight: 600;
    color: #334155;
}

.workstream-chip {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.workstream-chip-project {
    background: var(--success-tint);
    color: #166534;
}

.workstream-chip-change {
    background: #fce7f3;
    color: #9d174d;
}

.workstream-chip-tech {
    background: var(--nav-active-bg);
    color: #1e40af;
}

.workstream-chip-rnd {
    background: #fef3c7;
    color: #92400e;
}

.sprint-stats-forecast-assignees {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sprint-stats-forecast-select {
    width: 100%;
    min-width: 150px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.75rem;
    padding: 0.3rem 0.45rem;
}

.sprint-stats-forecast-empty {
    text-align: center;
    color: var(--muted-text);
    font-style: italic;
}

.sprint-stats-forecast-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.sprint-stats-eod-status-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sprint-stats-row-clear-btn {
    border: 0;
    background: #fee2e2;
    color: #b91c1c;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    font-weight: 700;
    line-height: 1;
}

.sprint-stats-clearable-row:hover .sprint-stats-row-clear-btn {
    opacity: 1;
}

.sprint-stats-row-clear-btn:hover {
    background: #fecaca;
    color: #991b1b;
}

.sprint-stats-eod-none {
    color: var(--muted-text);
    font-style: italic;
}

.sprint-stats-forecast-bank-btn,
.sprint-stats-forecast-bank-clear {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
}

.sprint-stats-forecast-bank-btn:hover,
.sprint-stats-forecast-bank-clear:hover {
    background: var(--hover-bg);
}

/* Actions dropdown */
.forecast-action-menu {
    position: relative;
    display: inline-block;
}

.forecast-action-trigger {
    min-width: 76px;
}

.forecast-action-dropdown {
    position: fixed;
    z-index: 9999;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 170px;
    padding: 0.3rem 0;
    white-space: nowrap;
}

.forecast-action-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.85rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0;
}

.forecast-action-dropdown button:hover {
    background: var(--hover-bg);
}

.forecast-action-dropdown button.forecast-action-danger {
    color: #b91c1c;
}

.forecast-action-dropdown button.forecast-action-danger:hover {
    background: #fee2e2;
}

.sprint-stats-banked-wrap {
    margin-top: 0.8rem;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}

.sprint-stats-banked-title {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
}

.sprint-stats-banked-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.sprint-stats-banked-header .sprint-stats-banked-title {
    margin: 0;
}

.sprint-stats-banked-copy-btn {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--text-color);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.sprint-stats-banked-copy-btn:hover {
    background: var(--hover-bg);
}

.sprint-stats-banked-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sprint-stats-banked-copy-btn.copied {
    border-color: #86efac;
    color: #166534;
    background: var(--success-tint);
}

.sprint-stats-banked-table-wrap {
    overflow-x: auto;
}

.sprint-stats-banked-empty {
    text-align: center;
    color: var(--muted-text);
    font-style: italic;
}

.sprint-stats-carryover-label {
    font-size: 0.75em;
    color: var(--muted-text);
    font-style: italic;
}

.sprint-stats-bank-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sprint-stats-bank-modal.hidden {
    display: none;
}

.sprint-stats-bank-modal-card {
    width: min(520px, 95vw);
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.sprint-stats-bank-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.sprint-stats-bank-modal-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.sprint-stats-bank-close {
    border: 0;
    background: transparent;
    color: var(--muted-text);
    font-size: 0.95rem;
    cursor: pointer;
}

.sprint-stats-bank-modal-body {
    padding: 0.85rem 0.9rem;
}

.sprint-stats-bank-meta {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.sprint-stats-bank-input-label {
    display: block;
    margin-top: 0.55rem;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-color);
}

.sprint-stats-bank-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-color);
    background: var(--surface-bg);
}

.sprint-stats-bank-error {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: #991b1b;
}

.sprint-stats-bank-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--border);
}

.sprint-stats-bank-btn {
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
}

.sprint-stats-bank-btn.secondary {
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--text-color);
}

.sprint-stats-bank-btn.primary {
    border: 1px solid var(--btn-bg);
    background: var(--btn-bg);
    color: #fff;
}

/* ============================================
   Workstream Breakdown Widget
   ============================================ */

.workstream-container {
    margin-bottom: 1.5rem;
}

.workstream-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.workstream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.workstream-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workstream-header h3::before {
    content: '📊';
    font-size: 1rem;
}

.workstream-table-wrap {
    overflow-x: auto;
}

.workstream-canonical-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.workstream-canonical-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.workstream-canonical-table th:first-child {
    text-align: left;
}

.workstream-canonical-table td {
    padding: 0.75rem;
    text-align: center;
    color: #334155;
    border-bottom: 1px solid var(--hover-bg);
    font-size: 0.875rem;
}

.workstream-canonical-table td.workstream-label {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

.workstream-clickable-row {
    cursor: pointer;
}

.workstream-clickable-row:hover td {
    background: var(--subtle-bg);
}

.workstream-total-row td {
    font-weight: 700;
    background: var(--subtle-bg);
    color: var(--text-color);
}

.workstream-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.workstream-pill.good {
    background: var(--success-tint);
    color: #166534;
}

.workstream-pill.medium {
    background: var(--warning-tint);
    color: #92400e;
}

.workstream-pill.low {
    background: var(--danger-tint);
    color: #991b1b;
}

/* ============================================
   Scope Drift Widget
   ============================================ */

.drift-container {
    margin-bottom: 1.5rem;
}

.drift-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.drift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.drift-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drift-header h3::before {
    content: '📈';
    font-size: 1rem;
}

.drift-baseline {
    font-size: 0.8125rem;
    color: var(--muted-text);
    background: var(--hover-bg);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

.drift-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.drift-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.drift-card.drift-added {
    border-left: 3px solid var(--success);
}

.drift-card.drift-removed {
    border-left: 3px solid #ef4444;
}

.drift-card.drift-changed {
    border-left: 3px solid var(--warning);
}

.drift-card.drift-net {
    border-left: 3px solid var(--btn-bg);
}

.drift-card.drift-net.positive {
    background: var(--warning-tint);
    border-left-color: var(--warning);
}

.drift-card.drift-net.negative {
    background: var(--success-tint);
    border-left-color: var(--success);
}

.drift-card.drift-net.neutral {
    background: #f0fdf4;
    border-left-color: var(--success);
}

.drift-label {
    font-size: 0.75rem;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.drift-points {
    font-size: 0.8125rem;
    color: var(--muted-text);
    margin-top: 0.125rem;
}

.drift-details {
    border-top: 1px solid var(--hover-bg);
    padding-top: 0.75rem;
}

.drift-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted-text);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
}

.drift-expand-btn:hover {
    background: var(--subtle-bg);
    color: var(--muted-text);
}

.drift-details-panel {
    margin-top: 1rem;
}

.drift-section {
    margin-bottom: 1rem;
}

.drift-section:last-child {
    margin-bottom: 0;
}

.drift-section h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--hover-bg);
}

.drift-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.drift-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    background: var(--subtle-bg);
    border-radius: 6px;
    font-size: 0.8125rem;
}

.drift-item-number {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.drift-dev-summary {
    padding: 0.625rem 0.625rem 0.5rem;
    border-bottom: 1px solid var(--hover-bg);
    margin-bottom: 0.5rem;
}

.drift-dev-summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.drift-dev-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: space-evenly;
}

.drift-dev-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem 0.2rem 0.2rem;
    border-radius: 999px;
    background: var(--subtle-bg);
    font-size: 0.75rem;
    white-space: nowrap;
}

.drift-dev-pill-heavy {
    background: var(--warning-tint);
    outline: 1.5px solid #d97706;
}

.drift-dev-pill-unassigned {
    background: var(--danger-tint);
}

.drift-dev-pill-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.drift-dev-pill-name {
    font-weight: 600;
    color: var(--text-color);
}

.drift-dev-pill-pts {
    color: var(--muted-text);
    font-weight: 500;
}

.drift-item-avatars {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
}

.drift-item-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.drift-item-title {
    flex: 1;
    color: var(--text-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drift-item-title:hover {
    color: var(--btn-bg);
    text-decoration: underline;
}

.drift-item-points {
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    white-space: nowrap;
}

.drift-item-points.added {
    background: var(--success-tint);
    color: #166534;
}

.drift-item-points.removed {
    background: var(--danger-tint);
    color: #991b1b;
}

.drift-item-points.changed {
    background: var(--warning-tint);
    color: #92400e;
}

.drift-empty {
    font-size: 0.8125rem;
    color: var(--status-todo);
    font-style: italic;
    padding: 0.5rem;
}

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

/* ============================================
   Capacity Planning Tab
   ============================================ */

.capacity-panel {
    padding: 1rem 0;
}

.capacity-header {
    margin-bottom: 1.5rem;
}

.capacity-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.capacity-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.capacity-description {
    font-size: 0.875rem;
    color: var(--muted-text);
}

/* Capacity Summary */
.capacity-summary {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.capacity-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.capacity-summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.capacity-sprint-name {
    font-size: 0.8125rem;
    color: var(--muted-text);
    background: var(--hover-bg);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

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

.capacity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.capacity-card-highlight {
    background: linear-gradient(135deg, var(--nav-active-bg) 0%, var(--primary-tint) 100%);
    border-color: var(--btn-bg);
}

.capacity-card-label {
    font-size: 0.75rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.375rem;
}

.capacity-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.capacity-card-highlight .capacity-card-value {
    color: var(--nav-active-text);
}

/* Capacity Sections */
.capacity-section {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.capacity-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.capacity-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.adjustment-sprint {
    font-size: 0.75rem;
    color: var(--muted-text);
    background: var(--hover-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Velocity Modal */
.velocity-modal-field {
    margin-bottom: 0.5rem;
}

.velocity-modal-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color, #0f172a);
    margin-bottom: 0.5rem;
}

.velocity-modal-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.velocity-modal-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #e5ebf3);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-color, #0f172a);
    background: var(--surface-bg, #fff);
}

.velocity-modal-suffix {
    font-size: 0.8125rem;
    color: var(--muted-text, #475569);
}

.velocity-modal-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted-text, #475569);
    line-height: 1.4;
}

/* Tables */
.roster-table-wrap,
.adjustments-table-wrap,
.velocity-table-wrap {
    overflow-x: auto;
}

.roster-table,
.adjustments-table,
.velocity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.roster-table th,
.adjustments-table th,
.velocity-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--subtle-bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.roster-table td,
.adjustments-table td,
.velocity-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
    color: var(--text-color);
}

.velocity-table th.text-center,
.velocity-table td.text-center {
    text-align: center;
}

.roster-table tr:hover,
.adjustments-table tr:hover,
.velocity-table tr:hover {
    background: var(--subtle-bg);
}

.empty-row td {
    text-align: center;
    color: var(--status-todo);
    font-style: italic;
    padding: 2rem;
}

.dev-name {
    font-weight: 500;
}

.dev-github code {
    background: var(--hover-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.discipline-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.discipline-badge.fe {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
}

.discipline-badge.be {
    background: var(--success-tint);
    color: #166534;
}

.discipline-badge.other {
    background: var(--hover-bg);
    color: var(--muted-text);
}

.tracked-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tracked-badge.yes {
    background: var(--success-tint);
    color: #166534;
}

.tracked-badge.no {
    background: var(--danger-tint);
    color: #991b1b;
}

.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.action-icon:hover {
    opacity: 1;
}

.actions {
    white-space: nowrap;
}

/* Adjustment inputs */
.adj-input {
    width: 60px;
    padding: 0.375rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
}

.adj-input.adj-day {
    width: 38px;
    padding: 0.25rem 0.15rem;
    font-size: 0.8rem;
    -moz-appearance: textfield;
}
.adj-input.adj-day::-webkit-inner-spin-button,
.adj-input.adj-day::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.adj-input.adj-spec {
    width: 46px;
    padding: 0.25rem 0.15rem;
}

.adj-input:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.adj-day-hdr {
    font-size: 0.7rem;
    padding: 0.4rem 0.15rem !important;
    text-align: center;
    min-width: 52px;
    white-space: nowrap;
}

.adjustments-table th.adj-today-col,
.adjustments-table td.adj-today-col {
    background: var(--primary-tint);
}

.adjustments-table th.adj-today-col {
    color: var(--nav-active-text);
    font-weight: 700;
}

.adjustments-table td.adj-today-col {
    box-shadow: inset 1px 0 0 var(--nav-active-bg), inset -1px 0 0 var(--nav-active-bg);
}

.adjustments-table td.adj-today-col .adj-input.adj-day {
    border-color: var(--nav-active-text);
}

.adj-dev-name {
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: var(--surface-bg);
    z-index: 1;
}

.adjustments-table-wrap {
    overflow-x: auto;
}

.adjustments-table {
    min-width: 0 !important;
    table-layout: auto;
}

.adjustments-table td,
.adjustments-table th {
    padding: 0.5rem 0.35rem !important;
    text-align: center;
}

.adjustments-table th:first-child,
.adjustments-table td:first-child {
    text-align: left !important;
    min-width: 210px;
}

.adjustments-table td:first-child {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.available-days {
    font-weight: 600;
    color: #166534;
}

.available-days.low {
    color: var(--danger);
}

.capacity-pts {
    font-weight: 600;
    color: var(--nav-active-text);
    background: var(--primary-tint);
    text-align: center;
}

.adj-rate {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 3rem;
}

/* Working Pattern Modal */
.wp-days-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wp-week {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wp-week-label {
    background: var(--surface-bg);
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wp-week-days {
    display: flex;
    gap: 0.5rem;
}

.wp-day-btn {
    flex-shrink: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 0.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    background: var(--surface-bg);
    color: var(--text-color);
}

.wp-day-btn.wp-day-on {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.wp-day-btn.wp-day-off {
    background: var(--hover-bg);
    border-color: var(--border);
    color: var(--muted-text);
    opacity: 0.6;
}

.wp-day-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.wp-day-name {
    font-weight: 600;
    font-size: 0.75rem;
}

.wp-day-date {
    font-size: 0.7rem;
    opacity: 0.8;
}

.wp-match {
    color: #16a34a;
    font-weight: 600;
}

.wp-mismatch {
    color: #f59e0b;
    font-weight: 600;
}

/* Non-working day cell in adjustments table */
.adj-day-non-working {
    background: var(--hover-bg) !important;
    position: relative;
}

.adj-day-non-working .adj-non-working-dash {
    display: block;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 30px;
}

/* Pencil icon for working pattern */
.wp-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.1rem 0.25rem;
    margin-left: 0.35rem;
    flex-shrink: 0;
    color: var(--muted-text);
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    vertical-align: middle;
}

.wp-edit-btn:hover {
    color: #3b82f6;
    background: #dbeafe;
}

/* Per-dev velocity table */
.dev-login-hint {
    font-size: 0.7rem;
    color: var(--muted-text);
    margin-left: 0.25rem;
}
.text-center { text-align: center; }
.rate-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.rate-badge.rate-personal {
    background: #dbeafe;
    color: #1d4ed8;
}
.rate-badge.rate-team {
    background: #f1f5f9;
    color: #64748b;
}

/* Velocity chart */
.velocity-chart-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
}
.velocity-chart-wrap canvas {
    width: 100%;
    max-width: 100%;
}
.velocity-chart-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.velocity-chart-controls select {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
}
.velocity-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8rem;
}
.vel-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-color);
}
.vel-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Over/under indicators on adjustments table */
.over-under-indicator {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.25rem;
}
.over-under-indicator.over {
    color: #ef4444;
}
.over-under-indicator.under {
    color: #3b82f6;
}
.over-under-indicator.on-track {
    color: #10b981;
}

/* Trend arrows */
.trend-arrow {
    font-weight: 700;
    font-size: 1rem;
}
.trend-arrow.trend-up {
    color: #10b981;
}
.trend-arrow.trend-down {
    color: #ef4444;
}
.trend-arrow.trend-stable {
    color: #94a3b8;
}
.trend-arrow.trend-na {
    color: #cbd5e1;
    font-size: 0.8rem;
}

/* Planned/unplanned split */
.split-planned {
    color: #3b82f6;
    font-weight: 600;
}
.split-unplanned {
    color: #f59e0b;
    font-weight: 600;
}
.text-muted {
    color: var(--muted-text, #94a3b8);
}

/* Action buttons */
.adjustments-actions,
.velocity-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hover-bg);
}



.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}

/* Modal form groups */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--muted-text);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .capacity-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .capacity-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Specialist Work Widget */
.specialist-work-container {
    margin-bottom: 1.5rem;
}

.specialist-work-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.specialist-work-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
}

.specialist-work-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specialist-work-header h3::before {
    content: '🧩';
    font-size: 0.9375rem;
}

.specialist-work-table-wrap {
    overflow-x: auto;
}

.specialist-work-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.specialist-work-table th {
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.specialist-work-table th:first-child {
    text-align: left;
}

.specialist-work-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #334155;
    text-align: center;
    border-bottom: 1px solid var(--hover-bg);
}

.specialist-work-table td.specialist-dev-name {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

.specialist-dev-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.specialist-expand-btn {
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--muted-text);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

.specialist-expand-btn:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.specialist-expand-spacer {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
}

.specialist-dev-label {
    font-weight: 600;
}

.specialist-clickable-row {
    cursor: pointer;
}

.specialist-clickable-row:hover td {
    background: var(--subtle-bg);
}

.specialist-over {
    color: var(--danger);
    font-weight: 700;
}

.specialist-delta {
    font-size: 0.75rem;
    font-weight: 600;
}

.specialist-delta.over {
    color: var(--danger);
}

.specialist-delta.under {
    color: #166534;
}

.specialist-delta.even {
    color: var(--muted-text);
}

.specialist-summary-row td:nth-child(2),
.specialist-summary-row td:nth-child(3),
.specialist-summary-row td:nth-child(4) {
    font-weight: 500;
}

.specialist-summary-row.specialist-summary-expanded td:nth-child(2),
.specialist-summary-row.specialist-summary-expanded td:nth-child(3),
.specialist-summary-row.specialist-summary-expanded td:nth-child(4) {
    font-weight: 700;
}

.specialist-total-row td {
    font-weight: 700;
    background: var(--subtle-bg);
    color: var(--text-color);
}

.specialist-detail-row td {
    padding: 0;
    border-bottom: 1px solid var(--hover-bg);
}

.specialist-detail-panel {
    background: var(--subtle-bg);
    padding: 0.5rem 0.75rem 0.65rem;
}

.specialist-detail-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.specialist-detail-table col.specialist-col-ticket { width: 8%; }
.specialist-detail-table col.specialist-col-type { width: 14%; }
.specialist-detail-table col.specialist-col-title { width: 30%; }
.specialist-detail-table col.specialist-col-points { width: 7%; }
.specialist-detail-table col.specialist-col-status { width: 18%; }
.specialist-detail-table col.specialist-col-product { width: 13%; }
.specialist-detail-table col.specialist-col-suite { width: 6%; }
.specialist-detail-table col.specialist-col-age { width: 4%; }

.specialist-detail-table th,
.specialist-detail-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0.45rem;
    font-size: 0.75rem;
    color: #334155;
    text-align: left;
}

.specialist-detail-table th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text);
    background: transparent;
}

.specialist-detail-table th:nth-child(4),
.specialist-detail-table td.specialist-col-points,
.specialist-detail-table th:nth-child(8),
.specialist-detail-table td.specialist-col-age {
    text-align: center;
    white-space: nowrap;
}

.specialist-detail-table td.specialist-col-status,
.specialist-detail-table td.specialist-col-type {
    white-space: nowrap;
}

.specialist-detail-table td.specialist-col-status {
    overflow: hidden;
    text-overflow: ellipsis;
}

.specialist-detail-table td.specialist-col-product,
.specialist-detail-table td.specialist-col-suite {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.specialist-issue-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.specialist-issue-title-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.specialist-issue-title-link:hover {
    color: var(--btn-bg);
    text-decoration: underline;
}

.specialist-detail-table .status-badge,
.specialist-detail-table .type-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.specialist-detail-empty {
    font-size: 0.78rem;
    color: var(--muted-text);
    padding: 0.35rem 0.2rem;
}

/* Capacity Mini-Widget (Dashboard) */
.capacity-mini-container {
    margin-bottom: 1.5rem;
}

.capacity-mini-widget {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

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

.capacity-mini-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.capacity-mini-header h3::before {
    content: '👥';
    font-size: 0.9375rem;
}

.capacity-mini-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.capacity-alert-badge {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.capacity-alert-badge.over {
    background: var(--danger-tint);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.capacity-alert-badge.good {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.capacity-mini-stat {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.capacity-mini-stat.highlight .capacity-mini-value {
    color: var(--nav-active-text);
}

.capacity-mini-label {
    font-size: 0.75rem;
    color: var(--muted-text);
}

.capacity-mini-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

.capacity-mini-unit {
    font-size: 0.75rem;
    color: var(--status-todo);
}

/* Developer Workload Section */
.dev-workload-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.dev-workload-header.compact {
    margin-bottom: 0.5rem;
}

.dev-workload-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted-text);
}

.over-capacity-badge {
    font-size: 0.6875rem;
    background: var(--danger-tint);
    color: var(--danger);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

.team-capacity-summary {
    background: var(--subtle-bg);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.team-capacity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.team-capacity-row.sub {
    font-size: 0.75rem;
    padding-left: 0.5rem;
    color: var(--muted-text);
}

.team-capacity-row.over .team-label {
    color: var(--danger);
}

.team-label {
    font-weight: 600;
    font-size: 0.8125rem;
    min-width: 40px;
}

.team-stats {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--muted-text);
}

.team-delta {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.team-delta.over {
    color: var(--danger);
}

.team-delta.under {
    color: var(--success);
}

.team-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.team-status-dot.over {
    background: var(--danger);
}

.team-status-dot.under {
    background: var(--success);
}

/* Developer Workload List */
.dev-workload-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* Developer Card - New Design */
.dev-workload-card {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.dev-workload-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dev-workload-card.under-capacity {
    background: var(--surface-bg);
}

.dev-workload-card.over-capacity {
    background: var(--danger-tint);
    border-color: #fecaca;
}

/* Left status indicator bar */
.dev-card-status-indicator {
    width: 5px;
    flex-shrink: 0;
}

.dev-card-status-indicator.over {
    background: var(--danger);
}

.dev-card-status-indicator.under {
    background: var(--success);
}

/* Card content */
.dev-card-content {
    flex: 1;
    padding: 0.75rem 1rem;
    min-width: 0;
}

/* Card header row */
.dev-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.375rem;
    gap: 1rem;
}

.dev-card-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dev-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dev-status-dot.over {
    background: var(--danger);
}

.dev-status-dot.under {
    background: var(--success);
}

.dev-workload-card .dev-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
}

.dev-workload-card .dev-discipline {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.dev-workload-card .dev-discipline.fe {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
}

.dev-workload-card .dev-discipline.be {
    background: #f3e8ff;
    color: #7c3aed;
}

.dev-workload-card .dev-discipline.other {
    background: var(--border);
    color: var(--muted-text);
}

/* Card status badge */
.dev-card-status {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.dev-card-status.over {
    color: var(--danger);
    background: var(--danger-tint);
}

.dev-card-status.under {
    color: var(--success);
    background: var(--success-tint);
}

/* Card stats */
.dev-card-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.dev-card-stats strong {
    color: var(--text-color);
    font-weight: 600;
}

.dev-stat-sep {
    color: #cbd5e1;
}

.dev-completed-inline {
    color: var(--success);
}

/* Progress bar - fixed width, no overflow */
.dev-card-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--border);
    position: relative;
}

.dev-bar-capacity {
    height: 100%;
    background: #f87171;
    position: relative;
    transition: width 0.3s ease;
}

.dev-bar-assigned {
    height: 100%;
    background: #60a5fa;
    position: relative;
    transition: width 0.3s ease;
}

.dev-bar-completed {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--success);
}

.dev-bar-overflow {
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        #fca5a5,
        #fca5a5 4px,
        #f87171 4px,
        #f87171 8px
    );
}

.dev-bar-remaining {
    height: 100%;
    background: var(--border);
}

.dev-bar-capacity-line {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 3px;
    background: var(--text-color);
    border-radius: 1px;
    z-index: 2;
}

/* Card hint */
.dev-card-hint {
    font-size: 0.6875rem;
    color: var(--status-todo);
    margin-top: 0.375rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dev-workload-card:hover .dev-card-hint {
    opacity: 1;
}

/* Header badges */
.over-capacity-badge-prominent {
    font-size: 0.75rem;
    background: var(--danger-tint);
    color: var(--danger);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    border: 1px solid #fecaca;
}

.all-good-badge {
    font-size: 0.75rem;
    background: var(--success-tint);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    border: 1px solid #bbf7d0;
}

.dev-workload-table-wrap {
    overflow-x: auto;
}

.dev-workload-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.dev-workload-table th {
    padding: 0.45rem 0.6rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.dev-workload-table th:first-child {
    text-align: left;
}

.dev-workload-table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.8125rem;
    color: #334155;
    text-align: center;
    border-bottom: 1px solid var(--hover-bg);
}

.dev-workload-table td.dev-name-cell {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

.dev-workload-row {
    cursor: pointer;
}

.dev-workload-row:hover td {
    background: var(--subtle-bg);
}

.dev-workload-row .dev-discipline {
    margin-left: 0.5rem;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.dev-workload-row .dev-discipline.fe {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
}

.dev-workload-row .dev-discipline.be {
    background: #f3e8ff;
    color: #7c3aed;
}

.dev-workload-row .dev-discipline.other {
    background: var(--border);
    color: var(--muted-text);
}

.delta-over {
    color: var(--danger);
    font-weight: 700;
}

.delta-under {
    color: #166534;
    font-weight: 700;
}

.dev-track {
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.dev-track.over {
    color: var(--danger);
    background: var(--danger-tint);
    border-color: #fecaca;
}

.dev-track.under {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.dev-track.on-track {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.dev-workload-total-row td {
    font-weight: 700;
    background: var(--subtle-bg);
    color: var(--text-color);
}

/* ============================================
   Velocity & Settings Styles
   ============================================ */

.settings-description {
    color: var(--status-todo);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.settings-field {
    margin-bottom: 0.75rem;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--border);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.settings-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    background: var(--text-color);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: var(--border);
    font-size: 0.9rem;
    text-align: center;
}

.settings-input:focus {
    outline: none;
    border-color: var(--btn-bg);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.settings-input-suffix {
    color: var(--status-todo);
    font-size: 0.85rem;
}

.settings-hint {
    display: block;
    color: var(--muted-text);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #334155;
    color: var(--status-todo);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
}

.velocity-average-row {
    border-top: 2px solid #334155;
    background: rgba(59, 130, 246, 0.05);
}

.velocity-average-row td {
    color: var(--btn-bg);
    font-weight: 600;
    padding-top: 0.75rem;
}

.modal-description {
    color: var(--status-todo);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ============================================
   Release Notes Tab
   ============================================ */

.release-notes-panel {
    padding: 1rem 0;
}

.release-notes-header-section {
    margin-bottom: 1.5rem;
}

.rn-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.release-notes-header-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.release-notes-description {
    font-size: 0.875rem;
    color: var(--muted-text);
}

/* Sprint Summary Card */
.release-notes-sprint-summary {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rn-summary-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

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

.rn-sprint-name {
    font-size: 0.875rem;
    color: var(--muted-text);
}

.rn-sprint-dates {
    font-size: 0.8rem;
    color: var(--status-todo);
    margin-top: 0.15rem;
}

.rn-summary-right {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.rn-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.rn-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.rn-stat-label {
    font-size: 0.75rem;
    color: var(--status-todo);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Controls bar */
.rn-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.rn-controls-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rn-controls-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Table container */
.rn-table-container {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.rn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 1500px;
    table-layout: fixed;
}

.rn-table thead th {
    background: var(--subtle-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--muted-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rn-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
    color: #334155;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Release Summary and Title columns should always wrap to show full text */
.rn-table td[data-col="field_release_summary"],
.rn-table td[data-col="title"] {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.rn-table tbody tr:hover {
    background: var(--subtle-bg);
}

.rn-table tbody tr.rn-excluded {
    opacity: 0.45;
}

.rn-table tbody tr.rn-excluded td {
    text-decoration: line-through;
    text-decoration-color: #cbd5e1;
}

.rn-checkbox-col {
    width: 40px;
    text-align: center !important;
}

.rn-checkbox-col input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--btn-bg);
}

.rn-table td:nth-child(1) {
    text-align: center;
}

.rn-table td:nth-child(1) input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--btn-bg);
}

.rn-issue-number {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #6366f1;
    font-weight: 500;
}

.rn-issue-title a {
    color: var(--text-color);
    text-decoration: none;
}

.rn-issue-title a:hover {
    color: var(--btn-bg);
    text-decoration: underline;
}

.rn-missing-field {
    color: var(--warning);
    font-style: italic;
    font-size: 0.8rem;
}

.rn-empty-field {
    color: #cbd5e1;
}

/* ============================================
   Publish Modal
   ============================================ */
.publish-modal {
    max-width: 600px;
    width: 90%;
}

.publish-sprint-detail {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #0c4a6e;
}

.publish-type-selector {
    margin-bottom: 1rem;
}

.publish-type-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: #334155;
}

.publish-type-options {
    display: flex;
    gap: 1rem;
}

.publish-type-option {
    flex: 1;
    cursor: pointer;
}

.publish-type-option input[type="radio"] {
    display: none;
}

.publish-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.publish-type-option input:checked + .publish-type-card {
    border-color: var(--btn-bg);
    background: var(--primary-tint);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.publish-type-icon {
    font-size: 1.5rem;
}

.publish-type-name {
    font-weight: 600;
    color: var(--text-color);
}

.publish-type-desc {
    font-size: 0.75rem;
    color: var(--muted-text);
    line-height: 1.3;
}

.publish-summary-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--muted-text);
}

.publish-existing-notice {
    background: var(--warning-tint);
    border: 1px solid var(--warning);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.publish-warning-box {
    background: var(--danger-tint);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.publish-warning-header {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.publish-warning-list {
    max-height: 200px;
    overflow-y: auto;
}

.publish-warning-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--danger-tint);
    font-size: 0.8rem;
    align-items: baseline;
}

.publish-warning-issue {
    font-family: 'SF Mono', monospace;
    color: var(--danger);
    font-weight: 500;
    flex-shrink: 0;
}

.publish-warning-title {
    color: var(--text-color);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-warning-fields {
    color: #ef4444;
    font-style: italic;
    flex-shrink: 0;
}

.publish-warning-more {
    color: var(--muted-text);
    font-style: italic;
    padding-top: 0.25rem;
    font-size: 0.8rem;
}

.publish-warning-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted-text);
}

.publish-all-good {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    color: #166534;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ============================================
   Sprint Image Upload (Publish Modal)
   ============================================ */
.publish-image-section {
    margin-top: 1rem;
}

.publish-image-upload {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    min-height: 120px;
}

.publish-image-upload:hover {
    border-color: #6366f1;
}

.publish-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: pointer;
    color: var(--status-todo);
    font-size: 0.85rem;
    gap: 0.4rem;
    min-height: 100px;
    position: relative;
}

.publish-image-placeholder span:first-child {
    font-size: 1.5rem;
}

.publish-image-placeholder input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.publish-image-preview {
    position: relative;
    text-align: center;
    background: var(--subtle-bg);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.publish-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.publish-image-placeholder {
    color: var(--status-todo);
    font-size: 0.85rem;
    padding: 1.5rem;
}

.publish-image-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(0, 0, 0, 0.6);
    color: var(--btn-text);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.publish-image-remove:hover {
    background: rgba(220, 38, 38, 0.85);
}

/* ============================================
   Published Release Notes Tab
   ============================================ */
.published-rn-panel {
    padding: 1.5rem;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.rn-archive-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.rn-archive-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.rn-share-wrapper {
    position: relative;
}

.rn-share-popover {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
    z-index: 100;
    min-width: 320px;
}

.rn-share-popover.active {
    display: block;
}

.rn-share-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.rn-share-input-row {
    display: flex;
    gap: 0.4rem;
}

.rn-share-url {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #334155;
    background: var(--subtle-bg);
    outline: none;
    min-width: 0;
}

.rn-share-url:focus {
    border-color: #6366f1;
}

.rn-share-copied {
    display: none;
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 0.3rem;
}

.rn-share-copied.visible {
    display: block;
}

.published-rn-table-container {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.published-rn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.published-rn-table thead th {
    background: var(--subtle-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--muted-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.published-rn-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--hover-bg);
    color: #334155;
    vertical-align: middle;
}

.published-rn-table tbody tr:hover {
    background: #f0f9ff;
}

.published-row {
    transition: background 0.15s;
}

.published-action-btn {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.8rem !important;
    margin-right: 0.25rem;
}

/* Type badges */
.rn-type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rn-type-final {
    background: var(--success-tint);
    color: #166534;
    border: 1px solid #86efac;
}

.rn-type-prerelease {
    background: var(--warning-tint);
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* No published state */
.no-published-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--status-todo);
}

.no-published-state .text-muted {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ============================================
   Published Detail View
   ============================================ */
.published-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.published-detail-actions {
    display: flex;
    gap: 0.5rem;
}

.published-detail-summary {
    max-width: 860px;
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
}

/* Hero layout: image left, info right */
.rn-detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.rn-detail-hero:not(.has-image) {
    display: block;
}

.rn-detail-hero-image {
    flex-shrink: 0;
    width: 200px;
}

.rn-detail-hero-image img {
    width: 100%;
    border-radius: 8px;
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rn-detail-hero-info {
    flex: 1;
    min-width: 0;
}

.rn-detail-hero-info h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.4rem;
}

.rn-detail-sprint-number {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--status-todo);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.rn-detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.rn-detail-dates {
    font-size: 0.85rem;
    color: var(--muted-text);
    margin-bottom: 0.15rem;
}

.rn-detail-published {
    font-size: 0.8rem;
    color: var(--status-todo);
}

@media (max-width: 640px) {
    .rn-detail-hero {
        flex-direction: column;
    }
    .rn-detail-hero-image {
        width: 100%;
        max-width: 280px;
    }
}

.published-detail-meta h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.published-detail-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--muted-text);
}

/* Release Notes Stats Table — pink header, CSS Grid */
.rn-stats-table-wrapper {
    margin-top: 1.25rem;
    border: 1px solid #ad1457;
    border-radius: 4px;
    overflow: hidden;
}

.rn-stats-header,
.rn-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}

.rn-stats-header .rn-stats-cell {
    background: #c2185b;
    color: var(--btn-text);
    font-weight: 600;
    padding: 0.6rem 0.5rem;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    border-right: 1px solid #ad1457;
}

.rn-stats-header .rn-stats-cell:first-child {
    text-align: left;
}

.rn-stats-header .rn-stats-cell:last-child {
    border-right: none;
}

.rn-stats-row .rn-stats-cell {
    padding: 0.6rem 0.5rem;
    text-align: center;
    color: var(--text-color);
    background: var(--surface-bg);
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.rn-stats-row .rn-stats-cell:last-child {
    border-right: none;
}

.rn-stats-row .rn-stats-label {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    background: var(--subtle-bg);
}

.rn-stats-row--sub .rn-stats-cell {
    font-size: 0.8rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
}
.rn-stats-row--sub .rn-stats-label {
    font-weight: 500;
    padding-left: 1.25rem;
}

/* Publish modal — final stats inputs */
.publish-final-stats {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.publish-stats-hint {
    font-size: 0.8rem;
    color: var(--muted-text);
    margin: 0.25rem 0 0.75rem;
}

.publish-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.publish-stat-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
}

.publish-stat-field input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
    background: var(--surface-bg);
    box-sizing: border-box;
}

.publish-stat-field input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* Published detail document container — nice shoulders */
.published-detail-items {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Category groups — clean document style */
.published-category-group {
    margin-bottom: 2.5rem;
}

.published-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 0;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 0;
    user-select: none;
}

.published-category-header:hover {
    opacity: 0.75;
}

.published-category-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.published-category-chevron {
    color: var(--status-todo);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.published-category-chevron.rotated {
    transform: rotate(180deg);
}

.published-items-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.published-items-list.collapsed {
    display: none;
}

/* Individual items — plain document rows */
.published-item {
    padding: 1.25rem 0.5rem;
    border-bottom: 1px solid var(--hover-bg);
}

.published-item:last-child {
    border-bottom: none;
}

/* Product — pink */
.published-item-product {
    font-size: 0.8rem;
    font-weight: 600;
    color: #db2777;
    margin-bottom: 0.15rem;
}

/* Title — bold black */
.published-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.45;
}

.published-item-title a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.published-item-title a:hover {
    text-decoration: underline;
}

/* Sprint planning type — color-coded */
.published-item-planning {
    font-weight: 700;
}

.published-item-planning.planning-planned {
    color: var(--success);
}

.published-item-planning.planning-unplanned {
    color: var(--danger);
}

.published-item-planning.planning-future {
    color: #d97706;
}

/* Summary — regular weight */
.published-item-summary {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.65;
    margin-top: 0.3rem;
}

/* Footer — workstream & requested by in blue */
.published-item-footer {
    font-size: 0.8rem;
    color: #2563eb;
    margin-top: 0.25rem;
}

.published-footer-workstream,
.published-footer-requested {
    color: #2563eb;
}

/* ============================================
   Toast Notifications
   ============================================ */
.rn-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.rn-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.rn-toast-success {
    background: #166534;
    color: var(--btn-text);
}

.rn-toast-info {
    background: #1e40af;
    color: var(--btn-text);
}

.rn-toast-error {
    background: #991b1b;
    color: var(--btn-text);
}

/* ── Inline Edit Mode ── */
.rn-edit-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--page-bg);
    transition: opacity 0.2s, background 0.2s;
}

.rn-edit-item.rn-edit-removed {
    opacity: 0.35;
    background: var(--danger-tint);
    border-color: #fecaca;
}

.rn-edit-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rn-edit-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rn-edit-title {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    width: 100%;
    box-sizing: border-box;
}

.rn-edit-title:focus,
.rn-edit-summary:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.rn-edit-summary {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    width: 100%;
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    min-height: 32px;
    font-family: inherit;
    line-height: 1.4;
}

.rn-edit-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-bg);
    color: var(--muted-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.rn-edit-remove:hover {
    background: var(--danger-tint);
    border-color: #fecaca;
    color: var(--danger);
}

.rn-edit-removed .rn-edit-remove {
    background: var(--nav-active-bg);
    border-color: #93c5fd;
    color: #2563eb;
}

.rn-edit-removed .rn-edit-remove:hover {
    background: #bfdbfe;
}

.rn-edit-stat {
    width: 100%;
    max-width: 100px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg);
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.rn-edit-stat::-webkit-outer-spin-button,
.rn-edit-stat::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rn-edit-stat:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ============================================
   Sprint Confidence Tile
   ============================================ */

.confidence-tile {
    position: relative;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.confidence-tile:hover,
.confidence-tile:focus-visible {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    outline: none;
}

.confidence-tile:focus-visible {
    box-shadow: 0 0 0 2px var(--primary);
}

.confidence-green .hero-stat-value { color: var(--success); }
.confidence-amber .hero-stat-value { color: var(--warning); }
.confidence-red .hero-stat-value { color: var(--danger); }

.confidence-green { border-color: var(--success); background: var(--success-tint); }
.confidence-amber { border-color: var(--warning); background: var(--warning-tint); }
.confidence-red   { border-color: var(--danger); background: var(--danger-tint); }

/* ---- Confidence Tooltip ---- */
.confidence-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: #fff;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    width: max-content;
    max-width: 300px;
    z-index: 200;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.confidence-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-color);
}

.confidence-tile:hover .confidence-tooltip,
.confidence-tile:focus .confidence-tooltip,
.confidence-tile:focus-within .confidence-tooltip {
    display: block;
}

.confidence-tooltip-line1 {
    font-weight: 600;
    margin-bottom: 2px;
}

.confidence-tooltip-line2 {
    opacity: 0.85;
}

/* ---- Confidence Modal ---- */
.confidence-modal {
    max-width: 780px;
}

#tab-confidence .confidence-page-card {
    width: 100%;
    max-width: none;
}

.confidence-modal .modal-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
}

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

.confidence-modal .modal-body {
    padding: 1.5rem;
}

.confidence-modal-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    width: 100%;
    margin-top: 0.375rem;
}

.confidence-reason-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.reason-chip-red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.reason-chip-amber {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.reason-chip-green {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.confidence-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.confidence-badge-green { background: var(--success-tint); color: #15803d; }
.confidence-badge-amber { background: var(--warning-tint); color: #92400e; }
.confidence-badge-red   { background: var(--danger-tint); color: #991b1b; }

/* Key number cards */
.confidence-numbers-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.confidence-number-card {
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.confidence-number-card h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.confidence-number-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.cnl { color: var(--muted-text); }
.cnv { font-weight: 600; text-align: right; }
.cnv-warn { color: var(--danger); }
.cnv-ok { color: var(--success); }

/* Section titles */
.confidence-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border);
}

.confidence-section-title:first-child {
    margin-top: 0;
}

/* Rule checks */
.confidence-rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.confidence-rule {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
}

.confidence-rule-icon {
    font-weight: 700;
    min-width: 1.1rem;
    text-align: center;
}

.rule-pass .confidence-rule-icon { color: var(--success); }
.rule-fail-red .confidence-rule-icon { color: var(--danger); }
.rule-fail-amber .confidence-rule-icon { color: var(--warning); }
.rule-fail-red { border-left: 3px solid var(--danger); }
.rule-fail-amber { border-left: 3px solid var(--warning); }
.rule-pass { border-left: 3px solid var(--success); }

.confidence-rule-label {
    font-weight: 600;
    min-width: 120px;
}

.confidence-rule-detail {
    color: var(--muted-text);
    flex: 1;
    text-align: right;
}

/* Action lists */
.confidence-action-section {
    margin-bottom: 1.5rem;
}

.confidence-action-section:last-child {
    margin-bottom: 0;
}

.confidence-action-section h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--text-color);
}

.confidence-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.confidence-action-item {
    padding: 0.5rem 0.625rem;
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.confidence-action-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confidence-action-title:hover {
    text-decoration: underline;
}

.confidence-action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--muted-text);
    align-items: center;
}

.confidence-action-status {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confidence-chip {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.chip-warn { background: var(--warning-tint); color: #92400e; }
.chip-danger { background: var(--danger-tint); color: #991b1b; }
.chip-info { background: var(--primary-tint); color: var(--primary); }
.chip-muted { background: var(--hover-bg); color: var(--muted-text); }
.chip-meta { background: var(--subtle-bg); color: var(--text-color); border: 1px solid var(--border); }

.confidence-action-viewall {
    font-size: 0.75rem;
    color: var(--muted-text);
    text-align: right;
    margin-top: 0.25rem;
}

.confidence-action-hidden {
    display: none;
}

.confidence-action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.confidence-show-more-btn {
    display: block;
    width: 100%;
    margin-top: 0.375rem;
    padding: 0.375rem 0;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.confidence-show-more-btn:hover {
    background: var(--primary-tint);
    border-color: var(--primary);
}

.confidence-no-actions {
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

/* Responsive */
@media (max-width: 640px) {
    #tab-confidence {
        padding: 0 1rem;
    }
    #tab-capacity-drilldown {
        padding: 0 1rem;
    }
    .confidence-numbers-row {
        grid-template-columns: 1fr;
    }
    .confidence-modal {
        max-width: 95vw;
    }
    .confidence-page-card {
        max-width: none;
    }
    .confidence-tooltip {
        max-width: 200px;
        font-size: 0.6875rem;
    }
}

/* ============================================
   Capacity Tile + Drill-down
   ============================================ */

/* ---- Hero stat sub-line ---- */
.hero-stat-sub {
    font-size: 0.625rem;
    color: var(--muted-text);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

/* ---- Capacity tile colour states ---- */
.capacity-tile {
    position: relative;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.capacity-tile:hover,
.capacity-tile:focus-visible {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    outline: none;
}
.capacity-tile:focus-visible {
    box-shadow: 0 0 0 2px var(--primary);
}

.capacity-green .hero-stat-value { color: var(--success); }
.capacity-amber .hero-stat-value { color: var(--warning); }
.capacity-red .hero-stat-value   { color: var(--danger); }

.capacity-green { border-color: var(--success); background: var(--success-tint); }
.capacity-amber { border-color: var(--warning); background: var(--warning-tint); }
.capacity-red   { border-color: var(--danger);  background: var(--danger-tint); }

/* ---- Drill-down modal ---- */
.cap-drilldown-modal {
    width: 1400px;
    max-width: 95vw;
}
.cap-drilldown-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.cap-drilldown-page-card .modal-body {
    overflow-x: hidden;
}

.cap-drilldown-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    background: var(--subtle-bg);
}

.cap-tab-btn {
    background: none;
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted-text);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.cap-tab-btn:hover {
    color: var(--text-color);
}
.cap-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.cap-gap-badge {
    display: inline-block;
    background: var(--danger-tint);
    color: #991b1b;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ---- Summary tiles ---- */
.cap-summary-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.cap-summary-tile {
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
}

.cap-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.cap-summary-label {
    font-size: 0.75rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}

/* ---- Section title ---- */
.cap-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text);
    margin: 1rem 0 0.5rem;
}

/* ---- Status distribution bar ---- */
.cap-status-bar-wrap {
    position: relative;
    margin-bottom: 2rem;
}
.cap-status-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.cap-bar-segment {
    transition: opacity 0.15s, filter 0.15s;
    min-width: 2px;
}
.cap-bar-segment:hover {
    filter: brightness(1.15);
}
.cap-bar-segment-active {
    outline: 2px solid var(--text-color);
    outline-offset: -2px;
    z-index: 1;
}

/* ---- Bar chart hover tooltip ---- */
.cap-bar-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 6px;
    background: var(--text-color, #1e293b);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
}

.cap-status-legend-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.8125rem;
}
.cap-status-legend-table th {
    background: var(--subtle-bg);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.cap-status-legend-table th:first-child { width: 20px; padding-right: 0; }
.cap-status-legend-table th:nth-child(3),
.cap-status-legend-table td:nth-child(3) { width: 70px; text-align: right; }
.cap-status-legend-table th:nth-child(4),
.cap-status-legend-table td:nth-child(4) { width: 70px; text-align: right; }
.cap-status-legend-table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.cap-status-legend-table tbody tr:last-child td { border-bottom: none; }
.cap-legend-row {
    cursor: pointer;
    transition: color 0.15s;
}
.cap-legend-row:hover td,
.cap-legend-row-active td {
    color: var(--text-color);
}
.cap-legend-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cap-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Banners ---- */
.cap-banner {
    padding: 0.625rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.cap-banner-warn {
    background: var(--warning-tint);
    border: 1px solid #f59e0b;
    color: #92400e;
}
.cap-banner-danger {
    background: var(--danger-tint);
    border: 1px solid var(--danger);
    color: #991b1b;
}
.cap-banner-info {
    background: var(--primary-tint, #e0e7ff);
    border: 1px solid var(--primary);
    color: var(--primary);
}
.cap-banner-cta {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0;
}

/* ---- Filters ---- */
.cap-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cap-filters select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    background: var(--subtle-bg);
    color: var(--text-color);
    cursor: pointer;
}
.cap-filters select:focus {
    border-color: var(--primary);
    outline: none;
}

.cap-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--muted-text);
    cursor: pointer;
    white-space: nowrap;
}
.cap-toggle-label input[type="checkbox"] {
    accent-color: var(--primary);
}

.cap-clear-filters {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ---- Issue tables ---- */
.cap-issue-list-wrap,
.cap-dev-table-wrap,
.cap-gap-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.cap-issue-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.8125rem;
}
.cap-issue-table th,
.cap-issue-table td {
    box-sizing: border-box;
}
.cap-issue-table th {
    position: sticky;
    top: 0;
    background: var(--subtle-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.625rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 1;
    white-space: nowrap;
}
.cap-issue-table td {
    padding: 0.4rem 0.625rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cap-issue-table tbody tr:last-child td {
    border-bottom: none;
}
.cap-issue-table tbody tr:hover {
    background: var(--hover-bg);
}

/* ---- Column sizing classes ---- */
.cap-col-chk  { width: 36px; text-align: center !important; }
.cap-col-xs   { width: 65px; text-align: right; }
.cap-col-sm   { width: 100px; }
.cap-col-md   { width: 130px; }
.cap-col-num  { width: 100px; text-align: right; }
.cap-col-title {
    max-width: 0;
    width: 99%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cap-issue-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cap-issue-link:hover {
    text-decoration: underline;
}

/*
 * Column widths are set via .cap-col-* classes on <th> elements.
 * No table-layout:fixed — browser auto-layout respects width hints.
 */

.cap-dev-table th:nth-child(n+2),
.cap-dev-table td:nth-child(n+2) { text-align: right; }

.cap-dev-table .cap-col-title {
    width: 22%;
    max-width: 180px;
}

.cap-dev-table .cap-col-num {
    width: 12%;
}

.cap-dev-table th,
.cap-dev-table td {
    padding: 0.35rem 0.45rem;
}

.cap-dev-table td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Resize handles removed — using browser auto table layout */

.cap-pts-cell {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.cap-status-chip {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 0.1rem 0.375rem;
    border-radius: 4px;
    background: var(--hover-bg);
    color: var(--muted-text);
    white-space: nowrap;
}

/* ---- By Developer ---- */
.cap-dev-name {
    font-weight: 600;
}
.cap-dev-total td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    background: var(--subtle-bg);
}
.cap-dev-ptsperday {
    font-size: 0.8125rem;
    color: var(--muted-text);
    margin-top: 0.5rem;
}

/* ---- Gap Resolver ---- */
.cap-gap-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cap-gap-metric {
    background: var(--subtle-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.cap-gap-metric-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-color);
}

.cap-gap-metric-label {
    font-size: 0.6875rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}

.cap-gap-resolved {
    border-color: var(--success);
    background: var(--success-tint);
}
.cap-gap-resolved .cap-gap-metric-value {
    color: var(--success);
}

.cap-gap-remaining .cap-gap-metric-value {
    color: var(--danger);
}

/* ---- Gap Resolver: Scope Toggle ---- */
.cap-gap-scope-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.cap-gap-scope-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.cap-gap-scope-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    background: var(--subtle-bg);
    color: var(--muted-text);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.cap-gap-scope-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.cap-gap-scope-btn:hover {
    background: var(--hover-bg);
}

.cap-gap-scope-btn.active {
    background: var(--primary, #4f6bed);
    color: #fff;
    font-weight: 600;
}

/* ---- Gap Resolver: Developer Summary Table ---- */
.cap-gap-dev-summary {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.cap-gap-dev-table {
    max-width: 600px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.cap-gap-dev-table thead th,
.cap-gap-dev-table tbody td {
    box-sizing: border-box;
    white-space: nowrap;
}

.cap-gap-dev-table thead th {
    background: var(--subtle-bg);
    padding: 0.4rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text);
    border-bottom: 1px solid var(--border);
}

/* Numeric columns sized via .cap-col-num class on <th> — alignment here */
.cap-gap-dev-table th:nth-child(n+2),
.cap-gap-dev-table td:nth-child(n+2) {
    text-align: right;
}

.cap-gap-dev-table tbody td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.cap-gap-dev-table tbody tr:last-child td {
    border-bottom: none;
}

.cap-gap-dev-table tbody td:nth-child(n+2) {
    font-variant-numeric: tabular-nums;
}

.cap-gap-dev-row {
    cursor: pointer;
    transition: background 0.12s;
}

.cap-gap-dev-row:hover {
    background: var(--hover-bg);
}

.cap-gap-dev-row.cap-gap-dev-active {
    background: var(--primary-tint, #e0e7ff);
}

.cap-gap-dev-row.cap-gap-dev-active td {
    font-weight: 600;
}

.cap-gap-dev-row.cap-gap-dev-over {
    /* subtle warning on rows with a gap */
}

.cap-gap-dev-gap-val {
    color: var(--danger);
    font-weight: 700;
}

.cap-gap-dev-ok {
    color: var(--muted-text);
}

.cap-gap-dev-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Multi-assignee badge */
.cap-multi-assignee {
    display: inline-block;
    font-size: 0.6875rem;
    color: var(--muted-text);
    margin-left: 0.375rem;
    vertical-align: middle;
}

.cap-gap-toggles {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cap-gap-row-selected {
    background: var(--primary-tint, #e0e7ff) !important;
}

.cap-reason-tag {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 0.1rem 0.375rem;
    border-radius: 4px;
    background: var(--hover-bg);
    color: var(--muted-text);
    font-weight: 500;
}

.cap-gap-export {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* ---- Empty states ---- */
.cap-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted-text);
}
.cap-empty-state p {
    margin-bottom: 0.75rem;
}

.cap-gap-empty-icon {
    font-size: 2.5rem;
    color: var(--success);
    margin-bottom: 0.5rem;
}
.cap-gap-empty h4 {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}
.cap-gap-empty-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.cap-muted {
    color: var(--muted-text);
    font-size: 0.8125rem;
}

/* ---- Export toast ---- */
.cap-export-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-color);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.cap-export-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cap-export-fallback textarea {
    width: 100%;
    font-family: monospace;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    background: var(--subtle-bg);
    color: var(--text-color);
    margin-bottom: 0.5rem;
    resize: vertical;
}

/* ---- Shared utility ---- */
.cnv-warn { color: var(--danger); }
.cnv-ok   { color: var(--success); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .cap-summary-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .cap-gap-header {
        grid-template-columns: repeat(2, 1fr);
    }
    .cap-drilldown-modal {
        width: 95vw;
    }
    .cap-filters {
        gap: 0.375rem;
    }
}

/* ============================================
   Specialist Work — health card + summary badge
   ============================================ */
.cap-specialist-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--subtle-bg);
}
.cap-specialist-title {
    font-size: 0.8125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}
.cap-specialist-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.5rem;
    font-size: 0.8125rem;
}
.cap-specialist-state {
    font-weight: 600;
}
.cap-specialist-ok .cap-specialist-state { color: var(--success); }
.cap-specialist-warn .cap-specialist-state { color: var(--warning-text, #d97706); }
.cap-specialist-over { border-color: var(--danger); }
.cap-specialist-over .cap-specialist-state { color: var(--danger); }
.cap-specialist-none {
    opacity: 0.7;
}
.cap-specialist-warn-banner {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* Specialist table summary badge */
.specialist-work-summary {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: 0.75rem;
}
.specialist-over-badge {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================
   Delivery Progress – drill-down modal
   ============================================ */
.dp-drilldown-modal {
    max-width: 900px;
}
.dp-drilldown-modal .modal-body {
    overflow-y: auto;
    max-height: 70vh;
}
.dp-summary-bar {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-text);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.625rem;
    background: var(--subtle-bg);
    border-radius: 6px;
}
.dp-group-header {
    font-size: 0.8125rem;
    font-weight: 700;
    margin: 1rem 0 0.4rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.dp-group-count {
    font-weight: 400;
    color: var(--muted-text);
}
.dp-unassigned-badge {
    display: inline-block;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.dp-missing-badge {
    display: inline-block;
    background: var(--warning, #f59e0b);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.dp-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--muted-text);
    font-size: 0.875rem;
}
.dp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}
.dp-issue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.dp-issue-table th {
    position: sticky;
    top: 0;
    background: var(--subtle-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.625rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.dp-issue-table td {
    padding: 0.4rem 0.625rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.dp-issue-table tbody tr:last-child td {
    border-bottom: none;
}
.dp-issue-table tbody tr:hover {
    background: var(--hover-bg);
}
.dp-issue-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: block;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dp-issue-link:hover {
    text-decoration: underline;
}
.dp-col-pts     { text-align: right; font-weight: 600; white-space: nowrap; width: 65px; }
.dp-col-status  { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.dp-col-assignee{ white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.dp-col-qa      { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.dp-col-qastatus{ white-space: nowrap; width: 100px; }
.dp-col-testsize{ white-space: nowrap; width: 80px; text-align: center; }
.dp-col-focus   { white-space: nowrap; width: 110px; }
.dp-col-blockers{ max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.dp-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.dp-muted { color: var(--muted-text); }

/* ============================================
   Snapshots Tab
   ============================================ */
.snapshots-sprint-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    min-width: 220px;
}

.snapshots-sprint-select:hover,
.snapshots-sprint-select:focus {
    border-color: var(--btn-bg);
    outline: none;
}

.snapshots-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nav-active-text);
    background: var(--primary-tint);
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
}

.snap-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.snap-badge-done {
    background: var(--success-tint);
    color: #166534;
}

.snap-badge-todo {
    background: var(--hover-bg);
    color: var(--muted-text);
}

.snap-badge-progress {
    background: #dbeafe;
    color: #1e40af;
}

.snap-badge-test {
    background: #fef3c7;
    color: #92400e;
}

.snap-badge-blocked {
    background: #fef2f2;
    color: #991b1b;
}

.snap-badge-removed {
    background: var(--hover-bg);
    color: var(--muted-text);
}

.snapshot-baseline-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    color: var(--success);
    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1;
}

.snapshot-baseline-btn {
    border: 1px solid var(--border);
    background: var(--surface-bg);
    color: var(--muted-text);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    cursor: pointer;
}

.snapshot-baseline-btn:hover {
    border-color: var(--btn-bg);
    color: var(--btn-bg);
}

.snap-mini-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
    background: var(--hover-bg);
}

.snap-mini-bar-fill {
    height: 100%;
}

.snapshots-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.85rem;
}

/* Snapshot expand/detail row */
.snapshot-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.snapshot-expand-btn:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.snapshot-chevron {
    transition: transform 0.2s ease;
}

.snapshot-expand-btn.expanded .snapshot-chevron {
    transform: rotate(90deg);
}

.snapshot-detail-row {
    display: none;
}

.snapshot-detail-row.visible {
    display: table-row;
}

.snapshot-detail-row > td {
    padding: 0 !important;
    border-top: none !important;
    background: var(--hover-bg);
}

.snapshot-detail-content {
    padding: 0.75rem 1rem 1rem 2.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.snapshot-detail-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.8125rem;
    font-style: italic;
}

.snapshot-issues-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
}

.sndi-col-new { width: var(--sndi-col-new, 40px); }
.sndi-col-num { width: var(--sndi-col-num, 70px); }
.sndi-col-type { width: var(--sndi-col-type, 90px); }
.sndi-col-title { width: var(--sndi-col-title, auto); }
.sndi-col-startdate { width: var(--sndi-col-startdate, 100px); }
.sndi-col-assignee { width: var(--sndi-col-assignee, 140px); }
.sndi-col-plan { width: var(--sndi-col-plan, 120px); }
.sndi-col-points { width: var(--sndi-col-points, 50px); }
.sndi-col-status { width: var(--sndi-col-status, 160px); }
.sndi-col-actions { width: var(--sndi-col-actions, 30px); }

.snapshot-issues-table th {
    text-align: left;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--muted-text);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.snapshot-issues-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.snapshot-issues-table tbody tr:last-child td {
    border-bottom: none;
}

.snapshot-issues-table tbody tr:hover {
    background: var(--surface-bg);
}

.snapshot-issues-table a {
    color: var(--nav-active-text);
    text-decoration: none;
    font-weight: 600;
}

.snapshot-issues-table a:hover {
    text-decoration: underline;
}

.snapshot-issue-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snapshot-remove-issue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.snapshot-remove-issue-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.snapshot-new-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    vertical-align: middle;
}

.snapshot-issue-new {
    background: #f0f9ff;
}

.snapshot-col-widths-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.snapshot-col-width-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.snapshot-col-width-row label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
}

.snapshot-col-width-input {
    width: 70px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--surface-bg);
    color: var(--text-color);
    text-align: right;
}

.snapshot-col-width-input:focus {
    outline: none;
    border-color: var(--btn-bg);
}

.snapshot-col-width-unit {
    font-size: 0.7rem;
    color: var(--muted-text);
    width: 20px;
}

/* ============================================
   Capacity Planning Mode Styles
   ============================================ */

.capacity-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.capacity-context-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
}

.capacity-context-toggle .ctx-btn {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    background: var(--card-bg, #fff);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.capacity-context-toggle .ctx-btn:not(:last-child) {
    border-right: 1px solid var(--border-color, #e2e8f0);
}

.capacity-context-toggle .ctx-btn.ctx-active {
    background: var(--primary, #3b82f6);
    color: #fff;
}

.capacity-context-toggle .ctx-btn:hover:not(.ctx-active) {
    background: var(--hover-bg, #f1f5f9);
}

/* Planning empty state */
.capacity-planning-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg, #fff);
    border: 2px dashed var(--border-color, #e2e8f0);
    border-radius: 12px;
}

.planning-empty-inner h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.planning-empty-dates {
    color: var(--text-secondary, #64748b);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.planning-empty-text {
    color: var(--text-secondary, #64748b);
    margin-bottom: 1.25rem;
}

.planning-empty-warn {
    color: var(--warning, #f59e0b);
    font-size: 0.82rem;
    margin-top: 0.75rem;
}

.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
}

/* Planning mode: amber border on summary cards */
.capacity-summary.planning-mode .capacity-card {
    border-left: 4px solid var(--warning, #f59e0b);
}

/* Plan status badge */
.capacity-plan-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.capacity-plan-badge.badge-draft {
    background: var(--warning, #f59e0b);
    color: #fff;
}

.capacity-plan-badge.badge-ready {
    background: var(--success, #10b981);
    color: #fff;
}

/* Mark Plan Ready button */
.btn-warning {
    background: var(--warning, #f59e0b);
    color: #fff;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-warning:hover {
    opacity: 0.9;
}

/* ── Changeboard Stakeholder Dashboard ── */

/* Layout: fixed viewport height with scrollable table */
#tab-changeboard #cbViewItems {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    overflow: hidden;
}
#tab-changeboard #cbViewItems > .filter-controls {
    flex-shrink: 0;
}
#tab-changeboard #changeboardContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}

/* View toggle dropdown */
.cb-view-toggle {
    position: relative;
    display: inline-block;
    z-index: 1000;
}
.cb-view-heading {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.cb-view-heading:hover svg {
    opacity: 0.8 !important;
}
.cb-view-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--surface-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
}
.cb-view-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color, #0f172a);
}
.cb-view-dropdown-item:hover {
    background: var(--hover-bg, #f1f5f9);
}
.cb-view-dropdown-item.active {
    font-weight: 600;
    color: #2563eb;
}

/* Status pills */
.cb-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.4;
}
.cb-status-new { background: #dbeafe; color: #1d4ed8; }
.cb-status-review { background: #fef3c7; color: #92400e; }
.cb-status-discovery { background: #e0e7ff; color: #4338ca; }
.cb-status-approved { background: #d1fae5; color: #065f46; }
.cb-status-planned { background: #cffafe; color: #0e7490; }
.cb-status-inprogress { background: #fef9c3; color: #854d0e; }
.cb-status-delivered { background: #dcfce7; color: #15803d; }
.cb-status-notplanned { background: #f1f5f9; color: #64748b; }

/* Planned window pills */
.cb-window-current { background: #dcfce7; color: #15803d; }
.cb-window-next { background: #dbeafe; color: #1d4ed8; }
.cb-window-later { background: #f1f5f9; color: #64748b; }
.cb-window-unscheduled { background: #fef3c7; color: #92400e; }

/* Summary cards */
.cb-summary-cards {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
}
.cb-summary-card {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.cb-summary-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.cb-card-all { border-left-color: #6366f1; }
.cb-card-active { border-left-color: #3b82f6; }
.cb-card-upcoming { border-left-color: #f59e0b; }
.cb-card-delivered { border-left-color: #22c55e; }
.cb-card-insights { border-left-color: #8b5cf6; }
.cb-card-insights-active {
    background: #f5f3ff;
    border-color: #8b5cf6;
    border-left-color: #8b5cf6;
    box-shadow: 0 0 0 1px #8b5cf6;
}
.cb-summary-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}
.cb-card-all .cb-summary-count { color: #6366f1; }
.cb-card-active .cb-summary-count { color: #3b82f6; }
.cb-card-upcoming .cb-summary-count { color: #d97706; }
.cb-card-delivered .cb-summary-count { color: #16a34a; }
.cb-summary-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Saved view pills */
.cb-saved-views {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.cb-saved-views-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
    margin-right: 0.25rem;
}
.cb-saved-view-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cb-saved-view-pill:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.cb-saved-view-pill.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Clickable issue rows */
#tab-changeboard table {
    width: 100%;
    table-layout: auto;
}
#tab-changeboard th,
#tab-changeboard td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#tab-changeboard td.issue-title {
    white-space: normal;
    word-break: break-word;
}
.cb-issue-row:hover td { background: #f8fafc; }
.cb-empty-filtered { text-align: center; padding: 2rem 1rem; color: #64748b; }

/* Actual status pill */
.cb-status-actual { background: #f1f5f9; color: #334155; }
[data-theme="dark"] .cb-status-actual { background: #334155; color: #e2e8f0; }

/* Status chips matching GitHub project colors */
.cb-actual-status-0--new-request { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.cb-actual-status-1--in-review { background: #fef9c3; color: #854d0e; border: 1px solid #facc15; }
.cb-actual-status-3--needs-requirements { background: #ecfccb; color: #3f6212; border: 1px solid #a3e635; }
.cb-actual-status-4--ready-to-size { background: #f3f4f6; color: #374151; border: 1px solid #9ca3af; }
.cb-actual-status-5--to-do { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }
.cb-actual-status-6--in-progress { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.cb-actual-status-7--blocked { background: #fed7aa; color: #9a3412; border: 1px solid #f97316; }
.cb-actual-status-8--pr-ready--tech-test- { background: #fef9c3; color: #713f12; border: 1px solid #ca8a04; }
.cb-actual-status-9--merged--ready-for-test- { background: #fef9c3; color: #713f12; border: 1px solid #ca8a04; }
.cb-actual-status-10--in-test { background: #ccfbf1; color: #115e59; border: 1px solid #14b8a6; }
.cb-actual-status-11--ready-for-release { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.cb-actual-status-12--released { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.cb-actual-status-13--on-hold { background: #fed7aa; color: #9a3412; border: 1px solid #f97316; }
.cb-actual-status-14--benched { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.cb-actual-status-15--rejected { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.cb-actual-status-16--no-longer-required { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.cb-actual-status-open { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }

/* Dark theme status chips */
[data-theme="dark"] .cb-actual-status-0--new-request { background: #1f2937; color: #d1d5db; border-color: #4b5563; }
[data-theme="dark"] .cb-actual-status-1--in-review { background: #422006; color: #fde68a; border-color: #ca8a04; }
[data-theme="dark"] .cb-actual-status-3--needs-requirements { background: #1a2e05; color: #bef264; border-color: #65a30d; }
[data-theme="dark"] .cb-actual-status-4--ready-to-size { background: #1f2937; color: #d1d5db; border-color: #6b7280; }
[data-theme="dark"] .cb-actual-status-5--to-do { background: #1e3a5f; color: #93c5fd; border-color: #2563eb; }
[data-theme="dark"] .cb-actual-status-6--in-progress { background: #451a03; color: #fcd34d; border-color: #d97706; }
[data-theme="dark"] .cb-actual-status-7--blocked { background: #431407; color: #fdba74; border-color: #ea580c; }
[data-theme="dark"] .cb-actual-status-8--pr-ready--tech-test- { background: #422006; color: #fde68a; border-color: #a16207; }
[data-theme="dark"] .cb-actual-status-9--merged--ready-for-test- { background: #422006; color: #fde68a; border-color: #a16207; }
[data-theme="dark"] .cb-actual-status-10--in-test { background: #042f2e; color: #5eead4; border-color: #0d9488; }
[data-theme="dark"] .cb-actual-status-11--ready-for-release { background: #064e3b; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .cb-actual-status-12--released { background: #064e3b; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .cb-actual-status-13--on-hold { background: #431407; color: #fdba74; border-color: #ea580c; }
[data-theme="dark"] .cb-actual-status-14--benched { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-actual-status-15--rejected { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-actual-status-16--no-longer-required { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-actual-status-open { background: #1e3a5f; color: #93c5fd; border-color: #2563eb; }

/* Product Domain chips matching GitHub project colors */
.cb-domain-liftshare { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }
.cb-domain-surveys { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.cb-domain-acel { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.cb-domain-ptp { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.cb-domain-commuteiq { background: #ede9fe; color: #5b21b6; border: 1px solid #8b5cf6; }
.cb-domain-commuteboost { background: #fce7f3; color: #9d174d; border: 1px solid #ec4899; }
.cb-domain-community-engagement { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
.cb-domain-dashboard-platform { background: #f3f4f6; color: #374151; border: 1px solid #9ca3af; }
.cb-domain-mobile-app-platform { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.cb-domain-onboarding-site { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; }
.cb-domain-notifications { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.cb-domain-infrastructure { background: #e5e7eb; color: #1f2937; border: 1px solid #6b7280; }
.cb-domain-operations { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

/* Dark theme domain chips */
[data-theme="dark"] .cb-domain-liftshare { background: #1e3a5f; color: #93c5fd; border-color: #2563eb; }
[data-theme="dark"] .cb-domain-surveys { background: #451a03; color: #fcd34d; border-color: #d97706; }
[data-theme="dark"] .cb-domain-acel { background: #064e3b; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .cb-domain-ptp { background: #064e3b; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .cb-domain-commuteiq { background: #2e1065; color: #c4b5fd; border-color: #7c3aed; }
[data-theme="dark"] .cb-domain-commuteboost { background: #500724; color: #f9a8d4; border-color: #db2777; }
[data-theme="dark"] .cb-domain-community-engagement { background: #422006; color: #fde68a; border-color: #ca8a04; }
[data-theme="dark"] .cb-domain-dashboard-platform { background: #1f2937; color: #d1d5db; border-color: #4b5563; }
[data-theme="dark"] .cb-domain-mobile-app-platform { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-domain-onboarding-site { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-domain-notifications { background: #450a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .cb-domain-infrastructure { background: #1f2937; color: #d1d5db; border-color: #4b5563; }
[data-theme="dark"] .cb-domain-operations { background: #450a0a; color: #fca5a5; border-color: #dc2626; }

/* Type chips */
.cb-type-story { background: #dbeafe; color: #1e40af; }
.cb-type-feature { background: #d1fae5; color: #065f46; }
.cb-type-s2-bug, .cb-type-s3-bug, .cb-type-s1-bug { background: #fee2e2; color: #991b1b; }
.cb-type-tech-debt { background: #fef3c7; color: #92400e; }
.cb-type-task { background: #e0e7ff; color: #3730a3; }
[data-theme="dark"] .cb-type-story { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .cb-type-feature { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .cb-type-s2-bug, [data-theme="dark"] .cb-type-s3-bug, [data-theme="dark"] .cb-type-s1-bug { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .cb-type-tech-debt { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .cb-type-task { background: #312e81; color: #a5b4fc; }

/* Detail panel (expanded row) */
.cb-detail-row td { padding: 0 !important; border-top: none !important; }
.cb-detail-cell { padding: 0 !important; }
.cb-detail-panel {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.cb-detail-main { flex: 1; min-width: 0; }
.cb-detail-meta {
    width: 180px;
    flex-shrink: 0;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cb-detail-meta-heading {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}
.cb-detail-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}
.cb-detail-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.cb-detail-internal-status {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}
.cb-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.75rem;
}
.cb-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.cb-detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.cb-detail-field span:last-child,
.cb-detail-field a {
    font-size: 0.8125rem;
    color: #334155;
}
.cb-detail-summary { margin-bottom: 0.75rem; }
.cb-detail-summary p {
    font-size: 0.8125rem;
    color: #475569;
    margin: 0.25rem 0 0 0;
    line-height: 1.5;
}
.cb-detail-note { margin-top: 0.5rem; }
.cb-note-text {
    font-size: 0.8125rem;
    color: #334155;
    margin: 0.25rem 0 0 0;
    line-height: 1.5;
}
.cb-note-empty {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-style: italic;
    margin: 0.25rem 0 0 0;
}

/* ── Dark theme overrides ── */
[data-theme="dark"] .cb-status-new { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .cb-status-review { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .cb-status-discovery { background: #312e81; color: #a5b4fc; }
[data-theme="dark"] .cb-status-approved { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .cb-status-planned { background: #164e63; color: #67e8f9; }
[data-theme="dark"] .cb-status-inprogress { background: #422006; color: #fde047; }
[data-theme="dark"] .cb-status-delivered { background: #14532d; color: #86efac; }
[data-theme="dark"] .cb-status-notplanned { background: #1e293b; color: #64748b; }

[data-theme="dark"] .cb-window-current { background: #14532d; color: #86efac; }
[data-theme="dark"] .cb-window-next { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .cb-window-later { background: #1e293b; color: #64748b; }
[data-theme="dark"] .cb-window-unscheduled { background: #451a03; color: #fcd34d; }

[data-theme="dark"] .cb-summary-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .cb-summary-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
}
[data-theme="dark"] .cb-summary-count { color: #f1f5f9; }
[data-theme="dark"] .cb-summary-label { color: #94a3b8; }

[data-theme="dark"] .cb-saved-view-pill {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .cb-saved-view-pill:hover {
    background: #334155;
    color: #f1f5f9;
}
[data-theme="dark"] .cb-saved-view-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
[data-theme="dark"] .cb-saved-views-label { color: #94a3b8; }

[data-theme="dark"] .cb-issue-row:hover td { background: #1e293b; }
[data-theme="dark"] .cb-row-expanded td { background: #283548; }
[data-theme="dark"] .cb-empty-filtered { color: #94a3b8; }

[data-theme="dark"] .cb-detail-panel {
    background: #1e293b;
    border-top-color: #334155;
    border-bottom-color: #334155;
}
[data-theme="dark"] .cb-detail-meta { border-left-color: #334155; }
[data-theme="dark"] .cb-detail-title { color: #f1f5f9; }
[data-theme="dark"] .cb-detail-internal-status { color: #64748b; }
[data-theme="dark"] .cb-detail-label { color: #64748b; }
[data-theme="dark"] .cb-detail-field span:last-child,
[data-theme="dark"] .cb-detail-field a { color: #cbd5e1; }
[data-theme="dark"] .cb-detail-summary p { color: #94a3b8; }
[data-theme="dark"] .cb-note-text { color: #cbd5e1; }
[data-theme="dark"] .cb-note-empty { color: #64748b; }

/* ── Editable note textarea ── */
.cb-note-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 160px;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    resize: vertical;
    margin-top: 0.25rem;
    background: #fff;
    color: #334155;
}
.cb-note-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.cb-note-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
}
.cb-char-indicator {
    font-size: 0.6875rem;
    color: #94a3b8;
}
.cb-char-over { color: #dc2626; font-weight: 600; }
.cb-note-save, .cb-note-delete { font-size: 0.75rem; padding: 0.2rem 0.6rem; }
.cb-note-more { color: #3b82f6; cursor: pointer; font-size: 0.8125rem; }
.cb-note-more:hover { text-decoration: underline; }

/* ── Planned window editable ── */
.cb-pw-select {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    background: #fff;
    color: #334155;
    margin-left: 0.5rem;
    cursor: pointer;
}
.cb-pw-select:focus { outline: none; border-color: #3b82f6; }
.cb-pw-reset {
    font-size: 0.6875rem;
    padding: 0.15rem 0.5rem;
    margin-left: 0.25rem;
}
.cb-override-badge, .cb-auto-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    margin-left: 0.25rem;
}
.cb-override-badge { background: #fef3c7; color: #92400e; }
.cb-auto-badge { background: #f1f5f9; color: #94a3b8; }

[data-theme="dark"] .cb-note-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .cb-note-textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,0.15);
}
[data-theme="dark"] .cb-char-indicator { color: #64748b; }
[data-theme="dark"] .cb-char-over { color: #ef4444; }
[data-theme="dark"] .cb-pw-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .cb-override-badge { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .cb-auto-badge { background: #1e293b; color: #64748b; }

/* ── Group By ── */
#tab-changeboard .filter-controls {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: nowrap;
}
#tab-changeboard .filter-group.search-group {
    margin-left: 0;
}
.cb-groupby-wrapper {
    flex-shrink: 0;
    margin-left: auto;
}
.cb-groupby-select {
    appearance: none;
    -webkit-appearance: none;
    font-size: 0.875rem;
    font-family: inherit;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--surface-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    color: var(--text-color);
    cursor: pointer;
    min-width: 140px;
    line-height: 1.5;
    transition: all 0.15s;
}
.cb-groupby-select:hover { border-color: #9ca3af; }
.cb-groupby-select:focus { outline: none; border-color: var(--btn-bg); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

.cb-group-header td {
    background: #f1f5f9;
    border-top: 2px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}
.cb-group-header:hover td { background: #e8ecf1; }
.cb-group-header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cb-group-chevron {
    font-size: 0.65rem;
    color: #64748b;
    width: 1rem;
    text-align: center;
}
.cb-group-name { font-size: 0.875rem; color: #1e293b; }
.cb-group-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
}
.cb-group-dates {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* ── Insights section ── */
.cb-insights {
    margin: 0 1.25rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8fafc;
}
.cb-insights-body { padding: 1rem; }
.cb-insights-close-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}
.cb-insights-close {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0.1rem 0.5rem;
    transition: color 0.15s, background 0.15s;
}
.cb-insights-close:hover { background: #f1f5f9; color: #1e293b; }
.cb-insights-toggle {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.cb-insights-toggle:hover { background: #f1f5f9; border-color: #cbd5e1; }
.cb-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.cb-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
}
.cb-chart-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
}
.cb-chart-container { min-height: 60px; }
.cb-chart-empty { color: #94a3b8; font-size: 0.8125rem; text-align: center; }

/* Horizontal bar chart */
.cb-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}
.cb-bar-label {
    font-size: 0.75rem;
    color: #475569;
    width: 140px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cb-bar-track {
    flex: 1;
    height: 16px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}
.cb-bar-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
    transition: width 0.3s ease;
}
.cb-bar-ws { background: #3b82f6; }
.cb-bar-value {
    font-size: 0.6875rem;
    color: #64748b;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* Timeline chart */
.cb-timeline-grid {
    display: flex;
    gap: 0.25rem;
    align-items: flex-end;
    height: 120px;
    padding-bottom: 1.5rem;
    position: relative;
}
.cb-timeline-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.cb-timeline-bars {
    flex: 1;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    width: 100%;
}
.cb-timeline-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.cb-tl-raised { background: #3b82f6; }
.cb-tl-delivered { background: #22c55e; }
.cb-timeline-label {
    font-size: 0.625rem;
    color: #64748b;
    margin-top: 0.25rem;
    white-space: nowrap;
}
.cb-timeline-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: #64748b;
}
.cb-tl-legend-raised { color: #3b82f6; }
.cb-tl-legend-delivered { color: #22c55e; }

/* ── Dark theme: charts + group ── */
[data-theme="dark"] .cb-groupby-select {
    background: #0f172a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .cb-group-header td {
    background: #1e293b;
    border-top-color: #334155;
    border-bottom-color: #334155;
}
[data-theme="dark"] .cb-group-header:hover td { background: #263348; }
[data-theme="dark"] .cb-group-name { color: #f1f5f9; }
[data-theme="dark"] .cb-group-chevron { color: #94a3b8; }
[data-theme="dark"] .cb-group-count { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .cb-insights { border-color: #334155; background: #1e293b; }
[data-theme="dark"] .cb-insights-close { border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .cb-insights-close:hover { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .cb-insights-toggle { border-color: #334155; }
[data-theme="dark"] .cb-insights-toggle:hover { background: #334155; border-color: #475569; }
[data-theme="dark"] .cb-insights-header { background: #1e293b; }
[data-theme="dark"] .cb-insights-header h3 { color: #f1f5f9; }
[data-theme="dark"] .cb-insights-chevron { color: #94a3b8; }
[data-theme="dark"] .cb-insights-body { background: #0f172a; }
[data-theme="dark"] .cb-chart-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .cb-chart-card h4 { color: #e2e8f0; }
[data-theme="dark"] .cb-chart-empty { color: #64748b; }
[data-theme="dark"] .cb-bar-label { color: #94a3b8; }
[data-theme="dark"] .cb-bar-track { background: #334155; }
[data-theme="dark"] .cb-bar-value { color: #94a3b8; }
[data-theme="dark"] .cb-bar-ws { background: #60a5fa; }
[data-theme="dark"] .cb-timeline-label { color: #94a3b8; }
[data-theme="dark"] .cb-timeline-legend { color: #94a3b8; }
[data-theme="dark"] .cb-tl-raised { background: #60a5fa; }
[data-theme="dark"] .cb-tl-delivered { background: #4ade80; }
[data-theme="dark"] .cb-tl-legend-raised { color: #60a5fa; }
[data-theme="dark"] .cb-tl-legend-delivered { color: #4ade80; }

/* ── Changeboard Slide-out Detail Panel ── */
.cb-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cb-panel-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.cb-detail-panel-slide {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    max-width: 900px;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}
.cb-panel-overlay.active .cb-detail-panel-slide {
    transform: translateX(0);
}
.cb-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
    flex-shrink: 0;
}
.cb-panel-header-left {
    flex: 1;
    min-width: 0;
}
.cb-panel-header-left h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    word-wrap: break-word;
}
.cb-panel-issue-number {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}
.cb-panel-issue-number a {
    color: #4f46e5;
    text-decoration: none;
}
.cb-panel-issue-number a:hover {
    text-decoration: underline;
}
.cb-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
}
.cb-panel-close:hover {
    background: #f3f4f6;
    color: #111827;
}
.cb-panel-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.cb-panel-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-width: 0;
}
.cb-panel-main h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cb-panel-main .cb-panel-section {
    margin-bottom: 1.5rem;
}
.cb-panel-main .cb-panel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}
.cb-panel-main .cb-panel-internal-status {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}
.cb-panel-main .cb-panel-summary {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-line;
    word-wrap: break-word;
}
.cb-panel-main .cb-panel-summary-empty {
    color: #9ca3af;
    font-style: italic;
}
.cb-panel-sidebar {
    width: 240px;
    flex-shrink: 0;
    overflow-y: auto;
    border-left: 1px solid #e5e7eb;
    padding: 1.25rem;
    background: #f9fafb;
}
.cb-panel-sidebar .cb-sidebar-section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}
.cb-panel-sidebar .cb-sidebar-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0.75rem 0;
}
.cb-panel-sidebar .cb-sidebar-field {
    margin-bottom: 1rem;
}
.cb-panel-sidebar .cb-sidebar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.cb-panel-sidebar .cb-sidebar-value {
    font-size: 0.85rem;
    color: #111827;
    word-wrap: break-word;
}
/* Decision note in panel */
.cb-panel-note-section { margin-top: 1rem; }
.cb-panel-note-section .cb-note-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 160px;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    resize: vertical;
    margin-top: 0.25rem;
    background: #fff;
    color: #334155;
}
.cb-panel-note-section .cb-note-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}
/* Planned window edit in panel */
.cb-panel-pw-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

/* Dark theme */
[data-theme="dark"] .cb-detail-panel-slide { background: #1e293b; box-shadow: -4px 0 24px rgba(0,0,0,0.4); }
[data-theme="dark"] .cb-panel-header { border-color: #334155; }
[data-theme="dark"] .cb-panel-header-left h3 { color: #f1f5f9; }
[data-theme="dark"] .cb-panel-issue-number { color: #94a3b8; }
[data-theme="dark"] .cb-panel-issue-number a { color: #818cf8; }
[data-theme="dark"] .cb-panel-close { color: #94a3b8; }
[data-theme="dark"] .cb-panel-close:hover { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .cb-panel-main h4 { color: #cbd5e1; }
[data-theme="dark"] .cb-panel-main .cb-panel-internal-status { color: #94a3b8; }
[data-theme="dark"] .cb-panel-main .cb-panel-summary { color: #cbd5e1; }
[data-theme="dark"] .cb-panel-sidebar { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .cb-panel-sidebar .cb-sidebar-section-heading { color: #cbd5e1; }
[data-theme="dark"] .cb-panel-sidebar .cb-sidebar-divider { border-color: #334155; }
[data-theme="dark"] .cb-panel-sidebar .cb-sidebar-label { color: #94a3b8; }
[data-theme="dark"] .cb-panel-sidebar .cb-sidebar-value { color: #e2e8f0; }
[data-theme="dark"] .cb-panel-note-section .cb-note-textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .cb-panel-overlay { background: rgba(0,0,0,0.6); }

/* ============================================
   Changeboard Executive Dashboard
   ============================================ */
.cbd-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 24px 40px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0f172a;
}

/* Header */
.cbd-header {
    margin-bottom: 18px;
}

/* Section titles */
.cbd-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 26px 0 12px;
}

/* KPI grid */
.cbd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.cbd-kpi {
    background: #fff;
    border: 1px solid #e7ebf3;
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.07);
    min-height: 108px;
    position: relative;
    overflow: hidden;
}
.cbd-kpi.cbd-kpi-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.cbd-kpi.cbd-kpi-clickable:hover {
    border-color: #5b8def;
    box-shadow: 0 10px 30px rgba(91,141,239,0.15);
}
.cbd-kpi:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #5b8def, #36cfc9);
}
.cbd-kpi-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}
.cbd-kpi-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

/* Panel */
.cbd-panel {
    background: #fff;
    border: 1px solid #e7ebf3;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.07);
    padding: 18px 18px 16px;
    overflow: hidden;
}
.cbd-panel h3 {
    margin: 0 0 4px;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: #0f172a;
}
.cbd-panel-sub {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
}

/* Grids */
.cbd-summary-grid {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 14px;
    margin-top: 14px;
}
.cbd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

/* Attention cards */
.cbd-attention-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.cbd-attention-card {
    background: #f8fbff;
    border: 1px solid #dfe8ff;
    border-radius: 16px;
    padding: 14px;
    min-height: 94px;
}
.cbd-attention-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}
.cbd-attention-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

/* Note */
.cbd-note {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #fff8e8;
    border: 1px solid #ffe0a3;
    color: #6b4d00;
    font-size: 13px;
}

/* Table */
.cbd-table-wrap {
    overflow: hidden;
    border: 1px solid #e7ebf3;
    border-radius: 16px;
    margin-top: 8px;
}
.cbd-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.cbd-table-wrap thead th {
    background: #f8fafc;
    color: #475569;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e7ebf3;
    font-weight: 700;
    white-space: nowrap;
}
.cbd-table-wrap tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #22314a;
    vertical-align: top;
}
.cbd-table-wrap tbody tr:last-child td { border-bottom: none; }
.cbd-title-cell {
    max-width: 440px;
    font-weight: 600;
    line-height: 1.35;
}

/* Footer note */
.cbd-footer-note {
    margin-top: 18px;
    color: #6b7280;
    font-size: 12px;
}

/* Empty / loading */
.cbd-empty-chart {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}
.cbd-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
.cbd-empty-state a { color: #2754c5; }
.cbd-loading { padding: 20px; }
.cbd-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: cbdShimmer 1.5s infinite;
    border-radius: 18px;
    margin-bottom: 14px;
}
.cbd-sk-kpi-row { height: 108px; }
.cbd-sk-charts-row { height: 260px; }
.cbd-sk-wide { height: 380px; }
@keyframes cbdShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 1100px) {
    .cbd-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .cbd-summary-grid,
    .cbd-grid-2 { grid-template-columns: 1fr; }
    .cbd-attention-grid { grid-template-columns: repeat(2, 1fr); }
    .cbd-filter-pills { justify-content: flex-start; max-width: 100%; }
    .cbd-header { flex-direction: column; }
}
@media (max-width: 640px) {
    .cbd-kpi-grid { grid-template-columns: 1fr; }
    .cbd-attention-grid { grid-template-columns: 1fr; }
    .cbd-page { padding: 16px 12px 30px; }
}

/* Dark theme minimal overrides */
[data-theme="dark"] .cbd-page { color: #e2e8f0; }
[data-theme="dark"] .cbd-kpi,
[data-theme="dark"] .cbd-panel { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .cbd-kpi:before { background: linear-gradient(90deg, #3b82f6, #22d3ee); }
[data-theme="dark"] .cbd-kpi-value,
[data-theme="dark"] .cbd-attention-value { color: #f1f5f9; }
[data-theme="dark"] .cbd-kpi-label,
[data-theme="dark"] .cbd-panel-sub,
[data-theme="dark"] .cbd-attention-label,
[data-theme="dark"] .cbd-subtitle,
[data-theme="dark"] .cbd-footer-note { color: #94a3b8; }
[data-theme="dark"] .cbd-section-title { color: #94a3b8; }
[data-theme="dark"] .cbd-panel h3 { color: #f1f5f9; }
[data-theme="dark"] .cbd-attention-card { background: #0f172a; border-color: #1e3a5f; }
[data-theme="dark"] .cbd-note { background: #1e293b; border-color: #92400e; color: #fbbf24; }
[data-theme="dark"] .cbd-table-wrap { border-color: #334155; }
[data-theme="dark"] .cbd-table-wrap thead th { background: #0f172a; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .cbd-table-wrap tbody td { color: #e2e8f0; border-color: #1e293b; }
[data-theme="dark"] .cbd-badge { background: #1e3a5f; color: #93c5fd; }

/* ============================================================
   Backlog Health Dashboard
   ============================================================ */

/* Page header */
.backhealth-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 0 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.backhealth-compare-control {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.backhealth-control-label {
    font-size: 0.8125rem;
    color: #64748b;
    white-space: nowrap;
}
.backhealth-last-synced {
    font-size: 0.8125rem;
    color: #64748b;
}
.backhealth-sync-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-left: auto;
}
.backhealth-sync-tooltip-wrap {
    position: relative;
    display: inline-flex;
}
.backhealth-sync-button {
    white-space: nowrap;
}
.backhealth-sync-tooltip {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 220px;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    display: none;
    z-index: 30;
    pointer-events: none;
}
.backhealth-sync-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: #0f172a;
    transform: rotate(45deg);
}
.backhealth-sync-tooltip-wrap:hover .backhealth-sync-tooltip,
.backhealth-sync-tooltip-wrap:focus-within .backhealth-sync-tooltip {
    display: block;
}
.backhealth-sync-tooltip-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #cbd5e1;
}
.backhealth-schedule-button {
    min-width: 46px;
    height: 38px;
    justify-content: center;
    padding: 0 0.85rem;
    box-sizing: border-box;
}
.backhealth-schedule-button svg {
    width: 18px;
    height: 18px;
}
.backhealth-schedule-button--active {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
}
.backhealth-schedule-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10020;
}
.backhealth-schedule-modal-card {
    width: min(100%, 420px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}
.backhealth-schedule-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
}
.backhealth-schedule-modal-header h3 {
    margin: 0.2rem 0 0;
    font-size: 1.05rem;
    color: #0f172a;
}
.backhealth-schedule-modal-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}
.backhealth-schedule-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.backhealth-schedule-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
}
.backhealth-schedule-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
}
.backhealth-schedule-fields {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.backhealth-schedule-interval-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
    gap: 0.75rem;
}
.backhealth-schedule-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.backhealth-schedule-preset {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.backhealth-schedule-preset:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1d4ed8;
}
.backhealth-schedule-summary {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
}
.backhealth-schedule-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.25rem 1.25rem;
}

@media (max-width: 720px) {
    .backhealth-page-header {
        width: 100%;
        justify-content: flex-start;
    }

    .backhealth-sync-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .backhealth-schedule-interval-row {
        grid-template-columns: 1fr;
    }

    .backhealth-sync-tooltip {
        right: auto;
        left: 0;
    }

    .backhealth-sync-tooltip::before {
        right: auto;
        left: 18px;
    }
}

[data-theme="dark"] .backhealth-control-label,
[data-theme="dark"] .backhealth-last-synced {
    color: #94a3b8;
}
[data-theme="dark"] .backhealth-schedule-button--active {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #bfdbfe;
}
[data-theme="dark"] .backhealth-schedule-modal-card {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 26px 60px rgba(2, 6, 23, 0.45);
}
[data-theme="dark"] .backhealth-schedule-modal-header {
    border-bottom-color: #1e293b;
}
[data-theme="dark"] .backhealth-schedule-modal-header h3,
[data-theme="dark"] .backhealth-schedule-toggle {
    color: #f8fafc;
}
[data-theme="dark"] .backhealth-schedule-preset {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .backhealth-schedule-preset:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #bfdbfe;
}
[data-theme="dark"] .backhealth-schedule-modal-kicker,
[data-theme="dark"] .backhealth-schedule-summary,
[data-theme="dark"] .backhealth-schedule-close {
    color: #94a3b8;
}

/* KPI row (legacy, kept for any other consumers) */
.backhealth-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 0 1.25rem;
}

/* Ready to Size slim strip */
.backhealth-strip {
    padding: 0.75rem 0 0;
    display: flex;
    gap: 0.75rem;
}
.backhealth-kpi-card--strip {
    min-width: 200px;
    max-width: 260px;
}

/* Inline KPI chips inside chart headers */
.bh-kpi-strip {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-shrink: 0;
}
.bh-kpi-strip--page {
    flex-shrink: unset;
    margin-top: 0.875rem;
}
.bh-kpi-strip--page .bh-kpi-chip {
    flex: 1;
    padding: 1.25rem 1.5rem;
    gap: 0.25rem;
    justify-content: center;
    min-height: 100px;
}
.bh-kpi-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 0.625rem;
    padding: 0.35rem 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    position: relative;
}
.bh-kpi-chip--bug { border-left: 4px solid #ef4444; cursor: pointer; }
.bh-kpi-chip--debt { border-left: 4px solid #f59e0b; cursor: pointer; }
.bh-kpi-chip-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}
.bh-kpi-chip-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    letter-spacing: -0.02em;
}
.bh-kpi-chip-sub {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.2rem;
}

/* Side-by-side panel rows */
.backhealth-panel-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0 0;
    align-items: stretch;
}
.backhealth-panel-cell {
    flex-shrink: 0;
    min-width: 220px;
    max-width: 280px;
}
.backhealth-panel-cell--grow {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
}
.backhealth-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
}
.backhealth-kpi-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #94a3b8;
    border-radius: 4px 0 0 4px;
}
.backhealth-kpi-card--bug::before { background: #ef4444; }
.backhealth-kpi-card--debt::before { background: #f59e0b; }
.backhealth-kpi-card--combined::before { background: #8b5cf6; }
.backhealth-kpi-card--donut {
    padding: 0.75rem 1rem 0.5rem;
}
.backhealth-kpi-card--donut::before { background: #5B8DEF; }

/* Donut hover callout */
.backhealth-donut-tooltip {
    display: none;
    position: fixed;
    pointer-events: none;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 9999;
    white-space: nowrap;
    min-width: 120px;
}
.bh-tip-label {
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 3px;
    border-bottom: 1px solid #334155;
    padding-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bh-tip-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bh-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
}
.bh-tip-val {
    font-weight: 700;
    color: #f8fafc;
    font-size: 14px;
}
.bh-tip-pct {
    color: #94a3b8;
    font-size: 11px;
}
.backhealth-kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.backhealth-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.backhealth-kpi-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.25rem;
    text-align: center;
}

/* Sections */
.backhealth-section {
    padding: 1.25rem 0;
    border-top: 1px solid #f1f5f9;
}
.backhealth-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
}

/* Charts */
.backhealth-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.backhealth-chart-row--full {
    grid-template-columns: 1fr;
}
.backhealth-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 1rem 1.25rem;
    min-height: 180px;
}
.backhealth-chart-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
}
.bh-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.bh-chart-header .backhealth-chart-title {
    margin-bottom: 0;
}
.bh-mode-toggle {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}
.bh-mode-btn {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 3px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.bh-mode-btn--active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.bh-intake-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

/* Planner */
.backhealth-planner-inputs {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.backhealth-planner-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.backhealth-planner-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}
.backhealth-planner-field input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    width: 160px;
}
.backhealth-planner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.backhealth-planner-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
}
.backhealth-planner-block-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem;
}
.backhealth-planner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.backhealth-planner-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.backhealth-planner-label { color: #475569; }
.backhealth-planner-value { text-align: right; font-weight: 500; color: #1e293b; }
.backhealth-planner-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.5rem 0 0;
}

/* Status badges */
.backhealth-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.backhealth-on-track {
    background: #dcfce7;
    color: #166534;
}
.backhealth-off-track {
    background: #fee2e2;
    color: #991b1b;
}
.backhealth-badge--neutral {
    background: #f1f5f9;
    color: #64748b;
}

/* Issue lists */
.backhealth-issue-list {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.backhealth-issue-list-title {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    user-select: none;
}
.backhealth-issue-list-title::-webkit-details-marker { display: none; }
.backhealth-issue-list-title::before {
    content: '▶';
    font-size: 0.6rem;
    color: #94a3b8;
    transition: transform 0.15s;
}
details[open] > .backhealth-issue-list-title::before { transform: rotate(90deg); }
.backhealth-issue-count {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}
.backhealth-issue-table-wrap {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}
.backhealth-issue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.backhealth-issue-table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-align: left;
    position: sticky;
    top: 0;
}
.backhealth-issue-table tbody td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.backhealth-issue-table tbody tr:hover { background: #f8fafc; }
.backhealth-issue-table a { color: #3b82f6; text-decoration: none; }
.backhealth-issue-table a:hover { text-decoration: underline; }

/* Utility */
.backhealth-placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
    padding: 1.5rem;
    text-align: center;
}
.backhealth-info-banner {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    color: #92400e;
    margin: 0 0 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
    .backhealth-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .backhealth-chart-row { grid-template-columns: 1fr; }
    .backhealth-planner-grid { grid-template-columns: 1fr; }
    .backhealth-panel-row { flex-direction: column; }
    .backhealth-panel-cell { max-width: none; min-width: 0; }
}
@media (max-width: 640px) {
    .backhealth-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .backhealth-planner-inputs { flex-direction: column; align-items: stretch; }
    .backhealth-planner-field input { width: 100%; }
    .backhealth-panel-row { flex-direction: column; }
    .backhealth-panel-cell { max-width: none; min-width: 0; }
}

/* Dark theme */
[data-theme="dark"] .backhealth-kpi-card,
[data-theme="dark"] .backhealth-chart-card,
[data-theme="dark"] .backhealth-planner-block { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .backhealth-kpi-value { color: #f1f5f9; }
[data-theme="dark"] .backhealth-kpi-sub { color: #94a3b8; }
[data-theme="dark"] .backhealth-kpi-label,
[data-theme="dark"] .backhealth-last-synced { color: #94a3b8; }
[data-theme="dark"] .backhealth-section-title,
[data-theme="dark"] .backhealth-planner-block-title { color: #f1f5f9; }
[data-theme="dark"] .backhealth-planner-label,
[data-theme="dark"] .backhealth-chart-title { color: #94a3b8; }
[data-theme="dark"] .backhealth-planner-value { color: #e2e8f0; }
[data-theme="dark"] .backhealth-planner-table td { border-color: #334155; }
[data-theme="dark"] .backhealth-issue-list { border-color: #334155; }
[data-theme="dark"] .backhealth-issue-list-title { background: #0f172a; color: #f1f5f9; }
[data-theme="dark"] .backhealth-issue-table thead th { background: #0f172a; color: #94a3b8; }
[data-theme="dark"] .backhealth-issue-table tbody td { color: #e2e8f0; border-color: #1e293b; }
[data-theme="dark"] .backhealth-issue-table tbody tr:hover { background: #0f172a; }
[data-theme="dark"] .backhealth-planner-field input { background: #1e293b; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .backhealth-section { border-color: #1e293b; }

/* ============================================================
   Backlog Health Dashboard — New Health Sections (Phase 1)
   ============================================================ */

/* --- Seed error panel --- */
.bh-seed-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    color: #991b1b;
    font-size: 0.875rem;
}
.bh-seed-error ul { margin: 0.5rem 0 0 1.25rem; padding: 0; }

/* --- Summary banner --- */
.bh-summary-banner {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0284c7;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #0c4a6e;
    line-height: 1.6;
}

/* --- KPI section label --- */
.bh-kpi-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 0.75rem 0 0.35rem;
}

/* --- KPI rows (new) --- */
.bh-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.bh-kpi-row--movement .bh-kpi-card { flex: 1 1 calc(12.5% - 0.5rem); min-width: 120px; }
.bh-kpi-row--risk .bh-kpi-card { flex: 1 1 calc(20% - 0.5rem); min-width: 130px; }

/* --- KPI card (new) --- */
.bh-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    cursor: default;
    transition: box-shadow 0.15s;
}
.bh-kpi-card[onclick] { cursor: pointer; }
.bh-kpi-card[onclick]:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.bh-kpi-card--bugs { border-left-color: #ef4444; }
.bh-kpi-card--td { border-left-color: #f59e0b; }
.bh-kpi-card--delivery { border-left-color: #3b82f6; }
.bh-kpi-card--stale { border-left-color: #f97316; }
.bh-kpi-card--featured {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    border-left: none;
    padding: 0.875rem 1rem;
}
.bh-kpi-card--featured:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.09); }
.bh-kpi-featured-icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bh-kpi-featured-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}
.bh-kpi-featured-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.bh-kpi-featured-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
}
.bh-kpi-vs {
    display: block;
    width: 100%;
    font-size: 0.6875rem;
    color: #94a3b8;
}
.bh-kpi-delta-plain {
    font-size: 0.75rem;
    font-weight: 600;
}
.bh-kpi-delta-plain.bh-kpi-delta--down-good { color: #16a34a; }
.bh-kpi-delta-plain.bh-kpi-delta--up-bad    { color: #dc2626; }
.bh-kpi-delta-plain.bh-kpi-delta--neutral   { color: #94a3b8; }
.bh-kpi-featured-icon { background: #f1f5f9; }
.bh-kpi-featured-icon svg { color: #6366f1; }
.bh-kpi-featured-icon--bugs { background: #fef2f2; }
.bh-kpi-featured-icon--bugs svg { color: #ef4444; }
.bh-kpi-featured-icon--td { background: #fffbeb; }
.bh-kpi-featured-icon--td svg { color: #f59e0b; }
.bh-kpi-featured-icon--added { background: #eff6ff; }
.bh-kpi-featured-icon--added svg { color: #2563eb; }
.bh-kpi-featured-icon--closed { background: #f5f3ff; }
.bh-kpi-featured-icon--closed svg { color: #8b5cf6; }
.bh-kpi-featured-icon--net { background: #ecfeff; }
.bh-kpi-featured-icon--net svg { color: #0f766e; }
.bh-kpi-featured-icon--ratio { background: #f5f3ff; }
.bh-kpi-featured-icon--ratio svg { color: #7c3aed; }
.bh-kpi-featured-icon--stale180 { background: #fff7ed; }
.bh-kpi-featured-icon--stale180 svg { color: #f59e0b; }
.bh-kpi-featured-icon--stale365 { background: #fef2f2; }
.bh-kpi-featured-icon--stale365 svg { color: #ef4444; }
.bh-kpi-featured-icon--avgage { background: #f5f3ff; }
.bh-kpi-featured-icon--avgage svg { color: #8b5cf6; }
.bh-kpi-featured-icon--oldest { background: #f5f3ff; }
.bh-kpi-featured-icon--oldest svg { color: #8b5cf6; }
.bh-kpi-featured-icon--target-unplanned { background: #fff7ed; }
.bh-kpi-featured-icon--target-unplanned svg { color: #f97316; }
.bh-kpi-featured-icon--target-goal { background: #eff6ff; }
.bh-kpi-featured-icon--target-goal svg { color: #2563eb; }
.bh-kpi-featured-icon--target-required { background: #f5f3ff; }
.bh-kpi-featured-icon--target-required svg { color: #7c3aed; }
.bh-kpi-featured-icon--target-gap { background: #ecfeff; }
.bh-kpi-featured-icon--target-gap svg { color: #0f766e; }
.bh-kpi-featured-icon--target-status { background: #f1f5f9; }
.bh-kpi-featured-icon--target-status svg { color: #6366f1; }
.bh-kpi-featured-icon--target-forecast { background: #fef3c7; }
.bh-kpi-featured-icon--target-forecast svg { color: #d97706; }
.bh-kpi-featured-icon--target-capacity { background: #f0fdf4; }
.bh-kpi-featured-icon--target-capacity svg { color: #15803d; }
.bh-kpi-featured-icon--target-planned { background: #eff6ff; }
.bh-kpi-featured-icon--target-planned svg { color: #1d4ed8; }
.bh-kpi-featured-icon--target-avg { background: #faf5ff; }
.bh-kpi-featured-icon--target-avg svg { color: #7c3aed; }
.bh-kpi-featured-icon--target-ptsgap { background: #ecfeff; }
.bh-kpi-featured-icon--target-ptsgap svg { color: #0f766e; }
.bh-target-badge--warn { background: #fef3c7; color: #92400e; }
.bh-target-inline-input {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.1rem 0.35rem;
    width: 70px;
    background: #f8fafc;
    line-height: 1.1;
}
.bh-target-inline-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
[data-theme="dark"] .bh-target-inline-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
.bh-kpi-row--target .bh-kpi-card { flex: 1 1 calc(14.28% - 0.5rem); min-width: 120px; }
.bh-kpi-row--target .bh-kpi-value { font-size: 1.25rem; }
.bh-kpi-card--target-status { }
.bh-kpi-card--target-warn { background: #fef2f2; border-color: #fecaca; }
.bh-kpi-card--target-warn .bh-kpi-featured-icon { background: #fecaca; }
.bh-kpi-card--target-warn .bh-kpi-featured-icon svg { color: #dc2626; }
.bh-kpi-card--target-warn-amber { background: #fffbeb; border-color: #fde68a; }
.bh-kpi-card--target-warn-amber .bh-kpi-featured-icon { background: #fde68a; }
.bh-kpi-card--target-warn-amber .bh-kpi-featured-icon svg { color: #d97706; }
.bh-kpi-card--target-ok { background: #f0fdf4; border-color: #bbf7d0; }
.bh-kpi-card--target-ok .bh-kpi-featured-icon { background: #bbf7d0; }
.bh-kpi-card--target-ok .bh-kpi-featured-icon svg { color: #16a34a; }
[data-theme="dark"] .bh-kpi-card--featured { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .bh-kpi-featured-icon { background: #0f172a; }
[data-theme="dark"] .bh-kpi-featured-icon svg { color: #818cf8; }
.bh-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.bh-kpi-excl { font-size: 0.6rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: #cbd5e1; }
.bh-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}
.bh-kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}
.bh-kpi-points {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.bh-kpi-points:empty { display: none; }
[data-theme="dark"] .bh-kpi-points { color: #64748b; }
.bh-kpi-value--sm { font-size: 1.25rem; }
.bh-kpi-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}
.bh-kpi-sub--muted { color: #cbd5e1; }
.bh-kpi-partial-label { font-style: italic; color: #f59e0b; font-size: 0.75rem; }
.bh-kpi-delta {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    display: inline-block;
    align-self: flex-start;
}
.bh-kpi-delta--up-bad { background: #fef2f2; color: #dc2626; }
.bh-kpi-delta--down-good { background: #f0fdf4; color: #16a34a; }
.bh-kpi-delta--neutral { background: #f8fafc; color: #64748b; }
.bh-kpi-delta--up-good { background: #f0fdf4; color: #16a34a; }
.bh-kpi-delta--down-bad { background: #fef2f2; color: #dc2626; }

/* --- Controls bar --- */
.bh-controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}
.bh-toggle-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #475569;
    cursor: pointer;
}
.bh-toggle-pill input[type="checkbox"] { cursor: pointer; }
.bh-mode-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.15rem;
}
.bh-mode-label { font-size: 0.75rem; color: #64748b; padding: 0 0.35rem; }
.bh-adjusted-label {
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 0.25rem;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
}

/* --- Chart sections --- */
.bh-chart-section { }

/* 2-column grid for core overview charts */
.bh-chart-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.bh-chart-grid-2col > .backhealth-chart-card {
    margin-top: 0 !important;
}

/* 2-column layout for Bug Health + Tech Debt side by side */
.bh-section-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 0;
}
.bh-section-pair > .bh-section {
    margin-top: 0;
    min-width: 0;
}

/* Anomaly caveat badge */
.bh-anomaly-caveat {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #78350f;
    flex-wrap: wrap;
    line-height: 1.5;
}
.bh-anomaly-caveat-icon { font-style: normal; flex-shrink: 0; }
.bh-anomaly-caveat-text { flex: 1; }
.bh-anomaly-type-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.bh-chart-filter-bar {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.bh-filter-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.1s, color 0.1s;
}
.bh-filter-btn:hover { background: #e2e8f0; }
.bh-filter-btn--active { background: #6366f1; color: #fff; border-color: #6366f1; }
.bh-chart-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.4rem 0 0;
    line-height: 1.5;
}

/* --- Sections --- */
.bh-section {
    border-top: 1px solid #f1f5f9;
    margin-top: 1.25rem;
    padding-top: 1rem;
}
.bh-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem;
}
.bh-subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin: 1rem 0 0.5rem;
}
.bh-section-note {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: -0.25rem 0 0.75rem;
}

/* --- Mini KPI row (inside sections) --- */
.bh-mini-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bh-mini-kpi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 200px;
    cursor: default;
}
.bh-mini-kpi[onclick] { cursor: pointer; }
.bh-mini-kpi[onclick]:hover { background: #f1f5f9; }
.bh-mini-kpi--bugs { border-left: 3px solid #ef4444; }
.bh-mini-kpi--td { border-left: 3px solid #f59e0b; }
.bh-mini-kpi--stale { border-left: 3px solid #f97316; }
.bh-mini-kpi--added { border-left: 3px solid #6366f1; }
.bh-mini-kpi--closed { border-left: 3px solid #16a34a; }
.bh-mini-kpi--net-growing { border-left: 3px solid #dc2626; }
.bh-mini-kpi--net-growing .bh-mini-kpi-value,
.bh-mini-kpi--net-growing .bh-kpi-value { color: #dc2626; }
.bh-mini-kpi--net-stable { border-left: 3px solid #6366f1; }
.bh-mini-kpi--net-stable .bh-mini-kpi-value,
.bh-mini-kpi--net-stable .bh-kpi-value { color: #475569; }
.bh-mini-kpi--net-shrinking { border-left: 3px solid #16a34a; }
.bh-mini-kpi--net-shrinking .bh-mini-kpi-value,
.bh-mini-kpi--net-shrinking .bh-kpi-value { color: #16a34a; }
.bh-mini-kpi-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}
.bh-flow-kpi-row { margin-top: 0.25rem; }

/* --- Reduction Target section --- */
.bh-target-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bh-target-subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0.15rem 0 0;
    white-space: nowrap;
}
.bh-target-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}
.bh-target-label {
    display: flex;
    flex-direction: column;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    gap: 0.2rem;
}
.bh-target-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #1e293b;
    width: 110px;
}
select.bh-target-input {
    width: 200px;
}
.bh-target-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.bh-target-save-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid #6366f1;
    border-radius: 0.375rem;
    background: #6366f1;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
.bh-target-save-btn:hover { background: #4f46e5; }

/* Example calculation box */
.bh-target-example {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-left: 3px solid #6366f1;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* Status card special backgrounds */
.bh-mini-kpi--target-status { }
.bh-mini-kpi--target-warn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 3px solid #dc2626;
}
.bh-mini-kpi--target-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 3px solid #16a34a;
}

/* Side-by-side chart + table body */
.bh-section--target {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.bh-target-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 0.75rem;
    margin-top: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.bh-target-chart-col,
.bh-target-table-col {
    display: flex;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.bh-target-chart-card,
.bh-target-breakdown-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
/* Chart area fills to match table height */
.bh-target-chart-area {
    position: relative;
    flex: 1 1 0;
    min-height: 280px;
}
/* Table scroll: fills remaining space in card, scrolls if needed */
.bh-target-table-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 1100px) {
    .bh-target-body { grid-template-columns: 1fr; }
}

/* Chart subtitle */
.bh-chart-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.1rem;
}

/* Target table */
.bh-target-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
    box-sizing: border-box;
}
.bh-target-table th,
.bh-target-table td {
    padding: 0.3rem 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}
.bh-target-table th:nth-child(1),
.bh-target-table td:nth-child(1) { width: 18%; }
.bh-target-table th:nth-child(2),
.bh-target-table td:nth-child(2) { width: 28%; }
.bh-target-table th:nth-child(3),
.bh-target-table td:nth-child(3) { width: 28%; }
.bh-target-table th:nth-child(4),
.bh-target-table td:nth-child(4) { width: 26%; }
.bh-target-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.625rem;
    letter-spacing: 0.04em;
    color: #64748b;
    text-align: left;
}
.bh-target-table tbody tr:hover {
    background: rgba(99,102,241,0.04);
}

/* Status badges */
.bh-target-badge {
    display: inline-flex;
    max-width: 100%;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 9999px;
    white-space: nowrap;
    box-sizing: border-box;
}
.bh-target-badge--ahead {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.bh-target-badge--under {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Summary row below table */
.bh-target-summary {
    margin-top: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}
.bh-target-summary--warn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.bh-target-summary--ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Behaviour rules */
.bh-target-rules {
    margin-top: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}
.bh-target-rules-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.4rem;
}
.bh-target-rules-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.6;
}
.bh-mini-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.bh-mini-kpi-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
}
.bh-mini-kpi-sub { font-size: 0.65rem; color: #94a3b8; }

/* --- Status table --- */
.bh-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.bh-status-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
}
.bh-status-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: middle;
}
.bh-status-table tr:hover td { background: #f8fafc; }
.bh-status-table td:first-child { font-weight: 500; color: #1e293b; }
.bh-status-flag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}
.bh-status-age-high { color: #dc2626; font-weight: 600; }
.bh-status-count-high { color: #dc2626; font-weight: 600; }
.bh-type-breakdown { font-size: 0.6875rem; color: #94a3b8; }

/* --- Drilldown modal --- */
.bh-drilldown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 10000;
}
.bh-drilldown-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 10001;
    width: min(95vw, 1100px);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.bh-drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.bh-drilldown-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
}
.bh-drilldown-close {
    background: none;
    border: none;
    font-size: 1.375rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}
.bh-drilldown-close:hover { color: #1e293b; }
.bh-drilldown-body {
    overflow-y: auto;
    padding: 0.75rem 1.25rem 1.25rem;
    flex: 1;
}
.bh-drilldown-table-wrap { overflow-x: auto; }
.bh-drilldown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7875rem;
    min-width: 800px;
}
.bh-drilldown-table th:first-child,
.bh-drilldown-table td:first-child {
    width: 56px;
    min-width: 56px;
    white-space: nowrap;
}
.bh-drilldown-table th:nth-child(2),
.bh-drilldown-table td:nth-child(2) {
    width: 40%;
    min-width: 300px;
}
.bh-drilldown-table td:nth-child(2) a,
.bh-drilldown-table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
}
.bh-drilldown-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #fff;
}
.bh-drilldown-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: top;
    line-height: 1.4;
}
.bh-drilldown-table tr:hover td { background: #f8fafc; }
.bh-drilldown-table a { color: #6366f1; text-decoration: none; }
.bh-drilldown-table a:hover { text-decoration: underline; }
.bh-drilldown-count {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.bh-drilldown-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-size: 0.875rem;
}

/* --- Anomaly annotation (Chart.js chart area callout) --- */
.bh-anomaly-tooltip {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    padding: 0.4rem 0.625rem;
    pointer-events: none;
    z-index: 9999;
    max-width: 240px;
    line-height: 1.5;
    display: none;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .bh-chart-grid-2col { grid-template-columns: 1fr; }
    .bh-section-pair { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .bh-kpi-row--movement .bh-kpi-card { flex: 1 1 calc(25% - 0.5rem); }
    .bh-kpi-row--risk .bh-kpi-card { flex: 1 1 calc(33% - 0.5rem); }
    .bh-kpi-row--target .bh-kpi-card { flex: 1 1 calc(33% - 0.5rem); }
}
@media (max-width: 600px) {
    .bh-kpi-row--movement .bh-kpi-card,
    .bh-kpi-row--risk .bh-kpi-card,
    .bh-kpi-row--target .bh-kpi-card { flex: 1 1 calc(50% - 0.5rem); }
    .bh-drilldown-modal { top: 0; left: 0; transform: none; width: 100vw; max-height: 100vh; border-radius: 0; }
}

/* --- Dark theme overrides (new) --- */
[data-theme="dark"] .bh-seed-error { background: #2d1515; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .bh-summary-banner { background: #082f49; border-color: #0369a1; color: #bae6fd; }
[data-theme="dark"] .bh-kpi-section-label { color: #475569; }
[data-theme="dark"] .bh-kpi-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .bh-kpi-label { color: #64748b; }
[data-theme="dark"] .bh-kpi-value { color: #f1f5f9; }
[data-theme="dark"] .bh-kpi-sub { color: #64748b; }
[data-theme="dark"] .bh-controls-bar { color: #94a3b8; }
[data-theme="dark"] .bh-toggle-pill { color: #94a3b8; }
[data-theme="dark"] .bh-mode-toggle-group { background: #0f172a; }
[data-theme="dark"] .bh-mode-label { color: #64748b; }
[data-theme="dark"] .bh-adjusted-label { background: #451a03; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .bh-filter-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .bh-filter-btn:hover { background: #334155; }
[data-theme="dark"] .bh-filter-btn--active { background: #6366f1; color: #fff; border-color: #6366f1; }
[data-theme="dark"] .bh-chart-note { color: #475569; }
[data-theme="dark"] .bh-section { border-color: #1e293b; }
[data-theme="dark"] .bh-section-title { color: #f1f5f9; }
[data-theme="dark"] .bh-subsection-title { color: #94a3b8; }
[data-theme="dark"] .bh-section-note { color: #475569; }
[data-theme="dark"] .bh-mini-kpi { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .bh-mini-kpi[onclick]:hover { background: #334155; }
[data-theme="dark"] .bh-mini-kpi-label { color: #475569; }
[data-theme="dark"] .bh-mini-kpi-value { color: #f1f5f9; }
[data-theme="dark"] .bh-mini-kpi-sub { color: #64748b; }
[data-theme="dark"] .bh-status-table th { color: #475569; border-color: #334155; }
[data-theme="dark"] .bh-status-table td { color: #cbd5e1; border-color: #1e293b; }
[data-theme="dark"] .bh-status-table tr:hover td { background: #0f172a; }
[data-theme="dark"] .bh-status-table td:first-child { color: #f1f5f9; }
[data-theme="dark"] .bh-status-flag { background: #451a03; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .bh-drilldown-modal { background: #1e293b; }
[data-theme="dark"] .bh-drilldown-header { border-color: #334155; }
[data-theme="dark"] .bh-drilldown-title { color: #f1f5f9; }
[data-theme="dark"] .bh-drilldown-close { color: #475569; }
[data-theme="dark"] .bh-drilldown-close:hover { color: #f1f5f9; }
[data-theme="dark"] .bh-drilldown-table th { background: #1e293b; border-color: #334155; color: #475569; }
[data-theme="dark"] .bh-drilldown-table td { color: #cbd5e1; border-color: #0f172a; }
[data-theme="dark"] .bh-drilldown-table tr:hover td { background: #0f172a; }
[data-theme="dark"] .bh-drilldown-table a { color: #818cf8; }
[data-theme="dark"] .bh-kpi-delta--up-bad { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .bh-kpi-delta--down-good { background: #052e16; color: #86efac; }
[data-theme="dark"] .bh-kpi-delta--neutral { background: #0f172a; color: #64748b; }
[data-theme="dark"] .bh-kpi-card--target-warn { background: #2d1515; border-color: #7f1d1d; }
[data-theme="dark"] .bh-kpi-card--target-warn .bh-kpi-featured-icon { background: #7f1d1d; }
[data-theme="dark"] .bh-kpi-card--target-ok { background: #052e16; border-color: #166534; }
[data-theme="dark"] .bh-kpi-card--target-ok .bh-kpi-featured-icon { background: #166534; }
[data-theme="dark"] .bh-kpi-delta--up-good { background: #052e16; color: #86efac; }
[data-theme="dark"] .bh-kpi-delta--down-bad { background: #450a0a; color: #fca5a5; }

/* ============================================================
   Backlog Health — Unified Story Section
   ============================================================ */

.bh-unified-story-section {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1rem 0 1.25rem;
}

/* Header row */
.bh-unified-story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.bh-unified-story-title-block { flex: 1 1 auto; }
.bh-story-time-select {
    flex: 0 0 auto;
    font-size: 0.8125rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    color: #334155;
    cursor: pointer;
    outline: none;
}
.bh-story-time-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
[data-theme="dark"] .bh-story-time-select { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.bh-unified-story-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.2rem;
}
.bh-unified-story-subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
}

/* Story badges */
.bh-unified-story-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    flex: 1;
}
.bh-story-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.bh-story-badge--info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.bh-story-badge--success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.bh-story-badge--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.bh-story-badge--warn    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.bh-story-badge-icon { font-style: normal; line-height: 1; flex-shrink: 0; }

/* Chart card */
.bh-unified-story-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.875rem 0.875rem 0.5rem;
}

/* Plain-English interpretation sentence */
.bh-unified-story-interpretation {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 0.75rem;
    padding: 0.625rem 0.875rem;
    background: #f1f5f9;
    border-radius: 0.375rem;
    border-left: 3px solid #94a3b8;
}

/* Net strip label */
.bh-unified-story-net-strip-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 0.5rem 0 0.15rem;
    padding-left: 2px;
}

/* Legend */
.bh-unified-story-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.625rem;
    border-top: 1px solid #f1f5f9;
    align-items: flex-start;
}
.bh-unified-legend-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
}
.bh-unified-legend-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.bh-unified-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    font-size: 0.75rem;
    color: #475569;
}
.bh-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}
.bh-legend-line-swatch {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}
.bh-unified-legend-footer {
    width: 100%;
    font-size: 0.6875rem;
    color: #94a3b8;
    margin: 0.35rem 0 0;
    font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
    .bh-unified-story-header { flex-direction: column; gap: 0.75rem; }
    .bh-unified-story-badges { width: 100%; }
    .bh-story-badge { white-space: normal; }
    .bh-unified-legend-group { min-width: 140px; }
}

/* Dark theme */
[data-theme="dark"] .bh-unified-story-section { background: #0f172a; border-color: #1e293b; }
[data-theme="dark"] .bh-unified-story-title { color: #f1f5f9; }
[data-theme="dark"] .bh-unified-story-subtitle { color: #64748b; }
[data-theme="dark"] .bh-unified-story-chart-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .bh-unified-story-interpretation { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .bh-unified-story-net-strip-label { color: #475569; }
[data-theme="dark"] .bh-unified-story-legend { border-color: #1e293b; }
[data-theme="dark"] .bh-unified-legend-label { color: #475569; }
[data-theme="dark"] .bh-unified-legend-items { color: #94a3b8; }
[data-theme="dark"] .bh-unified-legend-footer { color: #475569; }
[data-theme="dark"] .bh-story-badge--info    { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
[data-theme="dark"] .bh-story-badge--success { background: #052e16; color: #86efac; border-color: #166534; }
[data-theme="dark"] .bh-story-badge--warning { background: #451a03; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .bh-story-badge--warn    { background: #450a0a; color: #fca5a5; border-color: #991b1b; }
