* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, Arial, sans-serif;
    color: #1c2430;
    background: #f4f6f9;
}

/* Левая навигация */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #16222e;
    color: #dce6f0;
    display: flex;
    flex-direction: column;
    padding: 28px 22px;
}
.brand a {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}
.brand span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #8fa5b8;
}
.nav {
    list-style: none;
    margin: 36px 0 0;
    padding: 0;
    flex: 1;
}
.nav li { margin-bottom: 6px; }
.nav a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: #c4d3e2;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.35;
    transition: background .15s, color .15s;
}
.nav a:hover { background: #22374a; color: #fff; }
.nav a.active { background: #2f80ed; color: #fff; }
.sidebar-footer a { color: #6f8698; font-size: 13px; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

/* Контент */
.content {
    margin-left: 260px;
    padding: 40px 48px 80px;
    max-width: 1180px;
}
.hero { margin-bottom: 32px; }
.hero h1 { margin: 0 0 8px; font-size: 34px; }
.hero p { margin: 0 0 6px; color: #55677a; font-size: 17px; }
.schedule-stamp { font-size: 14px; color: #2f80ed; }

.notice {
    background: #e6f4ea;
    border: 1px solid #b7e2c4;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 28px;
}
.notice.muted { background: #eef1f5; border-color: #d5dde6; color: #55677a; }
.notice.error { background: #fdecea; border-color: #f5c6c0; }

.section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 32px 36px 36px;
    margin-bottom: 40px;
    scroll-margin-top: 24px;
}
.section h2 { margin: 0 0 8px; font-size: 26px; }
.section h3 { margin: 26px 0 12px; font-size: 18px; }
.lead { color: #55677a; margin: 0; }

.columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    margin-top: 8px;
}

/* Таблицы */
table.courses, table.calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.courses th, .courses td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.courses th { color: #55677a; font-weight: 600; }
.courses td:last-child, .courses th:last-child { text-align: right; }

/* Календарь */
.calendars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.calendar caption {
    font-weight: 600;
    padding-bottom: 8px;
    text-align: left;
}
.calendar th {
    font-size: 12px;
    color: #8fa5b8;
    font-weight: 600;
    padding: 4px 0;
}
.calendar td {
    border: 1px solid #e9eef4;
    min-height: 52px;
    height: 52px;
    vertical-align: top;
    padding: 4px 6px;
    position: relative;
}
.calendar td.empty { border: none; background: transparent; }
.calendar .day { font-size: 13px; color: #55677a; }
.calendar td.has-students { background: #eaf3ff; }
.calendar td.has-students .day { color: #1c2430; font-weight: 600; }
.calendar td.full-day { background: #ffe9c7; }
.calendar .full-label {
    position: absolute;
    left: 5px;
    bottom: 5px;
    font-size: 11px;
    color: #a05a00;
    font-weight: 600;
}
.calendar .count {
    position: absolute;
    right: 5px;
    top: 5px;
    background: #2f80ed;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    padding: 3px 7px;
}
.calendar .slot {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
    color: #2f56a0;
    white-space: nowrap;
}

/* Форма */
.apply label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #34465a;
}
.apply input, .apply select, .apply textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
    background: #fff;
}
.apply textarea { resize: vertical; }
.apply label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}
.apply label.check input { width: auto; margin: 0; }
.apply button, .toolbar button {
    background: #2f80ed;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.apply button:hover, .toolbar button:hover { background: #2569c4; }

/* Админка */
body.admin { background: #f4f6f9; }
.admin-panel {
    max-width: 980px;
    margin: 48px auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 32px 36px 40px;
}
.admin-panel h1 { margin-top: 0; }
.admin-panel .login { max-width: 340px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 24px; }
.toolbar button[name="logout"] { background: #6b7d8f; }
.muted { color: #8fa5b8; }

@media (max-width: 900px) {
    .sidebar { position: static; width: auto; }
    .content { margin-left: 0; padding: 24px 18px 48px; }
    .columns, .calendars { grid-template-columns: 1fr; }
}
