/**
 * ENV RMP Enterprise - Professional Stylesheet
 * Includes Layout, Component UI, and Specialized Print Engines.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- BASE & LAYOUT --- */
:root {
    --primary: #3b82f6;
    --sidebar-bg: #ffffff;
    --app-bg: #f1f5f9;
    --text-main: #1e293b;
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--app-bg); 
    color: var(--text-main);
    margin: 0;
    padding: 25px; 
    height: 100vh; 
    display: flex; 
    overflow: hidden; 
}

main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    overflow: hidden; 
    position: relative; 
}

#content-area { 
    flex: 1; 
    overflow-y: auto; 
    padding: 2rem; 
}

/* --- NAVIGATION --- */
.nav-item {
    transition: all 0.2s ease;
    border-right: 4px solid transparent;
}

.nav-item.active { 
    background-color: #e2e8f0; 
    color: #0f172a; 
    border-right: 4px solid var(--primary); 
    font-weight: 600;
}

/* --- RISK MATRICES --- */
.matrix-cell { 
    transition: all 0.2s ease; 
    cursor: pointer; 
    border: 1px solid rgba(0,0,0,0.05); 
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* Significance Coloring Logic */
.bg-extreme { background-color: #ef4444; color: white; } /* Red 500 */
.bg-high    { background-color: #fb923c; color: white; } /* Orange 400 */
.bg-moderate { background-color: #fde047; color: #854d0e; } /* Yellow 300 */
.bg-low      { background-color: #4ade80; color: white; } /* Green 400 */

/* Opportunity (Blue Scale) */
.bg-opp-high { background-color: #2563eb; color: white; }
.bg-opp-mod  { background-color: #60a5fa; color: white; }
.bg-opp-low  { background-color: #bfdbfe; color: #1e3a8a; }

/* --- TECHNICAL DIAGRAMS --- */
.bowtie-box { 
    border-radius: 8px; 
    padding: 15px; 
    text-align: center; 
    color: white; 
    font-weight: bold; 
    position: relative; 
    z-index: 10; 
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.bowtie-barrier { 
    background-color: #fff; 
    border: 2px solid #64748b; 
    color: #475569; 
    padding: 10px; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    z-index: 20; 
    position: relative; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    width: 130px; 
    text-align: center;
    font-weight: 600;
}

/* --- SPECIALIZED PRINT ENGINE --- */
@media print {
    * { 
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important; 
    }
    
    body { background: white !important; overflow: visible !important; padding: 0 !important; }
    aside, .no-print, button, .modal, #login-overlay, header { display: none !important; }
    
    main { margin: 0; padding: 0 !important; overflow: visible; width: 100%; display: block; }
    #content-area { padding: 0 !important; overflow: visible; width: 100%; }
    
    /* Section-specific Visibility Logic */
    body.printing-single-risk #print-risk-view { display: block !important; width: 100%; }
    body.printing-single-risk #content-area > :not(#print-risk-view) { display: none !important; }
    
    body.printing-dashboard #view-dashboard { display: block !important; }
    body.printing-dashboard #content-area > :not(#view-dashboard) { display: none !important; }
    
    body.printing-methodology #view-methodology { display: block !important; width: 100%; }
    body.printing-methodology #content-area > :not(#view-methodology) { display: none !important; }

    /* Page Orientation Overrides */
    .print-landscape { @page { size: landscape; margin: 1cm; } }
    .print-portrait { @page { size: portrait; margin: 1.5cm; } }
    
    .chart-container { page-break-inside: avoid; height: 350px !important; width: 100% !important; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
}

/* UI Helper Classes */
.view-section { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.chart-container { position: relative; width: 100%; height: 300px; }