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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f7ff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.container {
    background: white;
    border-radius: 24px;
    padding: 36px 48px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    max-width: 1100px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    align-items: center;
}

.left-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    color: #1d1d1f;
    font-weight: 600;
    font-size: 2rem;
    margin-bottom: 16px;
}

.description {
    color: #86868b;
    font-size: 0.95rem;
    line-height: 1.6;
}

.right-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #e8e8ed;
}

th {
    color: #1d1d1f;
    font-weight: 600;
    font-size: 0.9rem;
    background: #f5f5f7;
}

th:first-child {
    border-radius: 8px 0 0 0;
}

th:last-child {
    border-radius: 0 8px 0 0;
}

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

tbody tr:last-child td.row-label {
    border-radius: 0 0 8px 8px;
}

.row-label {
    text-align: left;
    color: #1d1d1f;
    font-weight: 500;
    background: #f5f5f7;
}

td input[type="number"] {
    width: 100%;
    max-width: 80px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
    background: #f5f5f7;
    transition: border-color 0.2s, background 0.2s;
    appearance: textfield;
    -moz-appearance: textfield;
}

td input[type="number"]::-webkit-outer-spin-button,
td input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

td input[type="number"]:hover {
    background: #ebebf0;
}

td input[type="number"]:focus {
    outline: none;
    border-color: #0071e3;
    background: white;
}

td input[type="number"]::placeholder {
    color: #acacac;
}

.final-grade {
    font-weight: 600;
    color: #1d1d1f;
}

.stats-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f5f5f7;
    border-radius: 10px;
}

.stat-row.average-row {
    background: #e3f2fd;
}

.stat-row label {
    color: #1d1d1f;
    font-weight: 500;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
}

.goal-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: right;
    background: white;
    border: 1px solid #e8e8ed;
    appearance: textfield;
    -moz-appearance: textfield;
}

.goal-input::-webkit-outer-spin-button,
.goal-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.goal-input:focus {
    outline: none;
    border-color: #0071e3;
}

.goal-input::placeholder {
    color: #acacac;
}


@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 24px;
    }

    .left-section {
        text-align: left;
        align-items: flex-start;
    }

    h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 12px;
    }

    .container {
        padding: 20px 14px;
        gap: 24px;
    }

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

    table {
        table-layout: fixed;
        max-width: 100%;
    }

    th,
    td {
        padding: 8px 6px;
        font-size: 0.85rem;
        min-width: 0;
    }

    th {
        font-size: 0.8rem;
    }

    .row-label {
        white-space: normal;
        word-break: break-word;
    }

    td input[type="number"] {
        max-width: none;
        width: 100%;
        min-width: 0;
        padding: 6px 6px;
        font-size: 0.85rem;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
        background: #121212;
        color: #e2e8f0;
    }

    .container {
        background: #1a1a1a;
        box-shadow: 0 8px 28px rgba(2, 6, 23, 0.5);
    }

    h1,
    .row-label,
    .final-grade,
    .stat-row label,
    .stat-value,
    th {
        color: #e2e8f0;
    }

    .description {
        color: #a1a1aa;
    }

    th,
    .row-label,
    .stat-row {
        background: #232323;
    }

    .stat-row.average-row {
        background: #2a2a2a;
    }

    th, td {
        border-bottom: 1px solid #2f2f2f;
    }

    td input[type="number"] {
        background: #232323;
        color: #e2e8f0;
    }

    td input[type="number"]:hover {
        background: #2a2a2a;
    }

    td input[type="number"]:focus {
        border-color: #9ca3af;
        background: #1a1a1a;
    }

    td input[type="number"]::placeholder,
    .goal-input::placeholder {
        color: #6b7280;
    }

    .goal-input {
        background: #1a1a1a;
        color: #e2e8f0;
        border: 1px solid #2f2f2f;
    }

    .goal-input:focus {
        border-color: #9ca3af;
    }
}
