:root { --text: #172033; --heading: #172033; --muted: #64748b; --page: #eef3f8; --surface: rgba(255,255,255,.94); --field: #fbfdff; --border: #dce5f0; --field-border: #c9d5e5; --secondary: #edf2f8; --secondary-text: #34445f; --accent: #3767c7; --accent-hover: #2e58ad; --button-text: #fff; --notice: #edf4ff; --notice-text: #2857a9; font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; color: var(--text); background: var(--page); }
[data-theme="dark"] { --text: #d9e2f2; --heading: #b9c9df; --muted: #9eacc1; --page: #121824; --surface: rgba(27,36,52,.96); --field: #172131; --border: #344258; --field-border: #4a5a73; --secondary: #33435f; --secondary-text: #d0daea; --notice: #1d355b; --notice-text: #b9cce8; --accent: #4b6da9; --accent-hover: #587cbb; --button-text: #dbe5f3; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0%, #dce9ff 0, transparent 34%), var(--page); transition: background .2s, color .2s; }
[data-theme="dark"] body { background: radial-gradient(circle at 10% 0%, #243554 0, transparent 34%), var(--page); }
.container { max-width: 760px; margin: 0 auto; padding: 56px 18px 72px; }
header { margin-bottom: 28px; position: relative; }
.header-tools { position: absolute; top: 0; right: 0; z-index: 2; height: 32px; display: flex; align-items: center; gap: 5px; }
.account-icon, .theme-toggle, .admin-key-icon { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--secondary); color: var(--secondary-text); box-shadow: none; font-size: 16px; opacity: .75; display: inline-grid; place-items: center; line-height: 1; }
.account-icon svg, .theme-toggle svg, .admin-key-icon svg { width: 20px; height: 20px; display: block; flex: 0 0 20px; }
.admin-user-icon { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle, .account-icon, .admin-key-icon { margin: 0; }
.account-icon:hover, .theme-toggle:hover, .admin-key-icon:hover { background: #e1eaf5; border-color: #c2d2e6; color: var(--secondary-text); opacity: 1; transform: none; }
[data-theme="dark"] .account-icon:hover, [data-theme="dark"] .theme-toggle:hover, [data-theme="dark"] .admin-key-icon:hover { background: var(--secondary); border-color: var(--border); }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .11em; font-size: 11px; }
h1 { margin: 9px 0 10px; font-size: clamp(28px, 5vw, 42px); line-height: 1.08; letter-spacing: -.04em; max-width: 680px; }
h1, h2, h3 { color: var(--heading); }
.muted, .hint { color: var(--muted); line-height: 1.55; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: clamp(22px, 5vw, 34px); box-shadow: 0 24px 70px rgba(40, 68, 110, .12); }
h2 { margin: 0 0 8px; letter-spacing: -.025em; }
h3 { margin: 28px 0 4px; }
label { display: block; font-size: 14px; font-weight: 750; margin: 19px 0 8px; color: var(--secondary-text); }
input, select { width: 100%; border: 1px solid var(--field-border); border-radius: 12px; padding: 13px 14px; font: inherit; color: var(--text); background: var(--field); outline: none; transition: border-color .18s, box-shadow .18s; }
.admin-picker { position: relative; }
.admin-picker-button { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; border: 1px solid var(--field-border); background: var(--field); color: var(--text); box-shadow: none; }
.admin-picker-button:hover { background: var(--field); color: var(--text); transform: none; }
.picker-chevron { font-size: 20px; color: var(--muted); }
.admin-picker-options { position: absolute; z-index: 6; display: none; left: 0; right: 0; top: calc(100% + 7px); padding: 7px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: 0 14px 32px rgba(35, 58, 95, .2); }
.admin-picker-options.visible { display: grid; gap: 3px; }
.admin-picker-option { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 11px 12px; border-radius: 9px; background: transparent; color: var(--secondary-text); box-shadow: none; text-align: left; }
.admin-picker-option:hover { background: var(--notice); color: var(--notice-text); transform: none; }
.admin-class-list { display: grid; gap: 10px; }
#schoolActions { justify-content: space-between; }
#schoolActions + h3 { margin-top: 28px; }
.admin-actions-left { display: flex; gap: 10px; align-items: center; }
.admin-actions-right { display: flex; gap: 10px; align-items: center; }
.admin-account-actions { margin-top: 0; }
.icon-button { width: 32px; height: 32px; padding: 0; border-radius: 10px; display: inline-grid; place-items: center; }
.key-icon { width: 22px; height: 18px; }
.card > h3 { margin-top: 14px; }
.admin-school-heading { display: flex; align-items: center; gap: 10px; margin-top: 6px !important; }
.admin-class-card { display: flex; align-items: center; justify-content: flex-start; gap: 16px; padding: 11px 20px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; width: 100%; }
.admin-class-card:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(237,244,255,.44); }
[data-theme="dark"] .admin-class-card:hover { background: var(--notice); }
.admin-class-card strong { display: block; font-size: 22px; color: var(--heading); }
.admin-class-card .muted { display: block; margin-top: 4px; }
input:focus, select:focus { border-color: #4e78d6; box-shadow: 0 0 0 4px #4e78d620; }
.suggestion-field { position: relative; }
.suggestions { position: absolute; z-index: 5; top: calc(100% + 7px); left: 0; right: 0; display: none; padding: 7px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: 0 14px 32px rgba(35, 58, 95, .18); }
.suggestions.visible { display: grid; gap: 3px; }
.suggestion { width: 100%; padding: 10px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--secondary-text); box-shadow: none; text-align: left; font-weight: 650; }
.suggestion:hover { background: var(--notice); color: var(--notice-text); transform: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; line-height: 1.45; }
.check input { appearance: none; width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; border: 2px solid var(--field-border); border-radius: 4px; background: var(--field); cursor: pointer; }
.check input:checked { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-8' fill='none' stroke='%23dbe5f3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: center; background-repeat: no-repeat; background-size: 15px 15px; box-shadow: none; }
.check a { color: var(--accent); font-size: 1em !important; font-weight: 500 !important; line-height: inherit; text-decoration: underline; text-underline-offset: 3px; }
.consent-editor { margin-top: 18px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.editor-toolbar button { min-width: auto; padding: 9px 12px; }
.consent-editable { min-height: 520px; padding: 18px; border: 1px solid var(--field-border); border-radius: 14px; background: var(--field); color: var(--text); line-height: 1.55; overflow: auto; }
.consent-editable:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent-editable h2 { margin: 20px 0 10px; }
button { border: 0; border-radius: 12px; padding: 13px 17px; font: inherit; font-weight: 750; cursor: pointer; background: var(--accent); color: var(--button-text); box-shadow: 0 7px 16px #3767c733; transition: transform .15s, background .15s; }
button:hover { background: var(--accent-hover); transform: translateY(-1px); }
button.secondary { background: var(--secondary); color: var(--secondary-text); box-shadow: none; }
button.secondary:hover { background: var(--secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--notice); color: var(--notice-text); margin: 16px 0; line-height: 1.45; }
.form-error { display: none; }
.form-error.visible { display: block; }
.invalid { border-color: #c77735 !important; box-shadow: 0 0 0 4px #c7773520 !important; }
.warning { background: #fff0f3; color: #a13d55; }
.class-link { display: block; background: #f5f8fc; border: 1px solid #e4ebf4; padding: 15px 16px; border-radius: 13px; margin: 16px 0; word-break: break-all; }
[data-theme="dark"] .class-link { background: #202b3e; border-color: #3b4b65; }
[data-theme="dark"] .warning { background: #3e2633; color: #e7a6b6; }
.student { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 15px 0; border-bottom: 1px solid #e8eef5; }
[data-theme="dark"] .student { border-bottom-color: #344258; }
.student:last-child { border-bottom: 0; }
.cancelled { opacity: .55; }
.teacher-actions { margin: 0 0 10px; }
.small { font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; background: rgba(15, 23, 42, .52); backdrop-filter: blur(5px); }
.modal { width: min(100%, 480px); padding: 26px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 80px rgba(15, 23, 42, .28); }
.modal h2 { margin-bottom: 10px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal-input { margin-top: 8px; }
.modal-actions { justify-content: flex-end; }
@media (max-width: 520px) { .container { padding-top: 34px; } .card { border-radius: 18px; } .student { align-items: flex-start; flex-direction: column; gap: 8px; } .actions button { flex: 1 1 100%; } }
@media (max-width: 700px) { .admin-class-card { width: 100%; } }
.ql-toolbar.ql-snow { border: 1px solid var(--border); background: var(--surface); border-radius: 14px 14px 0 0; }
.ql-container.ql-snow { border: 1px solid var(--border); border-top: 0; background: var(--field); color: var(--text); border-radius: 0 0 14px 14px; }
.ql-snow .ql-stroke { stroke: var(--text); }
.ql-snow .ql-fill { fill: var(--text); }
.ql-snow .ql-picker { color: var(--text); }
.ql-snow .ql-picker-options { background: var(--surface); border-color: var(--border); }
.ql-snow .ql-picker-item { color: var(--text); }
.ql-snow .ql-picker-label:hover, .ql-snow .ql-picker-item:hover, .ql-snow button:hover .ql-stroke { color: var(--accent); stroke: var(--accent); }
.ql-editor { min-height: 520px; font-size: 17px; line-height: 1.55; }

.admin-year-controls { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; width: max-content; max-width: 100%; }
.admin-year-select { appearance: none; width: 220px !important; min-width: 0; height: 44px; padding: 0 42px 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2365799b' stroke-width='2.5'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center; color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.admin-year-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-year-add { height: 44px !important; margin: 0; white-space: nowrap;  }
.consent-content p, .consent-editor .ql-editor p { margin: 0 0 1em; }
.consent-content p:empty, .consent-editor .ql-editor p:empty, .consent-content p:has(> br:only-child), .consent-editor .ql-editor p:has(> br:only-child) { margin: 0; height: .75em; }

.ql-toolbar .ql-undo:after { content: '↶'; font-size: 22px; font-weight: 700; }
.ql-toolbar .ql-redo:after { content: '↷'; font-size: 22px; font-weight: 700; }
.consent-editor .ql-toolbar.ql-snow button { color: var(--text) !important; opacity: 1; }
.consent-editor .ql-toolbar.ql-snow button .ql-stroke { stroke: var(--text) !important; }
.consent-editor .ql-toolbar.ql-snow button .ql-fill { fill: var(--text) !important; }
.consent-editor .ql-toolbar.ql-snow .ql-picker-label { color: var(--text) !important; }
.consent-editor .ql-toolbar .ql-undo:after, .consent-editor .ql-toolbar .ql-redo:after { display: inline-block; font-size: 24px; line-height: 1; font-family: system-ui, sans-serif; color: var(--text); font-weight: 400; }
.consent-editor .ql-toolbar .ql-undo:after { content: '↩'; }
.consent-editor .ql-toolbar .ql-redo:after { content: '↪'; }

.consent-editor .ql-snow .ql-picker.ql-header { width: 190px; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-options {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  min-width: 150px;
}
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-label::before { content: 'Обычный текст' !important; color: var(--text) !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before { content: 'Заголовок 1' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before { content: 'Заголовок 2' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before { content: 'Заголовок 3' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item { color: var(--text) !important; white-space: nowrap; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item::before { color: var(--text) !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item:not([data-value])::before { content: 'Обычный текст' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: 'Заголовок 1' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'Заголовок 2' !important; }
.consent-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'Заголовок 3' !important; }
.admin-year-picker { position: relative; }
.admin-year-picker-button { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-width: 220px; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.admin-year-picker-button:hover { border-color: var(--accent); }
.admin-year-options { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: none; min-width: 170px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 40px rgba(15,23,42,.22); }
.admin-year-options.visible { display: grid; gap: 3px; }
.admin-year-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.admin-year-option:hover { background: var(--accent); color: #fff; }
.admin-year-option.active::after { content: '✓'; margin-left: auto; color: var(--accent); font-weight: 700; }
.admin-year-option.active:hover::after { color: #fff; }
.admin-year-option:hover .muted, .admin-year-option.active .muted { color: rgba(255,255,255,.8); }
.admin-year-picker-button { width: 150px !important; min-width: 150px !important; background: var(--field) !important; color: var(--text) !important; }
.admin-year-options { width: 150px; min-width: 150px; }

.theme-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.class-link-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.class-link-actions { display:flex; gap:8px; flex-shrink:0; }
.link-icon-button { width:38px; height:38px; padding:0; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); font-size:21px; line-height:1; cursor:pointer; box-shadow:none; transform:none; }
.link-icon-button:hover, .link-icon-button:focus-visible { border-color:var(--accent); background:var(--accent); color:#fff; box-shadow:none; }
.class-link-url { display:inline-block; margin-top:4px; }
.copy-status { display:block; min-height:0; height:0; margin-top:0; color:var(--accent); font-size:13px; overflow:hidden; }
.copy-status:not(:empty) { height:auto; min-height:1.2em; margin-top:6px; overflow:visible; }
.class-link { padding: 12px 16px; }
.class-link-heading { align-items: flex-start; }
.link-icon-button { width: 36px; height: 36px; }
.class-link-actions { align-self: flex-start; }

.link-icon-button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; }
.link-icon-button:hover { transform:none; }

.admin-class-card > button[data-pin-class] { margin-left: auto; }
.admin-class-card > button[data-class] { margin-left: 0; }

.admin-class-card { column-gap: 10px; }
.consent-editor .ql-toolbar .ql-undo:after, .consent-editor .ql-toolbar .ql-redo:after { content: none; }
.consent-editor .ql-toolbar .ql-undo svg, .consent-editor .ql-toolbar .ql-redo svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.school-class-title { display:inline-flex; align-items:center; gap:12px; padding:0; background:transparent; box-shadow:none; color:var(--heading); text-align:left; }
.school-class-title strong { display:inline; }
.class-count { display:inline-flex; align-items:center; border:1px solid var(--border); border-radius:999px; padding:4px 10px; font-size:14px; white-space:nowrap; color:var(--muted); background:var(--field); box-shadow:none; }
.admin-class-card > div > strong { display:inline-block; margin-right:10px; }
.school-class-card > div { min-width:0; flex:1; }
.school-class-card .muted { overflow-wrap:anywhere; }
.school-class-card .link-icon-button { flex-shrink:0; }
.copy-toast { position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:20000; pointer-events:none; max-width:calc(100vw - 32px); padding:10px 18px; border:1px solid var(--border); border-radius:14px; background:var(--surface); color:var(--text); box-shadow:0 6px 24px rgba(0,0,0,.18); font-size:15px; font-weight:600; text-align:center; }
