:root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #212529;
    --text-secondary: #6c757d;
    --accent: #0056b3;
    --border: #dee2e6;
    --transition: all 0.2s ease-in-out;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.wrapper {
    max-width: 1000px;
    margin: 40px auto;
    width: 100%;
}

input,
select,
textarea,
button {
    font-family: inherit !important;
    color: var(--text);
}

/* Buttons */
.button-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.button,
.form .button[type="submit"] {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.button:hover,
.button.active,
.form .button[type="submit"]:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 86, 179, 0.2);
}

/* Form */
.form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 35px;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    margin-bottom: 40px;
    align-items: end;
    width: 100%;
}

.form-item_title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 700;
}

.form-item_body select,
.form-item_body input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
}

.form-item:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.form .button[type="submit"] {
    min-width: 300px;
    width: auto;
}

/* Schedule table */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
    table-layout: fixed;
}

.schedule-table th {
    background: #f1f3f5;
    padding: 15px;
    text-align: left;
    font-size: 13px;
    color: #6c757d !important;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    border-left: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
    overflow: hidden;
    word-break: break-word;
}

.schedule-table .subject-name {
    display: block;
    font-weight: 600;
    color: #000;
    margin-bottom: 3px;
}

.day-header td {
    background: #e8f0fb !important;
    color: var(--accent) !important;
    border-left: 3px solid var(--accent);
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .wrapper {
        margin: 12px auto;
    }

    .button-wrapper {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .button,
    .form .button[type="submit"] {
        min-height: 50px;
        font-size: 15px;
        width: 100%;
    }

    .form {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
        margin-bottom: 20px;
    }

    .form-item:last-child {
        margin-top: 4px;
    }

    .form .button[type="submit"] {
        min-width: unset;
        width: 100%;
    }

    .form-item_body select,
    .form-item_body input {
        font-size: 16px;
    }

    .schedule-table th:nth-child(3),
    .schedule-table td:nth-child(3),
    .schedule-table th:nth-child(4),
    .schedule-table td:nth-child(4) {
        display: none;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

        .schedule-table th:nth-child(1),
    .schedule-table td:nth-child(1) {
        width: 28%;
    }

    .schedule-table th:nth-child(2),
    .schedule-table td:nth-child(2) {
        width: 44%;
    }

    .schedule-table th:nth-child(5),
    .schedule-table td:nth-child(5) {
        width: 28%;
    }
}
