/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #F7F9FB;
    color: #0D1B2A;
    line-height: 1.5;
    min-width: 768px;
}

/* Layout */
.header {
    background-color: #0D1B2A;
    color: #FFFFFF;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.header__info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header__company {
    font-weight: 500;
    opacity: 0.9;
}

.header__version {
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.container {
    display: flex;
    min-height: calc(100vh - 120px); /* header + footer */
}

.sidebar {
    width: 280px;
    background: #FFFFFF;
    border-right: 1px solid #E3E8EE;
    padding: 1.5rem 0;
}

.main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Stepper */
.stepper {
    display: flex;
    flex-direction: column;
}

.stepper__item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.stepper__item:hover:not(.is-locked) {
    background: #F7F9FB;
}

.stepper__item.is-active {
    background: #EEF6F2;
    color: #3BAA78;
    font-weight: 600;
}

.stepper__item.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3BAA78;
}

.stepper__item.is-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.stepper__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #E3E8EE;
    color: #0D1B2A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.is-active .stepper__icon {
    background: #3BAA78;
    color: #FFFFFF;
}

.is-complete .stepper__icon {
    background: #3BAA78;
    color: #FFFFFF;
}

/* Components */
.card {
    background: #FFFFFF;
    border: 1px solid #E3E8EE;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card--sub {
    border-style: dashed;
    background: #FCFDFF;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background-color: #3BAA78;
    color: #FFFFFF;
}

.btn--secondary {
    background-color: #E3E8EE;
    color: #0D1B2A;
}

.btn--success {
    background-color: #3BAA78;
    color: #FFFFFF;
}

.btn--danger {
    background-color: #D64545;
    color: #FFFFFF;
}

.btn--small {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #E3E8EE;
    text-transform: uppercase;
}

.badge--success { background: #EEF6F2; color: #3BAA78; }
.badge--alt { background: #FFF4E5; color: #B7791F; }

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #E3E8EE;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table th, .table td {
    padding: 0.75rem;
    border-bottom: 1px solid #E3E8EE;
    text-align: left;
}

.table th {
    background: #F7F9FB;
    font-weight: 600;
    font-size: 0.85rem;
    color: #4A5568;
}

/* Screens */
.screen {
    display: none;
}

.screen.is-visible {
    display: block;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.section-title {
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
    border-left: 4px solid #3BAA78;
    padding-left: 0.75rem;
}

/* Footer Nav */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #FFFFFF;
    border-top: 1px solid #E3E8EE;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    z-index: 100;
}

/* Custom UI Elements */
.drivers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.driver-card {
    background: #F7F9FB;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.tier-summary {
    background: #0D1B2A;
    color: #FFFFFF;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.accordion__header {
    background: #F7F9FB;
    padding: 0.75rem 1rem;
    border: 1px solid #E3E8EE;
    cursor: pointer;
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tabs__btn {
    padding: 0.5rem 1rem;
    border: 1px solid #E3E8EE;
    background: #FFFFFF;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
}

.tabs__btn.is-active {
    background: #3BAA78;
    color: #FFFFFF;
    border-color: #3BAA78;
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.is-loading .spinner {
    display: inline-block;
}

.is-loading .btn__text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Charts */
.chart-container {
    margin: 1.5rem 0;
}

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

.bar-label { width: 150px; font-size: 0.9rem; }
.bar-wrapper { flex: 1; height: 12px; background: #E3E8EE; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: #3BAA78; border-radius: 6px; }
.bar-val { width: 40px; font-weight: 700; text-align: right; }

/* Assessment Grid */
.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.domain-card {
    border: 1px solid #E3E8EE;
    padding: 1rem;
    border-radius: 8px;
}

.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F7F9FB;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 2px;
}

.lvl { font-weight: 800; color: #3BAA78; }

/* Print */
@media print {
    .sidebar, .footer-nav, .header, .no-print {
        display: none !important;
    }
    .main {
        padding: 0;
        margin: 0;
    }
    .screen {
        display: block !important;
    }
    .screen:not([data-screen="9"]) {
        display: none !important;
    }
    body {
        background: white;
    }
}
