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

:root {
    --primary: #0066CC;
    --primary-dark: #004D99;
    --primary-light: #E8F4FD;
    --secondary: #1E3A5F;
    --accent: #00A3E0;
    --success: #10B981;
    --success-light: #DCFCE7;
    --success-dark: #166534;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --error-dark: #991B1B;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --info-dark: #1E40AF;
    --waiver: #F97316;
    --waiver-light: #FFEDD5;
    --waiver-dark: #EA580C;
    --intent: #8B5CF6;
    --intent-light: #EDE9FE;
    --intent-dark: #7C3AED;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --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;
    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;
    }
}

.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;
}

.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: -400px;
    width: 400px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.chat-panel.open {
    right: 0;
}

.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: -780px;
    width: min(760px, 94vw);
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    z-index: 150;
    box-shadow: var(--shadow-lg);
}

.detail-panel.open {
    right: 0;
}

.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);
}

.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 .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;
}

.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)
    }
}

.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;
    }
}

/* Mobile navigation toggle (hamburger) — hidden on desktop, shown ≤768px */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary, inherit);
    font-size: 22px;
    line-height: 1;
    padding: 6px 10px;
    margin-right: 6px;
    cursor: pointer;
    border-radius: 8px;
}
.menu-toggle:hover { background: rgba(0, 0, 0, 0.06); }
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
}
.nav-backdrop.show { display: block; }

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; align-items: center; }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
    }

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

    /* No app should scroll the whole page sideways on a phone. */
    html, body, .app { overflow-x: hidden; max-width: 100vw; }
    .content { overflow-x: hidden; }

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

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

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

    .chat-panel,
    .detail-panel {
        width: 100%;
        right: -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);
}

/* ── 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);
}

/* 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; }
.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; }
/* ========================================
   APEX Console — supplemental helpers
   ======================================== */
.loading-block { padding:48px; text-align:center; color:var(--text-muted); font-size:13px; }
.empty-state { padding:32px; text-align:center; color:var(--text-muted); font-size:13px; background:var(--background); border-radius:var(--radius); }
.empty-state.error { color:var(--error); background:var(--error-light); }
.muted { color:var(--text-muted); font-size:12px; }
.mono { font-family:'JetBrains Mono', monospace; font-size:12px; }
.mt { margin-top:14px; } .mt-lg { margin-top:22px; } .w-full { width:100%; }

/* stat tiles */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:18px; }
.stat-card { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px 20px; box-shadow:var(--shadow-sm); }
.stat-value { font-size:28px; font-weight:700; color:var(--text-primary); line-height:1.1; }
.stat-label { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); margin-top:6px; font-weight:600; }
.stat-clickable { cursor:pointer; transition:border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.stat-clickable:hover { border-color:var(--brand); box-shadow:var(--shadow-md,0 4px 14px rgba(0,0,0,.10)); transform:translateY(-1px); }
.stat-clickable:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.stat-arrow { font-size:14px; font-weight:600; color:var(--text-muted); opacity:0; transition:opacity .12s ease; }
.stat-clickable:hover .stat-arrow { opacity:1; }
.filter-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-secondary,var(--text-muted)); background:var(--card-bg); border:1px solid var(--border); border-radius:999px; padding:2px 6px 2px 10px; margin-left:10px; vertical-align:middle; }
.filter-chip a { cursor:pointer; color:var(--text-muted); text-decoration:none; font-weight:700; padding:0 4px; border-radius:999px; }
.filter-chip a:hover { color:var(--error,#dc2626); background:var(--border); }

/* two column */
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:1100px){ .two-col { grid-template-columns:1fr; } }

/* tables */
.table-wrap { overflow-x:auto; }
.data-table td .badge { white-space:nowrap; }

/* tiles / cards grid */
.tile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.tile { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; box-shadow:var(--shadow-sm); transition:var(--transition); }
.tile:hover { box-shadow:var(--shadow-md); border-color:var(--primary-light); }
.tile-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.tile-title { font-weight:600; font-size:14px; }
.tile-desc { color:var(--text-secondary); font-size:12px; margin-bottom:10px; }
.tile-meta { display:flex; gap:14px; flex-wrap:wrap; color:var(--text-muted); font-size:11px; margin-top:6px; }

/* key-value grid */
.kv-grid { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; align-items:baseline; }
.kv-key { color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.03em; font-weight:600; }
.kv-val { font-size:13px; color:var(--text-primary); word-break:break-word; }
.detail-subhead { margin:18px 0 8px; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-secondary); }

/* forms */
.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.form-label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); font-weight:700; margin:0 0 6px; }
.input { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius); font-size:13px; font-family:inherit; background:var(--card-bg); color:var(--text-primary); }
.input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
.form-error { color:var(--error); font-size:12px; margin-top:10px; }

/* option tiles (composition) */
.opt-row { display:flex; flex-wrap:wrap; gap:10px; }
.opt { flex:1 1 150px; min-width:140px; cursor:pointer; border:1px solid var(--border); border-radius:var(--radius); padding:12px; text-align:center; transition:var(--transition); background:var(--card-bg); }
.opt:hover { border-color:var(--accent); }
.opt.sel { border-color:var(--primary); background:var(--primary-light); box-shadow:0 0 0 2px var(--primary-light) inset; }
.opt-n { font-weight:600; font-size:13px; }
.opt-s { color:var(--text-muted); font-size:11px; margin-top:2px; }
.cap { display:inline-block; background:var(--success-light); color:var(--success-dark); border-radius:20px; padding:3px 11px; font-size:11px; font-weight:600; margin:2px; }

/* Provision form — sectioned layout with breathing room + a collapsible
   "Production options" panel so the common path isn't a wall of fields. */
.prov-sec { padding:20px 0; border-top:1px solid var(--border); }
.prov-sec:first-child { border-top:0; padding-top:2px; }
.prov-sec-h { font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-secondary, var(--text-muted)); font-weight:700; margin:0 0 14px; }
.cap-row { display:flex; flex-wrap:wrap; gap:7px; }
.cap-row .cap { margin:0; }

/* Service catalog: application (product) → its components (deployable units) */
.cat-app { margin-bottom:16px; }
.cat-comps { display:flex; flex-direction:column; gap:6px; }
.cat-comp { display:flex; align-items:center; gap:12px; padding:9px 12px; border:1px solid var(--border); border-radius:8px; cursor:pointer; transition:background .12s ease, border-color .12s ease; }
.cat-comp:hover { background:color-mix(in srgb, var(--text-primary) 4%, transparent); border-color:var(--brand); }
.cat-comp-name { flex:1; font-size:13px; font-weight:600; }
.tmpl-actions { display:flex; gap:8px; margin-top:10px; }
.prov-adv { border:1px solid var(--border); border-radius:var(--radius); margin-top:6px; overflow:hidden; }
.prov-adv > summary { cursor:pointer; padding:14px 16px; font-size:13px; font-weight:600; color:var(--text-primary); list-style:none; display:flex; align-items:center; gap:10px; user-select:none; transition:background .12s ease; }
.prov-adv > summary::-webkit-details-marker { display:none; }
.prov-adv > summary::before { content:'▸'; color:var(--text-muted); transition:transform .15s ease; }
.prov-adv[open] > summary::before { transform:rotate(90deg); }
.prov-adv[open] > summary { border-bottom:1px solid var(--border); }
.prov-adv > summary:hover { background:color-mix(in srgb, var(--text-primary) 4%, transparent); }
.prov-adv-body { padding:18px 16px; display:flex; flex-direction:column; gap:18px; }

/* buttons */
.btn-danger { background:var(--error); color:#fff; border:1px solid var(--error); }
.btn-danger:hover { background:var(--error-dark); }

/* timeline items */
.timeline-item { display:flex; gap:12px; padding:8px 0; }
.timeline-item .timeline-dot { width:10px; height:10px; border-radius:50%; background:var(--primary); margin-top:5px; flex:none; }
.timeline-title { font-weight:600; font-size:13px; }
.timeline-meta { color:var(--text-muted); font-size:11px; }

/* code */
.code-block { background:#0f172a; color:#e2e8f0; padding:14px; border-radius:var(--radius); font-family:'JetBrains Mono',monospace; font-size:11px; overflow-x:auto; white-space:pre; line-height:1.5; }
.cs-block { margin:10px 0; }
.cs-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:4px; }
.cs-head span { font-size:12px; font-weight:600; color:var(--text-secondary,#64748b); }
.cs-head .btn { padding:2px 10px; font-size:11px; }

/* toast */
.toast { position:fixed; bottom:24px; right:24px; background:var(--secondary); color:#fff; padding:12px 18px; border-radius:var(--radius); font-size:13px; box-shadow:var(--shadow-lg); opacity:0; transform:translateY(10px); transition:.2s; z-index:1000; pointer-events:none; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.success { background:var(--success); } .toast.error { background:var(--error); } .toast.info { background:var(--info); }

/* content spacing */
.content > .card, .content > .stat-grid, .content > .two-col { margin-bottom:16px; }

/* live provisioning log stream */
.log-stream{background:#0f172a;border-radius:var(--radius);padding:10px 12px;max-height:280px;overflow-y:auto;
  font-family:'JetBrains Mono',monospace;font-size:12px;line-height:1.6;display:flex;flex-direction:column;gap:2px}
.log-line{display:grid;grid-template-columns:auto auto 1fr;gap:9px;align-items:baseline}
.log-line .log-t{color:#64748b;font-size:11px;white-space:nowrap}
.log-line .log-m{color:#cbd5e1;word-break:break-word}
.log-stream .pill{font-size:10px;padding:1px 7px}

/* ===== Environment graph (Account Scanner → Graph) ===== */
.gn-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.gn-wrap {
    border: 1px solid var(--border, #e2e8f0); border-radius: 12px; overflow-x: auto; overflow-y: visible;
    background: radial-gradient(circle at 1px 1px, rgba(100,116,139,.18) 1px, transparent 0) 0 0 / 22px 22px, var(--surface, #fff);
}
/* Render the whole graph at natural node size — the box grows vertically and the
   page scrolls, instead of squishing everything into a short window. */
.gn-svg { width: 100%; min-width: 820px; height: auto; display: block; }
.gn-node { cursor: pointer; }
.gn-node:hover .gn-rect { stroke-width: 3; filter: brightness(1.05); }
.gn-edge { fill: none; stroke: #cbd5e1; stroke-width: 1.5; }
.gn-rect { fill: var(--surface, #fff); stroke-width: 1.5; }
.gn-acct .gn-rect, .gn-cont .gn-rect { fill: #f8fafc; }
.gn-node .gn-nicon { font-size: 15px; }
.gn-node .gn-title { font: 600 12.5px 'Inter', system-ui, sans-serif; fill: var(--text-primary, #0f172a); }
.gn-node .gn-sub { font: 11px 'Inter', system-ui, sans-serif; fill: var(--text-secondary, #64748b); }
.gn-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.gn-legend .gn-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary, #64748b); text-transform: capitalize; }
.gn-legend .gn-lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ===== Contract Studio ===== */
.ct-meter { position: relative; width: 128px; height: 16px; background: var(--border, #e2e8f0); border-radius: 8px; overflow: hidden; display: inline-block; vertical-align: middle; }
.ct-meter-fill { height: 100%; border-radius: 8px; transition: width .3s; }
.ct-meter span { position: absolute; inset: 0; font-size: 10px; text-align: center; line-height: 16px; color: #0f172a; font-weight: 700; }
.ct-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 700px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-domain { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 12px 14px; background: var(--surface, #fff); }
.ct-domain-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; gap: 8px; }
.ct-res { display: flex; flex-direction: column; gap: 5px; }
.ct-res-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; align-items: center; padding: 3px 4px; border-radius: 6px; }
.ct-res-main { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ct-res-main b { font-weight: 600; white-space: nowrap; }
.ct-res-id { color: var(--text-secondary, #64748b); white-space: nowrap; }
.ct-res-row.ct-click { cursor: pointer; }
.ct-res-row.ct-click:hover { background: var(--primary-light, #eff6ff); }
.ct-domain-actions { display: inline-flex; align-items: center; gap: 8px; }
.ct-domain-actions .ct-edit { padding: 2px 10px; font-size: 11px; }
.ct-note { font-size: 12.5px; color: var(--text-primary, #0f172a); line-height: 1.5; }
.ct-fieldlist { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ct-res .ct-extra { display: none; }
.ct-res.ct-open .ct-extra { display: flex; }
.ct-more { padding: 3px 4px; font-size: 12px; font-weight: 600; color: var(--primary, #2563eb); cursor: pointer; }
.ct-more:hover { text-decoration: underline; }
.ct-hint { margin: 8px 0 0; font-size: 12.5px; }
