/* ═══ Lumen Verum SPDA Risk Analyzer ═══ */
/* Dark Navy Theme — Engineering Instrument */

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

:root {
    /* Background layers */
    --bg-body: #0e1525;
    --bg-sidebar: #0a0f1a;
    --bg-card: #161b2e;
    --bg-input: #1e2a3a;
    --bg-hover: #1a2235;
    --bg-section-banner: linear-gradient(135deg, #e6ac0c 0%, #dd8d00 100%);

    /* Borders */
    --border: #2d3a4e;
    --border-focus: #e6ac0c;

    /* Gold palette */
    --gold: #e6ac0c;
    --gold-hover: #dd8d00;
    --gold-dim: #c49a0a;
    --gold-glow: rgba(230, 172, 12, 0.15);

    /* Text */
    --text-primary: #e8e8e8;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-gold: #f5a800;
    --text-dark: #1a1a2e;

    /* Semantic */
    --green-bg: #0f2a1a;
    --green-text: #4ade80;
    --green-border: #1a5c35;
    --red-bg: #2a0f0f;
    --red-text: #f87171;
    --red-border: #5c1a1a;
    --warn-bg: #2a1f0f;
    --warn-text: #fbbf24;
    --info-bg: #0f1a2a;
    --info-text: #60a5fa;

    /* Typography */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Layout */
    --sidebar-width: 260px;
    --radius: 6px;
    --radius-lg: 10px;
    --transition: 200ms ease;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

/* ═══ Analysis Layout (sidebar + main) ═══ */
.analysis-layout {
    display: flex;
    min-height: 100vh;
}

/* ═══ Sidebar ═══ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 2px solid var(--gold);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.sidebar-logo img { height: 28px; }
.sidebar-app-title {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}
.sidebar-app-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}
.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sidebar-nav a.active {
    color: var(--gold);
    border-left-color: var(--gold);
    background: var(--gold-glow);
    font-weight: 600;
}
.sidebar-nav a .nav-icon {
    font-size: 0.75rem;
    width: 1.2rem;
    text-align: center;
}

/* Sidebar Risk Status Panel */
.risk-status {
    padding: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0;
}
.risk-status-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.risk-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}
.risk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.risk-dot.ok { background: var(--green-text); }
.risk-dot.nok { background: var(--red-text); }
.risk-dot.pending { background: var(--text-muted); }
.risk-label { color: var(--text-secondary); }
.risk-value { color: var(--text-primary); font-weight: 600; margin-left: auto; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.sidebar-user {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ═══ Main Content Area ═══ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-inner {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

/* ═══ Title Banner (golden header per section) ═══ */
.title-banner {
    background: var(--bg-section-banner);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.title-banner h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.15rem;
}
.title-banner p {
    font-size: 0.85rem;
    color: rgba(26, 26, 46, 0.7);
}

/* ═══ Section Headers (golden banners) ═══ */
.section-header {
    background: var(--bg-section-banner);
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.55rem 1rem;
    border-radius: var(--radius);
    margin: 1.5rem 0 0.75rem;
}

.sub-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold);
    padding: 0.4rem 0.75rem;
    border-left: 3px solid var(--gold);
    margin: 1rem 0 0.6rem;
    background: var(--gold-glow);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ═══ Form Controls ═══ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.25rem; }
.form-full { grid-column: 1 / -1; }

.field-group { margin-bottom: 0.85rem; }
.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-gold);
    margin-bottom: 0.2rem;
}
.field-label .required { color: var(--red-text); }

.field-input, .field-select, .field-textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-glow);
}
.field-input::placeholder { color: var(--text-muted); }
.field-input:disabled, .field-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.field-help {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.field-textarea { min-height: 80px; resize: vertical; }
.field-select { cursor: pointer; }
.field-select option { background: var(--bg-input); color: var(--text-primary); }

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.field-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
}
.field-checkbox label {
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* ═══ Result Blocks ═══ */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.results-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }

.result-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
}
.result-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-gold);
    display: block;
    margin-bottom: 0.15rem;
}
.result-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}
.result-unit {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.result-formula {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ═══ Risk Badges ═══ */
.risk-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
}
.risk-ok {
    background: var(--green-bg);
    color: var(--green-text);
    border: 1px solid var(--green-border);
}
.risk-nok {
    background: var(--red-bg);
    color: var(--red-text);
    border: 1px solid var(--red-border);
}
.risk-summary {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    border: 2px solid;
}
.risk-summary.ok {
    border-color: var(--green-border);
    background: var(--green-bg);
}
.risk-summary.nok {
    border-color: var(--red-border);
    background: var(--red-bg);
}

/* ═══ Buttons ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.4;
}
.btn-primary {
    background: var(--gold);
    color: var(--text-dark);
    border-color: var(--gold);
}
.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    text-decoration: none;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold-dim);
}
.btn-secondary:hover {
    background: var(--gold-glow);
    text-decoration: none;
}
.btn-danger {
    background: var(--red-bg);
    color: var(--red-text);
    border-color: var(--red-border);
}
.btn-danger:hover { background: #3a1515; }
.btn-outline-light {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline-light:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
.btn-sm { padding: 0.3rem 0.55rem; font-size: 0.75rem; }
.btn-full { width: 100%; }

/* ═══ Alerts ═══ */
.alert {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
}
.alert-success { background: var(--green-bg); color: var(--green-text); border-color: var(--green-text); }
.alert-error { background: var(--red-bg); color: var(--red-text); border-color: var(--red-text); }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-text); }

/* ═══ Cards ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ═══ Tables ═══ */
.table-norm {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.table-norm thead th {
    background: var(--bg-section-banner);
    color: var(--text-dark);
    padding: 0.5rem 0.65rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.table-norm tbody td {
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.table-norm tbody tr { background: var(--bg-card); }
.table-norm tbody tr:nth-child(even) { background: #1a2035; }
.table-norm tbody tr:hover { background: var(--bg-hover); }

/* ═══ Progress Bar ═══ */
.progress-bar {
    background: var(--border);
    border-radius: 3px;
    height: 4px;
    margin-bottom: 0.3rem;
    overflow: hidden;
}
.progress-fill {
    background: var(--bg-section-banner);
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.progress-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ═══ Page Navigation ═══ */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.page-indicator { font-size: 0.82rem; color: var(--text-muted); }

/* ═══ Auth Pages ═══ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-body);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.auth-card h1 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}
.auth-card h2 {
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 400;
    margin-bottom: 1.5rem;
}
.auth-links { text-align: center; margin-top: 1rem; }
.auth-links a { color: var(--gold); font-size: 0.85rem; }

/* ═══ Projects Page ═══ */
.page-content { padding: 1.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.projects-header h1 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    font-size: 1.5rem;
}
.projects-count { font-size: 0.82rem; color: var(--text-secondary); }

.project-name { font-weight: 500; color: var(--text-primary); }
.project-progress { width: 120px; }
.project-progress-bar { background: var(--border); border-radius: 2px; height: 4px; }
.project-progress-fill { background: var(--gold); height: 100%; border-radius: 2px; }
.project-progress-text { font-size: 0.72rem; color: var(--text-muted); }
.project-date { font-size: 0.78rem; color: var(--text-muted); }
.project-actions { display: flex; gap: 0.35rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state p { margin-bottom: 1rem; }

/* ═══ Collapsible ═══ */
.collapsible-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    transition: background var(--transition);
}
.collapsible-toggle:hover { background: var(--bg-hover); }
.collapsible-content {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -0.4rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

/* ═══ Recommendations ═══ */
.recommendation {
    background: var(--warn-bg);
    border: 1px solid var(--warn-text);
    border-left: 4px solid var(--warn-text);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}
.recommendation h4 { color: var(--warn-text); margin-bottom: 0.4rem; font-size: 0.9rem; }
.recommendation p { font-size: 0.82rem; color: var(--text-secondary); }

/* ═══ Legal ═══ */
.legal-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}
.legal-content h1 { font-family: var(--font-serif); color: var(--text-primary); margin-bottom: 1rem; }
.legal-content h2 { font-family: var(--font-serif); color: var(--gold); margin-top: 1.5rem; margin-bottom: 0.5rem; }
.legal-content ul { margin-left: 1.5rem; margin-bottom: 1rem; color: var(--text-secondary); }
.legal-content p { margin-bottom: 0.75rem; color: var(--text-secondary); }
.legal-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ═══ Footer ═══ */
.footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.footer a { color: var(--gold-dim); }

/* ═══ Report Page ═══ */
.report-actions { display: flex; gap: 0.75rem; margin: 1.25rem 0; flex-wrap: wrap; }
.report-summary { margin-bottom: 1.25rem; }

/* ═══ Navbar (for non-analysis pages) ═══ */
.navbar {
    background: var(--bg-sidebar);
    padding: 0.6rem 0;
    border-bottom: 2px solid var(--gold);
}
.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.nav-brand img { height: 28px; }
.nav-app-name {
    font-family: var(--font-serif);
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
}
.nav-links { display: flex; align-items: center; gap: 0.75rem; }
.nav-user { color: var(--text-secondary); font-size: 0.82rem; }
.nav-link { color: var(--text-secondary); font-size: 0.82rem; }
.nav-link:hover { color: var(--gold); }

/* ═══ HTMX loading indicator ═══ */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }
#main-section.htmx-swapping { opacity: 0.6; transition: opacity 100ms; }
#main-section.htmx-settling { opacity: 1; transition: opacity 200ms; }

/* ═══ Auto-save indicator ═══ */
.save-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--green-bg);
    color: var(--green-text);
    border: 1px solid var(--green-border);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 300ms;
    z-index: 1000;
}
.save-indicator.show { opacity: 1; }

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-focus); }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .sidebar { position: relative; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .main-content { margin-left: 0; }
    .analysis-layout { flex-direction: column; }
    .main-inner { padding: 1rem; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .results-grid, .results-grid-3 { grid-template-columns: 1fr; }
    .page-nav { flex-direction: column; gap: 0.5rem; }
    .projects-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .report-actions { flex-direction: column; }
    .auth-card { margin: 1rem; padding: 1.5rem; }
    .page-content { padding: 1rem; }
}


/* ═══ Tooltips ═══ */
.field-with-tooltip {
    position: relative;
}
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
    color: var(--gold-dim);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
    margin-left: 0.35rem;
    vertical-align: middle;
    transition: all var(--transition);
    flex-shrink: 0;
}
.tooltip-trigger:hover {
    background: var(--gold);
    color: var(--text-dark);
    border-color: var(--gold);
}
.tooltip-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: #2a2000;
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.tooltip-trigger:hover + .tooltip-content,
.tooltip-content:hover,
.tooltip-trigger.active + .tooltip-content {
    display: block;
}

/* ═══ SVG Gauge ═══ */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.25rem 0;
}
.gauge-svg {
    width: 320px;
    height: 180px;
}
.gauge-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.gauge-value-display {
    text-align: center;
    margin-top: -1.5rem;
}
.gauge-main-value {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.gauge-delta {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.15rem;
}
.gauge-delta.positive { color: var(--red-text); }
.gauge-delta.negative { color: var(--green-text); }

/* ═══ Risk Result Enhanced ═══ */
.risk-verdict {
    text-align: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    font-family: var(--font-mono);
}
.risk-verdict.ok {
    background: linear-gradient(135deg, #0a3d1f 0%, #1a6b3a 100%);
    border: 2px solid var(--green-text);
}
.risk-verdict.nok {
    background: linear-gradient(135deg, #3d0a0a 0%, #6b1a1a 100%);
    border: 2px solid var(--red-text);
}
.risk-verdict-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
}
.risk-verdict-label {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.risk-verdict.ok .risk-verdict-label { color: var(--green-text); }
.risk-verdict.nok .risk-verdict-label { color: var(--red-text); }
.risk-verdict-detail {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

/* ═══ Chart Container ═══ */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}
.chart-container canvas {
    max-height: 300px;
}
.chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ═══ Value Box (like Streamlit metric) ═══ */
.value-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-align: center;
    margin-bottom: 0.5rem;
}
.value-box-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-gold);
    margin-bottom: 0.2rem;
}
.value-box-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══ Recommendation Cards Enhanced ═══ */
.recommendations-section {
    margin-top: 1.5rem;
    border: 2px solid var(--gold-dim);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.recommendations-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid var(--gold-dim);
    padding: 0.85rem 1rem;
}
.recommendations-header h3 {
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}
.recommendations-header p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}
.recommendation-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.recommendation-item:last-child { border-bottom: none; }
.recommendation-item h4 {
    color: var(--gold);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}
.recommendation-item .rec-diagnosis { color: var(--text-primary); font-size: 0.82rem; margin-bottom: 0.3rem; }
.recommendation-item .rec-solution { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.3rem; }
.recommendation-item .rec-field {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    margin-top: 0.3rem;
}
