:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #6b7385;
  --border: #e3e6ee;
  --navy: #14213d;
  --navy-2: #1f2f55;
  --gold: #e0a526;
  --primary: #2b59c3;
  --success: #1f9d61;
  --warn: #d98a0b;
  --danger: #cf3a3a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; }
h2 { font-size: 15px; margin-bottom: 12px; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--navy); color: #c9d1e6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: block; padding: 20px 18px 14px; color: #fff; text-decoration: none !important; }
.logo { display: block; font-size: 24px; font-weight: 800; letter-spacing: 3px; color: var(--gold); }
.brand small { font-size: 11px; color: #9aa6c4; }
.unit-switch { padding: 0 18px 16px; border-bottom: 1px solid var(--navy-2); }
.unit-switch label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #9aa6c4; margin-bottom: 4px; }
.unit-switch select { width: 100%; background: var(--navy-2); color: #fff; border-color: #33467a; }
.unit-fixed { color: #fff; font-weight: 600; }
.sidebar nav { padding: 10px 0; overflow-y: auto; }
.sidebar nav a { display: block; padding: 9px 18px; color: #c9d1e6; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--navy-2); color: #fff; border-left-color: var(--gold); font-weight: 600; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; flex: 1; }
.user-menu { display: flex; align-items: center; gap: 14px; }
.user-menu form { margin: 0; }
.unit-pill { background: #fff4dc; color: #8a5a00; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }
.content { padding: 20px 24px 40px; max-width: 1400px; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; color: var(--muted); border-top: 4px solid var(--success);
}
.stat:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.stat span { display: block; font-size: 28px; font-weight: 700; color: var(--text); }
.stat.st-new { border-top-color: var(--primary); }
.stat.st-hold { border-top-color: var(--warn); }
.stat.st-dropped { border-top-color: var(--danger); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.small-th { font-size: 10px !important; max-width: 90px; }
.row-warn { background: #fff7e8; }
tr.inactive td { color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #eef0f5; color: var(--muted); }
.st-new.badge { background: #e6edfc; color: var(--primary); }
.st-active.badge { background: #e2f5ec; color: var(--success); }
.st-hold.badge { background: #fff1d6; color: #9a6200; }
.st-dropped.badge { background: #fde7e7; color: var(--danger); }
.pri-badge-high { background: #fff1d6; color: #9a6200; }
.pri-badge-urgent { background: #fde7e7; color: var(--danger); }
.role-admin { background: #ece6fb; color: #5b3cc4; }
.role-general_manager { background: #e6edfc; color: var(--primary); }
.role-local_manager { background: #e2f5ec; color: var(--success); }
.role-help { margin: 0 0 12px; }
[hidden] { display: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { background: var(--card); border: 1px solid var(--border); border-radius: 99px; padding: 3px 12px; font-size: 12px; }

/* forms */
input, select, textarea {
  font: inherit; color: inherit; padding: 7px 10px; border: 1px solid #cfd4df; border-radius: 7px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd0ff; border-color: var(--primary); }
input[type=checkbox] { width: auto; }
.form label { display: block; margin-bottom: 12px; font-weight: 500; }
.form label > input, .form label > select, .form label > textarea { margin-top: 4px; font-weight: 400; }
.form h2 { margin-top: 6px; padding-top: 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.narrow { max-width: 640px; }
.check-label { display: flex !important; align-items: center; gap: 8px; }
.check-label[hidden] { display: none !important; }
.actions { display: flex; gap: 10px; margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 340px; }
.toolbar select, .toolbar input[type=date] { width: auto; }
.toolbar p { margin: 0; }
.inline-label { display: flex; align-items: center; gap: 6px; }
.spacer { flex: 1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.inline-form input { flex: 1 1 200px; }
.inline-form select { width: auto; }
form.inline { display: inline; }
details summary { cursor: pointer; }
details[open] summary { margin-bottom: 14px; }

/* buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer;
  border: 1px solid #cfd4df; background: #fff; color: var(--text); white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.btn-row form { margin: 0; }
button.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.check {
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid #c3c9d6; background: #fff; cursor: pointer;
  color: #fff; font-weight: 700; line-height: 1; padding: 0;
}
.check.on { background: var(--success); border-color: var(--success); }

/* alerts */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: #e8f7ef; border-color: #b6e3cb; color: #11603b; }
.alert-error { background: #fdecec; border-color: #f3c0c0; color: #8e1f1f; }

/* misc */
.muted { color: var(--muted); }
.block { display: block; }
.pre { white-space: pre-wrap; margin: 6px 0; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.profile-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile-head .name { font-size: 24px; margin: 6px 0 2px; }
.profile-head p { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.checklist form { margin: 0; }
.note-list { list-style: none; padding: 0; margin: 0; }
.note-list li { padding: 8px 10px; border-left: 3px solid var(--border); margin-bottom: 8px; background: #fafbfd; border-radius: 0 6px 6px 0; }
.note-row { display: flex; justify-content: space-between; gap: 10px; }
.pri-high { border-left-color: var(--warn) !important; }
.pri-urgent { border-left-color: var(--danger) !important; }
.resolved { background: #f7f8fa; }
.resolved > header, .resolved > .note-row, .resolved > p { opacity: .6; }
.resolution { border-left: 3px solid var(--success); background: #eef9f3; border-radius: 0 6px 6px 0; padding: 8px 10px; margin-top: 8px; }
.resolution strong { color: var(--success); }
.resolution .pre { margin: 4px 0 6px; }
.resolve-box { margin-top: 6px; }
.resolve-box > summary { list-style: none; display: inline-block; }
.resolve-box > summary::-webkit-details-marker { display: none; }
.resolve-box[open] { flex-basis: 100%; }
.resolve-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.resolve-form button { align-self: flex-start; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; }
.note-card { border-left: 4px solid var(--border); display: flex; flex-direction: column; }
.note-card header { display: flex; justify-content: space-between; gap: 8px; }
.note-card footer { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.danger-zone { margin-top: 16px; text-align: right; }

/* login / plain pages */
.plain { min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; padding: 16px; background: linear-gradient(135deg, var(--navy), #2a3f72); }
.login-card { width: 100%; max-width: 380px; padding: 28px; }
.login-card label { display: block; margin-bottom: 14px; font-weight: 500; }
.login-card input { margin-top: 4px; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .logo { font-size: 36px; color: var(--navy); }
.login-brand p { margin: 4px 0 0; font-weight: 600; }
.login-brand small { color: var(--muted); }
.error-card { max-width: 520px; margin: 60px auto; }

/* responsive */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .sidebar { position: fixed; left: -240px; z-index: 20; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.25); }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .unit-pill, .user-menu a { display: none; }
  .details { grid-template-columns: 110px 1fr; }
}

/* schedule */
.seg { display: inline-flex; border: 1px solid #cfd4df; border-radius: 7px; overflow: hidden; background: #fff; }
.seg a { padding: 6px 12px; color: var(--text); font-weight: 600; border-right: 1px solid #cfd4df; }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: #f1f3f8; text-decoration: none; }
.seg a.on { background: var(--navy); color: #fff; }
.filters { margin: 0; }
.filters select, .filters input { width: auto; flex: none; }
.sched-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sched-title h2 { margin: 0; }
.sched-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; max-height: calc(100vh - 230px);
}
.sched { display: grid; grid-template-rows: auto 1fr; min-width: min-content; }
.sched-corner, .sched-head {
  position: sticky; top: 0; z-index: 3; background: #f8f9fc; border-bottom: 1px solid var(--border);
}
.sched-corner { left: 0; z-index: 4; }
.sched-head { padding: 8px 10px; border-left: 1px solid var(--border); }
.sched-head strong { display: block; }
.sched-head small { color: var(--muted); }
.sched-head.today { background: #fff4dc; }
.sched-times { position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--border); }
.sched-times span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.sched-times span:first-child { transform: none; }
.sched-col {
  position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image:
    repeating-linear-gradient(to bottom, #e3e6ee 0 1px, transparent 1px var(--hour)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), #f1f3f7 calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour));
}
.sched-col:hover { background-color: #fbfcfe; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.lesson {
  position: absolute; z-index: 1; overflow: hidden; border-radius: 6px; padding: 3px 6px;
  font-size: 11.5px; line-height: 1.3; color: #1d2433; cursor: pointer;
  border: 1px solid rgba(0,0,0,.08); border-left: 4px solid var(--c, #8a93a6); background: var(--bgc, #eef0f5);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.lesson:hover { text-decoration: none; z-index: 5; box-shadow: 0 3px 10px rgba(0,0,0,.18); overflow: visible; min-height: fit-content; }
.lesson strong, .lesson span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .lesson-meta { color: #4a5266; }
.lesson .flag { font-weight: 700; font-size: 10.5px; }
.lesson.conflict { outline: 2px solid var(--danger); outline-offset: -1px; }
.lesson.conflict .flag { color: var(--danger); }
.lesson.on-hold { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.05) 6px 12px); }
.c-0 { --c: #2b59c3; --bgc: #e6edfc; } .c-1 { --c: #1f9d61; --bgc: #e2f5ec; }
.c-2 { --c: #c2410c; --bgc: #fde9dc; } .c-3 { --c: #7c3aed; --bgc: #efe7fd; }
.c-4 { --c: #b7791f; --bgc: #fdf3d8; } .c-5 { --c: #0e7490; --bgc: #dcf3f8; }
.c-6 { --c: #be185d; --bgc: #fbe4ef; } .c-7 { --c: #4d7c0f; --bgc: #ecf6dc; }
.c-none { --c: #8a93a6; --bgc: #eef0f5; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { width: 14px; height: 14px; border-radius: 4px; border-left: 4px solid var(--c); background: var(--bgc); }
.legend-item i.legend-conflict { background: #fff; border: 2px solid var(--danger); }
.legend-item i.legend-hold { background: #eee; opacity: .6; border-left: 4px solid #999; }
.warn-box { border: 1px solid #f3dca0; background: #fff8e6; color: #7a5200; border-radius: 8px; padding: 6px 14px; margin: 6px 0; }
.warn-box ul { margin: 4px 0; padding-left: 18px; }
.conflict-box { border: 1px solid #f3c0c0; background: #fdf1f1; border-radius: 8px; padding: 10px 14px; margin: 6px 0 14px; }
.conflict-box.ok { border-color: #b6e3cb; background: #eef9f3; color: #11603b; }
.conflict-box ul { margin: 6px 0; padding-left: 18px; }
.conflict-box .check-label { margin: 6px 0 0; color: #8e1f1f; }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 6px; border-left: 4px solid var(--c); background: var(--bgc); }
.lesson-list li.ended { opacity: .5; }

@media print {
  .sidebar, .topbar, .no-print, .legend, .alert { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .sched-wrap { max-height: none; overflow: visible; border: 0; }
  .sched-col { cursor: default; }
  .lesson { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* live filters */
.live-spinner { width: 16px; height: 16px; border: 2px solid #cfd4df; border-top-color: var(--primary); border-radius: 50%; visibility: hidden; }
form.loading .live-spinner { visibility: visible; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* instrument catalog */
.check-grid { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 4px; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
.check-grid legend { font-weight: 500; padding: 0 4px; }
.check-grid .check-label { margin: 0 0 6px; font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-off { opacity: .5; text-decoration: line-through; }
.chip-btn { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.chip-btn:hover { color: var(--danger); }

.pair-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pair { padding: 3px 10px; border-radius: 99px; background: var(--bgc); border-left: 4px solid var(--c); font-size: 13px; }
.field-hint { grid-column: 1 / -1; margin: -4px 0 10px; }

/* searchable select */
.combo { position: relative; margin-top: 4px; font-weight: 400; }
.combo input { padding-right: 30px; }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.combo-clear:hover { color: var(--danger); }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #cfd4df; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 33, 61, .15);
}
.combo-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.combo-list li.active { background: #e6edfc; }
.combo-list li.selected { font-weight: 600; }
.combo-list li.combo-empty { color: var(--muted); cursor: default; font-size: 12px; }

/* language */
.lang-switch select { width: auto; padding: 3px 6px; font-size: 12px; }
.login-langs { display: flex; gap: 6px; justify-content: center; }
.login-langs button { background: none; border: 1px solid rgba(255,255,255,.3); color: #c9d1e6; border-radius: 99px; padding: 3px 12px; cursor: pointer; font: inherit; font-size: 12px; }
.login-langs button.on, .login-langs button:hover { background: rgba(255,255,255,.15); color: #fff; }
@media (max-width: 900px) { .lang-switch { display: block; } }

/* lesson reports */
.alert-warn { background: #fff7e6; border-color: #f3dca0; color: #7a5200; }
.occ-list { list-style: none; margin: 0; padding: 0; }
.occ-day { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 14px 0 6px; }
.occ-day:first-child { padding-top: 0; }
.occ { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 6px; border-radius: 8px; border-left: 4px solid var(--c); background: var(--bgc); }
.occ-time { min-width: 70px; font-weight: 700; }
.occ-time small { display: block; font-weight: 400; color: var(--muted); }
.occ-main { flex: 1; min-width: 0; }
.occ-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.report-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-head strong { font-size: 17px; }
.radio-row { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.radio-pill { display: inline-flex !important; align-items: center; gap: 6px; border: 1px solid #cfd4df; border-radius: 99px; padding: 6px 14px; margin: 0 !important; cursor: pointer; font-weight: 500; }
.radio-pill:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.video-field { border: 1px dashed #cfd4df; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.video-field input[type=file] { margin: 8px 0 4px; }
.inline-check { display: inline-flex !important; margin: 0 0 0 10px !important; }
.upload-progress { margin-bottom: 12px; }
.upload-progress .bar { height: 10px; background: #e6e9f0; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.lesson-video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.video-processing { display: flex; align-items: center; gap: 10px; padding: 18px; background: #f4f6fb; border-radius: 8px; }
.spinner { width: 18px; height: 18px; border: 2px solid #cfd4df; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.att-present.badge { background: #e2f5ec; color: var(--success); }
.att-late.badge { background: #fff1d6; color: #9a6200; }
.att-absent.badge { background: #fde7e7; color: var(--danger); }
.vid-ready.badge { background: #e6edfc; color: var(--primary); }
.vid-processing.badge { background: #fff1d6; color: #9a6200; }
.vid-failed.badge { background: #fde7e7; color: var(--danger); }
.clamp { max-width: 340px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) {
  .occ { flex-wrap: wrap; }
  .occ-status { width: 100%; justify-content: flex-start; }
}

.teacher-links { grid-column: 1 / -1; }
.field-label { font-weight: 500; margin: 0 0 2px; }
.access-card { border-top: 3px solid var(--primary); }

.inline-add { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.inline-add input { width: auto; flex: 1 1 220px; max-width: 320px; padding: 5px 8px; }
.inline-add-msg { color: var(--success); }
.inline-add-msg.error { color: var(--danger); }

/* schedule - month */
.month-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.month-summary .chips { margin: 0; }
.month-summary .chip:hover { text-decoration: none; border-color: var(--primary); }
.month-total { font-size: 15px; }
.month-grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mhead { background: #f8f9fc; padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.mcell { background: #fff; min-height: 118px; padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mcell.out { background: #fafbfd; }
.mcell.out .mday, .mcell.out .mitem { opacity: .45; }
.mcell.today { background: #fffaf0; box-shadow: inset 0 0 0 2px var(--gold); }
.mcell-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.mday { font-weight: 700; color: var(--text); padding: 0 4px; border-radius: 4px; }
.mday:hover { background: #eef1f7; text-decoration: none; }
.mitem { display: block; font-size: 11.5px; line-height: 1.35; padding: 1px 5px; border-radius: 4px; color: #1d2433;
  background: var(--bgc); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem:hover { text-decoration: none; filter: brightness(.96); }
.mitem.conflict { outline: 1.5px solid var(--danger); outline-offset: -1.5px; }
.mitem.on-hold { opacity: .5; }
.mmore { font-size: 11.5px; font-weight: 600; padding: 0 5px; }
@media (max-width: 700px) {
  .mcell { min-height: 74px; padding: 2px; }
  .mitem b { display: none; }
  .mcell-head small { display: none; }
}
@media print {
  .month-grid { border-radius: 0; }
  .mcell { min-height: 90px; }
  .mitem { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* recording link */
.recording-modes { margin: 8px 0 10px; }
.video-field input[type=url] { margin: 4px 0; }
.warn-text { color: #9a6200; }
.vid-link.badge { background: #ece6fb; color: #5b3cc4; }
.recording-link { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; background: #f6f3fe; border-radius: 8px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.link-text { color: var(--muted); word-break: break-all; margin: 0; }

/* radio pills: the generic "input { width: 100% }" must not stretch radio buttons */
input[type=radio] { width: auto; margin: 0; flex-shrink: 0; }
.form .radio-pill > input { margin-top: 0; }
.radio-pill { white-space: nowrap; line-height: 1.2; }
.recording-modes { gap: 8px; }
@media (max-width: 520px) {
  .radio-pill { white-space: normal; }
}

/* teacher pay */
.pay-table tfoot th { border-top: 2px solid var(--border); color: var(--text); font-size: 13px; text-transform: none; }
.pay-rules { margin-top: 12px; }
.pay-total { font-size: 18px; }
.pay-actions { margin-top: 14px; align-items: center; }
.seg a.on { cursor: default; }
input[type=month] { width: auto; }

/* indicators */
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 10px; }
.stat .delta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.chart-card h3 { font-size: 14px; margin: 0 0 6px; }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .grid { stroke: #eef0f5; stroke-width: 1; }
.bar-chart .axis { stroke: #cfd4df; stroke-width: 1; }
.bar-chart .tick { font-size: 11px; fill: var(--muted); }
.bar-chart .value { font-size: 12px; font-weight: 700; fill: var(--text); }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar:hover path { opacity: .82; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@media print { .bar-chart path { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.indicator-tables { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 18px; }
@media (max-width: 1100px) { .indicator-tables { grid-template-columns: 1fr; } }

/* counters (missing reports) */
.sidebar nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-badge, .tab-badge {
  display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 16px; background: var(--danger); color: #fff;
}
.tab-badge { margin-left: 6px; }
.seg a.on .tab-badge { background: #fff; color: var(--danger); }

.nav-badge.warn { background: var(--warn); }
.nav-badge.danger { background: var(--danger); }

.since-note { margin: -6px 0 12px; }
.since-note .warn-text { margin-left: 6px; }

/* menu groups */
.nav-group { padding: 14px 18px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: #7f8bab; }
.sidebar nav { padding-top: 4px; }
.sidebar nav a { padding-top: 7px; padding-bottom: 7px; }

/* dashboard card explanations */
.stat { position: relative; }
.stat-info {
  position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #a3adc4; color: #7f8bab; font: 700 11px/15px Georgia, serif; font-style: italic;
  text-align: center; cursor: help; user-select: none;
}
.stat-info:hover, .stat-info:focus { border-color: var(--primary); color: var(--primary); outline: none; }
.stat-info::after {
  content: attr(data-tip); display: none; position: absolute; z-index: 20; top: 24px; right: -6px;
  width: 260px; max-width: 80vw; padding: 10px 12px; border-radius: 8px; background: #1f2a44; color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 13px; line-height: 1.45;
  font-weight: 400; font-style: normal; text-align: left; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.stat-info:hover::after, .stat-info:focus::after { display: block; }
.stats-hint { margin: -10px 0 18px; }

/* lesson form: availability of the chosen day */
.avail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; }
.avail-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.avail-legend span { display: inline-flex; align-items: center; gap: 5px; }
.avail-dialog .lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.avail-grid { overflow-x: auto; }
.avail-inner { min-width: 820px; }
.avail-row { display: flex; align-items: stretch; height: 38px; border-top: 1px solid var(--border); }
.avail-row.axis { height: 18px; border-top: 0; }
.avail-row.sep { border-top: 2px solid #cfd5e3; }
.avail-label { position: sticky; left: 0; z-index: 3; background: #fff; flex: 0 0 130px; font-size: 12.5px; padding: 0 8px 0 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avail-label small { color: var(--muted); margin-right: 4px; }
.avail-track { position: relative; flex: 1; background-image: linear-gradient(to right, #e9ecf3 1px, transparent 1px); }
.avail-row.room .avail-track { cursor: copy; }
.avail-row.room .avail-track:hover { background-color: #f0f5ff; }
.avail-tick { position: absolute; top: 2px; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.avail-block { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; overflow: hidden; font-size: 10.5px; line-height: 28px; padding: 0 5px; white-space: nowrap; text-overflow: ellipsis; cursor: default; }
.avail-dialog .busy, .avail-block.busy { background: #c9d0de; color: #2c3550; }
.avail-dialog .hold, .avail-block.hold { background: repeating-linear-gradient(45deg, #e3e7ef, #e3e7ef 4px, #cfd5e1 4px, #cfd5e1 8px); color: #4a536b; }
.avail-dialog .pick, .avail-block.pick { background: rgba(31, 157, 85, .22); border: 2px solid #1f9d55; }
.avail-dialog .pick.bad, .avail-block.pick.bad { background: rgba(207, 58, 58, .2); border-color: var(--danger); }
.avail-block.pick { top: 2px; bottom: 2px; pointer-events: none; z-index: 2; }
.avail-msg { padding: 8px 0 2px; }
.avail-open-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: -4px 0 14px; }
.avail-dialog { width: min(1180px, 96vw); max-width: none; max-height: 92vh; border: 0; border-radius: 14px; padding: 18px 22px 16px; box-shadow: 0 20px 60px rgba(15, 25, 50, .35); }
.avail-dialog::backdrop { background: rgba(15, 25, 50, .55); }
.avail-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.avail-dialog-head h2 { margin: 0; }
.avail-x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.avail-x:hover { color: var(--text); }
.avail-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.avail-days button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 13.5px; }
.avail-days button:hover { border-color: var(--primary); }
.avail-days button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.avail-days button.chosen:not(.active) { border-color: #1f9d55; color: #11603b; font-weight: 600; }
.avail-dialog .avail-head { margin-bottom: 6px; }
.avail-dialog .avail-grid { max-height: calc(92vh - 250px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px 4px; }
.avail-dialog .avail-row.axis { position: sticky; top: 0; z-index: 4; background: #fff; height: 22px; }
.avail-dialog .avail-row.axis .avail-label { z-index: 5; }
.avail-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 16px; margin-top: 12px; }
.avail-foot .avail-choice { margin-right: auto; }
.avail-foot .inline-label { margin: 0; display: flex; align-items: center; gap: 6px; }
.avail-foot select { width: auto; }
.avail-tick:first-child { transform: none; }
.avail-tick:last-child { transform: translateX(-100%); }
.avail-week { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.avail-week strong { min-width: 190px; text-align: center; }
.avail-days button { display: inline-flex; align-items: baseline; gap: 4px; }
.avail-days button small { opacity: .75; }
.avail-days button.past:not(.active) { color: #a3abbd; }
.avail-days button.today:not(.active) { border-color: var(--primary); }
.avail-block.later { opacity: .55; border: 1px dashed #7f8bab; }
.avail-past { margin: 6px 0; padding: 6px 10px; border-radius: 6px; background: #fff8e6; color: #7a5200; font-size: 13px; }

/* teacher pay: header, tiles and receipt */
.pay-hero { padding: 0; overflow: hidden; }
.pay-hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 18px 22px; background: linear-gradient(120deg, #1f2a44, #2b3f73); color: #fff; }
.pay-hero-head h2 { margin: 0; color: #fff; font-size: 20px; }
.pay-hero-head .muted { color: #c7d0e6; }
.pay-hero-head a { color: #ffd479; }
.pay-hero-head .warn-text { color: #ffd479; }
.pay-who { display: flex; align-items: center; gap: 14px; }
.pay-avatar { width: 46px; height: 46px; border-radius: 50%; background: #e2a72e; color: #1f2a44; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.pay-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pay-status .badge { font-size: 13px; padding: 4px 12px; }
.pay-status .badge:not(.st-active):not(.st-new) { background: rgba(255,255,255,.16); color: #fff; }
.pay-hero-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 20px; padding: 20px 22px; }
.pay-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.pay-tile { border-radius: 10px; padding: 12px 14px; color: var(--muted); background: #f5f7fb; border-left: 4px solid #c3cad9; font-size: 13.5px; }
a.pay-tile:hover { text-decoration: none; filter: brightness(.97); }
.pay-tile span { display: block; font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.15; }
.pay-tile small { display: block; margin-top: 2px; font-size: 12px; }
.pay-tile.ok { background: #eef8f2; border-left-color: var(--success); }
.pay-tile.bad { background: #fdf1f1; border-left-color: var(--danger); }
.pay-tile.warn { background: #fff7e8; border-left-color: var(--warn); }
.pay-tile.warn small { color: #9a5d00; font-weight: 600; }
.pay-tile.info { background: #eef3fc; border-left-color: var(--primary); }
.pay-receipt { border: 1px solid var(--border); border-radius: 12px; padding: 6px 18px 14px; background: #fcfdff; align-self: start; }
.pay-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #d9dee9; }
.pay-line span small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pay-line strong { font-size: 16px; white-space: nowrap; }
.pay-line strong.plus { color: var(--success); }
.pay-line strong.minus { color: var(--danger); }
.pay-line.total { border-bottom: 0; padding-top: 14px; }
.pay-line.total span { font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.pay-line.total strong { font-size: 30px; color: var(--success); }
.pay-forecast { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.pay-side { margin-bottom: 18px; }
@media (max-width: 760px) {
  .pay-hero-body { grid-template-columns: 1fr; }
  .pay-status { align-items: flex-start; }
}
@media print {
  .pay-hero-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* teacher pay: list of adjustments in the receipt */
.pay-line.adj { padding: 9px 0; }
.adj-value { display: inline-flex; align-items: center; gap: 8px; }
.adj-del { margin: 0; display: inline; }
.x-btn { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #fde8e8; color: var(--danger); font-size: 16px; line-height: 22px; padding: 0; cursor: pointer; font-weight: 700; }
.x-btn:hover { background: var(--danger); color: #fff; }

/* trial lessons */
.st-trial.badge { background: #f1e8fd; color: #6b3fb5; }
.st-not_enrolled.badge { background: #eef0f4; color: #5b6478; }
.trial-tag { display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 1.5; padding: 0 6px; border-radius: 999px; background: #6b3fb5; color: #fff; vertical-align: middle; letter-spacing: .3px; }
.trial-banner { background: #f6f0fe; border: 1px solid #e0cffa; color: #4b2a85; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.trial-card { border-left: 4px solid #6b3fb5; }
.trial-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trial-actions form { margin: 0; }
.lost-pop { position: relative; }
.lost-pop summary { list-style: none; cursor: pointer; }
.lost-pop summary::-webkit-details-marker { display: none; }
.lost-pop[open] .lost-form { position: absolute; z-index: 10; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.12); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; width: max-content; }
.lost-form label { margin: 0; font-size: 12.5px; }
.lost-form select { width: auto; }
.tab-badge.warn { background: var(--warn); }
.stat.st-trial { border-top-color: #6b3fb5; }

.trial-count { color: #6b3fb5; font-weight: 600; }
small.trial-count { font-size: 11.5px; }

/* finance */
.finance-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.finance-steps .step p { margin: 4px 0 10px; }
.finance-steps form { margin: 0; }
.price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-items { margin-bottom: 8px; }
@media (max-width: 760px) { .finance-steps, .price-grid { grid-template-columns: 1fr; } }

/* wide search box in toolbars (finance) */
.filters input.search-wide { width: 340px; max-width: 100%; }
@media (max-width: 760px) { .filters input.search-wide { width: 100%; } }

/* past days on the schedule + toast message */
.sched-col.past { background-image: repeating-linear-gradient(135deg, rgba(120,130,150,.06) 0 8px, transparent 8px 16px); cursor: not-allowed; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 1000;
  background: #1f2a44; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; max-width: min(520px, 92vw); transition: opacity .2s, transform .2s; }
.toast.error { background: #b42828; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* lesson form: repeats every week / only on this date */
.repeat-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -2px 0 14px; }
.repeat-label { font-weight: 600; margin-right: 4px; }
.pill-radio { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 500; background: #fff; }
.pill-radio:has(input:checked) { border-color: var(--primary); background: #eef3fc; color: var(--primary); }
.repeat-field small { flex-basis: 100%; }

/* month view: add a lesson on a day */
.mcell[data-new-day] { cursor: copy; }
.mcell.past { cursor: not-allowed; background-image: repeating-linear-gradient(135deg, rgba(120,130,150,.05) 0 8px, transparent 8px 16px); }
.mcell-head { align-items: center; gap: 4px; }
.mcell-head small { margin-left: auto; }
.madd { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; line-height: 1;
  color: var(--primary); background: #eef3fc; opacity: 0; transition: opacity .15s; }
.mcell:hover .madd, .madd:focus { opacity: 1; text-decoration: none; }
.madd:hover { background: var(--primary); color: #fff; }
@media (hover: none) { .madd { opacity: 1; } }

/* lesson form: which unit the lesson goes to */
.unit-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 16px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--unit-color); border-left-width: 6px; background: color-mix(in srgb, var(--unit-color) 8%, #fff); }
.unit-banner .unit-icon { font-size: 22px; }
.unit-banner strong { color: var(--unit-color); font-size: 17px; text-transform: uppercase; letter-spacing: .5px; }
.unit-banner small { color: var(--muted); }
.unit-switch-btns { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.unit-banner.flash { animation: unit-flash .7s; }
@keyframes unit-flash { 0% { box-shadow: 0 0 0 0 var(--unit-color); } 100% { box-shadow: 0 0 0 10px transparent; } }

.conflict-date { display: inline-block; padding: 3px 8px; margin-left: -8px; border-radius: 6px; }
.conflict-date:hover { background: #eef3fc; text-decoration: none; }

/* contracts: document, public signing page */
.contract-doc { max-width: 760px; margin: 0 auto; font-size: 15px; line-height: 1.6; color: #1d2433; }
.contract-doc header { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid #1f2a44; padding-bottom: 8px; margin-bottom: 14px; }
.contract-logo { font-weight: 800; color: #c8901f; letter-spacing: 3px; font-size: 20px; }
.contract-doc h1 { font-size: 20px; margin: 6px 0 12px; }
.contract-doc h2 { font-size: 15.5px; margin: 18px 0 6px; color: #1f2a44; }
.contract-doc ul { margin: 4px 0 8px; padding-left: 22px; }
.contract-doc p { text-align: justify; margin: 6px 0; }
.contract-note { color: #b42828; font-weight: 600; font-size: 13px; }
.sign-page { background: #eef1f6; }
.sign-wrap { max-width: 820px; margin: 0 auto; padding: 20px 14px 40px; }
.sign-form { max-width: 820px; }
.sig-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; background: #fff; }
.sig-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.sig-box canvas { width: 100%; height: 180px; border: 1.5px dashed #b9c1d3; border-radius: 8px; background: #fcfdff; touch-action: none; cursor: crosshair; display: block; }
.sig-box canvas.sig-missing { border-color: var(--danger); background: #fff5f5; }
.consent { align-items: flex-start !important; font-weight: 400; font-size: 13.5px; margin: 6px 0 16px; }
.consent input { margin-top: 3px; }
.btn-lg { padding: 12px 26px; font-size: 16px; }
.sign-msg { text-align: center; padding: 34px 24px; }
.sign-msg h1 { font-size: 22px; }
.sign-check { width: 64px; height: 64px; border-radius: 50%; background: #e2f5ec; color: var(--success); font-size: 34px; display: grid; place-items: center; margin: 0 auto 10px; }
.sign-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; font-size: 12.5px; }
.sig-preview { max-width: 320px; border: 1px solid var(--border); border-radius: 8px; background: #fff; margin-top: 8px; }
.steps-list { padding-left: 20px; line-height: 1.6; }
.form label.consent, label.check-label.consent { font-weight: 400; }

/* detail lists: long values (links, fingerprints, error messages) wrap instead of widening the page */
.details { grid-template-columns: 140px minmax(0, 1fr); }
.details dd { min-width: 0; overflow-wrap: anywhere; }
.details code { word-break: break-all; }
.card-head { flex-wrap: wrap; gap: 6px 12px; }
.copy-row input { min-width: 0; }
@media (max-width: 900px) { .details { grid-template-columns: 110px minmax(0, 1fr); } }
@media (max-width: 520px) {
  /* phone: label above its value */
  .details { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; margin-top: 10px; }
  .details dd { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .copy-row { flex-wrap: wrap; }
  .copy-row input { flex-basis: 100%; }
  .copy-row .btn { flex: 1; text-align: center; }
}

/* closed days (holidays) */
.closed-tag { color: #b42828; font-weight: 600; font-size: 11.5px; }

/* enrollment steps */
.enroll-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; }
.enroll-step { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.enroll-step .step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #eef0f4; color: var(--muted); }
.enroll-step.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 89, 195, .08); }
.enroll-step.current .step-num { background: var(--primary); color: #fff; }
.enroll-step.done .step-num { background: var(--success); color: #fff; }
.enroll-step.todo { opacity: .65; }
.enroll-step .step-body { flex: 1; min-width: 0; }
.enroll-step h2 { margin: 4px 0 8px; }
.lesson-list.compact li { padding: 8px 0; }
.paper-box { margin-top: 12px; }
.paper-box summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.paper-box form { margin-top: 10px; }
.enroll-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; border-left: 4px solid var(--primary); }
.enroll-banner h2 { margin: 0 0 4px; }
.enroll-banner p { margin: 0; }
.enroll-tag { font-size: 11px; }
.st-enrolling.badge { background: #e6edfc; color: var(--primary); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #c3cad9; }
.timeline li.ev-signed::before, .timeline li.ev-paper::before { background: var(--success); }
.timeline li.ev-email_failed::before, .timeline li.ev-voided::before { background: var(--danger); }
.timeline li.ev-email_sent::before, .timeline li.ev-created::before { background: var(--primary); }

/* setup guide */
.guide-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.guide-intro h2 { margin: 0 0 4px; }
.guide-intro p { margin: 0; max-width: 720px; }
.guide-progress { min-width: 180px; text-align: right; }
.guide-progress strong { font-size: 26px; display: block; }
.guide-progress .bar { height: 8px; background: #e7eaf1; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.guide-progress .bar i { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.guide-steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.guide-step { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.guide-step .step-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--primary); color: #fff; }
.guide-step.done .step-num { background: var(--success); }
.guide-step .step-body { flex: 1; min-width: 0; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-head h3 { margin: 4px 0; font-size: 16px; }
.guide-detail { margin: 2px 0 6px; font-weight: 600; }
.guide-todo { margin: 6px 0 12px; padding-left: 20px; line-height: 1.55; }
.practice .step-num { background: #6b7385; }
.routine ul { padding-left: 20px; line-height: 1.6; }
.routine h3 { margin: 6px 0; }
.guide-alert { background: #eef3fc; border: 1px solid #c9d7f5; color: #1f3d85; }

.saved-note { margin-left: 12px; color: var(--success); font-weight: 600; font-size: 14px; animation: saved-in .4s ease-out; }
@keyframes saved-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.toast.success { background: #1f7a4d; }

/* agreement preview popup */
.preview-dialog { width: min(880px, 96vw); max-width: none; max-height: 90vh; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(15, 25, 50, .35); display: flex; flex-direction: column; }
.preview-dialog:not([open]) { display: none; }
.preview-dialog::backdrop { background: rgba(15, 25, 50, .55); }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.preview-body { overflow: auto; padding: 20px 26px 28px; }

.check.locked { opacity: .55; cursor: not-allowed; font-size: 12px; }
button[disabled] { cursor: not-allowed; opacity: .55; }

.check.readonly { display: inline-grid; place-items: center; cursor: default; }
.check.readonly:not(.on) { color: var(--muted); }

/* what changed in each agreement */
.change-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; line-height: 1.6; }
.change-list .ch-added { color: #1f7a4d; }
.change-list .ch-removed { color: #b42828; }
.change-list .ch-changed { color: #8a5a00; }
.change-list .ch-initial { color: var(--muted); }
.fresh-note { margin: -6px 0 10px; }
.st-validated.badge { background: #dff4f4; color: #0d7173; }
.stat.st-validated span { color: #0d7173; }
a.stat { color: inherit; text-decoration: none; }
.validated-box { background: #dff4f4; border: 1px solid #b5e3e3; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; color: #0d7173; }
.validated-box small { display: block; margin-top: 2px; }
.validate-row { flex-wrap: wrap; }
.access-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: 0; text-transform: none;
  padding: 1px 7px; border-radius: 999px; background: #f3eefc; color: #5b3a9a; border: 1px solid #e2d6f7; white-space: nowrap; vertical-align: middle; cursor: help; }
h1 .access-tag { font-size: 12px; margin-left: 6px; }
.nav-lock { font-size: 10px; opacity: .55; cursor: help; }
.access-table td.yes { color: var(--success); font-weight: 700; }
.access-table td.no { color: #b7bdc9; }
.access-table .center { text-align: center; }
.due-box { background: #f6f8fc; border: 1px solid #e3e8f2; border-radius: 10px; padding: 10px 12px; margin: 10px 0 12px; display: grid; gap: 4px; }
.due-box label { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.due-box input[type="date"] { width: auto; }
.due-custom { color: #9a6200; font-weight: 600; }
.due-custom .link { font-size: inherit; padding: 0; }
.paid-box { background: #e2f5ec; border: 1px solid #bfe6d2; border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; color: var(--success); margin-bottom: 6px; }
.paid-box strong { font-size: 16px; }
/* the access tag keeps its own look inside cards whose spans are big numbers (.stat span) */
.stat span.access-tag, .card span.access-tag { display: inline-flex; width: fit-content; font-size: 11px; font-weight: 600; color: #5b3a9a; line-height: 1.3; margin: 4px 0 2px; }
.otp-box { border: 1px solid #d7dce6; background: #f6f8fc; border-radius: 10px; padding: 12px 14px; margin: 12px 0 16px; }
.otp-box p { margin: 4px 0 10px; }
.otp-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.otp-row input { width: 150px; font-size: 20px; letter-spacing: 4px; text-align: center; }
.otp-msg { display: block; margin-top: 8px; }
.otp-msg.ok { color: var(--success); }
.otp-msg.err { color: var(--danger); }
.details.evidence { margin-top: 12px; }
.verify-box { margin-top: 12px; border: 1px dashed #c9d1e0; border-radius: 10px; padding: 10px 12px; }
.verify-box p { margin: 4px 0 8px; }
.verify-ok { display: block; margin-top: 6px; color: var(--success); font-weight: 600; }
.verify-bad { display: block; margin-top: 6px; color: var(--danger); font-weight: 600; }
.tab-badge.danger { background: var(--danger); }
.trial-mail form { display: inline-block; }
.trial-mail small { margin-top: 3px; }
.otp-dialog { border: 0; border-radius: 16px; padding: 28px 26px 22px; width: min(420px, calc(100vw - 32px)); text-align: center; box-shadow: 0 20px 60px rgba(15, 25, 50, .35); }
.otp-dialog::backdrop { background: rgba(15, 25, 50, .55); }
.otp-dialog h2 { margin: 6px 0 6px; font-size: 21px; }
.otp-dialog p { margin: 0 0 16px; }
.otp-icon { width: 54px; height: 54px; border-radius: 50%; background: #e6edfc; color: var(--primary); font-size: 26px; display: grid; place-items: center; margin: 0 auto; }
.otp-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.otp-input { display: block; width: 100%; max-width: 260px; margin: 0 auto; box-sizing: border-box; padding: 12px 10px; font-size: 30px; font-weight: 700; letter-spacing: 10px; text-indent: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { color: #c8cfdb; }
.otp-msg { display: block; min-height: 20px; margin: 10px 0 6px; font-size: 14px; }
.otp-msg.ok { color: var(--success); }
.otp-msg.err { color: var(--danger); }
.otp-confirm { width: 100%; max-width: 260px; }
.otp-help { margin: 14px 0 0 !important; }
.otp-help .link { font-size: inherit; padding: 0; }
.nav-badge + .nav-badge { margin-left: 3px; }
.nav-badges { display: inline-flex; gap: 3px; margin-left: auto; white-space: nowrap; }
.lesson-line { white-space: nowrap; line-height: 1.5; }
/* long student history: about 20 entries visible, the rest scrolls */
.history-scroll { max-height: 740px; overflow-y: auto; padding-right: 6px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.student-filter { display: inline-block; min-width: 220px; }
/* filter rows: every control on the same line, centered */
.filters { align-items: center; }
.filters .combo { margin-top: 0; }
.filters .btn-sm { align-self: center; white-space: nowrap; }
/* × of the searchable field: small round button */
.combo-clear { width: 22px; height: 22px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: #eef1f6; color: #6b7385; right: 8px; }
.combo-clear:hover { background: #fde7e7; color: var(--danger); }
.combo-clear[hidden] { display: none; }
.filters .btn-sm { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; }
.filters .student-filter { width: 240px; min-width: 0; }
.filters .combo input { width: 100%; box-sizing: border-box; }
.login-forgot { text-align: center; margin: 12px 0 0; font-size: 13px; }
.pw-title { font-size: 19px; margin: 6px 0 4px; text-align: center; }
.pw-option { margin: 4px 0 12px; }
.pw-option summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.pw-option label { margin-top: 8px; max-width: 320px; }
/* password fields: eye button + rules checklist */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 42px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; border: 0; border-radius: 6px; background: none; color: #7a8297; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { background: #eef1f6; color: var(--text); }
.pw-eye .pw-slash { display: none; }
.pw-eye.on .pw-slash { display: inline; }
.pw-rules { list-style: none; margin: -2px 0 12px; padding: 0; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: '○'; display: inline-block; width: 18px; color: #b7bdc9; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before { content: '✓'; color: var(--success); font-weight: 700; }
.pw-rules.touched li:not(.ok) { color: #9a6200; }
.pw-match { display: block; margin: -6px 0 12px; font-size: 12.5px; font-weight: 600; }
.pw-match.ok { color: var(--success); }
.pw-match.bad { color: var(--danger); }
/* deactivated teachers, rooms and users: grey row, name struck through */
tr.row-off td { background: #eceef2; }
tr.row-off td:first-child { box-shadow: inset 4px 0 0 #a9b0be; }
tr.row-off td:first-child strong, tr.row-off td:first-child a { text-decoration: line-through; text-decoration-thickness: 2px; color: #7a8297; }
.badge.st-off { background: #d9dde5; color: #4a5266; }
