/**
 * AI Risk Intelligence Center Styles
 * 
 * @version 2.3.0
 */

/* ==================== Container & Layout ==================== */
.ric-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==================== Header ==================== */
.ric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
}

.ric-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.ric-icon {
    font-size: 28px;
}

.ric-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Phase Indicator */
.ric-phase-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ric-phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ric-phase-step.active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ric-phase-step.complete {
    background: rgba(34, 197, 94, 0.3);
}

.ric-phase-icon {
    font-size: 18px;
}

.ric-phase-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ric-phase-connector {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Main Content ==================== */
.ric-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    min-height: 600px;
    transition: grid-template-columns 0.3s ease;
}

.ric-main.chat-minimized {
    grid-template-columns: 1fr 50px;
}

.ric-workflow-panel {
    padding: 24px;
    overflow-y: auto;
    max-height: 75vh;
}

.ric-chat-panel {
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.ric-chat-panel.hidden {
    display: none;
}

.ric-chat-panel.minimized {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

.ric-chat-panel.minimized .ric-chat-title {
    display: none;
}

.ric-chat-panel.minimized .ric-chat-header {
    justify-content: center;
    padding: 12px 8px;
    flex-direction: column;
}

.ric-chat-panel.minimized .ric-chat-messages,
.ric-chat-panel.minimized .ric-chat-input-area,
.ric-chat-panel.minimized .ric-chat-welcome {
    display: none;
}

.ric-chat-panel.minimized .ric-chat-minimize {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

/* ==================== Phase Content ==================== */
.ric-phase-content {
    max-width: 900px;
    margin: 0 auto;
}

.ric-phase-header {
    margin-bottom: 24px;
}

.ric-phase-header h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1e293b;
}

.ric-phase-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

/* ==================== Forms ==================== */
.ric-form {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ric-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ric-form-group.full-width {
    grid-column: span 2;
}

.ric-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ric-form-group input,
.ric-form-group select,
.ric-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

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

.ric-char-count {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
}

.ric-import-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.ric-import-hint {
    font-size: 12px;
    color: #64748b;
}

.ric-form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* ==================== Buttons ==================== */
.ric-btn-primary,
.ric-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.ric-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.ric-btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ric-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ric-btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

.ric-btn-icon {
    font-size: 18px;
}

/* ==================== AI Intro ==================== */
.ric-ai-intro {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.ric-ai-avatar {
    font-size: 40px;
    flex-shrink: 0;
}

.ric-ai-message {
    flex: 1;
}

.ric-ai-message p {
    margin: 0 0 12px;
    color: #1e40af;
    font-size: 15px;
    line-height: 1.6;
}

.ric-risk-areas {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
}

.ric-risk-areas ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.ric-risk-areas li {
    color: #475569;
    font-size: 13px;
    margin: 4px 0;
}

/* ==================== Discovery Questions ==================== */
.ric-discovery-questions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ric-question-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-question-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}

.ric-question-content {
    flex: 1;
}

.ric-question-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.ric-question-context {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.ric-question-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ric-option {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-option:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
}

.ric-option input {
    display: none;
}

.ric-option input:checked + .ric-option-label {
    color: #1d4ed8;
    font-weight: 600;
}

.ric-option:has(input:checked) {
    background: #eff6ff;
    border-color: #3b82f6;
}

.ric-option-label {
    font-size: 14px;
    color: #1e293b;
}

.ric-option-risk {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ==================== Risk Summary Cards ==================== */
.ric-summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.ric-summary-card {
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-summary-card.critical { border-left: 4px solid #ef4444; }
.ric-summary-card.high { border-left: 4px solid #f97316; }
.ric-summary-card.medium { border-left: 4px solid #eab308; }
.ric-summary-card.low { border-left: 4px solid #22c55e; }
.ric-summary-card.total { border-left: 4px solid #3b82f6; }

.ric-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.ric-card-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ==================== Risk Matrix ==================== */
.ric-risk-matrix-section,
.ric-rbs-section,
.ric-risk-details-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-risk-matrix-section h4,
.ric-rbs-section h4,
.ric-risk-details-section h4 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
}

.ric-matrix-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ric-matrix-header,
.ric-matrix-row {
    display: flex;
    gap: 2px;
}

.ric-matrix-corner,
.ric-matrix-row-label,
.ric-matrix-header-cell {
    width: 80px;
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.ric-matrix-cell {
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-matrix-cell.low { background: #dcfce7; }
.ric-matrix-cell.medium { background: #fef9c3; }
.ric-matrix-cell.high { background: #fed7aa; }
.ric-matrix-cell.critical { background: #fecaca; }

.ric-matrix-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ric-matrix-risks {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

.ric-matrix-risk-dot {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.ric-matrix-more {
    font-size: 9px;
    color: #64748b;
}

.ric-matrix-xlabel,
.ric-matrix-ylabel {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    padding: 8px;
}

.ric-matrix-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.ric-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.ric-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.ric-legend-color.critical { background: #fecaca; }
.ric-legend-color.high { background: #fed7aa; }
.ric-legend-color.medium { background: #fef9c3; }
.ric-legend-color.low { background: #dcfce7; }

/* ==================== RBS Tree ==================== */
.ric-rbs-category {
    margin-bottom: 8px;
}

.ric-rbs-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-rbs-category-header:hover {
    background: #f1f5f9;
}

.ric-rbs-toggle {
    color: #64748b;
    font-size: 10px;
}

.ric-rbs-icon {
    font-size: 18px;
}

.ric-rbs-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
}

.ric-rbs-count {
    font-size: 12px;
    color: #94a3b8;
}

.ric-rbs-risks {
    padding-left: 40px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ric-rbs-risks.collapsed {
    max-height: 0;
}

.ric-rbs-risks.expanded {
    max-height: 500px;
}

.ric-rbs-risk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 4px 0;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-rbs-risk.critical { border-left-color: #ef4444; }
.ric-rbs-risk.high { border-left-color: #f97316; }
.ric-rbs-risk.medium { border-left-color: #eab308; }
.ric-rbs-risk.low { border-left-color: #22c55e; }

.ric-rbs-risk:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.ric-rbs-risk-id {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.ric-rbs-risk-name {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
}

.ric-rbs-risk-severity {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.ric-rbs-risk-severity.critical { background: #fef2f2; color: #dc2626; }
.ric-rbs-risk-severity.high { background: #fff7ed; color: #ea580c; }
.ric-rbs-risk-severity.medium { background: #fefce8; color: #ca8a04; }
.ric-rbs-risk-severity.low { background: #f0fdf4; color: #16a34a; }

/* ==================== Risk List & Cards ==================== */
.ric-risk-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ric-risk-tab {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-risk-tab:hover {
    border-color: #3b82f6;
}

.ric-risk-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ric-risk-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ric-risk-card {
    background: white;
    border-radius: 10px;
    border-left: 4px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ric-risk-card.critical { border-left-color: #ef4444; }
.ric-risk-card.high { border-left-color: #f97316; }
.ric-risk-card.medium { border-left-color: #eab308; }
.ric-risk-card.low { border-left-color: #22c55e; }

.ric-risk-card.highlight {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.ric-risk-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
}

.ric-risk-id-badge {
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: #475569;
    padding: 4px 8px;
    border-radius: 4px;
}

.ric-risk-title {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.ric-risk-severity-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.ric-risk-severity-badge.critical { background: #ef4444; color: white; }
.ric-risk-severity-badge.high { background: #f97316; color: white; }
.ric-risk-severity-badge.medium { background: #eab308; color: white; }
.ric-risk-severity-badge.low { background: #22c55e; color: white; }

.ric-risk-card-body {
    padding: 16px;
}

.ric-risk-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ric-risk-category {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 12px;
}

.ric-risk-score {
    font-size: 12px;
    color: #64748b;
}

.ric-risk-description {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 16px;
}

.ric-risk-metrics {
    display: flex;
    gap: 24px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
}

.ric-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ric-metric .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

.ric-metric .value {
    font-size: 13px;
    font-weight: 600;
}

.ric-metric .value.very-high,
.ric-metric .value.high { color: #dc2626; }
.ric-metric .value.medium { color: #ca8a04; }
.ric-metric .value.low,
.ric-metric .value.very-low { color: #16a34a; }

.ric-risk-details {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.ric-risk-details.collapsed {
    display: none;
}

.ric-detail-section {
    margin-bottom: 12px;
}

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

.ric-detail-section strong {
    display: block;
    font-size: 12px;
    color: #1e293b;
    margin-bottom: 6px;
}

.ric-detail-section ul {
    margin: 0;
    padding-left: 18px;
}

.ric-detail-section li {
    font-size: 13px;
    color: #475569;
    margin: 4px 0;
}

.ric-linked-risks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ric-link-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
}

.ric-impacts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ric-impact-item {
    font-size: 12px;
    padding: 4px 10px;
    background: white;
    border-radius: 4px;
    color: #475569;
}

.ric-toggle-details {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-toggle-details:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

.ric-toggle-details .hide-text {
    display: none;
}

.ric-toggle-details.expanded .show-text {
    display: none;
}

.ric-toggle-details.expanded .hide-text {
    display: inline;
}

/* ==================== Quantitative Phase ==================== */
.ric-quant-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-quant-section h4 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
}

.ric-monte-carlo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ric-mc-card {
    padding: 16px;
    border-radius: 10px;
    background: #f8fafc;
}

.ric-mc-card.cost { border-top: 3px solid #3b82f6; }
.ric-mc-card.schedule { border-top: 3px solid #10b981; }

.ric-mc-header {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.ric-mc-chart {
    margin-bottom: 12px;
}

.ric-mc-svg {
    width: 100%;
    height: auto;
}

.ric-mc-label {
    font-size: 10px;
    fill: #64748b;
}

.ric-mc-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ric-mc-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
}

.ric-mc-stat.highlight {
    background: #1e40af;
    color: white;
}

.ric-mc-stat .label {
    font-size: 12px;
}

.ric-mc-stat .value {
    font-size: 13px;
    font-weight: 600;
}

.ric-mc-stat .value.positive { color: #16a34a; }
.ric-mc-stat .value.negative { color: #dc2626; }

/* EMV Section */
.ric-emv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ric-emv-card {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    text-align: center;
}

.ric-emv-card.total { border-top: 3px solid #ef4444; }
.ric-emv-card.contingency { border-top: 3px solid #f97316; }
.ric-emv-card.management { border-top: 3px solid #22c55e; }

.ric-emv-value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.ric-emv-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.ric-emv-breakdown h5 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #1e293b;
}

.ric-emv-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ric-emv-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ric-emv-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ric-emv-bar-label .rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e40af;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.ric-emv-bar-label .name {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
}

.ric-emv-bar-label .emv {
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
}

.ric-emv-bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.ric-emv-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Exposure Gauge */
.ric-exposure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

.ric-gauge-container {
    text-align: center;
}

.ric-gauge-svg {
    width: 200px;
    height: 120px;
}

.ric-gauge-label {
    font-size: 10px;
    fill: #64748b;
}

.ric-gauge-value {
    margin-top: 8px;
}

.ric-gauge-value .score {
    font-size: 32px;
    font-weight: 700;
}

.ric-gauge-value .label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.ric-gauge-value .trend {
    font-size: 12px;
    color: #64748b;
}

.ric-category-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ric-category-bar-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    gap: 12px;
    align-items: center;
}

.ric-category-label {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.ric-category-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.ric-category-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.ric-category-value {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

/* Tornado Chart */
.ric-tornado-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ric-tornado-bar {
    display: grid;
    grid-template-columns: 200px 1fr 50px;
    gap: 12px;
    align-items: center;
}

.ric-tornado-label {
    font-size: 13px;
    color: #1e293b;
    text-align: right;
}

.ric-tornado-track {
    height: 20px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.ric-tornado-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 4px;
}

.ric-tornado-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

/* Recommendations */
.ric-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.ric-recommendation {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.ric-recommendation .icon {
    font-size: 24px;
}

.ric-recommendation .content strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.ric-recommendation .content p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.ric-priority-actions {
    padding: 16px;
    background: #eff6ff;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.ric-priority-actions ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.ric-priority-actions li {
    font-size: 13px;
    color: #1e40af;
    margin: 6px 0;
}

/* Scenario Builder */
.ric-scenario-builder {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ric-scenario-builder textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.ric-scenario-results {
    margin-top: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.ric-scenario-results.hidden {
    display: none;
}

.ric-scenario-result h5 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1e293b;
}

.ric-scenario-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ric-likelihood,
.ric-impact {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ric-likelihood.low { background: #dcfce7; color: #16a34a; }
.ric-likelihood.medium { background: #fef9c3; color: #ca8a04; }
.ric-likelihood.high { background: #fecaca; color: #dc2626; }

.ric-impact.minor { background: #dcfce7; color: #16a34a; }
.ric-impact.moderate { background: #fef9c3; color: #ca8a04; }
.ric-impact.major { background: #fed7aa; color: #ea580c; }
.ric-impact.severe { background: #fecaca; color: #dc2626; }

/* ==================== Response Phase ==================== */
.ric-response-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ric-response-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ric-urgency-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.ric-urgency-badge.🔴 { color: #dc2626; }
.ric-response-header.urgent .ric-urgency-badge { background: #fef2f2; color: #dc2626; }
.ric-response-header.important .ric-urgency-badge { background: #fff7ed; color: #ea580c; }
.ric-response-header.standard .ric-urgency-badge { background: #fefce8; color: #ca8a04; }
.ric-response-header.accepted .ric-urgency-badge { background: #f0fdf4; color: #16a34a; }

.ric-timeframe {
    font-size: 12px;
    color: #64748b;
}

.ric-response-risks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ric-response-risks.collapsed {
    max-height: 300px;
    overflow: hidden;
}

.ric-toggle-risks {
    width: 100%;
    padding: 10px;
    background: #f8fafc;
    border: none;
    border-radius: 6px;
    color: #3b82f6;
    font-size: 13px;
    cursor: pointer;
    margin-top: 12px;
}

.ric-response-risk-card {
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #e2e8f0;
}

.ric-response-risk-card.urgent { border-left-color: #ef4444; }
.ric-response-risk-card.important { border-left-color: #f97316; }
.ric-response-risk-card.standard { border-left-color: #eab308; }

.ric-response-risk-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ric-strategy-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ric-strategy-badge.mitigate { background: #dbeafe; color: #1d4ed8; }
.ric-strategy-badge.transfer { background: #fae8ff; color: #a21caf; }
.ric-strategy-badge.avoid { background: #fef2f2; color: #dc2626; }
.ric-strategy-badge.accept { background: #f0fdf4; color: #16a34a; }
.ric-strategy-badge.escalate { background: #fef3c7; color: #d97706; }

.ric-strategy-rationale {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.ric-response-actions strong {
    display: block;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 8px;
}

.ric-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ric-action-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.ric-action-checkbox {
    color: #cbd5e1;
    font-size: 16px;
}

.ric-action-content {
    flex: 1;
}

.ric-action-text {
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 6px;
}

.ric-action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ric-action-meta span {
    font-size: 11px;
    color: #64748b;
}

.ric-response-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ric-response-footer > div {
    font-size: 12px;
    color: #475569;
}

.ric-residual-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ric-residual-badge.low { background: #dcfce7; color: #16a34a; }
.ric-residual-badge.medium { background: #fef9c3; color: #ca8a04; }
.ric-residual-badge.high { background: #fecaca; color: #dc2626; }

/* Resources */
.ric-resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.ric-resource-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.ric-resource-card .icon {
    font-size: 24px;
}

.ric-resource-card .value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.ric-resource-card .label {
    font-size: 11px;
    color: #64748b;
}

/* Monitoring */
.ric-monitoring-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.ric-monitoring-item {
    font-size: 13px;
    color: #475569;
}

.ric-kpis {
    margin-top: 16px;
}

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

.ric-kpi-table th,
.ric-kpi-table td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.ric-kpi-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

/* PM Notes */
.ric-pm-notes-content {
    padding: 16px;
    background: #fffbeb;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
}

.ric-pm-notes-content p {
    margin: 0;
    font-size: 14px;
    color: #78350f;
    line-height: 1.6;
}

/* ==================== Complete Phase ==================== */
.ric-complete-phase {
    text-align: center;
    padding: 40px 20px;
}

.ric-complete-header {
    margin-bottom: 32px;
}

.ric-complete-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.ric-complete-header h3 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #1e293b;
}

.ric-complete-summary {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
}

.ric-complete-summary .ric-summary-card {
    min-width: 140px;
}

.ric-export-section {
    margin-bottom: 40px;
}

.ric-export-section h4 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1e293b;
}

.ric-export-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.ric-export-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-export-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.ric-export-btn .icon {
    font-size: 32px;
}

.ric-export-btn .label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.ric-export-btn .desc {
    font-size: 11px;
    color: #64748b;
}

.ric-actions-section h4 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
}

.ric-next-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ric-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-action-btn:hover {
    background: white;
    border-color: #3b82f6;
    color: #3b82f6;
}

.ric-cta-section {
    margin-top: 40px;
}

.ric-cta-box {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 16px;
    color: white;
}

.ric-cta-box h4 {
    margin: 0 0 12px;
    font-size: 18px;
}

.ric-cta-box p {
    margin: 0 0 16px;
    font-size: 14px;
    opacity: 0.9;
}

.ric-cta-link {
    display: inline-block;
    padding: 10px 24px;
    background: white;
    color: #1e40af;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ric-cta-link:hover {
    transform: scale(1.05);
}

/* ==================== Chat Panel ==================== */
.ric-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ric-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #1e40af;
    color: white;
}

.ric-chat-title {
    font-size: 14px;
    font-weight: 600;
}

.ric-chat-minimize {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

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

.ric-chat-welcome {
    display: flex;
    gap: 12px;
}

.ric-chat-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    border-radius: 50%;
    flex-shrink: 0;
}

.ric-chat-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
}

.ric-chat-bubble.assistant {
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.ric-chat-bubble.user {
    background: #3b82f6;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ric-chat-bubble.typing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.ric-chat-bubble ul {
    margin: 8px 0 0;
    padding-left: 16px;
}

.ric-chat-bubble li {
    margin: 4px 0;
    font-size: 12px;
}

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

.ric-chat-message.user {
    justify-content: flex-end;
}

.ric-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.ric-chat-input-container textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    resize: none;
}

.ric-chat-send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-chat-send-btn:hover {
    background: #1d4ed8;
}

/* ==================== Footer ==================== */
.ric-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.ric-powered-by {
    font-size: 12px;
    color: #64748b;
}

.ric-footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ric-footer-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ==================== Loading State ==================== */
.ric-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.ric-loading-spinner {
    margin-bottom: 24px;
}

.ric-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.ric-loading-message {
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 24px;
}

.ric-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
}

.ric-loading-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.ric-loading-step.active {
    opacity: 1;
    background: #dbeafe;
}

.ric-loading-step.complete {
    opacity: 1;
    background: #dcfce7;
}

.ric-loading-step.complete .step-icon::after {
    content: '✓';
    position: absolute;
}

.step-icon {
    font-size: 18px;
}

.step-text {
    font-size: 13px;
    color: #475569;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .ric-main {
        grid-template-columns: 1fr;
    }
    
    .ric-chat-panel {
        display: none;
    }
    
    .ric-monte-carlo-grid,
    .ric-exposure-grid,
    .ric-recommendations-grid,
    .ric-export-grid {
        grid-template-columns: 1fr;
    }
    
    .ric-summary-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ric-emv-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ric-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .ric-phase-indicator {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ric-form-grid {
        grid-template-columns: 1fr;
    }
    
    .ric-form-group.full-width {
        grid-column: span 1;
    }
    
    .ric-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ric-emv-grid,
    .ric-monitoring-grid {
        grid-template-columns: 1fr;
    }
    
    .ric-matrix-cell {
        width: 50px;
        height: 50px;
    }
    
    .ric-tornado-bar {
        grid-template-columns: 120px 1fr 40px;
    }
}

@media (max-width: 480px) {
    .ric-container {
        border-radius: 0;
    }
    
    .ric-workflow-panel {
        padding: 16px;
    }
    
    .ric-summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .ric-complete-summary {
        flex-wrap: wrap;
    }
    
    .ric-next-actions {
        flex-direction: column;
    }
}

/* Error State */
.ric-error-state {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.ric-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.ric-error-state h3 {
    color: #dc2626;
    font-size: 24px;
    margin-bottom: 12px;
}

.ric-error-state p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.ric-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ric-error-actions .ric-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ric-error-actions .ric-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.ric-error-actions .ric-btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ric-error-actions .ric-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
