:root {
    --nav: #17283a;
    --nav-soft: #223b55;
    --nav-text: #d8e6f3;
    --nav-muted: #8fa6bb;
    --bg: #eaf0f5;
    --surface: #ffffff;
    --surface-soft: #f8fbfd;
    --line: #d8e1ea;
    --text: #172033;
    --muted: #667085;
    --coral: #d96f66;
    --coral-hover: #c95d55;
    --blue: #315f85;
    --green: #2e7d67;
    --amber: #a96f1f;
    --red: #c84949;
    --shadow-soft: 0 18px 50px rgba(23, 32, 51, 0.12);
    --shadow-panel: 0 8px 22px rgba(23, 32, 51, 0.05);
    --shadow-button: 0 10px 20px rgba(217, 111, 102, 0.28);
    --radius: 8px;
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    padding: 22px 16px;
    background: linear-gradient(180deg, #17283a 0%, #112133 100%);
    color: var(--nav-text);
    box-shadow: 18px 0 42px rgba(23, 32, 51, 0.18);
    z-index: 20;
}

.sidebar-top {
    display: grid;
    gap: 24px;
}

.sidebar-brand {
    width: 100%;
    padding: 4px 6px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-nav a {
    min-height: 50px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(216, 230, 243, 0.08);
    border-radius: 12px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--nav-text);
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(4, 11, 20, 0.12);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-nav a:hover {
    border-color: rgba(217, 111, 102, 0.45);
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-nav a.active {
    border-color: rgba(217, 111, 102, 0.72);
    background: linear-gradient(135deg, rgba(217, 111, 102, 0.95), rgba(201, 93, 85, 0.85));
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(217, 111, 102, 0.26);
}

.sidebar-user {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(216, 230, 243, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-label {
    color: var(--nav-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-user strong {
    overflow-wrap: anywhere;
    color: #ffffff;
    font-size: 15px;
}

.sidebar-user form {
    margin: 4px 0 0;
}

.sidebar-profile-link {
    width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(216, 230, 243, 0.18);
    border-radius: var(--radius);
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.sidebar-profile-link:hover,
.sidebar-profile-link.active {
    border-color: rgba(217, 111, 102, 0.55);
    background: var(--coral);
}

.sidebar-logout {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(216, 230, 243, 0.18);
    border-radius: var(--radius);
    padding: 9px 12px;
    background: var(--nav-soft);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.sidebar-logout:hover {
    border-color: rgba(217, 111, 102, 0.55);
    background: var(--coral);
}

.sidebar-install-button {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(217, 111, 102, 0.42);
    border-radius: var(--radius);
    padding: 9px 12px;
    background: var(--coral);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(217, 111, 102, 0.22);
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.sidebar-install-button:hover {
    background: var(--coral-hover);
}

.sidebar-install-button[hidden] {
    display: none;
}

.main-area,
.main-content {
    min-width: 0;
    width: calc(100% - 240px);
    margin-left: 240px;
}

.main-content .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 30px 32px 54px;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    gap: 22px;
    padding: 28px;
}

.auth-brand {
    color: var(--text);
}

.auth-container {
    width: min(460px, 100%);
}

.header {
    background: var(--nav);
    color: var(--nav-text);
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.12);
}

.header-inner,
.container {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--coral);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(217, 111, 102, 0.35);
    font-weight: 800;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 700;
}

.nav a:hover {
    background: var(--nav-soft);
    color: #ffffff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.user-menu form {
    margin: 0;
}

.user-name {
    color: var(--nav-muted);
    font-size: 14px;
    font-weight: 800;
}

.nav-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(216, 230, 243, 0.18);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: var(--nav-soft);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.nav-button:hover {
    background: var(--coral);
}

.container {
    padding: 30px 0 54px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -8px 0 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.breadcrumbs a {
    color: var(--blue);
}

.breadcrumbs a:hover {
    color: var(--coral);
}

.breadcrumbs a::after {
    content: "/";
    margin-left: 8px;
    color: var(--muted);
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: 0;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.top-actions,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 9px 14px;
    background: var(--coral);
    color: #ffffff;
    box-shadow: var(--shadow-button);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button:hover {
    background: var(--coral-hover);
    transform: translateY(-1px);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 6px 16px rgba(23, 32, 51, 0.07);
}

.button-secondary:hover {
    background: var(--surface-soft);
}

.button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
    overflow: hidden;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.dashboard-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-panel);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dashboard-card:hover {
    border-color: rgba(217, 111, 102, 0.55);
    box-shadow: 0 14px 32px rgba(23, 32, 51, 0.09);
    transform: translateY(-2px);
}

.dashboard-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-card strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    line-height: 1.2;
}

.dashboard-card span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-card-accent {
    border-color: rgba(217, 111, 102, 0.42);
}

.dashboard-card-disabled {
    background: var(--surface-soft);
    color: var(--muted);
    cursor: default;
}

.dashboard-card-disabled:hover {
    border-color: var(--line);
    box-shadow: var(--shadow-panel);
    transform: none;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.education-card {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.education-card:hover {
    border-color: rgba(217, 111, 102, 0.45);
    box-shadow: 0 14px 32px rgba(23, 32, 51, 0.09);
    transform: translateY(-2px);
}

.education-card-active {
    border-color: rgba(46, 125, 103, 0.32);
}

.education-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.education-card strong {
    color: var(--text);
    font-size: 21px;
    line-height: 1.2;
}

.education-card span {
    color: var(--muted);
    font-size: 14px;
}

.education-card em {
    width: fit-content;
    border-radius: 999px;
    padding: 6px 10px;
    background: #e8f1ff;
    color: #1d4ed8;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.education-placeholder {
    max-width: 820px;
    padding: 24px;
}

.education-placeholder h2 {
    margin: 14px 0 8px;
    color: var(--text);
    font-size: 24px;
}

.education-placeholder p {
    margin: 0;
    color: var(--muted);
}

.education-record-table {
    margin-top: 14px;
}

.education-record-table table {
    min-width: 980px;
}

.education-record-table td {
    white-space: normal;
}

.education-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.education-type-topic {
    background: #e8f4ef;
    color: var(--green);
}

.education-type-homework {
    background: #fff8ec;
    color: var(--amber);
}

.education-type-test,
.education-type-checkpoint {
    background: #e8f1ff;
    color: #1d4ed8;
}

.education-type-comment {
    background: #f3f5f8;
    color: var(--muted);
}

.education-record-form {
    max-width: 980px;
}

.study-program-table table,
.study-topic-table table,
.study-material-table table {
    min-width: 920px;
}

.study-program-form,
.study-topic-form,
.study-material-form {
    max-width: 980px;
}

.study-program-description {
    margin-top: 16px;
}

.study-visibility {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.study-visibility-personal {
    background: #fff8ec;
    color: var(--amber);
}

.study-visibility-subject_shared {
    background: #e8f1ff;
    color: #1d4ed8;
}

.study-visibility-global_shared {
    background: #e8f4ef;
    color: var(--green);
}

.material-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.material-type-theory {
    background: #e8f1ff;
    color: #1d4ed8;
}

.material-type-homework,
.material-type-worksheet {
    background: #fff8ec;
    color: var(--amber);
}

.material-type-test,
.material-type-checkpoint,
.material-type-variant {
    background: #fff1f0;
    color: var(--red);
}

.material-file-box {
    display: grid;
    gap: 6px;
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.material-file-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.material-description {
    margin-top: 16px;
}

.assignment-table table {
    min-width: 1120px;
}

.assignment-form {
    max-width: 1040px;
}

.assignment-type,
.assignment-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.assignment-type-homework {
    background: #fff8ec;
    color: var(--amber);
}

.assignment-type-classwork,
.assignment-type-extra {
    background: #e8f1ff;
    color: #1d4ed8;
}

.assignment-type-test,
.assignment-type-checkpoint {
    background: #fff1f0;
    color: var(--red);
}

.assignment-status-assigned,
.assignment-status-in_progress,
.assignment-status-partial {
    background: #fff8ec;
    color: var(--amber);
}

.assignment-status-completed,
.assignment-status-checked {
    background: #e8f4ef;
    color: var(--green);
}

.assignment-status-not_completed {
    background: #fff1f0;
    color: var(--red);
}

.assignment-comment {
    margin-top: 14px;
}

.assigned-programs {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
}

.assigned-programs h3 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 17px;
}

.program-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.program-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
    border: 1px solid rgba(49, 95, 133, 0.18);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #f8fbfd;
}

.program-chip:hover {
    border-color: rgba(217, 111, 102, 0.45);
}

.program-chip strong {
    color: var(--text);
    font-size: 14px;
}

.program-chip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.profile-card {
    padding: 20px;
}

.security-card {
    display: grid;
    gap: 14px;
}

.security-card p {
    margin: 0;
    color: var(--muted);
}

.work-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.work-panel {
    padding: 18px;
}

.today-list,
.warning-list {
    display: grid;
    gap: 8px;
}

.today-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.today-item strong {
    color: var(--blue);
}

.today-item em {
    font-style: normal;
    white-space: nowrap;
}

.compact-empty {
    padding: 12px 0 0;
}

.dashboard-warnings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.warning-panel {
    padding: 18px;
}

.warning-panel h3 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 18px;
}

.warning-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.warning-row strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.warning-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.warning-row-danger span {
    color: var(--red);
}

.warning-row-attention span {
    color: var(--amber);
}

.warning-row:hover strong {
    color: var(--coral);
}

.dashboard-work-grid {
    align-items: stretch;
}

.dashboard-week-section {
    margin-top: 16px;
}

.pwa-ios-hint {
    display: none;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-color: rgba(49, 95, 133, 0.22);
    background: #edf4fa;
}

.pwa-ios-hint strong,
.pwa-ios-hint span {
    display: block;
}

.pwa-ios-hint strong {
    color: var(--blue);
    font-size: 15px;
}

.pwa-ios-hint span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.warning-panel-danger {
    border-color: rgba(200, 73, 73, 0.22);
}

.warning-panel-warning {
    border-color: rgba(169, 111, 31, 0.24);
}

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

.filter-panel {
    margin-bottom: 18px;
    padding: 16px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-row select {
    max-width: 320px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.quick-periods,
.segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.quick-periods {
    margin-bottom: 14px;
}

.quick-periods a,
.segmented-control a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.quick-periods a.active,
.quick-periods a:hover,
.segmented-control a.active,
.segmented-control a:hover {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 10px rgba(23, 32, 51, 0.06);
}

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

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

td {
    color: var(--text);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr {
    transition: background 0.16s ease;
}

tbody tr:hover {
    background: #fbfdff;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #f4f8fb;
}

.table-link {
    color: var(--blue);
    font-weight: 800;
}

.table-link:hover {
    color: var(--coral);
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    background: #e8f4ef;
    color: var(--green);
}

.status-archived {
    background: #edf4fa;
    color: var(--blue);
}

.status-free {
    background: #fff2df;
    color: var(--amber);
}

.status-no-show {
    background: #fff1f0;
    color: var(--red);
}

.form-panel {
    max-width: 1120px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}

.form-field-full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 11px;
    background: #fbfdff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(217, 111, 102, 0.14);
}

input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--coral);
}

.checkbox-field {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox-field label {
    margin: 0;
    color: var(--text);
}

.form-actions {
    justify-content: flex-start;
    padding: 0 22px 22px;
}

.errors {
    margin: 7px 0 0;
    padding-left: 18px;
    color: var(--red);
    font-size: 13px;
}

.empty {
    padding: 24px;
    color: var(--muted);
}

.form-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(200, 73, 73, 0.2);
    border-radius: var(--radius);
    background: #fff5f5;
    color: var(--red);
    font-size: 14px;
    font-weight: 800;
}

.form-note {
    padding: 14px 16px;
    border: 1px solid rgba(169, 111, 31, 0.24);
    border-radius: var(--radius);
    background: #fff8ec;
    color: var(--amber);
    font-size: 14px;
    font-weight: 800;
}

.lesson-date-warning {
    margin-top: 10px;
}

.auth-page {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(460px, 100%);
    padding: 26px;
}

.auth-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.auth-head h1 {
    font-size: 26px;
}

.auth-fields {
    display: grid;
    gap: 16px;
}

.auth-submit {
    width: 100%;
    margin-top: 20px;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    box-shadow: var(--shadow-panel);
}

.message-success {
    border-color: rgba(46, 125, 103, 0.24);
    background: #e8f4ef;
    color: var(--green);
}

.message-info {
    border-color: rgba(49, 95, 133, 0.22);
    background: #edf4fa;
    color: var(--blue);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-card {
    min-height: 210px;
    padding: 20px;
}

.admin-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-card h2 {
    margin: 10px 0 8px;
    color: var(--text);
    font-size: 22px;
}

.admin-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.password-panel {
    max-width: 760px;
}

.teacher-account-form {
    display: grid;
    gap: 16px;
}

.teacher-form-panel {
    max-width: 980px;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 0;
}

.form-section-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.form-section-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.teacher-security-panel {
    border-color: rgba(49, 95, 133, 0.2);
}

.generated-password-box {
    margin: 16px 22px 0;
    padding: 14px;
    border: 1px solid rgba(46, 125, 103, 0.24);
    border-radius: var(--radius);
    background: #e8f4ef;
}

.generated-password-box span {
    display: block;
    margin-bottom: 4px;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.generated-password-box strong {
    color: var(--text);
    font-size: 18px;
    letter-spacing: 0.02em;
}

.teacher-form-actions {
    padding: 0;
}

.free-learning-box {
    padding: 18px;
    border: 1px solid rgba(169, 111, 31, 0.24);
    border-radius: var(--radius);
    background: #fff8ec;
    color: var(--amber);
    font-size: 15px;
    font-weight: 900;
    box-shadow: var(--shadow-panel);
}

.finance-free-note {
    margin-top: 14px;
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.subscription-confirm-card .payment-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payments-table td strong {
    color: var(--green);
}

.payments-table tr.payment-cancelled {
    color: var(--muted);
    background: var(--surface-soft);
}

tr.payment-cancelled {
    color: var(--muted);
    background: var(--surface-soft);
}

.payments-table tr.payment-cancelled td {
    color: var(--muted);
    text-decoration: line-through;
}

.payments-table tr.payment-cancelled .status,
.payments-table tr.payment-cancelled .button {
    text-decoration: none;
}

.payments-table tr.payment-cancelled td strong {
    color: var(--muted);
}

.payment-form-panel {
    max-width: 860px;
}

.button-danger {
    border-color: rgba(200, 73, 73, 0.25);
    background: #fff5f5;
    color: var(--red);
    box-shadow: 0 6px 16px rgba(200, 73, 73, 0.08);
}

.button-danger:hover {
    background: #ffecec;
}

.detail-card {
    padding: 22px;
}

.student-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.status-stack {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.student-hero h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 26px;
    line-height: 1.2;
}

.student-hero p {
    margin: 6px 0 0;
    color: var(--muted);
}

.detail-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.info-grid,
.finance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.info-grid {
    padding-top: 18px;
}

.info-item {
    min-height: 86px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.info-item span,
.schedule-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.info-item strong {
    display: block;
    color: var(--text);
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.info-item p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.subscription-balance {
    border-width: 2px;
}

.subscription-balance-good {
    border-color: rgba(46, 125, 103, 0.28);
    background: #e8f4ef;
}

.subscription-balance-good strong,
.subscription-balance-good p {
    color: var(--green);
}

.subscription-balance-warning {
    border-color: rgba(169, 111, 31, 0.3);
    background: #fff8ec;
}

.subscription-balance-warning strong,
.subscription-balance-warning p {
    color: var(--amber);
}

.subscription-balance-low {
    border-color: rgba(217, 111, 102, 0.35);
    background: #fff6f2;
}

.subscription-balance-low strong,
.subscription-balance-low p {
    color: var(--coral-hover);
}

.subscription-balance-empty {
    border-color: rgba(200, 73, 73, 0.32);
    background: #fff5f5;
}

.subscription-balance-empty strong,
.subscription-balance-empty p {
    color: var(--red);
}

.subscription-warning {
    margin-bottom: 18px;
}

.subscription-warning h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 22px;
}

.subscription-warning p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.detail-section {
    margin-top: 18px;
}

#edit-form {
    display: none;
    scroll-margin-top: 96px;
}

#edit-form:target {
    display: block;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1.2;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.schedule-card {
    min-height: 116px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
}

.schedule-card strong {
    display: block;
    color: var(--blue);
    font-size: 24px;
    line-height: 1.1;
}

.schedule-card p {
    margin: 8px 0 0;
    color: var(--text);
    font-weight: 700;
}

.student-schedule-card strong {
    color: var(--text);
    font-size: 18px;
}

.student-schedule-card p {
    color: var(--blue);
    font-size: 26px;
    line-height: 1.1;
    font-weight: 900;
}

.lesson-free-note {
    margin-bottom: 14px;
}

.lesson-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.lesson-table td strong {
    color: var(--blue);
}

.lesson-table td {
    white-space: normal;
}

.lesson-list-table {
    margin-top: 18px;
}

.lesson-list-table table {
    min-width: 1260px;
}

.lesson-list-table td {
    white-space: normal;
}

.lesson-finance-detail {
    margin-top: 6px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lesson-actions form {
    margin: 0;
}

.actions-menu,
.action-menu {
    position: relative;
    display: inline-block;
}

.actions-menu summary,
.action-menu summary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 7px 11px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 6px 16px rgba(23, 32, 51, 0.07);
    font-size: 13px;
    font-weight: 900;
    list-style: none;
    appearance: none;
    cursor: pointer;
}

.actions-menu summary::marker,
.action-menu summary::marker {
    content: "";
}

.actions-menu summary::-webkit-details-marker,
.action-menu summary::-webkit-details-marker {
    display: none;
}

.actions-menu summary::after,
.action-menu summary::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted);
}

.actions-dropdown,
.action-menu-list {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 5000;
    min-width: 190px;
    display: none;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.actions-menu[open] .actions-dropdown,
.action-menu[open] .action-menu-list {
    display: grid;
    gap: 2px;
}

.actions-dropdown a,
.actions-dropdown button,
.action-menu-list a,
.action-menu-list button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.actions-dropdown a:hover,
.actions-dropdown button:hover,
.action-menu-list a:hover,
.action-menu-list button:hover {
    background: var(--surface-soft);
    color: var(--coral);
}

.actions-dropdown form,
.action-menu-list form {
    margin: 0;
}

.actions-divider {
    height: 1px;
    margin: 4px 2px;
    background: var(--line);
}

.lesson-form {
    max-width: 920px;
}

.payment-context-card {
    margin-bottom: 18px;
}

.schedule-note {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 14px;
}

.section-link {
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.section-link:hover {
    color: var(--coral);
}

.schedule-table-wrap {
    overflow-x: auto;
}

.schedule-table {
    min-width: 1040px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table th,
.schedule-table td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    white-space: normal;
}

.schedule-table thead th {
    height: 54px;
    background: #edf4fa;
    color: var(--blue);
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
}

.schedule-table tr:hover {
    background: transparent;
}

.schedule-time-head,
.schedule-time {
    width: 148px;
}

.schedule-time {
    background: var(--surface-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

.schedule-table td {
    height: 82px;
    background: #fbfdff;
    vertical-align: top;
}

.schedule-table td.schedule-filled {
    background: #fff6f2;
}

.schedule-table td.schedule-group {
    background: #e8f4ef;
    box-shadow: inset 4px 0 0 var(--green);
}

.schedule-student {
    display: block;
    margin-bottom: 6px;
    padding: 7px 9px;
    border-radius: 6px;
    background: rgba(217, 111, 102, 0.12);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.schedule-student:hover {
    background: rgba(217, 111, 102, 0.2);
    color: var(--coral-hover);
}

.schedule-board-wrap {
    overflow-x: auto;
}

.schedule-board {
    min-width: 1180px;
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    align-items: start;
}

.schedule-day-column {
    min-height: 100%;
    border-right: 1px solid var(--line);
    background: #fbfdff;
}

.schedule-day-column:last-child {
    border-right: 0;
}

.schedule-day-column h2 {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    background: #edf4fa;
    color: var(--blue);
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.schedule-day-list {
    display: grid;
}

.schedule-day-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-height: 58px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: #fff6f2;
}

.schedule-day-row-group {
    background: #e8f4ef;
    box-shadow: inset 4px 0 0 var(--green);
}

.schedule-day-row-custom {
    box-shadow: inset 4px 0 0 var(--blue);
}

.schedule-day-row-group.schedule-day-row-custom {
    box-shadow: inset 4px 0 0 var(--green), inset 0 3px 0 rgba(49, 95, 133, 0.26);
}

.schedule-row-time {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.schedule-row-students {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.schedule-board .schedule-student {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 5px 8px;
    line-height: 1.2;
}

.schedule-day-empty {
    padding: 18px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.comment-box {
    min-height: 92px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
    color: var(--text);
}

@media (max-width: 1080px) {
    .sidebar {
        width: 240px;
        flex-basis: 240px;
        padding: 20px 14px;
    }

    .sidebar-nav a {
        min-height: 48px;
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        flex-basis: auto;
        height: auto;
        padding: 14px;
        border-radius: 0 0 16px 16px;
    }

    .main-area,
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-top {
        gap: 14px;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 2px;
    }

    .sidebar-nav a {
        min-height: 42px;
        flex: 0 0 auto;
        padding: 10px 12px;
        white-space: nowrap;
    }

    .sidebar-nav a:hover {
        transform: none;
    }

    .sidebar-user {
        margin-top: 12px;
    }

    .header-inner,
    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-inner {
        padding: 14px 0;
    }

    .container,
    .header-inner {
        width: min(100% - 28px, 1320px);
    }

    .container {
        padding-top: 22px;
    }

    .top-actions {
        justify-content: flex-start;
    }

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

    .student-hero {
        flex-direction: column;
    }

    .info-grid,
    .finance-grid,
    .profile-grid,
    .work-grid,
    .stats-grid,
    .lesson-summary,
    .payment-summary,
    .subscription-confirm-card .payment-summary,
    .schedule-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .schedule-table {
        min-width: 920px;
    }

    .today-item {
        grid-template-columns: 82px 1fr;
    }

    .today-item em {
        grid-column: 1 / -1;
        width: fit-content;
    }

    th,
    td {
        padding: 12px;
    }
}
.status-payment {
    background: #e8f1ff;
    color: #1d4ed8;
}

.portal-form-section,
.portal-admin-card,
.student-portal-hero {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
}

.portal-form-section {
    padding: 18px;
}

.compact-head {
    margin-bottom: 14px;
}

.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.portal-actions {
    margin-top: 18px;
}

.portal-actions form {
    display: inline-flex;
}

.delete-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.actions-dropdown .danger-action {
    color: #b91c1c;
}

.actions-dropdown .danger-action:hover {
    background: #fef2f2;
    color: #991b1b !important;
}

.lesson-education-section {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    padding: 18px;
}

.nested-form-grid {
    margin-top: 0;
}

.checkbox-list-field ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.checkbox-list-field label {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0;
}

.progress-timeline {
    display: grid;
    gap: 18px;
}

.progress-item {
    padding: 22px;
}

.teacher-private-comment {
    border-color: #d1d5db;
    background: #f9fafb;
}

.balance-good {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.balance-warning,
.balance-low {
    border-color: #fed7aa;
    background: #fff7ed;
}

.balance-empty {
    border-color: #fecaca;
    background: #fef2f2;
}

html {
    scroll-behavior: smooth;
}

@media (max-width: 820px) {
    .portal-form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-list-field ul {
        grid-template-columns: 1fr;
    }
}

.mobile-topbar,
.mobile-menu-close,
.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    img,
    video,
    canvas,
    iframe {
        max-width: 100%;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        min-height: 62px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        background: linear-gradient(180deg, #17283a 0%, #112133 100%);
        box-shadow: 0 10px 26px rgba(23, 32, 51, 0.18);
    }

    .mobile-brand {
        min-width: 0;
        color: #ffffff;
        font-size: 18px;
    }

    .mobile-brand .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .mobile-menu-toggle {
        width: 46px;
        height: 46px;
        display: inline-grid;
        place-items: center;
        gap: 4px;
        border: 1px solid rgba(216, 230, 243, 0.18);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        width: 21px;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: #ffffff;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 980;
        background: rgba(7, 16, 28, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    body.sidebar-open .mobile-sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell {
        display: block;
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        width: min(86vw, 310px);
        height: 100dvh;
        max-height: 100dvh;
        flex-basis: auto;
        padding: 18px 14px;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-104%);
        transition: transform 0.2s ease;
        box-shadow: 22px 0 44px rgba(7, 16, 28, 0.32);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-menu-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(216, 230, 243, 0.18);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        font: inherit;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
    }

    .sidebar-brand {
        padding-right: 46px;
    }

    .sidebar-nav {
        display: grid;
        gap: 9px;
        overflow: visible;
        padding-bottom: 0;
    }

    .sidebar-nav a {
        width: 100%;
        min-height: 48px;
        flex: none;
        justify-content: flex-start;
        white-space: normal;
    }

    .sidebar-user {
        margin-top: 18px;
    }

    .main-area,
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .main-content .container,
    .container {
        width: 100%;
        max-width: none;
        padding: 18px 12px 34px;
    }

    .breadcrumbs {
        flex-wrap: wrap;
        margin: 0 0 14px;
        font-size: 12px;
    }

    .page-title {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 24px;
        line-height: 1.18;
    }

    .page-subtitle {
        font-size: 13px;
    }

    .top-actions,
    .form-actions,
    .filter-actions,
    .card-actions,
    .table-actions,
    .portal-actions,
    .delete-confirm-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        align-items: stretch;
        justify-content: stretch;
        gap: 9px;
    }

    .top-actions .button,
    .form-actions .button,
    .filter-actions .button,
    .card-actions .button,
    .table-actions .button,
    .portal-actions .button,
    .delete-confirm-actions .button,
    .portal-actions form,
    .portal-actions button {
        width: 100%;
    }

    .button {
        min-height: 44px;
        padding: 10px 14px;
    }

    .button-small {
        min-height: 38px;
    }

    .filter-panel,
    .panel,
    .detail-card,
    .work-panel,
    .warning-panel,
    .admin-card,
    .profile-card,
    .portal-form-section {
        border-radius: 10px;
    }

    .filter-panel {
        padding: 12px;
    }

    body.pwa-ios .pwa-ios-hint {
        display: block;
    }

    .filter-row,
    .quick-periods,
    .segmented-control {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .quick-periods a,
    .segmented-control a {
        justify-content: center;
    }

    .filter-grid,
    .form-grid,
    .nested-form-grid,
    .portal-form-grid,
    .profile-grid,
    .work-grid,
    .stats-grid,
    .dashboard-stats-grid,
    .dashboard-warnings,
    .dashboard-grid,
    .education-grid,
    .admin-grid,
    .info-grid,
    .finance-grid,
    .lesson-summary,
    .payment-summary,
    .subscription-confirm-card .payment-summary,
    .schedule-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    label {
        font-size: 13px;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }

    textarea {
        min-height: 120px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        min-height: 0;
    }

    input[type="file"] {
        width: 100%;
        padding: 10px;
        background: var(--surface-soft);
    }

    .form-panel {
        overflow: hidden;
    }

    .form-panel .form-grid,
    .form-panel .form-actions {
        padding-left: 14px;
        padding-right: 14px;
    }

    .form-section-head {
        display: grid;
        padding: 16px 14px 0;
    }

    .student-hero,
    .section-head,
    .warning-row,
    .today-item {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }

    .student-hero {
        gap: 12px;
        padding-bottom: 16px;
    }

    .student-hero h2 {
        font-size: 22px;
        overflow-wrap: anywhere;
    }

    .status-stack {
        justify-content: flex-start;
    }

    .info-item,
    .schedule-card {
        min-height: auto;
        padding: 13px;
    }

    .info-item strong,
    .schedule-card strong {
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .student-schedule-card p {
        font-size: 22px;
    }

    .today-item {
        gap: 5px;
        padding: 12px 0;
    }

    .today-item em {
        grid-column: auto;
        white-space: normal;
    }

    .warning-row span {
        white-space: normal;
    }

    .table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap th,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .table-wrap tbody {
        display: grid;
        gap: 12px;
    }

    .table-wrap tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
        box-shadow: var(--shadow-panel);
        overflow: hidden;
    }

    .table-wrap td {
        min-height: 42px;
        display: grid;
        grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid var(--line);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .table-wrap td:last-child {
        border-bottom: 0;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        line-height: 1.35;
    }

    .table-wrap td:not([data-label]) {
        display: block;
    }

    .table-wrap td:not([data-label])::before {
        content: none;
    }

    .clickable-row {
        cursor: pointer;
    }

    .lesson-list-table {
        margin-top: 12px;
    }

    .actions-menu,
    .action-menu {
        width: 100%;
    }

    .actions-menu summary,
    .action-menu summary {
        width: 100%;
        min-height: 42px;
    }

    .actions-dropdown,
    .action-menu-list {
        width: min(280px, calc(100vw - 24px));
        max-height: min(420px, calc(100dvh - 24px));
        overflow-y: auto;
    }

    .actions-dropdown a,
    .actions-dropdown button,
    .action-menu-list a,
    .action-menu-list button {
        min-height: 42px;
        font-size: 14px;
    }

    .schedule-board-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .schedule-board {
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .schedule-day-column {
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
        box-shadow: var(--shadow-panel);
        overflow: hidden;
    }

    .schedule-day-column h2 {
        position: static;
        text-align: left;
        font-size: 15px;
    }

    .schedule-day-row {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: auto;
        padding: 10px;
    }

    .schedule-row-time {
        white-space: normal;
    }

    .schedule-row-students {
        display: grid;
        gap: 6px;
    }

    .schedule-board .schedule-student {
        width: 100%;
        justify-content: flex-start;
    }

    .comment-box,
    .free-learning-box,
    .schedule-note,
    .form-note,
    .form-alert {
        padding: 14px;
    }

    .auth-layout {
        padding: 18px 12px;
    }

    .auth-card {
        padding: 20px;
    }
}

@media (max-width: 430px) {
    .main-content .container,
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    h1 {
        font-size: 22px;
    }

    .brand {
        gap: 9px;
    }

    .table-wrap td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .schedule-day-row {
        grid-template-columns: 1fr;
    }

    .status {
        width: fit-content;
    }
}
