


/* ═══════════════════════════════════════════════
   ABB-CFRI — Climate Finance Readiness Index
   Custom CSS — No frameworks
   ═══════════════════════════════════════════════ */

:root {
    --bg-page:        #f3f4f6;
    --bg-surface:     #ffffff;
    --bg-sidebar:     #111827;
    --bg-sidebar-dim: #1f2937;
    --accent:         #79AE40;
    --accent-hover:   #689936;
    --primary:        #28A0B1;
    --primary-hover:  #1f8796;
    --success:        #059669;
    --warning:        #d97706;
    --danger:         #dc2626;
    --text:           #111827;
    --text-muted:     #6b7280;
    --text-light:     #9ca3af;
    --text-sidebar:   #d1d5db;
    --border:         #e5e7eb;
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.12);
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --sidebar-w:      260px;
    --topbar-h:       64px;
    --font-body:      'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display:   'Cormorant Garamond', Georgia, serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Auth Pages ── */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827 0%, #1e293b 50%, #0f172a 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo { margin-bottom: 1rem; }

.auth-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.03em;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.auth-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9fafb;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 160, 177, 0.15);
    background: #fff;
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Alerts ── */

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); text-decoration: none; }

.btn-block { width: 100%; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

/* ── App Layout ── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    display: block;
    line-height: 1.2;
}

.sidebar-brand-org {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 0.25rem;
}

.nav-item:hover { background: var(--bg-sidebar-dim); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(232, 197, 71, 0.12); color: var(--accent); }

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    display: block;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
}

.logout-link { color: var(--text-light) !important; font-size: 0.85rem; }

/* Main area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 1rem;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text);
}
.sidebar-toggle svg { width: 24px; height: 24px; }

.main-content {
    flex: 1;
    padding: 2rem;
    /* max-width: 1200px; */
    width: 100%;
}

/* ── Stats Grid ── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.stat-card.accent { border-left: 4px solid var(--accent); }

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.25rem;
}

/* ── Section Header ── */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
}

/* ── Empty State ── */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ── Project Cards ── */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}

.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.project-status, .status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.status-draft     { background: #f3f4f6; color: var(--text-muted); }
.status-active    { background: #dbeafe; color: #1d4ed8; }
.status-submitted { background: #fef3c7; color: #92400e; }
.status-approved  { background: #d1fae5; color: #065f46; }

.project-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.project-card-sector { font-size: 0.85rem; color: var(--text-muted); margin-bottom: auto; }

.project-card-meta {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-light);
}

.project-country { font-size: 0.8rem; color: var(--text-muted); }

/* ── Data Table ── */

.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.data-table th {
    text-align: left;
    padding: 0.875rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #f9fafb; }

.cell-primary { font-weight: 600; }

.text-muted { color: var(--text-muted); }

.score-pill {
    display: inline-block;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    background: linear-gradient(90deg, #dbeafe var(--score-pct, 0%), #f3f4f6 var(--score-pct, 0%));
}

/* ── Form Card ── */

.form-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-width: 640px;
}
.form-card.form-card-full,
.form-card-full {
    max-width: 100% !important;
    width: 100% !important;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.required { color: var(--danger); }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9fafb;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 160, 177, 0.15);
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ── Project Hero ── */

.project-hero {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

.project-lead { color: var(--text-muted); font-size: 0.9rem; }

.meta-separator { color: var(--border); margin: 0 0.5rem; }

.project-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }

/* Score Gauge */
.score-gauge { width: 130px; height: 130px; flex-shrink: 0; }

.gauge-svg { width: 100%; height: 100%; }

.gauge-fill { transition: stroke-dasharray 0.6s ease; }

.gauge-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    fill: var(--text);
}

.gauge-label {
    font-size: 9px;
    fill: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Decision Banner */
.decision-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: #92400e;
}

/* ── Tabs ── */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    background: none;
    border: none;
    padding: 0.875rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Overview Grid ── */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.overview-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.overview-card h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.dim-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.dim-name {
    flex: 0 0 200px;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dim-bar-wrap {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.dim-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.dim-score {
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 3.5rem;
    text-align: right;
}

/* ── Dimension & Indicators (show page) ── */

.dimension-block { margin-bottom: 2rem; }

.dimension-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dim-weight {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.indicators-list { display: flex; flex-direction: column; gap: 0.5rem; }

.indicator-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.indicator-code {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.indicator-info { flex: 1; }

.indicator-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.indicator-good  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.indicator-evidence { font-size: 0.78rem; color: var(--text-light); margin-top: 0.25rem; }

.indicator-score { flex-shrink: 0; }

.score-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background: #f3f4f6;
}

.score-5 { background: #d1fae5; color: #065f46; }
.score-4 { background: #dbeafe; color: #1d4ed8; }
.score-3 { background: #fef3c7; color: #92400e; }
.score-2 { background: #fed7aa; color: #9a3412; }
.score-1 { background: #fecaca; color: #991b1b; }
.score-0 { background: #f3f4f6; color: #6b7280; }

/* ── Gates ── */

.gate-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.gate-critical  { background: #fef2f2; color: #991b1b; }
.gate-conditional { background: #eff6ff; color: #1d4ed8; }

.gate-status {
    font-size: 0.78rem;
    font-weight: 600;
}

.gate-yes  { color: var(--success); }
.gate-no   { color: var(--danger); }
.gate-na, .gate-N\/A { color: var(--text-light); }

/* ── Assessment Edit ── */

.assess-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.assess-header h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.assess-score-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.band-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.assess-section {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-item strong { color: var(--text); }

.assess-indicator {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    background: #fafbfc;
}

.assess-indicator-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.assess-indicator-head .indicator-name { font-size: 0.95rem; }

.indicator-guidance {
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.score-select {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.875rem;
}

.score-option {
    cursor: pointer;
}

.score-option input { display: none; }

.score-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.15s;
    background: #fff;
}

.score-option:hover .score-radio {
    border-color: var(--primary);
    color: var(--primary);
}

.score-option.selected .score-radio,
.score-option input:checked + .score-radio {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Gate controls */
.gate-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.gate-row:last-child { border-bottom: none; }

.gate-info { flex: 1; }

.gate-id {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    margin-right: 0.5rem;
}

.gate-evidence {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.gate-controls {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.gate-option {
    cursor: pointer;
}

.gate-option input { display: none; }

.gate-option span {
    display: block;
    padding: 0.4rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s;
    background: #fff;
}

.gate-option:hover span { border-color: var(--primary); }

.gate-option.selected span,
.gate-option input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Risk cards */
.risk-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    background: #fafbfc;
}

.risk-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.risk-id {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
}

.risk-cat {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.risk-statement {
    font-size: 0.9rem;
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.risk-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 0.75rem;
}

.form-group-sm label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.form-group-sm select,
.form-group-sm input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    background: #fff;
}

.assess-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--bg-page);
    padding: 1.25rem 0;
    z-index: 10;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 1.25rem;
    }

    .topbar {
        padding: 0 1.25rem;
    }

    .project-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-hero-score {
        align-self: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .risk-fields {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.82rem;
    }

    .score-select {
        flex-wrap: wrap;
    }

    .score-radio {
        width: 36px;
        height: 32px;
        font-size: 0.82rem;
    }

    .gate-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dim-name {
        flex: 0 0 120px;
        font-size: 0.75rem;
    }

    .assess-actions {
        flex-direction: column;
    }

    .assess-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .score-legend {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ── Backdrop for mobile sidebar ── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-backdrop.active {
    display: block;
}

/* ── Score Guidance Box ── */
.score-guidance-box {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.score-guidance-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-guidance-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.score-guidance-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.score-guidance-item:last-child {
    border-bottom: none;
}

.score-guidance-item.active {
    background: #eff6ff;
    margin: 0 -0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    border-bottom-color: transparent;
}

.score-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.score-text {
    flex: 1;
    color: var(--text);
    line-height: 1.4;
}

/* ── Gap Analysis Styles (for PDF report) ── */
.gap-analysis-box {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.gap-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.gap-text {
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.correction-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}


 /*── Brand logo ── */
.brand-logo-img {
    display: block;
    object-fit: contain;
    border-radius: 8px;
}
.auth-logo .brand-logo-img {
    margin: 0 auto;
}


