/* ========================================
   BNY CI/CD Platform - Light Theme
   ======================================== */

:root {
    --primary: #0066CC;
    --primary-dark: #004D99;
    --primary-light: #E8F4FD;
    --secondary: #1E3A5F;
    --accent: #00A3E0;
    --success: #047857;
    --success-light: #DCFCE7;
    --success-dark: #166534;
    --warning: #92400E;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --error: #B91C1C;
    --error-light: #FEE2E2;
    --error-dark: #991B1B;
    --info: #1D4ED8;
    --info-light: #DBEAFE;
    --info-dark: #1E40AF;
    --waiver: #C2410C;
    --waiver-light: #FFEDD5;
    --waiver-dark: #EA580C;
    --intent: #6D28D9;
    --intent-light: #EDE9FE;
    --intent-dark: #7C3AED;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #475569;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    /* Aliases used by dialogs and panels rendered from script.js. They were
       referenced without ever being defined, so those surfaces painted
       transparent (the AI pipeline builder drew straight over the page). */
    --surface: var(--card-bg);
    --bg-primary: var(--card-bg);
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --chat-width: 400px;
    --detail-width: 480px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 200ms ease;
}

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

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--background);
    line-height: 1.5;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .compliance-text,
.sidebar.collapsed .nav-badge {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
    opacity: 1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent);
    display: flex;
    align-items: center;
}
.logo-icon img {
    height: 32px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

.logo-subtitle {
    font-size: 10px;
    opacity: 0.7;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    opacity: 0.6;
    cursor: pointer;
    padding: 8px;
    transition: opacity var(--transition);
}

.sidebar-toggle:hover {
    opacity: 1;
}

.nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.nav-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.nav-badge.warning {
    background: var(--waiver);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.compliance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    font-size: 11px;
}

.compliance-icon {
    color: var(--success);
}

/* Main */
.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.sidebar.collapsed+.main {
    margin-left: var(--sidebar-collapsed);
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.page-icon {
    color: var(--primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.breadcrumb-sep {
    color: var(--border);
}

.breadcrumb-current {
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicators {
    display: flex;
    gap: 12px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background);
    border-radius: var(--radius);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.healthy {
    background: var(--success);
}

.status-dot.warning {
    background: var(--warning);
}

.status-dot.critical {
    background: var(--error);
}

.status-dot.info {
    background: var(--info);
}

.status-dot.waiver {
    background: var(--waiver);
}

.status-value {
    font-weight: 600;
    color: var(--text-primary);
}

.status-label {
    color: var(--text-secondary);
}

.ai-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.ai-button:hover {
    background: var(--primary-dark);
}

.ai-icon {
    font-size: 16px;
}

.ai-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes status-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Content */
.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-badge {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--success-light);
    color: var(--success-dark);
    border-radius: var(--radius-sm);
}

.card-action {
    font-size: 13px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.card-action:hover {
    text-decoration: underline;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.card-large {
    grid-column: span 2;
}

.card-wide {
    grid-column: span 4;
}

.card-span2 {
    grid-column: span 2;
}

/* Compliance Gauges */
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.gauge-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.gauge-fill.success {
    stroke: var(--success);
}

.gauge-fill.warning {
    stroke: var(--warning);
}

.gauge-fill.error {
    stroke: var(--error);
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
}

.gauge-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Agent List */
.agent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.agent-item:hover {
    background: var(--border-light);
}

.agent-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.agent-indicator.active {
    background: var(--success);
}

.agent-indicator.monitoring {
    background: var(--info);
}

.agent-indicator.idle {
    background: var(--text-muted);
}

.agent-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-name {
    font-size: 13px;
    font-weight: 500;
}

.agent-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.agent-badge.active {
    background: var(--success-light);
    color: var(--success-dark);
}

.agent-badge.monitoring {
    background: var(--info-light);
    color: var(--info-dark);
}

.agent-badge.idle {
    background: var(--border-light);
    color: var(--text-muted);
}

.agent-tasks {
    font-size: 12px;
    color: var(--text-muted);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-dot.success {
    background: var(--success);
}

.timeline-dot.warning {
    background: var(--warning);
}

.timeline-dot.info {
    background: var(--info);
}

.timeline-dot.neutral {
    background: var(--text-muted);
}

.timeline-content {
    flex: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 500;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-intent-link {
    font-size: 11px;
    color: var(--intent);
    text-decoration: none;
    margin-left: 8px;
}

.timeline-intent-link:hover {
    text-decoration: underline;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.quick-action-icon {
    font-size: 24px;
    color: var(--primary);
}

.quick-action-btn span:last-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Waivers Alert */
.waivers-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--waiver-light);
    border: 1px solid var(--waiver);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.waivers-alert-icon {
    font-size: 24px;
    color: var(--waiver);
}

.waivers-alert-content {
    flex: 1;
}

.waivers-alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.waivers-alert-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Risk Hotspots */
.risk-hotspots-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid var(--error);
}
.risk-hotspots-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.risk-hotspot-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
}
.risk-hotspot-row:last-child { margin-bottom: 0; }
.risk-hotspot-row:hover { background: var(--background); }
.risk-hotspot-row.risk-critical { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.2); }
.risk-hotspot-row.risk-critical:hover { background: rgba(239,68,68,0.08); }
.risk-hotspot-row.risk-high { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.2); }
.risk-hotspot-row.risk-high:hover { background: rgba(245,158,11,0.08); }
.risk-hotspot-severity { flex-shrink: 0; }
.risk-hotspot-body { flex: 1; min-width: 0; }
.risk-hotspot-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.risk-hotspot-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.risk-hotspot-action { flex-shrink: 0; color: var(--text-muted); }

/* Compliance Bars */
.compliance-bars { display: flex; flex-direction: column; gap: 10px; }
.comp-bar-row { display: flex; gap: 10px; align-items: center; }
.comp-bar-label { width: 160px; font-size: 14px; color: var(--text-secondary); flex-shrink: 0; }
.comp-bar-track { flex: 1; height: 10px; background: var(--border-light); border-radius: 5px; overflow: hidden; }
.comp-bar-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.comp-bar-val { width: 40px; font-size: 14px; font-weight: 600; text-align: right; flex-shrink: 0; }

/* Health Matrix */
.health-matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.health-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    gap: 16px;
    padding: 12px 16px;
    background: var(--secondary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
}

.health-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    gap: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: none;
    align-items: center;
    cursor: pointer;
}

.health-row:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.health-row:hover {
    background: var(--background);
}

.health-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
}

.health-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.health-bar-fill.success {
    background: var(--success);
}

.health-bar-fill.warning {
    background: var(--warning);
}

.health-bar-fill.error {
    background: var(--error);
}

.health-bar-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 36px;
}

.health-waiver {
    font-size: 12px;
    color: var(--waiver);
    text-align: center;
}

/* Query Bar */
.query-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.query-icon {
    font-size: 24px;
    color: var(--primary);
}

.query-input {
    flex: 1;
    border: none;
    font-size: 14px;
    outline: none;
}

.query-input::placeholder {
    color: var(--text-muted);
}

.query-submit {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
}

.query-submit:hover {
    background: var(--primary-dark);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--secondary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
}

.data-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table tr:hover td {
    background: var(--background);
}

.data-table tr {
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-error {
    background: var(--error-light);
    color: var(--error-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-waiver {
    background: var(--waiver-light);
    color: var(--waiver-dark);
}

.badge-intent {
    background: var(--intent-light);
    color: var(--intent-dark);
}

.badge-neutral {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--card-bg);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    background: var(--card-bg);
    border: none;
    font-size: 12px;
    cursor: pointer;
}

.view-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.view-btn.active,
.view-btn:hover {
    background: var(--primary);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

/* Waiver Cards */
.waiver-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
}

.waiver-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.waiver-card.expiring {
    border-left: 4px solid var(--waiver);
}

.waiver-card.critical {
    border-left: 4px solid var(--error);
}

.waiver-priority {
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
}

.waiver-priority.critical {
    background: var(--error-light);
    color: var(--error-dark);
}

.waiver-priority.high {
    background: var(--waiver-light);
    color: var(--waiver-dark);
}

.waiver-priority.normal {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.waiver-priority.active {
    background: var(--success-light);
    color: var(--success-dark);
}

.waiver-info {
    flex: 1;
}

.waiver-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.waiver-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.waiver-expiry {
    text-align: right;
}

.waiver-expiry-label {
    font-size: 11px;
    color: var(--text-muted);
}

.waiver-expiry-value {
    font-weight: 600;
}

.waiver-expiry-value.warning {
    color: var(--waiver);
}

.waiver-expiry-value.critical {
    color: var(--error);
}

/* Intent Cards */
.intent-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
}

.intent-card:hover {
    border-color: var(--intent);
    box-shadow: var(--shadow);
}

.intent-icon {
    width: 40px;
    height: 40px;
    background: var(--intent-light);
    color: var(--intent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.intent-content {
    flex: 1;
}

.intent-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.intent-text {
    font-weight: 500;
    margin-bottom: 8px;
}

.intent-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.intent-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Control Tree */
.control-tree {
    font-size: 13px;
}

.control-section {
    margin-bottom: 16px;
}

.control-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.control-section-header:hover {
    background: var(--border-light);
}

.control-items {
    margin-left: 24px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
    margin-top: 8px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
}

.control-item:hover {
    background: var(--background);
}

.control-status {
    font-size: 16px;
}

.control-status.compliant {
    color: var(--success);
}

.control-status.partial {
    color: var(--warning);
}

.control-status.failed {
    color: var(--error);
}

.control-name {
    flex: 1;
}

.control-coverage {
    font-size: 12px;
    color: var(--text-muted);
}

/* Metrics Cards */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.metric-trend {
    font-size: 11px;
    margin-top: 4px;
}

.metric-trend.up {
    color: var(--success);
}

.metric-trend.down {
    color: var(--error);
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 400px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

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

.chat-panel:not(.open) {
    display: none;
}

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

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
}

.chat-action:hover {
    background: var(--background);
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 90%;
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message.ai .message-avatar {
    background: var(--primary-light);
    color: var(--primary);
}

.chat-message.user .message-avatar {
    background: var(--secondary);
    color: white;
}

.message-content {
    padding: 12px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    line-height: 1.5;
}

.chat-message.ai .message-content {
    background: var(--background);
}

.chat-message.user .message-content {
    background: var(--primary);
    color: white;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 16px;
}

.message-content li {
    margin-bottom: 4px;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.suggestion-btn {
    padding: 6px 10px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    cursor: pointer;
}

.chat-send:hover {
    background: var(--primary-dark);
}

/* Dynamic chat messages (added by JS) */
.chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
    align-self: flex-start;
    background: var(--background);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Thinking / analyzing indicator */
.chat-thinking {
    opacity: 0.7;
    font-style: italic;
}
.thinking-dots span {
    animation: dotPulse 1.4s infinite;
    opacity: 0;
}
.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Chat filter banner — shown on screen when navigated from chat */
.chat-filter-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--primary-dark);
}
.chat-filter-banner .btn {
    margin-left: auto;
}
.chat-filter-icon {
    font-size: 16px;
    color: var(--primary);
}

/* Chat result list */
.chat-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 2px 0;
}
.chat-list li {
    padding: 3px 0;
    font-size: 12px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border);
}
.chat-list li:last-child {
    border-bottom: none;
}
.chat-list strong {
    color: var(--primary);
}

/* Chat actions row (navigate / confirm buttons) */
.chat-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: transparent !important;
    padding: 4px 0 !important;
}
.chat-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.chat-nav-btn:hover {
    background: var(--primary);
    color: white;
}
.chat-nav-icon {
    font-size: 14px;
    font-weight: bold;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 540px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 150;
    box-shadow: var(--shadow-lg);
}

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

.detail-panel:not(.open) {
    display: none;
}

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

.detail-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.detail-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
}

.detail-close:hover {
    background: var(--background);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* Standalone Admin dialogs use the overlay as the container.  Keep these
   rules scoped so the decorative overlay inside the shared .modal is unchanged. */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.admin-modal-card h3 {
    margin: 0 0 18px;
}

.admin-modal-card > label {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.admin-modal-card input {
    width: 100%;
    padding: 9px 10px;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 920px;
    width: 94%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
}

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

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    max-height: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* Impact Preview */
.impact-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.impact-metric {
    text-align: center;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius);
}

.impact-metric-value {
    font-size: 28px;
    font-weight: 700;
}

.impact-metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.impact-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--waiver-light);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--waiver-dark);
}

.impact-details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.impact-detail-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.impact-detail-item:last-child {
    border-bottom: none;
}

.impact-detail-item strong {
    display: block;
    margin-bottom: 4px;
}

/* ========== POLICY ========== */
.policy-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.policy-list-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.policy-search {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.policy-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

.policy-search input:focus {
    border-color: var(--primary);
}

.policy-groups {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.policy-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-group-count {
    font-size: 11px;
    background: var(--border-light);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
}

.policy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    border-left: 3px solid transparent;
}

.policy-item:hover {
    background: var(--background);
}

.policy-item.selected {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.policy-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.policy-status-dot.active {
    background: var(--success);
}

.policy-status-dot.draft {
    background: transparent;
    border: 2px solid var(--text-muted);
}

.policy-status-dot.pending {
    background: var(--warning);
}

.policy-item-info {
    flex: 1;
    min-width: 0;
}

.policy-item-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.policy-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.policy-detail-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.policy-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
}

.policy-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.policy-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.policy-detail-section {
    margin-bottom: 24px;
}

.policy-detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.policy-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.policy-meta-item {
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
}

.policy-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.policy-meta-value {
    font-size: 13px;
    font-weight: 500;
}

.enforcement-mode-selector {
    display: flex;
    gap: 8px;
}

.enforcement-mode-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--card-bg);
}

.enforcement-mode-btn:hover {
    border-color: var(--primary);
}

.enforcement-mode-btn.active-mode {
    border-color: var(--primary);
    background: var(--primary-light);
}

.enforcement-mode-btn .mode-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.enforcement-mode-btn .mode-label {
    font-size: 12px;
    font-weight: 600;
    display: block;
}

.scope-chip {
    display: inline-block;
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.scope-chip.active-scope {
    background: var(--info-light);
    border-color: var(--info);
    color: var(--info-dark);
}

.rego-editor {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
}

.rego-keyword {
    color: #c084fc;
}

.rego-string {
    color: #86efac;
}

.rego-comment {
    color: #64748b;
    font-style: italic;
}

.rego-rule {
    color: #38bdf8;
}

.control-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: 20px;
    font-size: 12px;
    color: var(--success-dark);
    cursor: pointer;
}

.control-chip:hover {
    background: var(--success);
    color: white;
}

.sim-results {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sim-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
}

.sim-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.sim-result-row:last-child {
    border-bottom: none;
}

.sim-badge-pass {
    background: var(--success-light);
    color: var(--success-dark);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.sim-badge-block {
    background: var(--error-light);
    color: var(--error-dark);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.sim-badge-warn {
    background: var(--warning-light);
    color: var(--warning-dark);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

/* ========== SBOM ========== */
.sbom-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.sbom-tree-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.sbom-tree-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sbom-app-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    color: var(--text-primary);
}

.sbom-app-toggle:hover {
    background: var(--background);
}

.sbom-version-list {
    padding-left: 20px;
}

.sbom-version-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    border-left: 3px solid transparent;
}

.sbom-version-item:hover {
    background: var(--background);
}

.sbom-version-item.selected {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.sbom-version-name {
    font-weight: 500;
    flex: 1;
}

.sbom-table-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sbom-table-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sbom-table-body {
    flex: 1;
    overflow: auto;
}

.sbom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sbom-table thead th {
    background: var(--background);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.sbom-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.sbom-table tbody tr {
    cursor: pointer;
}

.sbom-table tbody tr:hover {
    background: var(--background);
}

.sbom-comp-name {
    font-weight: 500;
    color: var(--primary);
}

.sbom-ver-current {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.sbom-ver-outdated {
    color: var(--warning-dark);
}

.sbom-ver-latest {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--success-dark);
}

.sbom-eol-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.sbom-eol-ok {
    background: var(--success-light);
    color: var(--success-dark);
}

.sbom-eol-soon {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.sbom-eol-yes {
    background: var(--error-light);
    color: var(--error-dark);
}

.sbom-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.sbom-metric {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sbom-metric-value {
    font-size: 28px;
    font-weight: 700;
}

.sbom-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.sbom-impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.sbom-impact-card {
    text-align: center;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
}

.sbom-impact-val {
    font-size: 20px;
    font-weight: 700;
}

.sbom-impact-lbl {
    font-size: 11px;
    color: var(--text-secondary);
}

.sbom-detail-cve-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sbom-cve-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.sbom-cve-item:last-child {
    border-bottom: none;
}

.sbom-cve-id {
    font-weight: 600;
    color: var(--primary);
    min-width: 130px;
}

.sbom-diff {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 12px;
}

.sbom-diff-line {
    padding: 4px 12px;
}

.sbom-diff-add {
    background: #dcfce7;
    color: #166534;
}

.sbom-diff-remove {
    background: #fee2e2;
    color: #991b1b;
}

.sbom-diff-ctx {
    background: var(--background);
    color: var(--text-secondary);
}

/* ========== AUDIT ========== */
.audit-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.audit-stat {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.audit-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.audit-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.audit-integrity-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--success-dark);
}

.audit-integrity-bar .int-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.audit-table thead th {
    background: var(--secondary);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-table thead th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.audit-table thead th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.audit-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.audit-table tbody tr {
    cursor: pointer;
}

.audit-table tbody tr:hover {
    background: var(--background);
}

.audit-actor-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-actor-type {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.audit-actor-type.human {
    background: var(--info-light);
    color: var(--info-dark);
}

.audit-actor-type.ai {
    background: var(--intent-light);
    color: var(--intent-dark);
}

.audit-actor-type.system {
    background: var(--border-light);
    color: var(--text-muted);
}

.audit-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

.audit-intent-link {
    font-size: 11px;
    color: var(--intent);
    cursor: pointer;
}

.audit-intent-link:hover {
    text-decoration: underline;
}

.audit-diff {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.audit-diff-line {
    padding: 4px 12px;
}

.audit-diff-add {
    background: #dcfce7;
    color: #166534;
}

.audit-diff-remove {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== APPROVALS ========== */
.approval-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
}

.approval-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.approval-card.priority-critical {
    border-left: 4px solid var(--error);
}

.approval-card.priority-high {
    border-left: 4px solid var(--waiver);
}

.approval-card.priority-normal {
    border-left: 4px solid var(--info);
}

.approval-type-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.approval-type-icon.type-policy {
    background: var(--primary-light);
    color: var(--primary);
}

.approval-type-icon.type-waiver {
    background: var(--waiver-light);
    color: var(--waiver);
}

.approval-type-icon.type-pipeline {
    background: var(--success-light);
    color: var(--success-dark);
}

.approval-type-icon.type-sbom {
    background: var(--info-light);
    color: var(--info-dark);
}

.approval-type-icon.type-security {
    background: var(--error-light);
    color: var(--error-dark);
}

.approval-content {
    flex: 1;
}

.approval-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.approval-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.approval-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    align-items: center;
}

.approval-sla {
    font-weight: 600;
}

.approval-sla.overdue {
    color: var(--error);
}

.approval-sla.urgent {
    color: var(--waiver);
}

.approval-chain-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-left: 2px solid var(--border);
    margin-left: 10px;
    padding-left: 16px;
    position: relative;
}

.approval-chain-step::before {
    content: '';
    position: absolute;
    left: -6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.approval-chain-step.step-done::before {
    background: var(--success);
}

.approval-chain-step.step-current::before {
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.appr-diff-line {
    padding: 4px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.appr-diff-add {
    background: #dcfce7;
    color: #166534;
}

.appr-diff-remove {
    background: #fee2e2;
    color: #991b1b;
}

.appr-diff-ctx {
    background: var(--background);
    color: var(--text-secondary);
}

.btn-approve {
    background: var(--success);
    color: white;
}

.btn-approve:hover {
    background: var(--success-dark);
}

.btn-reject {
    background: var(--error);
    color: white;
}

.btn-reject:hover {
    background: var(--error-dark);
}

/* ========== CONTROLS ========== */
.ctrl-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ctrl-stat {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ctrl-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.ctrl-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.ctrl-framework-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ctrl-framework-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    background: var(--card-bg);
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
}

.ctrl-framework-tab:last-child {
    border-right: none;
}

.ctrl-framework-tab:hover {
    background: var(--background);
}

.ctrl-framework-tab.active-tab {
    background: var(--primary);
    color: white;
}

.ctrl-framework-tab.active-tab .tab-score {
    color: white !important;
}

.ctrl-framework-tab .tab-score {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.ctrl-framework-tab .tab-name {
    display: block;
    font-size: 11px;
}

.ctrl-section-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.ctrl-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--background);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.ctrl-section-head:hover {
    background: var(--border-light);
}

.ctrl-section-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
    width: 16px;
}

.ctrl-section-arrow.open {
    transform: rotate(90deg);
}

.ctrl-section-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.ctrl-section-bar {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.ctrl-section-fill {
    height: 100%;
    border-radius: 3px;
}

.ctrl-section-fill.high {
    background: var(--success);
}

.ctrl-section-fill.mid {
    background: var(--warning);
}

.ctrl-section-fill.low {
    background: var(--error);
}

.ctrl-section-pct {
    font-size: 12px;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

.ctrl-row {
    display: grid;
    grid-template-columns: 28px 2fr 100px 120px 60px 60px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

.ctrl-row:last-child {
    border-bottom: none;
}

.ctrl-row:hover {
    background: var(--background);
}

.ctrl-status-icon {
    font-size: 18px;
    text-align: center;
}

.ctrl-status-icon.compliant {
    color: var(--success);
}

.ctrl-status-icon.partial {
    color: var(--warning);
}

.ctrl-status-icon.failed {
    color: var(--error);
}

.ctrl-status-icon.waived {
    color: var(--waiver);
}

.ctrl-id {
    font-weight: 600;
    font-size: 13px;
}

.ctrl-name-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.ctrl-pipe-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.ctrl-pipe-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--success);
}

.ctrl-pipe-count {
    font-size: 11px;
    color: var(--text-muted);
}

.ctrl-policy-chip {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--info-light);
    color: var(--info-dark);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.ctrl-detail-evidence {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ctrl-evidence-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.ctrl-evidence-item:last-child {
    border-bottom: none;
}

.ctrl-evidence-item:hover {
    background: var(--background);
}

.ctrl-evidence-type {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ctrl-evidence-type.ev-audit {
    background: var(--success-light);
    color: var(--success-dark);
}

.ctrl-evidence-type.ev-intent {
    background: var(--intent-light);
    color: var(--intent-dark);
}

.ctrl-evidence-type.ev-approval {
    background: var(--info-light);
    color: var(--info-dark);
}

.ctrl-evidence-type.ev-pipeline {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========== WAIVERS ========== */
.waiver-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.waiver-stat {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.waiver-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.waiver-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.waiver-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.waiver-table thead th {
    background: var(--secondary);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.waiver-table thead th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.waiver-table thead th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.waiver-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.waiver-table tbody tr {
    cursor: pointer;
}

.waiver-table tbody tr:hover {
    background: var(--background);
}

.waiver-table tbody tr.row-critical {
    border-left: 4px solid var(--error);
}

.waiver-table tbody tr.row-expiring {
    border-left: 4px solid var(--waiver);
}

.waiver-expiry-cell.exp-critical {
    color: var(--error);
    font-weight: 600;
}

.waiver-expiry-cell.exp-warning {
    color: var(--waiver);
    font-weight: 600;
}

.waiver-detail-justification {
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 4px solid var(--waiver);
}

.waiver-comp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.waiver-comp-item:last-child {
    border-bottom: none;
}

.waiver-chain-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-left: 2px solid var(--border);
    margin-left: 10px;
    padding-left: 16px;
    position: relative;
}

.waiver-chain-step::before {
    content: '';
    position: absolute;
    left: -6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.waiver-chain-step.wc-done::before {
    background: var(--success);
}

.waiver-chain-step.wc-current::before {
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.waiver-cross-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.waiver-cross-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--background);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
}

.waiver-cross-link:hover {
    background: var(--primary-light);
}


/* ========== RELEASE ORCHESTRATOR ========== */
.rel-layout {
    display: flex;
    gap: 20px;
}

.rel-list-panel {
    width: 320px;
    flex-shrink: 0;
}

.rel-main-panel {
    flex: 1;
    min-width: 0;
}

.rel-list-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .15s;
    background: var(--card-bg);
}

.rel-list-item:hover {
    border-color: var(--primary);
}

.rel-list-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.rel-list-item .rel-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.rel-list-item .rel-item-app {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.rel-list-item .rel-item-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.rel-list-item .rel-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.rel-pipeline-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.rel-pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.rel-pipeline-title {
    font-size: 18px;
    font-weight: 700;
}

.rel-pipeline-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.rel-stage-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.rel-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    position: relative;
    z-index: 1;
}

.rel-stage-node {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    border: 3px solid var(--border);
    background: var(--card-bg);
    transition: all .4s;
    position: relative;
}

.rel-stage-node.pending {
    border-color: var(--border);
    color: var(--text-muted);
}

.rel-stage-node.running,
.rel-stage-node.testing {
    border-color: var(--info);
    color: var(--info);
    animation: pulse-ring 1.5s infinite, stage-blink 1s steps(2, end) infinite;
}

.rel-stage-node.passed {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.rel-stage-node.failed {
    border-color: var(--error);
    background: var(--error);
    color: white;
}

.rel-stage-node.blocked {
    border-color: var(--warning);
    color: var(--warning);
}

.rel-stage-node.skipped {
    border-color: var(--border);
    color: var(--text-muted);
    opacity: 0.5;
}

@keyframes pulse-ring {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4)
    }

    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0)
    }
}

@keyframes stage-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .rel-stage-node.running,
    .rel-stage-node.testing {
        animation: none;
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18);
    }
}

.rel-stage-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    color: var(--text-secondary);
    max-width: 100px;
}

.rel-stage-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.rel-stage-type {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rel-connector {
    flex: 1;
    min-width: 30px;
    height: 3px;
    background: var(--border);
    margin-top: 24px;
    position: relative;
}

.rel-connector.done {
    background: var(--success);
}

.rel-connector.active {
    background: linear-gradient(90deg, var(--success), var(--info));
}

.rel-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    position: relative;
    z-index: 1;
}

.rel-gate-node {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px dashed var(--warning);
    background: var(--warning-light);
    color: var(--warning-dark);
    cursor: pointer;
    transition: all .2s;
    margin-top: 6px;
}

.rel-gate-node:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.rel-gate-node.approved {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success-dark);
    cursor: default;
}

.rel-gate-node.pending-gate {
    border-color: var(--text-muted);
    background: var(--background);
    color: var(--text-muted);
    cursor: default;
}

.rel-gate-label {
    font-size: 9px;
    font-weight: 600;
    margin-top: 6px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rel-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.rel-detail-card {
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.rel-detail-card h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.rel-evidence-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}

.rel-evidence-row:last-child {
    border-bottom: none;
}

.rel-progress-log {
    max-height: 420px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--secondary);
    color: #a5d6a7;
    padding: 12px;
    border-radius: var(--radius);
}

.rel-progress-log div {
    padding: 2px 0;
}

.rel-progress-log .log-time {
    color: #64B5F6;
}

.rel-progress-log .log-pass {
    color: #81C784;
}

.rel-progress-log .log-fail {
    color: #E57373;
}

.rel-progress-log .log-info {
    color: #FFD54F;
}

.rel-filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}


/* Responsive */
@media (max-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-large,
    .card-wide {
        grid-column: span 2;
    }

    .card-span2 {
        grid-column: span 2;
    }

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

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

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .logo-text,
    .sidebar .nav-label,
    .sidebar .nav-section-title,
    .sidebar .compliance-text,
    .sidebar .nav-badge {
        display: none;
    }

    .main {
        margin-left: var(--sidebar-collapsed);
    }

    .status-indicators {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .sidebar.collapsed + .main {
        margin-left: 0;
    }

    .header { padding: 0 12px; }
    .header-right { gap: 8px; }
    .ai-button { padding: 10px; }
    .ai-button > span:nth-child(2) { display: none; }
    .content { padding: 12px; }
    .card { padding: 16px; }

    .dashboard-grid > *,
    .screen,
    .risk-hotspots-card {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-grid,
    .card-large,
    .card-wide,
    .card-span2 {
        grid-template-columns: 1fr;
        grid-column: span 1;
    }

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

    .compliance-grid { grid-template-columns: 1fr; }
    .risk-hotspot-row { align-items: flex-start; flex-wrap: wrap; }

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

    .chat-panel,
    .detail-panel {
        width: 100%;
    }
}

/* ========================================
   Login Screen
   ======================================== */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0066CC 0%, #1E3A5F 50%, #004D99 100%);
    font-family: 'Inter', sans-serif;
}

.login-screen.hidden {
    display: none;
}

.login-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    padding: 48px 40px;
    width: 420px;
    max-width: 90vw;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.login-logo-icon {
    font-size: 32px;
    color: #0066CC;
    display: flex;
    align-items: center;
}
.login-logo-icon img {
    height: 40px;
    object-fit: contain;
}

.login-logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 2px;
}

.login-logo-subtitle {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: #0066CC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
}

.login-btn:hover {
    background: #004D99;
}

.login-btn:disabled {
    background: #94A3B8;
    cursor: not-allowed;
}

.login-error {
    color: #EF4444;
    font-size: 13px;
    text-align: center;
    min-height: 20px;
}

.login-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94A3B8;
}

/* ── Toggle Switch ────────────────────────────────────────────────────── */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.toggle-switch input { display: none; }
.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}
.toggle-slider::after {
    content: '';
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--warning);
}
.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* ── Integration Card ─────────────────────────────────────────────────── */
.integration-card {
    transition: box-shadow 0.2s ease;
}
.integration-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cp-step-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:18px 0; }
.cp-step-strip span { display:flex; align-items:center; gap:7px; min-height:36px; padding:7px 9px; border:1px solid var(--border); border-radius:7px; font-size:11px; color:var(--text-muted); background:var(--bg-secondary); }
.cp-step-strip b { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; flex:none; border-radius:50%; background:var(--primary); color:#fff; font-size:10px; }
.cp-connector-list { display:grid; gap:8px; }
.cp-connector-card, .cp-candidate, .cp-readiness-header, .cp-remediation { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 12px; border:1px solid var(--border); border-radius:7px; }
.cp-onboarding-form { display:grid; gap:12px; }
.cp-onboarding-form label { display:grid; gap:5px; color:var(--text-muted); font-size:12px; font-weight:600; }
.cp-onboarding-form input, .cp-onboarding-form select { width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:6px; background:var(--bg-primary); color:var(--text-primary); }
.cp-onboarding-form .cp-checkbox { display:flex; grid-template-columns:auto 1fr; align-items:center; }
.cp-onboarding-form .cp-checkbox input { width:auto; }
.cp-step-title { margin:0; font-size:14px; font-weight:700; }
.cp-help { padding:9px 10px; border-radius:6px; background:var(--bg-secondary); color:var(--text-muted); font-size:11px; }
.cp-progress-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.cp-remediation { margin:6px 0; font-size:11px; }
.cp-remediation code { color:var(--text-primary); }
.cp-ok { padding:10px; border-radius:6px; background:var(--success-light,#ecfdf5); color:var(--success); font-size:12px; }
.cp-candidate { margin:6px 0; }
.cp-candidate span { display:grid; gap:2px; }
.cp-candidate small { color:var(--text-muted); }
@media (max-width:900px) { .cp-step-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* ── Stage Detail Modals ─────────────────────────────────────────────── */

/* Clickable stage/gate nodes */
.rel-stage-node.clickable,
.rel-gate-node.clickable {
    cursor: pointer;
}
.rel-stage-node.clickable:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.rel-gate-node.clickable:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* Gate status colors */
.rel-gate-node.rejected {
    border-style: solid;
    border-color: var(--error);
    background: rgba(239,68,68,0.08);
    color: var(--error);
}
.rel-gate-node.partially_approved {
    border-style: dashed;
    border-color: var(--info);
    background: rgba(59,130,246,0.06);
    color: var(--info);
}

.rel-gate-node.locked {
    opacity: 0.45;
    filter: grayscale(1);
}

.gate-order-lock {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
}

/* Severity grid (for SAST/SCA findings) */
.severity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.severity-cell {
    text-align: center;
    padding: 10px 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.severity-cell .sev-count {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.severity-cell .sev-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 2px;
}
.severity-cell.critical { border-color: #dc2626; color: #dc2626; background: rgba(220,38,38,0.05); }
.severity-cell.high { border-color: #ea580c; color: #ea580c; background: rgba(234,88,12,0.05); }
.severity-cell.medium { border-color: #d97706; color: #d97706; background: rgba(217,119,6,0.05); }
.severity-cell.low { border-color: #65a30d; color: #65a30d; background: rgba(101,163,13,0.05); }

/* Coverage bar */
.coverage-bar-wrap {
    position: relative;
    height: 20px;
    background: var(--background);
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
    border: 1px solid var(--border);
}
.coverage-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}
.coverage-bar-fill.good { background: var(--success); }
.coverage-bar-fill.warn { background: var(--warning); }
.coverage-bar-fill.bad { background: var(--error); }
.coverage-threshold {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--text-primary);
    z-index: 2;
}
.coverage-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-top: 2px;
}

/* Findings table */
.findings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.findings-table th {
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    padding: 6px 8px;
    border-bottom: 2px solid var(--border);
}
.findings-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.findings-table tr:last-child td { border-bottom: none; }
.findings-table .sev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.sev-badge.critical { background: #dc2626; color: white; }
.sev-badge.high { background: #ea580c; color: white; }
.sev-badge.medium { background: #d97706; color: white; }
.sev-badge.low { background: #65a30d; color: white; }

/* Gate checklist */
.gate-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.gate-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.gate-checklist li:last-child { border-bottom: none; }
.gate-checklist .check-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.gate-checklist .check-ok { color: var(--success); }
.gate-checklist .check-fail { color: var(--error); }

/* Gate signature table */
.sig-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 12px;
}
.sig-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.sig-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

/* Gate action form (approve/reject) */
.gate-action-form {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}
.gate-action-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}
.gate-action-form input[type="password"],
.gate-action-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text-primary);
    margin-bottom: 10px;
    box-sizing: border-box;
}
.gate-action-form textarea { resize: vertical; min-height: 60px; }
.gate-action-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.gate-action-btns .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}
.btn-approve-gate {
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-approve-gate:hover { opacity: 0.9; }
.btn-reject-gate {
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-reject-gate:hover { opacity: 0.9; }

/* Regulatory control badges */
.control-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.control-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    background: rgba(59,130,246,0.08);
    color: var(--primary);
    border: 1px solid rgba(59,130,246,0.2);
}

/* Metrics inline grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.metric-cell {
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}
.metric-cell .metric-val {
    font-size: 18px;
    font-weight: 700;
}
.metric-cell .metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Stage status inline badge */
.stage-status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
}
.stage-status-badge.passed,
.stage-status-badge.approved { background: rgba(34,197,94,0.1); color: var(--success); }
.stage-status-badge.failed,
.stage-status-badge.rejected { background: rgba(239,68,68,0.1); color: var(--error); }
.stage-status-badge.pending { background: rgba(156,163,175,0.15); color: var(--text-muted); }
.stage-status-badge.running { background: rgba(59,130,246,0.1); color: var(--info); }
.stage-status-badge.partially_approved { background: rgba(59,130,246,0.1); color: var(--info); }
.stage-status-badge.blocked { background: rgba(245,158,11,0.1); color: var(--warning); }
.stage-status-badge.skipped { background: rgba(156,163,175,0.1); color: var(--text-muted); }

/* ── Dynamic Grid (AI results) ────────────────────────── */
.dynamic-grid { margin: 1rem 0; }
.dynamic-grid table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dynamic-grid th {
  background: var(--bg-tertiary, #f3f4f6);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary, #6b7280);
  border-bottom: 2px solid var(--border, #e5e7eb);
}
.dynamic-grid td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}
.dynamic-grid tbody tr:hover { background: var(--bg-secondary, #f9fafb); }
.dynamic-grid .agg-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.dynamic-grid-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dynamic-grid-summary .stat {
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  min-width: 120px;
  text-align: center;
}
.dynamic-grid-summary .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
}
.dynamic-grid-summary .stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}
.dynamic-grid-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary, #111827);
}
.dynamic-grid-meta {
  font-size: 0.72rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 0.5rem;
}

/* ── Admin Console Sub-Tabs ──────────────────────────────────────────── */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}
.admin-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.admin-tab:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ── Permission Matrix ───────────────────────────────────────────────── */
.perm-matrix-wrap { overflow-x: auto; margin-top: 16px; }
.perm-matrix { border-collapse: collapse; font-size: 12px; min-width: 600px; width: 100%; }
.perm-matrix th {
    background: var(--secondary);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.perm-matrix th.role-col { text-align: center; min-width: 80px; max-width: 120px; }
.perm-matrix td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.perm-matrix td.perm-cell { text-align: center; }
.perm-matrix tr:hover td { background: var(--background); }
.perm-group-header td {
    background: var(--border-light, #f3f4f6);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 6px 12px;
}

/* ── Admin Form Fields ───────────────────────────────────────────────── */
.admin-form-field { margin-bottom: 14px; }
.admin-form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.policy-control-options {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
}
.policy-control-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 8px;
    font-size: 12px;
    border-radius: 4px;
}
.policy-control-option:hover { background: var(--background); }
.policy-control-option[hidden] { display: none; }
.admin-help { display: block; margin-top: 5px; color: var(--text-muted); font-size: 11px; }
.admin-form-input, .admin-form-select, .admin-form-textarea {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13px; background: var(--card-bg); color: var(--text-primary);
    box-sizing: border-box; font-family: 'Inter', sans-serif;
}
.admin-form-input:focus, .admin-form-select:focus, .admin-form-textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}
.admin-form-textarea { resize: vertical; min-height: 72px; }
.admin-error {
    margin-top: 10px; font-size: 12px; color: var(--error);
    padding: 8px 12px; background: var(--error-light, #fef2f2);
    border-radius: var(--radius-sm); border-left: 3px solid var(--error); display: none;
}
.admin-error.visible { display: block; }

/* ── SoD Rule Cards ──────────────────────────────────────────────────── */
.sod-rule-card {
    padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card-bg); margin-bottom: 12px;
    display: flex; align-items: center; gap: 16px;
}
.sod-rule-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.sod-rule-meta { flex: 1; }
.sod-rule-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sod-rule-desc { font-size: 12px; color: var(--text-secondary); }
.sod-roles-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── Export Status Card ─────────────────────────────────────────────── */
.export-status-card {
    padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card-bg); text-align: center;
}
.export-status-icon { font-size: 32px; margin-bottom: 8px; }
.export-status-label { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.export-status-sub { font-size: 12px; color: var(--text-secondary); }

/* ── Admin Sub-table ─────────────────────────────────────────────────── */
.sub-table-wrap { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sub-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sub-table th {
    background: var(--background); padding: 8px 12px; text-align: left;
    font-size: 11px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.sub-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light, #f3f4f6); vertical-align: middle; }
.sub-table tr:last-child td { border-bottom: none; }
/* ═══════════════════════════════════════════════════════════════════════════
   Cross-App Release Orchestration
   Dependency graph + wave plan. Colours come from the shared tokens above so
   the screen tracks the theme rather than carrying its own palette.
   ═══════════════════════════════════════════════════════════════════════════ */

.xa-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1400px) {
    .xa-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .xa-inspector-pane { grid-column: 1 / -1; }
}

.xa-pane {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.xa-pane-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--border-light);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.xa-pane-body { padding: 10px 12px; }
.xa-scroll { max-height: 620px; overflow: auto; }

/* ── app catalog ─────────────────────────────────────────────────────────── */
.xa-search {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}
.xa-app-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}
.xa-app-row:hover { background: var(--border-light); }
.xa-app-row.sel { background: var(--primary-light); border-color: var(--primary); }
.xa-app-row .xa-nm { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.xa-app-row .xa-meta {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    font-size: 11px; color: var(--text-secondary); margin-top: 2px;
}
.xa-src {
    padding: 1px 5px; border-radius: 3px; font-weight: 700;
    font-size: 10px; text-transform: uppercase; letter-spacing: .03em;
}
.xa-src.rez  { background: var(--info-light);    color: var(--info-dark); }
.xa-src.snow { background: var(--intent-light);  color: var(--intent-dark); }
.xa-src.inf  { background: var(--warning-light); color: var(--warning-dark); }
.xa-src.man  { background: var(--border);        color: var(--text-secondary); }
.xa-nopipe { color: var(--warning-dark); font-weight: 600; }

/* ── graph canvas ────────────────────────────────────────────────────────── */
.xa-canvas-wrap { position: relative; overflow: auto; max-height: 620px; padding: 14px; }
/* The wires layer is never a hit target. Two things ruled out SVG hit-testing
   here: pointer-events:none on the <svg> root makes the whole subtree
   unhittable (a child's pointer-events:stroke does not rescue it), and making
   the root hittable puts it over the nodes, where it swallows every drag.
   Wire clicks are therefore resolved geometrically with isPointInStroke. */
.xa-wires { position: absolute; inset: 0; pointer-events: none; }
.xa-wires .xa-wire { fill: none; stroke: var(--border); stroke-width: 1.6; }
.xa-wires .xa-wire.hot { stroke: var(--primary); stroke-width: 2.4; }
.xa-wires .xa-wire.cyc { stroke: var(--error); stroke-width: 2.4; stroke-dasharray: 5 3; }
.xa-wires .xa-wire.inf { stroke-dasharray: 3 3; stroke: var(--warning); }
.xa-wires .xa-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }

.xa-waves { display: flex; gap: 34px; align-items: flex-start; position: relative; min-height: 120px; }
.xa-wave { display: flex; flex-direction: column; gap: 10px; min-width: 190px; }
.xa-wave-hd {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-secondary); white-space: nowrap;
}
.xa-wave-hd .xa-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.xa-node {
    position: relative; z-index: 1;
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: 6px; padding: 8px 10px; cursor: pointer;
}
.xa-node:hover { border-color: var(--primary); }
.xa-node.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.xa-node.s-running   { border-left-color: var(--info); }
.xa-node.s-succeeded { border-left-color: var(--success); }
.xa-node.in-cycle    { border-color: var(--error); }
.xa-n-nm { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.xa-n-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.xa-pill { padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 700; background: var(--border); color: var(--text-secondary); }
.xa-pill.running   { background: var(--info-light);    color: var(--info-dark); }
.xa-pill.succeeded { background: var(--success-light); color: var(--success-dark); }

/* ── inspector ───────────────────────────────────────────────────────────── */
.xa-insp-sec { padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.xa-insp-sec:last-child { border-bottom: 0; }
.xa-insp-sec h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.xa-kv { display: grid; grid-template-columns: 78px 1fr; gap: 4px 10px; margin: 0; font-size: 12px; }
.xa-kv dt { color: var(--text-secondary); }
.xa-kv dd { margin: 0; color: var(--text-primary); word-break: break-word; }
.xa-edge-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 0; }
.xa-ename { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.xa-eprov { font-size: 11px; color: var(--text-secondary); }
.xa-x {
    border: 1px solid var(--border); background: var(--card-bg); color: var(--error);
    border-radius: 4px; width: 22px; height: 22px; cursor: pointer; flex-shrink: 0; line-height: 1;
}
.xa-x:hover { background: var(--error-light); border-color: var(--error); }
.xa-hint { font-size: 12px; color: var(--text-secondary); margin: 0; }

/* ── validation ──────────────────────────────────────────────────────────── */
.xa-issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; font-size: 12px; margin-bottom: 6px; }
.xa-issue .xa-ico { font-weight: 800; flex-shrink: 0; }
.xa-issue.block { background: var(--error-light);   color: var(--error-dark); }
.xa-issue.warn  { background: var(--warning-light); color: var(--warning-dark); }
.xa-issue.good  { background: var(--success-light); color: var(--success-dark); }
.xa-issue button {
    border: 1px solid currentColor; background: transparent; color: inherit;
    border-radius: 4px; padding: 1px 7px; font-size: 11px; cursor: pointer; margin-left: 4px;
}
.xa-plan { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.xa-wchip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; font-weight: 600; }
.xa-hash { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 11px; color: var(--text-muted); }
.xa-status { padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; background: var(--border); color: var(--text-secondary); }
.xa-status.running { background: var(--info-light);    color: var(--info-dark); }
.xa-status.done    { background: var(--success-light); color: var(--success-dark); }
.xa-empty { padding: 34px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* Visible failure state for a screen whose backend call failed. Deliberately
   prominent: the alternative this replaced was rendering placeholder rows,
   which made a broken backend look like a working one. */
.screen-load-error {
    max-width: 640px;
    margin: 48px auto;
    padding: 28px 32px;
    border: 1px solid var(--danger, #b91c1c);
    border-left: 4px solid var(--danger, #b91c1c);
    border-radius: 8px;
    background: var(--surface, #fff);
}
.screen-load-error h3 { margin: 0 0 10px; font-size: 17px; color: var(--danger, #b91c1c); }
.screen-load-error p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.screen-load-error .screen-load-error-hint { opacity: 0.75; font-size: 13px; }
.screen-load-error button { margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Release Value Stream
   Shares the pane/wave chrome with Cross-App above and adds release execution:
   a per-node "who triggered this" badge, run identity, and shared-material
   proof. Every colour is a token, so this screen tracks the theme.

   One deliberate colour decision: Helio-scheduled nodes are blue and
   GoCD-triggered nodes are graphite. The blue is not "better" — it marks the
   only two or three nodes in a graph that Helio is allowed to act on, which is
   the invariant the whole design rests on.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The stream is the subject of the screen and grows horizontally with every
   added stage, so it gets the full width. The inspector moves below it and
   lays its sections out in columns, which reads better than a tall thin rail. */
.gc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.gc-release-context,
.gc-command-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    margin: 0 0 14px; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card-bg);
}
.gc-release-context label { font-size: 12px; font-weight: 700; }
.gc-release-context select { min-width: min(520px, 70vw); }
.gc-release-context code { color: var(--text-muted); }
.gc-command-bar { margin: 0 16px 14px; }
.gc-graph-filters {
    margin: 0 16px 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--background);
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}
.gc-graph-filters label {
    display: grid;
    gap: 3px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.gc-warning-panel {
    margin: 0 16px 12px;
    padding: 10px 12px;
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    background: var(--warning-light);
    color: var(--warning-dark);
    font-size: 12px;
}
.gc-filter-empty {
    min-width: 360px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}
.gc-node.critical-blocker {
    outline: 2px dashed var(--error);
    outline-offset: 3px;
}
.gc-node.critical-blocker::before {
    content: "blocking path";
    display: block;
    margin-bottom: 5px;
    color: var(--error-dark);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.gc-node-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Disabled actions must not retain primary blue or its hover treatment. */
.gc-node-actions .btn:disabled,
.gc-command-bar .btn:disabled,
.gc-action-overlay .btn:disabled {
    background: var(--border-light);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    box-shadow: none;
}
.gc-node:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 1200px) {
    .gc-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Scenario picker as a top strip rather than a column: the value stream is the
   subject of this screen and needs the horizontal room, and "which showcase am
   I looking at" is a mode switch, not a working pane. */
.gc-scn-strip {
    display: flex; gap: 10px; align-items: stretch;
    margin: 0 16px 14px; padding-bottom: 4px;
    overflow-x: auto;
}

/* ── the "this is not real" banner ───────────────────────────────────────── */
.gc-sim-banner {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 0 16px 14px; padding: 10px 12px;
    border: 1px dashed var(--intent); border-radius: 6px;
    background: var(--intent-light); color: var(--intent-dark);
    font-size: 12px; line-height: 1.5;
}
.gc-sim-tag {
    flex-shrink: 0; padding: 2px 8px; border-radius: 10px;
    background: var(--intent); color: #fff;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}

/* ── scenario picker ─────────────────────────────────────────────────────── */
.gc-scn {
    display: flex; flex-direction: column; text-align: left; cursor: pointer;
    flex: 1 1 0; min-width: 236px;
    padding: 10px;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px;
    font: inherit;
}
.gc-scn .gc-scn-tags { margin-top: auto; padding-top: 6px; }
.gc-scn:hover { border-color: var(--primary); }
.gc-scn.sel { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 1px var(--primary); }
.gc-scn-nm { display: block; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.gc-scn-blurb { display: block; font-size: 11px; line-height: 1.45; color: var(--text-secondary); margin-top: 3px; }
.gc-scn-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gc-tag {
    padding: 1px 6px; border-radius: 3px; background: var(--border-light);
    border: 1px solid var(--border); color: var(--text-secondary);
    font-size: 10px; font-weight: 600;
}
.gc-scn.sel .gc-tag { background: var(--card-bg); }

/* ── canvas ──────────────────────────────────────────────────────────────── */
.gc-canvas-wrap { position: relative; overflow: auto; max-height: 560px; padding: 16px; }
.gc-wires { position: absolute; inset: 0; pointer-events: none; }
.gc-wires .gc-wire { fill: none; stroke: var(--border); stroke-width: 1.6; }
.gc-wires .gc-wire.truefanin { stroke-width: 3.2; }
.gc-wires .gc-wire.proven { stroke: var(--success); }
.gc-wires .gc-wire.bad { stroke: var(--error); stroke-dasharray: 5 3; }
.gc-wires .gc-wire.hot { stroke: var(--primary); stroke-width: 3.2; }
/* Lineage labels live above the cards, not in the SVG behind them. The string
   is the audit claim — "this child proved THAT parent run" — so it must stay
   readable wherever the curve's midpoint happens to fall. */
.gc-wire-labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.gc-wire-label {
    position: absolute; transform: translate(-100%, -50%); white-space: nowrap;
    padding: 1px 5px; border-radius: 3px;
    background: var(--card-bg); border: 1px solid var(--border);
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 9px; font-weight: 600; color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.gc-waves { display: flex; gap: 64px; align-items: flex-start; position: relative; min-height: 140px; }
.gc-wave { display: flex; flex-direction: column; gap: 14px; min-width: 184px; }

/* ── node card ───────────────────────────────────────────────────────────── */
.gc-node {
    position: relative; z-index: 1; cursor: pointer;
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted); border-radius: 6px; padding: 9px 10px;
}
.gc-node:hover { border-color: var(--primary); }
.gc-node.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.gc-node.terminal { border-style: solid; border-width: 1px 1px 1px 3px; outline: 1px dashed var(--border); outline-offset: 2px; }
.gc-node.s-running    { border-left-color: var(--info); }
.gc-node.s-correlated { border-left-color: var(--info); }
.gc-node.s-passed     { border-left-color: var(--success); }
.gc-node.s-failed,
.gc-node.s-blocked,
.gc-node.s-ambiguous  { border-left-color: var(--error); }
.gc-node.s-accepted,
.gc-node.s-unknown    { border-left-color: var(--warning); }
.gc-node.s-manual     { border-left-color: var(--intent); }
.gc-node.s-runner     { border-left-color: var(--warning, #b7791f); border-left-style: dashed; }
.gc-node.s-locked     { border-left-color: var(--waiver); }

.gc-n-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gc-n-nm { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.gc-n-ctr {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 12px; font-weight: 700; color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.gc-n-trig {
    display: block; margin: 5px 0; padding: 2px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 700; letter-spacing: .02em; width: fit-content;
}
.gc-n-trig.helio { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary); }
.gc-n-trig.gocd  { background: var(--border-light); color: var(--text-secondary); border: 1px solid var(--border); }
.gc-n-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.gc-n-label { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 10px; color: var(--text-secondary); }

.gc-pill { padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; background: var(--border); color: var(--text-secondary); }
.gc-pill.correlated, .gc-pill.running   { background: var(--info-light);    color: var(--info-dark); }
.gc-pill.passed                          { background: var(--success-light); color: var(--success-dark); }
.gc-pill.accepted, .gc-pill.unknown,
.gc-pill.prepared, .gc-pill.preflight    { background: var(--warning-light); color: var(--warning-dark); }
.gc-pill.failed, .gc-pill.blocked,
.gc-pill.ambiguous                       { background: var(--error-light);   color: var(--error-dark); }
.gc-pill.manual                          { background: var(--intent-light);  color: var(--intent-dark); }
.gc-pill.locked                          { background: var(--waiver-light);  color: var(--waiver-dark); }

.gc-role, .gc-shape {
    padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary);
}
.gc-role.entry     { border-color: var(--primary); color: var(--primary-dark); }
.gc-role.terminal  { border-color: var(--text-secondary); color: var(--text-primary); }
.gc-shape.fanout   { border-color: var(--accent); color: var(--info-dark); }
.gc-shape.truefanin { border-color: var(--success); color: var(--success-dark); background: var(--success-light); }
.gc-shape.join     { border-color: var(--border); }
.gc-shape.manual   { border-color: var(--intent); color: var(--intent-dark); }
.gc-shape.locked   { border-color: var(--waiver); color: var(--waiver-dark); }

.gc-mat {
    margin-top: 6px; font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 10px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gc-failcode {
    margin-top: 6px; padding: 2px 6px; border-radius: 3px;
    background: var(--error-light); color: var(--error-dark);
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 10px; font-weight: 700;
    /* A snake_case code broken mid-token reads as corrupted text. Clip it on
       the card instead; the inspector carries the code in full. */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── shared-material proof ───────────────────────────────────────────────── */
.gc-proof { margin-top: 7px; border-top: 1px solid var(--border-light); padding-top: 6px; }
.gc-proof-hd { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-bottom: 4px; }
.gc-proof-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 2px 5px; border-radius: 3px; font-size: 10px; margin-bottom: 2px;
}
.gc-proof-row.ok { background: var(--success-light); color: var(--success-dark); }
.gc-proof-row.no { background: var(--error-light);   color: var(--error-dark); }
.gc-proof-row .gc-rev { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-weight: 700; }
.gc-proof-mark { font-weight: 800; }

/* ── legend ──────────────────────────────────────────────────────────────── */
.gc-legend {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    padding: 8px 14px; border-top: 1px solid var(--border-light);
    font-size: 11px; color: var(--text-secondary);
}
.gc-lg { display: inline-flex; align-items: center; gap: 5px; }
.gc-lg-sw { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--border); }
.gc-lg-sw.helio { background: var(--primary-light); border-color: var(--primary); }
.gc-lg-sw.gocd  { background: var(--border-light); }
.gc-lg-wire { width: 18px; height: 0; border-top: 2px solid var(--border); }
.gc-lg-wire.truefanin { border-top-width: 4px; border-color: var(--success); }

/* ── activity log ────────────────────────────────────────────────────────── */
.gc-log { max-height: 190px; overflow: auto; padding: 6px 0; }
.gc-log-row {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 5px 14px; font-size: 12px; line-height: 1.45;
    border-left: 3px solid transparent;
}
.gc-log-row .gc-log-t {
    flex-shrink: 0; font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.gc-log-row.info { border-left-color: var(--border); color: var(--text-secondary); }
.gc-log-row.live { border-left-color: var(--info); color: var(--info-dark); background: var(--info-light); }
.gc-log-row.good { border-left-color: var(--success); color: var(--success-dark); background: var(--success-light); }
.gc-log-row.warn { border-left-color: var(--warning); color: var(--warning-dark); background: var(--warning-light); }
.gc-log-row.bad  { border-left-color: var(--error);   color: var(--error-dark);   background: var(--error-light); }

/* ── inspector extras ────────────────────────────────────────────────────── */
.gc-dep { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 11px; }
.gc-dep-p { font-weight: 700; color: var(--text-primary); }
.gc-dep code, .gc-fail code {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 10px; color: var(--text-secondary); word-break: break-all;
}
.gc-cand {
    padding: 5px 8px; margin-bottom: 4px; border: 1px solid var(--error);
    border-radius: 4px; background: var(--error-light); color: var(--error-dark);
    font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 11px;
}
.gc-fail { padding: 8px 10px; border-radius: 6px; background: var(--error-light); }
.gc-fail code { display: block; color: var(--error-dark); font-weight: 700; font-size: 11px; margin-bottom: 5px; }
.gc-fail p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--error-dark); }
.gc-remedies h5 { margin: 10px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.gc-remedy { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.gc-remedy:last-child { border-bottom: 0; }
.gc-remedy span { font-size: 11px; line-height: 1.45; color: var(--text-secondary); }
.gc-remedy-btn {
    width: fit-content; padding: 3px 9px; border-radius: 4px;
    border: 1px solid var(--border); background: var(--card-bg);
    font-size: 11px; font-weight: 600; color: var(--text-secondary); cursor: not-allowed;
}

.gc-status { padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; background: var(--border); color: var(--text-secondary); }
.gc-status.running { background: var(--info-light);    color: var(--info-dark); }
.gc-status.done    { background: var(--success-light); color: var(--success-dark); }
.gc-status.warn    { background: var(--warning-light); color: var(--warning-dark); }
.gc-status.bad     { background: var(--error-light);   color: var(--error-dark); }
.gc-lg-wire.proven { border-top-color: var(--success); }
.gc-lg-chip {
    padding: 1px 5px; border-radius: 3px;
    background: var(--card-bg); border: 1px solid var(--border);
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 9px; font-weight: 600; color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Release Value Stream + state honesty (BRD §12.2, §12.3)
   Every state carries a glyph as well as a colour, so the stream is readable
   without colour vision. Provider identity is a badge on a node, never a
   colour that competes with execution state.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── §12.3 distinct states ───────────────────────────────────────────────── */
.state-block {
    padding: 14px 16px; border-radius: 6px; margin: 12px 0;
    border: 1px solid var(--border); border-left-width: 3px; background: var(--card-bg);
}
.state-block.state-inline { margin: 0 0 12px; padding: 10px 12px; }
.state-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.state-kind { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.state-code {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 11px; color: var(--text-muted);
}
.state-detail { margin: 6px 0 0; font-size: 13px; color: var(--text-primary); }
.state-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.state-block.state-error   { border-left-color: var(--error);   background: var(--error-light); }
.state-block.state-warn    { border-left-color: var(--warning); background: var(--warning-light); }
.state-block.state-neutral { border-left-color: var(--text-muted); }
.state-block.state-empty   { border-left-color: var(--border); background: var(--border-light); }

.cap-badge {
    padding: 1px 7px; border-radius: 3px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary);
}
.cap-badge.cap-ok   { border-color: var(--success); color: var(--success-dark); background: var(--success-light); }
.cap-badge.cap-warn { border-color: var(--warning); color: var(--warning-dark); background: var(--warning-light); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── preview banner ──────────────────────────────────────────────────────── */
.vs-sim {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 0 16px 14px; padding: 10px 12px;
    border: 1px dashed var(--intent); border-radius: 6px;
    background: var(--intent-light); color: var(--intent-dark);
    font-size: 12px; line-height: 1.5;
}
.vs-sim-tag {
    flex-shrink: 0; padding: 2px 8px; border-radius: 10px;
    background: var(--intent); color: #fff;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}

/* ── controls ────────────────────────────────────────────────────────────── */
.vs-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vs-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.vs-toggle-btn {
    padding: 6px 14px; border: 0; background: var(--card-bg); cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.vs-toggle-btn + .vs-toggle-btn { border-left: 1px solid var(--border); }
.vs-toggle-btn.on { background: var(--primary); color: #fff; }
.vs-toggle-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ── aggregate summary ───────────────────────────────────────────────────── */
.vs-summary {
    display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    margin: 0 16px 14px; padding: 12px 16px;
    border: 1px solid var(--border); border-left-width: 3px; border-radius: 6px;
    background: var(--card-bg);
}
.vs-summary.state-ok   { border-left-color: var(--success); }
.vs-summary.state-hold { border-left-color: var(--intent); }
.vs-summary.state-warn { border-left-color: var(--warning); }
.vs-summary.state-bad  { border-left-color: var(--error); }
.vs-summary.state-live { border-left-color: var(--info); }
.vs-summary.state-idle { border-left-color: var(--text-muted); }
.vs-sum-main { display: flex; flex-direction: column; gap: 3px; }
.vs-sum-label { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.vs-sum-detail { font-size: 12.5px; color: var(--text-secondary); }
.vs-sum-meta { display: grid; grid-template-columns: auto auto; gap: 2px 10px; margin: 0; font-size: 11px; }
.vs-sum-meta dt { color: var(--text-secondary); }
.vs-sum-meta dd { margin: 0; color: var(--text-primary); }

/* ── layout ──────────────────────────────────────────────────────────────── */
.vs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 16px 8px; align-items: start; }
.vs-canvas {
    display: flex; align-items: flex-start; gap: 0; overflow-x: auto;
    padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg);
}
.vs-canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vs-canvas { scroll-snap-type: x proximity; }
.vs-wave { scroll-snap-align: start; }
.vs-scroll-note { padding: 0 16px; font-size: 11px; color: var(--text-muted); }
.vs-wave { display: flex; flex-direction: column; gap: 12px; min-width: 178px; }
.vs-wave-hd {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-secondary); padding-bottom: 2px;
}
.vs-wave-hd.vs-wave-bad { color: var(--error); }
.vs-flow { display: flex; align-items: center; padding: 0 8px; color: var(--text-muted); font-size: 16px; }

/* ── node ────────────────────────────────────────────────────────────────── */
.vs-node {
    display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
    padding: 10px 11px; cursor: pointer; font: inherit;
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted); border-radius: 6px;
}
.vs-node:hover { border-color: var(--primary); }
.vs-node:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vs-node.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
/* The critical blocking path is marked by a rail AND a dashed outline, so it
   survives greyscale and colour-blind rendering. */
.vs-node.crit { outline: 1px dashed var(--error); outline-offset: 2px; }
.vs-node.tone-ok   { border-left-color: var(--success); }
.vs-node.tone-bad  { border-left-color: var(--error); }
.vs-node.tone-warn { border-left-color: var(--warning); }
.vs-node.tone-hold { border-left-color: var(--intent); }
.vs-node.tone-live { border-left-color: var(--info); }
.vs-node.tone-idle { border-left-color: var(--text-muted); }

.vs-node-top { display: flex; align-items: baseline; gap: 7px; }
.vs-kind { font-size: 13px; color: var(--text-secondary); }
.vs-node-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.vs-node-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vs-state { font-size: 11px; font-weight: 600; }
.vs-state.tone-ok   { color: var(--success-dark); }
.vs-state.tone-bad  { color: var(--error-dark); }
.vs-state.tone-warn { color: var(--warning-dark); }
.vs-state.tone-hold { color: var(--intent-dark); }
.vs-state.tone-live { color: var(--info-dark); }
.vs-state.tone-idle { color: var(--text-secondary); }

.vs-prov {
    padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--border); color: var(--text-secondary); background: var(--border-light);
}
.vs-prov.prov-gha   { border-color: var(--text-secondary); }
.vs-prov.prov-gl    { border-color: var(--waiver); color: var(--waiver-dark); }
.vs-prov.prov-gocd  { border-color: var(--accent); color: var(--info-dark); }
.vs-prov.prov-helio { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }

.vs-env, .vs-ref { font-size: 10.5px; color: var(--text-secondary); }
.vs-rev code { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 10px; color: var(--text-secondary); }

/* ── fan-in proof ────────────────────────────────────────────────────────── */
.vs-proof { margin-top: 6px; border-top: 1px solid var(--border-light); padding-top: 6px; }
.vs-proof-hd {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-secondary); margin-bottom: 4px;
}
.vs-proof-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 2px 5px; border-radius: 3px; font-size: 10px; margin-bottom: 2px;
}
.vs-proof-row.ok { background: var(--success-light); color: var(--success-dark); }
.vs-proof-row.no { background: var(--error-light); color: var(--error-dark); }
.vs-proof-row code { font-weight: 700; }

/* ── native jobs (progressive disclosure) ────────────────────────────────── */
.vs-jobs { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--border-light); }
.vs-jobs li { display: flex; align-items: baseline; gap: 6px; font-size: 10.5px; padding: 1px 0; }
.vs-job-mark { font-weight: 800; }
.vs-job-mark.tone-ok { color: var(--success); }
.vs-job-mark.tone-bad { color: var(--error); }
.vs-job-name { color: var(--text-primary); flex: 1; }
.vs-job-dur { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── inspector ───────────────────────────────────────────────────────────── */
.vs-inspector {
    border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg);
    padding: 4px 16px 12px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
    gap: 0 28px; align-items: start;
}
/* The heading section spans, so the node name reads as a title for the panel
   rather than as one column among several. */
.vs-inspector > .vs-insp-sec:first-child { grid-column: 1 / -1; }
.vs-insp-sec { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.vs-insp-sec:last-child { border-bottom: 0; }
.vs-insp-sec h4 {
    margin: 0 0 6px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-secondary);
}
.vs-hint { font-size: 12px; line-height: 1.5; color: var(--text-secondary); margin: 0; }
.vs-note {
    margin: 6px 0 0; padding: 8px 10px; border-radius: 4px;
    background: var(--warning-light); color: var(--warning-dark); font-size: 12px; line-height: 1.5;
}
.vs-kv { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; margin: 0; font-size: 12px; }
.vs-kv dt { color: var(--text-secondary); }
.vs-kv dd { margin: 0; color: var(--text-primary); word-break: break-word; }
.vs-dep, .vs-sig {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    padding: 4px 0; font-size: 12px; color: var(--text-primary);
}

/* ── legend ──────────────────────────────────────────────────────────────── */
.vs-legend {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
    padding: 10px 16px 4px; font-size: 11px; color: var(--text-secondary);
}
.vs-lg { display: inline-flex; align-items: center; gap: 5px; }
.vs-mark { font-weight: 800; }
.vs-mark.tone-ok { color: var(--success); }
.vs-mark.tone-hold { color: var(--intent); }
.vs-mark.tone-warn { color: var(--warning); }
.vs-mark.tone-idle { color: var(--text-muted); }
.vs-crit-key {
    width: 16px; height: 12px; border: 1px dashed var(--error); border-radius: 3px; display: inline-block;
}

/* Inspector sits below the stream now, so its sections flow into columns
   instead of stacking down a narrow rail. The 620px scroll cap that suited a
   tall sidebar would only add a second scrollbar here. */
#gcInspector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
    gap: 0 28px;
    align-items: start;
    max-height: none;
}
#gcInspector > .xa-insp-sec:first-child { grid-column: 1 / -1; }

/* ═══════════════════════════════════════════════════════════════════════════
   Cross-App board editor — hand-placed apps and hand-drawn dependencies
   ═══════════════════════════════════════════════════════════════════════════ */
.xa-modes { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.xa-mode-btn {
    padding: 5px 13px; border: 0; background: var(--card-bg); cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.xa-mode-btn + .xa-mode-btn { border-left: 1px solid var(--border); }
.xa-mode-btn.on { background: var(--primary); color: #fff; }
.xa-mode-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* The board is a positioned surface; wires are drawn into the same SVG the
   wave view uses, so both modes share one renderer. */
.xa-board { position: relative; display: block; min-height: 460px; min-width: 100%; }
.xa-board .xa-bnode {
    position: absolute;
    width: 190px;
    cursor: grab;
    touch-action: none;              /* pointer drag, not browser panning */
    user-select: none;
    box-shadow: var(--shadow-sm);
}
.xa-board .xa-bnode:active { cursor: grabbing; }
.xa-board .xa-bnode.linking { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

/* Output port — the grab handle that starts a dependency. Kept INSIDE the
   node box: hanging it outside put it beyond the scrollable canvas's clip for
   any node near the right edge, where it stopped being hit-testable at all. */
.xa-board .xa-bnode { padding-right: 26px; }
.xa-port {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; padding: 0; border-radius: 50%;
    border: 2px solid var(--primary); background: var(--card-bg);
    cursor: crosshair; touch-action: none;
}
.xa-port:hover { background: var(--primary); }
.xa-port:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.xa-off {
    position: absolute; top: 4px; right: 5px;
    width: 18px; height: 18px; padding: 0; line-height: 1;
    border-radius: 50%; border: 1px solid var(--border);
    background: var(--card-bg); color: var(--error);
    font-size: 12px; cursor: pointer; opacity: 0;
}
.xa-bnode:hover .xa-off, .xa-off:focus-visible { opacity: 1; }
.xa-off:hover { background: var(--error-light); border-color: var(--error); }

/* The wire being dragged, before it lands on a target. */
.xa-wires .xa-wire-new { stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 4; }

.xa-board-hint {
    padding: 8px 14px; font-size: 11.5px; color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
}
.xa-status.error { background: var(--error-light); color: var(--error-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   Value stream — stage zoom, parallel jobs, approval gates
   Borrows the release orchestrator's visual language: running pulses, passed
   is green, failed is red. Only the running stage expands, so the zoom marks
   where the release actually is rather than making every card larger.
   ═══════════════════════════════════════════════════════════════════════════ */

.gc-node { transition: box-shadow .3s, border-color .3s; }

.gc-node.s-running {
    border-color: var(--info);
    animation: pulse-ring 1.6s infinite;
}
/* A provider queue is active waiting, not execution. Keep the waiting label
   and dashed border; pulse only the background, never the text opacity. */
@keyframes gc-runner-wait {
    0%, 100% { background-color: var(--info-light); }
    50% { background-color: var(--card-bg); }
}
.gc-node.s-runner, .gc-log-row.runner-wait {
    border-left-color: var(--info);
    border-left-style: dashed;
    background: var(--info-light);
    animation: gc-runner-wait 2.4s ease-in-out infinite;
}
.gc-log-row.runner-wait { color: var(--info-dark); }
.gc-node.s-passed { border-color: var(--success); }
.gc-node.s-failed, .gc-node.s-blocked, .gc-node.s-ambiguous { border-color: var(--error); }

/* The zoom. Width is set on the wave so neighbours reflow rather than overlap. */
.gc-node.expanded {
    box-shadow: var(--shadow-md);
    border-width: 2px;
}
.gc-wave:has(.gc-node.expanded) { min-width: 300px; }

.gc-node.gate {
    border-style: dashed;
    background: linear-gradient(0deg, var(--intent-light) 0%, var(--card-bg) 60%);
}

/* ── jobs ────────────────────────────────────────────────────────────────── */
.gc-jobs { margin-top: 8px; border-top: 1px solid var(--border-light); padding-top: 7px; }
.gc-jobs-hd {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-secondary); margin-bottom: 5px;
}
.gc-jobs-grid { display: grid; gap: 5px; }

.gc-job {
    display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 7px;
    width: 100%; text-align: left; font: inherit; cursor: pointer;
    padding: 6px 8px; border-radius: 5px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
}
.gc-job:hover { border-color: var(--primary); }
.gc-job:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gc-job.focused { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.gc-job.tone-ok   { border-left-color: var(--success); }
.gc-job.tone-bad  { border-left-color: var(--error); }
.gc-job.tone-idle { border-left-color: var(--border); }
/* A running job blinks the same way a running stage does in the orchestrator,
   so the two screens read as one system. */
.gc-job.tone-live {
    border-left-color: var(--info);
    animation: stage-blink 1.4s steps(2, end) infinite;
}
.gc-job-mark { font-weight: 800; font-size: 11px; }
.gc-job.tone-ok   .gc-job-mark { color: var(--success); }
.gc-job.tone-bad  .gc-job-mark { color: var(--error); }
.gc-job.tone-live .gc-job-mark { color: var(--info); }
.gc-job.tone-idle .gc-job-mark { color: var(--text-muted); }
.gc-job-nm { font-size: 11.5px; font-weight: 600; color: var(--text-primary); }
.gc-job-tool { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── approval gate ───────────────────────────────────────────────────────── */
.gc-gate { margin-top: 7px; border-top: 1px solid var(--border-light); padding-top: 7px; }
.gc-gate-count {
    font-size: 11px; font-weight: 700; color: var(--intent-dark);
    padding: 2px 7px; border-radius: 10px; background: var(--intent-light);
    display: inline-block;
}
.gc-gate-count.met { background: var(--success-light); color: var(--success-dark); }
.gc-sig-row {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: 10.5px; color: var(--text-secondary); padding: 3px 0 0;
}
.gc-gate-wait { margin-top: 5px; font-size: 10.5px; line-height: 1.45; color: var(--warning-dark); }

@media (prefers-reduced-motion: reduce) {
    .gc-node.s-running, .gc-job.tone-live,
    .gc-node.s-runner, .gc-log-row.runner-wait { animation: none; }
    .gc-node.s-running { box-shadow: 0 0 0 4px rgba(59,130,246,0.18); }
}

/* ── job results popup ───────────────────────────────────────────────────── */
/* .modal-card carries no base styling in this document — the chrome lives on
   the admin- variants — so the job dialog styles itself completely rather than
   inheriting a card that does not exist. */
.gc-job-overlay,
.gc-action-overlay {
    position: fixed; inset: 0; z-index: 400;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}
.gc-job-card,
.gc-action-card {
    position: relative; z-index: 1;
    width: min(440px, 100%);
    max-height: calc(100vh - 48px); overflow: auto;
    padding: 20px 22px 16px;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; gap: 10px;
}
.gc-action-card label { font-size: 12px; font-weight: 700; }
.gc-action-card input,
.gc-action-card textarea {
    width: 100%; box-sizing: border-box; padding: 9px 10px;
    color: var(--text-primary); background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    font: inherit;
}
.gc-action-card textarea { min-height: 90px; resize: vertical; }
.gc-job-dlg-hd {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.gc-job-dlg-hd h3 { margin: 0; font-size: 17px; color: var(--text-primary); }
.gc-job-dlg-sub { margin-top: 3px; font-size: 12px; color: var(--text-secondary); }
.gc-job-dlg-summary { font-size: 13.5px; line-height: 1.5; color: var(--text-primary); }
.gc-job-dlg-meta {
    font-size: 11px; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.gc-job-dlg-table { width: 100%; font-size: 13px; }
.gc-job-dlg-table td { padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.gc-job-dlg-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.gc-job-dlg-empty {
    margin: 0; padding: 12px 14px; border-radius: 6px;
    background: var(--surface-2, var(--border-light));
    font-size: 13px; line-height: 1.5; color: var(--text-secondary);
}
.gc-job-dlg-actions { display: flex; justify-content: flex-end; padding-top: 4px; }

/* A governed refusal, stated on the page rather than hidden in a tooltip. */
.gc-blocked-notice {
    margin: 0 0 10px; padding: 10px 13px;
    border: 1px solid var(--warning); border-left-width: 3px; border-radius: 6px;
    background: var(--warning-light); color: var(--warning-dark);
}
.gc-blocked-title { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.gc-blocked-reason { font-size: 12px; line-height: 1.5; }
.admin-form-hint { margin: 5px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   Narrow viewports (K09)
   The layout was a fixed flex row with a 260px sidebar and no breakpoint, so
   at 320px the navigation sat off-screen — and the only toggle lived inside
   the sidebar, which is to say off-screen with it. The drawer control
   therefore lives in the header, where it is reachable when the drawer is not.
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-drawer-toggle {
    display: none;
    margin-right: 10px;
    width: 38px; height: 38px;
    font-size: 19px; line-height: 1; cursor: pointer;
    background: var(--card-bg); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.nav-drawer-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 900px) {
    .nav-drawer-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 500;
        transform: translateX(-100%);
        transition: transform 220ms ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.drawer-open { transform: translateX(0); }

    /* .main compensates for the fixed sidebar with margin-left:260px. Once the
       sidebar is off-canvas that margin is dead space wider than half the
       viewport, so it goes with it. */
    .main { margin-left: 0; width: auto; min-width: 0; }
    .app { display: block; }

    .nav-drawer-scrim {
        position: fixed; inset: 0; z-index: 499;
        background: rgba(15, 23, 42, 0.45);
    }

    /* Side panels become full-width sheets instead of fixed 480px slabs that
       would otherwise extend past a 320px viewport. */
    .detail-panel, .chat-panel { width: 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reduced motion
   Every animation in this stylesheet is decorative or status-signalling; none
   is a loading spinner. So motion can be removed outright, provided each
   animation that CONVEYS something keeps a static equivalent — a pulsing dot
   that simply stops is fine, one that animates from opacity:0 would vanish.
   The stage/node blocks above already substitute a static ring; these are the
   two that had no coverage at all.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    /* The typing indicator's base state is opacity:0 — the animation is what
       makes it visible. Stopping the animation must not hide it. */
    .thinking-dots span { opacity: 1 !important; }

    /* The live-status dot pulses to say "live"; static, it still says it. */
    .status-dot, .live-dot { animation: none !important; }

    html { scroll-behavior: auto !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Print
   These pages are printed as compliance evidence, so the rule is that the
   paper must not say something different from the screen: the filter bar stays
   (a printed list with its scope removed misstates what was reviewed), and
   status colour is forced to render (severity is the content, not decoration).
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
    .sidebar, .chat-panel, .chat-fab, .nav-drawer-toggle, .nav-drawer-scrim,
    .header-right, .btn, .detail-panel-actions,
    .modal-overlay, .gc-job-overlay, .gc-action-overlay { display: none !important; }

    .app { display: block; }
    .main { margin-left: 0 !important; width: auto; min-width: 0; }
    body, .main, .content { background: #fff !important; color: #000 !important; }

    /* Severity/status pills are information. Without this, print rendering
       drops their background and every state prints identically. */
    .badge, .status-pill, .severity, .tag, .chip {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* The filter bar is retained but flattened — it is a record of scope here,
       not a control. */
    .filter-bar, .filter-group { border: 0; padding-left: 0; }
    .filter-bar select, .filter-bar input,
    .filter-group select, .filter-group input { border: 0; background: transparent; }

    .card, .chart-card, table { break-inside: avoid; box-shadow: none; }
    .card, .chart-card { border: 1px solid #999; }
    thead { display: table-header-group; }

    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #555; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Release rail — parallel waves (fan-out / fan-in)
   The rail is a horizontal track of circles. A wave of one is a plain circle
   and keeps the existing markup untouched; a wave of two or more stacks its
   branches vertically at the same horizontal position, because that is what
   "these run at the same time" looks like on a left-to-right timeline.
   ═══════════════════════════════════════════════════════════════════════════ */
.rel-wave {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0 4px;
}

.rel-wave-branches {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    padding-left: 14px;
    padding-right: 14px;
}

/* Two spines, not one. The left is the fan-out where the branches split; the
   right is the fan-in where they rejoin. Drawing only the split would show
   half the story — the whole point of a join is that the next stage waits for
   every branch. */
.rel-wave-branches::before,
.rel-wave-branches::after {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.rel-wave-branches::before { left: 0; }
.rel-wave-branches::after { right: 0; }

.rel-wave-branch {
    position: relative;
    display: flex;
    align-items: flex-start;
}

/* Stubs tying each branch to both spines. */
.rel-wave-branch::before,
.rel-wave-branch::after {
    content: "";
    position: absolute;
    top: 24px;
    width: 14px;
    height: 2px;
    background: var(--border);
}

.rel-wave-branch::before { left: -14px; }
.rel-wave-branch::after { right: -14px; }

/* Inside a wave the labels sit beside the circle, so stacked branches stay
   compact instead of each reserving a full label row underneath. */
.rel-wave-branch .rel-stage,
.rel-wave-branch .rel-gate {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rel-wave-branch .rel-stage-label,
.rel-wave-branch .rel-gate-label {
    margin-top: 0;
    text-align: left;
    max-width: 120px;
}

.rel-wave-caption {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-muted);
    white-space: nowrap;
}

/* The connector entering a fan-out is drawn heavier: it is carrying more than
   one downstream branch. */
.rel-connector.fan-out {
    background: linear-gradient(90deg, var(--border), var(--primary));
    height: 4px;
    margin-top: 23px;
}

.rel-connector.fan-out.done {
    background: linear-gradient(90deg, var(--success), var(--success));
}

@media (max-width: 900px) {
    .rel-wave-branch .rel-stage-label,
    .rel-wave-branch .rel-gate-label { max-width: 84px; }
}

/* The join turns green only when the whole wave has completed — a half-done
   fan-in still blocks whatever comes next, and the rail should not suggest
   otherwise. */
.rel-wave.wave-done .rel-wave-branches::before,
.rel-wave.wave-done .rel-wave-branches::after,
.rel-wave.wave-done .rel-wave-branch::before,
.rel-wave.wave-done .rel-wave-branch::after {
    background: var(--success);
}

.rel-wave.wave-active .rel-wave-branches::before,
.rel-wave.wave-active .rel-wave-branch::before {
    background: var(--info);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Release execution mode + node provenance
   ═══════════════════════════════════════════════════════════════════════════ */
.rel-mode-option {
    padding: 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card-bg);
}
.rel-mode-option:hover { border-color: var(--primary); }
.rel-mode-option:has(input[name="relExecMode"]:checked),
.rel-mode-option.compact:has(input:checked) { border-color: var(--primary); background: rgba(59,130,246,.04); }
.rel-mode-option.compact { padding: 9px 10px; margin-bottom: 6px; }
.rel-mode-heading, .rel-mode-option.compact > label {
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
}
.rel-mode-heading > input, .rel-mode-option.compact > label > input { margin-top: 3px; flex: none; }
/* A flex child will not shrink below its content width without this, so the
   control table escaped the dialog instead of scrolling inside it. */
.rel-mode-option > div { min-width: 0; flex: 1; }
.rel-mode-heading > span { min-width: 0; flex: 1; }
.rel-mode-unavailable { margin: 6px 0 0 25px; color: var(--error); font-size: 11px; }
.rel-mode-title { font-weight: 600; font-size: 13px; }
.rel-mode-tag {
    margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: .03em;
    background: var(--success); color: #fff; text-transform: uppercase;
}
.rel-mode-desc { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.rel-mode-desc code { background: var(--background); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.rel-mode-sub { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.rel-mode-sub-title {
    font-size: 10px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.rel-ctl-table th, .rel-ctl-table td { font-size: 11px; padding: 6px 8px; vertical-align: middle; }
.rel-ctl-table .form-control, .rel-ctl-table .filter-select { font-size: 11px; padding: 3px 6px; }

/* Node provenance legend. The swatch encodes WHERE a node ran, which is not
   the same as its status — a green passed circle can be a provider job or a
   Helio control, and conflating them would let an external scan read as a
   step inside the pipeline. */
.rel-prov-legend {
    display: flex; flex-wrap: wrap; gap: 14px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 11px; color: var(--text-secondary);
}
.rel-prov { display: inline-flex; align-items: center; gap: 6px; }
.rel-prov-swatch { width: 11px; height: 11px; border-radius: 3px; border: 2px solid var(--border); flex: none; }
.rel-prov-swatch.provider-job { background: var(--info); border-color: var(--info); }
.rel-prov-swatch.helio-control { background: var(--intent, #8b5cf6); border-color: var(--intent, #8b5cf6); }
.rel-prov-swatch.provider-gate { background: transparent; border-color: var(--info); border-style: dashed; }
.rel-prov-swatch.helio-gate { background: transparent; border-color: var(--warning); }

/* ── Release trains ─────────────────────────────────────────────────────── */
.rt-empty { padding: 20px 16px; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rt-table th, .rt-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.rt-table th { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.rt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 0 16px 16px; }
@media (max-width: 1000px) { .rt-layout { grid-template-columns: 1fr; } }
.rt-board-wrap { min-width: 0; overflow-x: auto; }
.rt-board { display: flex; gap: 22px; align-items: flex-start; padding: 8px 4px 12px; min-height: 120px; }
.rt-wave { display: flex; flex-direction: column; gap: 10px; min-width: 230px; }
.rt-wave-hd { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--background); font-size: 12px; }
.rt-wave-hd .xa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 6px; }
.rt-gate.s-waiting_signatures { border-color: var(--warning); }
.rt-gate.s-approved { border-color: var(--success); }
.rt-gate.s-rejected, .rt-gate.s-expired { border-color: var(--error); }
.rt-gate-actions { display: flex; gap: 6px; }
.rt-sign { display: grid; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.rt-sign label { display: grid; gap: 2px; font-size: 12px; }
.rt-sign input { font: inherit; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; }
.rt-sign-actions { display: flex; gap: 6px; }
.rt-sign-status { margin: 0; font-size: 12px; color: var(--error); min-height: 1em; }
.rt-member { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--surface, #fff); padding: 10px 12px; display: grid; gap: 6px; font-size: 13px; }
.rt-member.hollow { border-style: dashed; opacity: .85; }
.rt-member.s-started { border-left-color: var(--info); }
.rt-member.s-released { border-left-color: var(--success); }
.rt-member.s-failed { border-left-color: var(--error); }
.rt-member.s-skipped, .rt-member.s-cancelled { border-left-color: var(--text-muted); text-decoration: line-through; }
.rt-member.s-skipped .rt-member-actions, .rt-member.s-cancelled .rt-member-actions { text-decoration: none; }
.rt-member-hd { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rt-version { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--text-muted); }
.rt-progress { display: flex; gap: 2px; }
.rt-seg { flex: 1; height: 6px; border-radius: 2px; background: var(--border); }
.rt-seg.done { background: var(--success); }
.rt-seg.live { background: var(--info); }
.rt-seg.hold { background: var(--warning); }
.rt-seg.fail { background: var(--error); }
.rt-wait { font-size: 12px; color: var(--text-secondary); }
.rt-member-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-rows { display: grid; gap: 10px; margin-top: 8px; }
.rt-row { border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); }
.rt-row-body { padding: 8px 12px; display: grid; gap: 4px; }
.rt-node { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.rt-node:last-child { border-bottom: 0; }
.rt-attention { border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--background); align-self: start; }
.rt-attention .xa-pane-hd span { color: var(--warning); font-weight: 700; }
.rt-att { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.rt-banner { margin: 0 16px 12px; padding: 10px 14px; border-radius: var(--radius-sm, 6px); font-size: 13px; border: 1px solid var(--warning); background: var(--warning-light, #fef3c7); }
.rt-banner.bad { border-color: var(--error); background: var(--error-light, #fee2e2); }
.rt-planner { margin: 0 16px 12px; padding: 14px 16px; border: 1px solid var(--primary); border-radius: var(--radius-sm, 6px); background: var(--background); }
.rt-planner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 10px 0; }
.rt-planner-grid label { display: grid; gap: 3px; font-size: 12px; }
.rt-member-config { display: grid; gap: 10px; min-width: 0; }
.rt-member-config label { display: grid; gap: 4px; font-size: 12px; }
.rt-member-config select, .rt-member-config textarea, .rt-planner-grid textarea { box-sizing: border-box; width: 100%; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); background: var(--background); }
.rt-member-config textarea, .rt-planner-grid textarea { resize: vertical; }
.rt-planner-grid input, .rt-planner-grid select, .rt-planner input.rt-version { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; }
.rt-planner input.rt-version { width: 100%; }
.rt-invalid td { background: var(--error-light, #fee2e2); }
.rt-external { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--warning); border-radius: 4px; font-size: 13px; display: grid; gap: 8px; }
.rt-ack { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.rt-planner-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.rt-planner-status { margin: 8px 0 0; font-size: 12px; color: var(--text-secondary); min-height: 1em; }
.adoption-settings label { display: block; margin: 12px 0 5px; }
.adoption-settings input:not([type="checkbox"]), .adoption-settings textarea,
.adoption-settings select { display: block; width: 100%; max-width: 100%; box-sizing: border-box; padding: 8px; }
.adoption-settings textarea { resize: vertical; }
.adoption-settings .btn { margin: 10px 6px 6px 0; }

/* Wide variant of the shared modal for the guided pipeline builder */
.modal.modal-wide .modal-content { max-width: 1120px; width: 96vw; max-height: 94vh; }
.modal.modal-wide .modal-body { overflow: auto; }

/* Release Orchestrator: live provider state fed by the value-stream projection */
.ro-live-panel { margin: 14px 0 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); padding: 12px 14px; }
.ro-live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ro-live-meta { font-size: 11px; color: var(--text-muted); }
.ro-stage-group { border-top: 1px solid var(--border-light); padding: 8px 0; }
.ro-stage-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.ro-stage-reason { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; overflow-wrap: anywhere; }
.ro-node { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; font-size: 12px; border-top: 1px dashed var(--border-light); }
.ro-node:first-of-type { border-top: 0; }
.ro-node-name { font-weight: 600; }
.ro-node-kind { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.ro-node-detail { color: var(--text-secondary); flex: 1 1 320px; min-width: 240px; line-height: 1.5; }
.ro-node-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   OPERATIONS — observability & support (UI only)
   docs/Helio-Operations-Observability-and-Support.md
   ═══════════════════════════════════════════════════════════════════════════ */
.ops { display: flex; flex-direction: column; gap: 16px; }

.ops-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.ops-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.ops-sub { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.ops-clock { text-align: right; min-width: 240px; }
.ops-clock-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ops-clock-value { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ops-clock-note { font-size: 11px; color: var(--text-muted); max-width: 280px; margin-left: auto; }

.ops-banner {
    border-left: 3px solid var(--info); background: var(--info-light); color: var(--info-dark);
    padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 12.5px; line-height: 1.55;
}

.ops-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ops-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.ops-stat-n { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ops-stat-l { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.ops-stat-hint { display: block; font-size: 10.5px; color: var(--text-muted); }
.ops-stat-error { border-left: 3px solid var(--error); }
.ops-stat-error .ops-stat-n { color: var(--error); }
.ops-stat-warn { border-left: 3px solid var(--warning); }
.ops-stat-warn .ops-stat-n { color: var(--warning); }

.ops-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ops-tab {
    background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
    padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 8px;
}
.ops-tab:hover { color: var(--text-primary); }
.ops-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ops-tab-count {
    background: var(--bg-secondary); color: var(--text-secondary); border-radius: 100px;
    padding: 1px 7px; font-size: 11px; font-variant-numeric: tabular-nums;
}
.ops-tab.active .ops-tab-count { background: var(--primary-light); color: var(--primary-dark); }

.ops-filters { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ops-filter-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.ops-filter-spacer { flex: 1; }
.ops-filter-count { font-size: 11px; color: var(--text-muted); }
.ops-toggle {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 100px; cursor: pointer;
    padding: 5px 12px; font-size: 12px; color: var(--text-secondary);
}
.ops-toggle.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

.ops-table-wrap { overflow-x: auto; }
.ops-table { min-width: 980px; }
.ops-table td { vertical-align: top; }
.ops-row-expected td { background: var(--bg-secondary); color: var(--text-secondary); }
.ops-row-active td { box-shadow: inset 3px 0 0 var(--primary); }
.ops-reason-label { font-weight: 600; color: var(--text-primary); }
.ops-reason-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ops-sub-cell { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.ops-next { font-weight: 600; font-size: 12.5px; }
.ops-next-none { color: var(--error); }
.ops-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.ops-actions-cell { white-space: nowrap; }
.ops-btn-sm { padding: 4px 10px; font-size: 12px; }
.ops-ack { font-size: 11px; color: var(--text-muted); }
.ops-empty { padding: 40px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.ops-foot-note { padding: 10px 16px; font-size: 11.5px; color: var(--text-muted); border-top: 1px solid var(--border-light); line-height: 1.55; }

.ops-chip-unmapped { background: var(--warning-light); color: var(--warning-dark); border-radius: 100px; padding: 1px 7px; font-size: 10px; font-weight: 700; }
.ops-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 100px; white-space: nowrap; }
.ops-kind-external-wait { background: var(--bg-tertiary); color: var(--text-secondary); }
.ops-kind-provider { background: var(--waiver-light); color: var(--waiver); }
.ops-kind-helio-stalled { background: var(--error-light); color: var(--error-dark); }
.ops-kind-uncertain { background: var(--intent-light); color: var(--intent-dark); }
.ops-kind-deadline { background: var(--warning-light); color: var(--warning-dark); }

.ops-unknown { color: var(--text-muted); font-style: italic; }
.ops-fresh { font-size: 11px; white-space: nowrap; border-radius: 100px; padding: 2px 8px; }
.ops-fresh-ok { background: var(--success-light); color: var(--success-dark); }
.ops-fresh-stale { background: var(--warning-light); color: var(--warning-dark); }
.ops-fresh-unknown { background: var(--bg-tertiary); color: var(--text-muted); font-style: italic; }

.ops-budget { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ops-budget-bar { flex: 1; max-width: 90px; height: 4px; background: var(--bg-tertiary); border-radius: 100px; overflow: hidden; }
.ops-budget-bar span { display: block; height: 100%; background: var(--warning); }
.ops-budget-pct { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.ops-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.ops-card-error { border-left: 3px solid var(--error); }
.ops-card-warn { border-left: 3px solid var(--warning); }
.ops-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ops-card-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.ops-card-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.ops-card-action { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-secondary); line-height: 1.55; }

.ops-kv { display: flex; flex-direction: column; gap: 8px; }
.ops-kv-row { display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: start; }
.ops-kv-k { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
.ops-kv-v { font-size: 12.5px; color: var(--text-primary); }
.ops-kv-detail { font-size: 11.5px; color: var(--text-secondary); }
.ops-kv-when { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ops-quota { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.ops-quota-bar { width: 80px; height: 5px; background: var(--bg-tertiary); border-radius: 100px; overflow: hidden; }
.ops-quota-bar span { display: block; height: 100%; background: var(--primary); }

.ops-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.ops-meter-l { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.ops-meter-bar { height: 5px; background: var(--bg-tertiary); border-radius: 100px; overflow: hidden; margin: 4px 0 3px; }
.ops-meter-bar span { display: block; height: 100%; background: var(--success); }
.ops-meter-bar.warn span { background: var(--warning); }
.ops-meter-v { font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ops-restarts { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.ops-dead { background: var(--error-light); color: var(--error-dark); border-radius: 6px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; }
.ops-detectors { margin-top: 14px; }

.ops-drawer-scrim, .ops-modal-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 900; }
.ops-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
    background: var(--card-bg); border-left: 1px solid var(--border); z-index: 901;
    overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px;
    box-shadow: -8px 0 32px -16px rgba(15, 23, 42, .4);
}
.ops-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ops-drawer-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ops-drawer-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.ops-drawer-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.ops-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.ops-close:hover { color: var(--text-primary); }

.ops-customer { background: var(--primary-light); border-radius: 8px; padding: 14px 16px; }
.ops-customer-label { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--primary-dark); font-weight: 700; }
.ops-customer-text { margin: 8px 0 0; font-size: 14px; color: var(--text-primary); line-height: 1.6; }
.ops-customer-action { margin: 8px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.ops-customer-warn { margin: 10px 0 0; font-size: 12px; color: var(--warning-dark); background: var(--warning-light); padding: 8px 10px; border-radius: 6px; line-height: 1.55; }

.ops-fields { display: flex; flex-direction: column; gap: 9px; }
.ops-field { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; }
.ops-field-k { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.ops-field-v { font-size: 12.5px; color: var(--text-primary); word-break: break-word; }
.ops-field-v code, .ops-drawer code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg-secondary); padding: 1px 5px; border-radius: 4px; }

.ops-recovery { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.ops-recovery-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.ops-recovery-copy { margin: 8px 0 12px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.ops-recovery-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ops-recovery-note { margin-top: 10px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.ops-timeline-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; }
.ops-tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.ops-tl-item { position: relative; }
.ops-tl-item::before { content: ''; position: absolute; left: -19px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.ops-tl-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.ops-tl-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-top: 1px; }
.ops-tl-detail { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }

.ops-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    z-index: 901; padding: 20px; display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 24px 64px -24px rgba(15, 23, 42, .45);
}
.ops-modal-copy { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.ops-support-id { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg-secondary); border-radius: 8px; padding: 12px 14px; }
.ops-support-id-value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ops-redaction { background: var(--bg-secondary); border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

@media (max-width: 720px) {
    .ops-head { flex-direction: column; }
    .ops-clock { text-align: left; }
    .ops-clock-note { margin-left: 0; }
    .ops-field, .ops-kv-row { grid-template-columns: 1fr; gap: 2px; }
    .ops-drawer { width: 100vw; }
}
