:root {
    /* Color Palette */
    --primary: #059669; /* Best in class */
    --primary-light: #10b981;
    --primary-bg: #ecfdf5;
    
    --c1: #ef4444; /* Very Weak */
    --c1-bg: #fef2f2;
    --c1-border: #f87171;
    
    --c2: #f97316; /* Developing */
    --c2-bg: #fff7ed;
    --c2-border: #fdba74;
    
    --c3: #eab308; /* Competent */
    --c3-bg: #fefce8;
    --c3-border: #fde047;
    
    --c4: #10b981; /* Strong */
    --c4-bg: #ecfdf5;
    --c4-border: #34d399;
    
    --c5: #059669; /* Best in class */
    --c5-bg: #ecfdf5;
    --c5-border: #10b981;

    --bg-main: #f8fafc;
    --surface: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Utilities */
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Typography */
h1 { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
h1 .subtitle { font-size: 0.875rem; font-weight: 400; color: var(--text-muted); background: var(--bg-main); padding: 2px 8px; border-radius: var(--radius-full); }
h2 { font-size: 1.125rem; font-weight: 600; }
p { color: var(--text-muted); font-size: 0.875rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 16px;
    font-size: 0.875rem; font-weight: 500;
    border-radius: var(--border-radius); border: none; cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #047857; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-main); }
.btn-text { background: transparent; border: none; color: var(--text-muted); font-size: 0.875rem; cursor: pointer; transition: color var(--transition); padding: 4px; }
.btn-text:hover { color: var(--primary); }

/* Top Nav */
.top-nav {
    background: var(--surface); border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 100;
    padding: 6px 0; box-shadow: var(--shadow-sm);
}
.nav-content {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; box-shadow: var(--shadow-sm);
}
.brand-text p { font-size: 0.75rem; margin-top: 2px; }

.nav-progress { flex: 1; max-width: 300px; }
.progress-info { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.progress-info .percent { color: var(--primary); margin-left: 4px; }
.progress-track {
    height: 6px; background: var(--border-color); border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--primary);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Container */
.main-container { max-width: 1200px; margin: 32px auto; padding: 0 24px; }

/* Info Card */
.info-card {
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: var(--border-radius); padding: 24px; box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}
.input-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
    font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px;
}
.input-group label span { color: var(--c1); }
.input-group label i { font-size: 1rem; color: var(--text-light); }
.input-group input {
    padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.875rem; color: var(--text-main); font-family: var(--font-stack);
    transition: var(--transition); background: var(--bg-main);
}
.input-group input:focus {
    outline: none; border-color: var(--primary-light); background: var(--surface);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Competency Header & Legend */
.competency-header { margin-bottom: 16px; }
.dot-separator { color: var(--border-color); }
#sections-completed-text { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

.rating-scale-legend {
    background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--border-radius);
    padding: 16px 24px; display: flex; align-items: center; gap: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.legend-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.legend-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px;
    border-radius: var(--radius-full); font-size: 0.875rem; font-weight: 600;
    border: 1px solid var(--border-color); background: var(--surface);
}
.badge .num {
    width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.75rem;
}
.badge.color-1 { color: var(--c1); border-color: var(--c1-border); background: var(--c1-bg); }
.badge.color-1 .num { background: var(--c1); }
.badge.color-2 { color: var(--c2); border-color: var(--c2-border); background: var(--c2-bg); }
.badge.color-2 .num { background: var(--c2); }
.badge.color-3 { color: var(--c3); border-color: var(--c3-border); background: var(--c3-bg); }
.badge.color-3 .num { background: var(--c3); }
.badge.color-4 { color: var(--c4); border-color: var(--c4-border); background: var(--c4-bg); }
.badge.color-4 .num { background: var(--c4); }
.badge.color-5 { color: var(--c5); border-color: var(--c5-border); background: var(--c5-bg); }
.badge.color-5 .num { background: var(--c5); }

/* Sections Styling */
.sections-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }

.section-card {
    background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm); overflow: hidden; transition: var(--transition);
}
.section-card:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.section-card.is-complete { border-left: 4px solid var(--primary); }

.section-header {
    padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
}
.section-title-group { display: flex; align-items: center; gap: 16px; }
.section-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; font-size: 1.75rem; color: var(--primary); }
.s-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.s-name { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.s-name span { font-weight: 400; color: var(--text-light); font-size: 0.875rem; margin-left: 4px; }

/* Rating inline in section header */
.section-header-rating {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.score-pill {
    padding: 4px 12px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
}
.score-pill.active { background: var(--primary-bg); border-color: var(--primary-light); color: var(--primary); }
.section-content { display: block; border-top: 1px solid var(--border-color); }

/* Criteria list (context bullets, no individual ratings) */
.section-criteria { padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border-color); background: var(--bg-main); }
.criteria-item { display: flex; align-items: flex-start; gap: 12px; }
.criteria-num { font-size: 0.75rem; font-weight: 700; color: var(--text-light); min-width: 28px; padding-top: 2px; }
.criteria-body { display: flex; flex-direction: column; gap: 2px; }
.criteria-text { font-size: 0.875rem; font-weight: 500; color: var(--text-main); }
.criteria-sub { font-size: 0.8rem; color: var(--text-muted); }

/* Single overall rating row at bottom of each section */
.section-rating-row { 
    padding: 20px 24px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 16px; 
    border-top: 1px solid var(--border-color);
    background: #fff;
}
.section-rating-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }

.question-row {
    padding: 24px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
    transition: background 0.2s;
}
.question-row:hover { background: #fcfcfd; }
.question-row:last-child { border-bottom: none; }

.q-text { flex: 1; }
.q-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; line-height: 1.4; display: flex; gap: 8px; }
.q-num { color: var(--text-light); font-weight: 500; }
.q-sub { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.4; padding-left: 26px; }

.q-rating { display: flex; align-items: center; gap: 12px; }
.rating-buttons { display: flex; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.r-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-right: 1px solid var(--border-color);
    font-size: 0.875rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
    transition: all 0.2s;
}
.r-btn:last-child { border-right: none; }
.r-btn:hover { background: var(--border-color); color: var(--text-main); }
    
/* Active States */
.r-btn[data-val="1"].active { background: var(--c1); color: white; border-color: var(--c1); }
.r-btn[data-val="2"].active { background: var(--c2); color: white; border-color: var(--c2); }
.r-btn[data-val="3"].active { background: var(--c3); color: white; border-color: var(--c3); }
.r-btn[data-val="4"].active { background: var(--c4); color: white; border-color: var(--c4); }
.r-btn[data-val="5"].active { background: var(--c5); color: white; border-color: var(--c5); }

.r-label { font-size: 0.75rem; font-weight: 500; color: var(--text-light); min-width: 80px; text-align: right; }

/* Dashboard Summary */
.dashboard-summary {
    background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.dashboard-header {
    background: var(--bg-main); padding: 24px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.dashboard-header h2 { display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.dashboard-header h2 i { color: var(--primary); }
.dashboard-eyebrow {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.dashboard-eyebrow i { color: var(--primary); font-size: 0.85rem; }
.dashboard-name-row {
    display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap;
}
.dashboard-assessee-name {
    font-size: 1.375rem; font-weight: 700; color: var(--text-main); line-height: 1.2;
}

.total-score-badge {
    background: white; border: 1.5px solid var(--primary); border-radius: var(--radius-full);
    padding: 6px 16px; display: flex; align-items: baseline; gap: 6px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.total-score-badge .label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.total-score-badge .value { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.total-score-badge .max-value { font-size: 0.875rem; font-weight: 600; color: var(--text-light); }

.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.chart-container {
    padding: 32px; border-right: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(to bottom right, #ffffff, #f8fafc);
}
.table-container { padding: 32px; overflow-x: auto; }
.scoring-table { width: 100%; border-collapse: collapse; }
.scoring-table th {
    text-align: left; padding: 12px; font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}
.scoring-table td {
    padding: 12px; border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem; font-weight: 500; color: var(--text-main);
}
.scoring-table tr:hover td { background: var(--bg-main); }
.scoring-table .score-val { font-weight: 700; color: var(--text-main); }
.scoring-table .empty-val { color: var(--text-light); font-style: italic; font-weight: 400; }

.res-pill {
    display: inline-block; padding: 4px 8px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 600;
}
.res-pill.val-1 { background: var(--c1-bg); color: var(--c1); border: 1px solid var(--c1-border); }
.res-pill.val-2 { background: var(--c2-bg); color: var(--c2); border: 1px solid var(--c2-border); }
.res-pill.val-3 { background: var(--c3-bg); color: var(--c3); border: 1px solid var(--c3-border); }
.res-pill.val-4 { background: var(--c4-bg); color: var(--c4); border: 1px solid var(--c4-border); }
.res-pill.val-5 { background: var(--c5-bg); color: var(--c5); border: 1px solid var(--c5-border); }

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { opacity: 0; animation: fadeIn 0.5s ease forwards; transform: translateY(10px); }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .chart-container { border-right: none; border-bottom: 1px solid var(--border-color); height: 350px; }
}
@media (max-width: 768px) {
    .main-container { margin: 16px auto; padding: 0 16px; }
    
    .competency-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    
    .rating-scale-legend { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 16px; 
        padding: 16px;
    }
    .legend-badges { 
        display: flex;
        flex-direction: row; 
        flex-wrap: wrap;
        width: 100%;
        gap: 10px; 
    }
    .badge { 
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
        justify-content: flex-start; 
        font-size: 0.75rem; 
        padding: 6px 12px 6px 6px; 
    }
    .badge .num { width: 22px; height: 22px; font-size: 0.75rem; }

    .section-header { padding: 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
    .section-icon { width: 40px; height: 40px; font-size: 1.5rem; }
    .s-name { font-size: 0.9375rem; }

    .section-rating-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .section-rating-row .row { width: 100%; justify-content: space-between; }
    .r-label { text-align: left; min-width: auto; }

    .question-row { flex-direction: column; gap: 16px; padding: 16px; }
    .q-rating { width: 100%; justify-content: space-between; }
    .nav-progress { display: none; }
    
    .nav-content { padding: 0 16px; }
    .brand-text h1 { font-size: 1rem; }
    .brand-text p { font-size: 0.65rem; }
    
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .total-score-badge { width: 100%; justify-content: center; }
}

/* Interpretation Table */
.interpretation-section {
    border-top: 1px solid var(--border-color);
    padding: 24px 32px;
}
.interpretation-header {
    margin-bottom: 16px; text-align: center;
}
.interpretation-title {
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.07em;
}
.interpretation-table {
    width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
.interpretation-table thead th {
    text-align: left; padding: 10px 14px;
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    background: var(--bg-main); border-bottom: 2px solid var(--border-color);
}
.interpretation-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--border-color); vertical-align: middle;
}
.interpretation-table tr:last-child td { border-bottom: none; }
.interp-range {
    font-weight: 700; font-size: 0.9rem; min-width: 70px;
}
.interp-level {
    font-weight: 600; white-space: nowrap; min-width: 160px;
}
.interp-meaning { color: var(--text-muted); }

/* Row color theming — neutral */
.interp-row { background: var(--surface); }
.interp-row:hover { background: var(--bg-main); }
.interp-range { color: var(--text-main); }
.interp-level { color: var(--text-main); }

/* Overall result badge — inline next to name */
.overall-result-badge {
    display: inline-flex; align-items: center;
    font-size: 0.78rem; font-weight: 700; padding: 4px 12px;
    border-radius: var(--radius-full); border: 1.5px solid var(--border-color);
    background: var(--bg-main); color: var(--text-main); letter-spacing: 0.02em;
    white-space: nowrap; height: fit-content;
}

/* Print Styles */
@media print {
    @page { 
        margin: 1cm;
    }
    body { 
        background: white;
        zoom: 0.75;
    }
    .top-nav { display: none !important; }
    html, body {
        height: initial !important;
        overflow: initial !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #btn-back, #btn-print { display: none !important; }
    .dashboard-summary { box-shadow: none; border: 1px solid #e2e8f0; }
    .main-container { margin: 0; padding: 0; }
}
