/* Raqb — Shared styles */

:root {
    --navy:      #0B1F33;
    --navy-2:    #112B45;
    --navy-3:    #16345A;
    --gold:      #D4A437;
    --gold-2:    #E8BB4D;
    --cyan:      #3DD9D6;
    --cyan-2:    #6FF0ED;
    --bg:        #0A1018;
    --bg-2:      #0E1620;
    --card:      #142233;
    --card-2:    #1A2D44;
    --border:    rgba(212,164,55,0.18);
    --text:      #E5ECF2;
    --muted:     #8FA0B3;
    --success:   #2BC48A;
    --danger:    #E63946;
    --warn:      #F4A540;
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navigation bar ── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(11,31,51,0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
}
.nav-brand .ar { color: var(--cyan); font-size: 18px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text); font-size: 14px; }
.nav-links a:hover { color: var(--gold); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: var(--navy);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(212,164,55,0.25); }
.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}
.btn-secondary:hover { background: rgba(212,164,55,0.08); }
.btn-cyan {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
    color: var(--navy);
}
.btn-cyan:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(61,217,214,0.25); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Forms ── */
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 440px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.form-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.form-card p.hint { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.form-error {
    background: rgba(230,57,70,0.1);
    border: 1px solid rgba(230,57,70,0.4);
    color: #ff8e96;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.form-success {
    background: rgba(43,196,138,0.1);
    border: 1px solid rgba(43,196,138,0.4);
    color: var(--success);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Cards / sections ── */
.section {
    padding: 60px 0;
}
.section-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-subtitle {
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 40px;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.2s;
    cursor: pointer;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 16px 40px rgba(212,164,55,0.12);
}
.feature-card .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--gold); }
.feature-card p { color: var(--muted); font-size: 14px; }

/* ── Hero ── */
.hero {
    padding: 100px 32px 80px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(212,164,55,0.08), transparent 60%);
}
.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 12px;
    border-radius: 999px;
    margin-bottom: 24px;
    letter-spacing: 1px;
}
.hero h1 {
    font-size: clamp(48px, 7vw, 84px);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .arabic { font-size: 32px; color: var(--gold); margin-bottom: 28px; }
.hero .tagline {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 500;
}
.hero .desc {
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 40px;
    font-size: 16px;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Dashboard layout ── */
.dash-wrap { display: flex; min-height: 100vh; }
.dash-sidebar {
    width: 260px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    flex-shrink: 0;
}
.dash-main {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 6px;
    cursor: pointer;
}
.sidebar-link:hover { background: rgba(212,164,55,0.08); color: var(--gold); }
.sidebar-link.active { background: rgba(212,164,55,0.15); color: var(--gold); }
.sidebar-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }

/* ── Pillar score ── */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.pillar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.pillar-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.pillar-card .score { font-size: 36px; font-weight: 800; margin: 6px 0; }
.score-good { color: var(--success); }
.score-mid  { color: var(--warn); }
.score-bad  { color: var(--danger); }
.progress-bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--cyan)); transition: width 0.4s; }

/* ── Findings list ── */
.finding {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
}
.finding.sev-critical { border-left-color: var(--danger); }
.finding.sev-high     { border-left-color: var(--warn); }
.finding.sev-medium   { border-left-color: var(--gold); }
.finding.sev-low      { border-left-color: var(--cyan); }
.finding-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.finding-title { font-size: 15px; font-weight: 600; color: var(--text); }
.severity-pill {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.severity-pill.critical { background: rgba(230,57,70,0.15); color: var(--danger); }
.severity-pill.high     { background: rgba(244,165,64,0.15); color: var(--warn); }
.severity-pill.medium   { background: rgba(212,164,55,0.15); color: var(--gold); }
.severity-pill.low      { background: rgba(61,217,214,0.15); color: var(--cyan); }
.finding-desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.framework-refs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.framework-tag {
    background: rgba(61,217,214,0.1);
    color: var(--cyan);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ── Upload zone ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--card);
}
.upload-zone:hover, .upload-zone.dragging {
    border-color: var(--gold);
    background: rgba(212,164,55,0.04);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-zone p { color: var(--muted); font-size: 14px; }
.upload-zone .filename { color: var(--gold); font-weight: 600; margin-top: 8px; }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid rgba(212,164,55,0.25);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--muted);
}
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 4px; margin-bottom: 16px; }

/* ── Utility ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* Service chip list */
.service-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(61,217,214,0.1);
    border: 1px solid rgba(61,217,214,0.3);
    color: var(--cyan);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    margin: 4px;
}
.service-chip .count {
    background: var(--cyan);
    color: var(--navy);
    font-weight: 700;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
}

/* ══════════════════════════════════════════════
   DIAGRAM ASSESSMENT REPORT
══════════════════════════════════════════════ */

/* ── Overall score hero ── */
.report-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.report-hero-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    flex-shrink: 0;
    position: relative;
}
.report-hero-score.good  { border-color: var(--success); }
.report-hero-score.mid   { border-color: var(--warn); }
.report-hero-score.bad   { border-color: var(--danger); }
.report-hero-score .num  {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}
.report-hero-score .lbl  {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 2px;
}
.report-hero-body { flex: 1; min-width: 200px; }
.report-hero-body h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.report-hero-body .pattern-badge {
    display: inline-block;
    background: rgba(61,217,214,.12);
    color: var(--cyan);
    border: 1px solid rgba(61,217,214,.25);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.report-hero-body p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

/* ── Risk summary bar ── */
.risk-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.risk-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.risk-pill:hover    { border-color: var(--gold); }
.risk-pill.active   { background: rgba(212,164,55,.08); border-color: var(--gold); }
.risk-pill.active.sev-critical { background: rgba(230,57,70,.1);  border-color: var(--danger); }
.risk-pill.active.sev-high     { background: rgba(244,165,64,.1); border-color: var(--warn); }
.risk-pill.active.sev-medium   { background: rgba(212,164,55,.1); border-color: var(--gold); }
.risk-pill.active.sev-low      { background: rgba(61,217,214,.1); border-color: var(--cyan); }
.risk-pill .rp-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sev-critical .rp-dot { background: var(--danger); }
.sev-high     .rp-dot { background: var(--warn); }
.sev-medium   .rp-dot { background: var(--gold); }
.sev-low      .rp-dot { background: var(--cyan); }
.risk-pill .rp-label  { font-size: 13px; font-weight: 600; color: var(--text); }
.risk-pill .rp-count  { font-size: 18px; font-weight: 800; color: var(--text); }
.risk-pill.sev-critical .rp-count { color: var(--danger); }
.risk-pill.sev-high     .rp-count { color: var(--warn); }
.risk-pill.sev-medium   .rp-count { color: var(--gold); }
.risk-pill.sev-low      .rp-count { color: var(--cyan); }

/* ── Pillar grid (enhanced) ── */
.pillar-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.pillar-card-v2 {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 16px 14px;
    transition: border-color .2s;
    cursor: default;
}
.pillar-card-v2:hover { border-color: rgba(212,164,55,.4); }
.pillar-card-v2 .pc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.pillar-card-v2 .pc-score {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}
.pillar-card-v2 .pc-bar {
    height: 5px;
    background: var(--bg-2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.pillar-card-v2 .pc-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .6s cubic-bezier(.22,1,.36,1);
}
.pc-fill.good { background: linear-gradient(90deg, var(--success), #22d48a); }
.pc-fill.mid  { background: linear-gradient(90deg, var(--warn), #f9b74e); }
.pc-fill.bad  { background: linear-gradient(90deg, var(--danger), #f06070); }
.pillar-card-v2 .pc-rationale {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* Pillar detail expand toggle */
.pillar-detail-toggle {
    font-size: 11px;
    color: var(--cyan);
    cursor: pointer;
    margin-top: 6px;
    display: inline-block;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
    transition: opacity .15s;
}
.pillar-detail-toggle:hover { opacity: .7; }
.pillar-detail-panel {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    font-size: 12px;
}
.pillar-detail-panel .pd-section { margin-bottom: 8px; }
.pillar-detail-panel .pd-section strong {
    display: block;
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}
.pillar-detail-panel ul {
    margin: 0;
    padding-left: 16px;
    color: var(--muted);
    line-height: 1.7;
}
.pillar-detail-panel ul li { font-size: 12px; }

/* ── Findings panel ── */
.findings-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}
.findings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}
.findings-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
}
.findings-list {
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.findings-list::-webkit-scrollbar       { width: 5px; }
.findings-list::-webkit-scrollbar-track { background: transparent; }
.findings-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* finding row */
.finding-row {
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .15s;
}
.finding-row:last-child { border-bottom: none; }
.finding-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
}
.finding-row-header:hover { background: rgba(255,255,255,.03); }
.finding-sev-bar {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}
.fr-critical .finding-sev-bar { background: var(--danger); }
.fr-high     .finding-sev-bar { background: var(--warn); }
.fr-medium   .finding-sev-bar { background: var(--gold); }
.fr-low      .finding-sev-bar { background: var(--cyan); }

.finding-row-meta { flex: 1; min-width: 0; }
.finding-row-meta .fr-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.finding-row-meta .fr-category {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.finding-row-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.sev-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.sev-badge.critical { background: rgba(230,57,70,.15); color: var(--danger); border: 1px solid rgba(230,57,70,.3); }
.sev-badge.high     { background: rgba(244,165,64,.15); color: var(--warn);   border: 1px solid rgba(244,165,64,.3); }
.sev-badge.medium   { background: rgba(212,164,55,.15); color: var(--gold);   border: 1px solid rgba(212,164,55,.3); }
.sev-badge.low      { background: rgba(61,217,214,.15); color: var(--cyan);   border: 1px solid rgba(61,217,214,.3); }
.expand-chevron { font-size: 12px; color: var(--muted); transition: transform .2s; }
.finding-row.open .expand-chevron { transform: rotate(90deg); }

/* finding body (expanded) */
.finding-row-body {
    padding: 0 20px 18px 52px;
    display: none;
}
.finding-row.open .finding-row-body { display: block; }
.fr-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 14px;
}
.fr-remediation { margin-bottom: 12px; }
.fr-remediation strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    margin-bottom: 6px;
}
.fr-remediation ol {
    padding-left: 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}
.fr-framework-refs { display: flex; gap: 6px; flex-wrap: wrap; }
.fr-framework-refs .ftag {
    background: rgba(61,217,214,.08);
    color: var(--cyan);
    border: 1px solid rgba(61,217,214,.2);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* findings empty state */
.findings-empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ── Positives panel ── */
.positives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.positive-card {
    background: rgba(43,196,138,.06);
    border: 1px solid rgba(43,196,138,.2);
    border-radius: 12px;
    padding: 14px 16px;
}
.positive-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 4px;
}
.positive-card p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

/* ── Recommendations panel ── */
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: border-color .15s;
}
.rec-card:hover { border-color: rgba(212,164,55,.3); }
.rec-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: var(--navy);
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rec-body { flex: 1; }
.rec-body h4 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.rec-body p  { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0 0 8px; }
.rec-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.effort-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}
.effort-badge.low    { background: rgba(43,196,138,.12);  color: var(--success); }
.effort-badge.medium { background: rgba(212,164,55,.12);  color: var(--gold); }
.effort-badge.high   { background: rgba(230,57,70,.12);   color: var(--danger); }
.rec-ref { font-size: 11px; color: var(--muted); background: var(--bg-2); border-radius: 4px; padding: 1px 6px; }

/* ── Section header ── */
.report-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
    margin-top: 28px;
    opacity: .8;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Loading steps ── */
.loading-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 0;
}
.loading-steps .ls-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(212,164,55,.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 24px;
}
.loading-steps .ls-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.loading-steps .ls-step {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    min-height: 20px;
    transition: opacity .3s;
}

/* animate in report sections */
@keyframes reportIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.report-animate { animation: reportIn .35s ease both; }

/* ── Download report button ─────────────────────────────────── */
.download-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
}
.download-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
}
.download-btn:hover { border-color: var(--gold); color: var(--gold); }
.download-hint { font-size: 11px; color: var(--muted); }

/* ── Attack paths panel ─────────────────────────────────────── */
.attack-paths-panel { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.ap-row {
    border: 1px solid var(--border);
    border-left: 4px solid var(--warn);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--card);
}
.ap-row.ap-critical { border-left-color: var(--danger); }
.ap-row.ap-high     { border-left-color: var(--warn); }
.ap-row.ap-medium   { border-left-color: var(--gold); }
.ap-top  { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ap-path { font-size: 12px; color: var(--cyan); background: rgba(61,217,214,.08); padding: 2px 8px; border-radius: 4px; }
.ap-desc { font-size: 13px; color: var(--muted); margin: 0; }

/* ── Cost Analysis — tab bar ────────────────────────────────── */
.cost-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    gap: 4px;
}
.cost-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px 10px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.cost-tab.active  { color: var(--gold); border-bottom-color: var(--gold); }
.cost-tab:hover   { color: var(--text); }

/* ── Cost form card ──────────────────────────────────────────── */
.cost-form-card { cursor: default !important; margin-top: 20px; }
.field-hint { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ── Cost service block (advanced) ──────────────────────────── */
.cost-svc-block {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-2);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.cost-svc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.cost-svc-name  { font-size: 14px; font-weight: 700; color: var(--cyan); }
.cost-svc-count { font-size: 12px; color: var(--muted); background: var(--card); padding: 2px 8px; border-radius: 12px; }

/* ── Cost hero ───────────────────────────────────────────────── */
.cost-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}
.cost-hero-label  { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 8px; }
.cost-hero-amount { font-size: 56px; font-weight: 800; color: var(--gold); line-height: 1; }
.cost-hero-sub    { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ── Cost breakdown rows ─────────────────────────────────────── */
.cost-breakdown { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.cost-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.cost-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cost-row-name   { font-size: 14px; font-weight: 600; }
.cost-row-right  { display: flex; align-items: center; gap: 10px; }
.cost-row-pct    { font-size: 11px; color: var(--muted); }
.cost-row-amount { font-size: 15px; font-weight: 700; color: var(--gold); }
.cost-bar        { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.cost-bar-fill   { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 2px; transition: width .6s ease; }
.cost-row-note   { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cost-row-risk   { font-size: 12px; color: var(--warn); margin-top: 6px; }

/* ── Cost risks ──────────────────────────────────────────────── */
.cost-risks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cost-risk-row {
    background: rgba(244,165,64,.06);
    border: 1px solid rgba(244,165,64,.25);
    border-left: 3px solid var(--warn);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
}
.cost-risk-row strong { display: block; margin-bottom: 4px; color: var(--warn); }
.cost-risk-row p { color: var(--muted); margin: 0; }

/* ── Savings opportunities ───────────────────────────────────── */
.savings-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.saving-card {
    background: var(--card);
    border: 1px solid rgba(43,196,138,.2);
    border-left: 3px solid var(--success);
    border-radius: 10px;
    padding: 14px 16px;
}
.saving-hdr   { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.saving-title { font-size: 14px; font-weight: 600; }
.saving-meta  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.saving-amount { font-size: 14px; font-weight: 700; color: var(--success); white-space: nowrap; }
.saving-pct   { font-size: 11px; color: var(--muted); }
.saving-desc  { font-size: 13px; color: var(--muted); margin: 0; }

/* ── Assumptions block ───────────────────────────────────────── */
.assumptions-block {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}
.assumptions-block h4 { font-size: 13px; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.assumptions-block ul { padding-left: 20px; }
.assumptions-block li { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ── Print / Save as PDF ─────────────────────────────────────── */
@media print {
    /* hide everything except the assessment report */
    body.printing-report > *:not(#view-diagram) { display: none !important; }
    body.printing-report #view-diagram > *:not(#diagram-result) { display: none !important; }
    body.printing-report #diagram-result { display: block !important; }
    .download-bar    { display: none !important; }
    .nav             { display: none !important; }
    .findings-list   { max-height: none !important; overflow: visible !important; }
    .finding-row-body { display: block !important; max-height: none !important; }
    .pillar-detail-panel { display: block !important; }
    @page { margin: 20mm; }
}

