* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

a {
    color: #0f4c81;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    padding: 20px;
    background: #0f2742;
    color: #fff;
}

.sidebar h2 {
    margin: 0 0 20px;
    font-size: 18px;
}

.sidebar a {
    display: block;
    margin-bottom: 6px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #dbeafe;
}

.sidebar a:hover {
    background: #173a5e;
    text-decoration: none;
}

.main {
    flex: 1;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 700;
}

.muted {
    font-size: 13px;
    color: #6b7280;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e5eef8;
    color: #0f4c81;
    font-size: 12px;
}

.row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.row-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.form-group input[readonly] {
    background: #f8fafc;
    color: #374151;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #0f4c81;
    color: #fff;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.95;
    text-decoration: none;
}

.btn.secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn.small {
    padding: 8px 12px;
    font-size: 12px;
}

.alert {
    margin-bottom: 15px;
    padding: 12px 14px;
    border-radius: 8px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.auth-wrap {
    max-width: 430px;
    margin: 60px auto;
}

.small {
    font-size: 12px;
}

.pre {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    white-space: pre-wrap;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    margin: -4px;
}

.actions > * {
    margin: 4px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: -4px;
}

.inline-actions > * {
    margin: 4px;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 16px;
}

.page-actions > * {
    margin: 4px 8px 4px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-head > * {
    margin: 4px 8px 4px 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.mini-card {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.mini-label {
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}

.mini-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.score-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.scorecard-section {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.scorecard-section h4 {
    margin-top: 0;
    margin-bottom: 14px;
}

.scorecard-section h5 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 15px;
    color: #0f2742;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav > * + * {
    margin-top: 2px;
}

.right {
    text-align: right;
}

.table .actions {
    display: flex;
    flex-wrap: wrap;
    margin: -3px;
}

.table .actions > * {
    margin: 3px;
}

@media (max-width: 900px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: auto;
    }

    .row,
    .row-2,
    .row-3,
    .row-4,
    .score-summary-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 640px) {
    .section-head,
    .page-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }
}