/* R37 school: subjects, branches, teachers, timetable and holidays. Every class of this file starts with "stt-". */

/* ---------- small bits ---------- */
.stt-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--stt-c, var(--primary)); flex: none; vertical-align: -1px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.stt-name { display: inline-flex; align-items: center; gap: 8px; }
.stt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.stt-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: color-mix(in srgb, var(--stt-c, var(--primary)) 14%, var(--surface)); color: color-mix(in srgb, var(--stt-c, var(--primary)) 78%, var(--text));
    border: 1px solid color-mix(in srgb, var(--stt-c, var(--primary)) 28%, transparent); white-space: nowrap; }
.stt-chip.short { background: var(--amber-bg); color: var(--amber-fg); border-color: transparent; }
.stt-chip.over { background: var(--red-bg); color: var(--red-fg); border-color: transparent; }
.stt-chip.ok { background: var(--green-bg); color: var(--green-fg); border-color: transparent; }
.stt-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stt-color-btn { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; background: var(--stt-c); cursor: pointer; padding: 0; }
.stt-color-btn[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.stt-color-input { width: 38px; height: 28px; padding: 0 2px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); }
.stt-sub { font-size: 12px; color: var(--muted); }
.stt-grade-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0; }
.stt-grade-row { display: grid; grid-template-columns: 1fr 88px; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--row-line); }
.stt-grade-row input[type="number"] { width: 100%; }
.stt-stage { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; margin: 10px 0 2px; }
.stt-days { display: flex; flex-wrap: wrap; gap: 6px; }
.stt-day-btn { min-width: 46px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.stt-day-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.stt-meter { height: 6px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; min-width: 70px; }
.stt-meter > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.stt-meter.over > span { background: var(--red-fg); }
.stt-load { display: flex; flex-direction: column; gap: 3px; min-width: 90px; }
.stt-note { font-size: 12px; color: var(--muted); }
.stt-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }

/* ---------- holiday banner (attendance, nursery, timetable, dashboard) ---------- */
.stt-holiday-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; margin: 0 0 14px;
    background: repeating-linear-gradient(135deg, var(--amber-bg) 0 14px, color-mix(in srgb, var(--amber-bg) 70%, var(--surface)) 14px 28px);
    color: var(--amber-fg); border: 1px solid color-mix(in srgb, var(--amber-fg) 25%, transparent); }
.stt-holiday-banner .stt-hb-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--amber-fg); flex: none; }
.stt-holiday-banner strong { display: block; font-size: 15px; color: var(--text); }
.stt-holiday-banner .stt-hb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stt-holiday-banner .stt-hb-sub { font-size: 13px; }

/* ---------- timetable grid ---------- */
.stt-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 0 0 12px; }
.stt-modes { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stt-modes button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.stt-modes button + button { border-inline-start: 1px solid var(--border); }
.stt-modes button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.stt-week { display: inline-flex; align-items: center; gap: 6px; }
.stt-week .icon-btn { border: 1px solid var(--border); }
.stt-wrap { overflow-x: auto; }
.stt-table { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 660px; }
.row > .card.side.stt-side { flex: 0 0 290px; min-width: 0; }
.row > .card.grow.stt-main { min-width: 0; }
.stt-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 2px; vertical-align: bottom; }
.stt-table th .stt-time { display: block; font-weight: 500; font-size: 11px; direction: ltr; }
.stt-table th.stt-dayhead { width: 78px; text-align: start; vertical-align: middle; }
.stt-table th.stt-dayhead strong { display: block; font-size: 13px; color: var(--text); }
.stt-table th.stt-dayhead span { font-size: 11.5px; font-weight: 500; }
.stt-table tr.stt-today th.stt-dayhead strong { color: var(--primary); }
.stt-table tr.stt-today th.stt-dayhead::after { content: ""; display: block; height: 3px; width: 26px; border-radius: 3px; background: var(--primary); margin-top: 4px; }
.stt-table th.stt-break, .stt-table td.stt-break { width: 24px; padding: 0; }
.stt-cell { height: 62px; border-radius: 9px; padding: 6px 7px; vertical-align: top; position: relative; text-align: start;
    background: color-mix(in srgb, var(--stt-c, var(--primary)) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--stt-c, var(--primary)) 26%, transparent);
    border-inline-start: 4px solid var(--stt-c, var(--primary)); overflow: hidden; }
.stt-cell.empty { background: var(--surface); border: 1px dashed var(--border); border-inline-start: 1px dashed var(--border); }
.stt-cell.editable { cursor: pointer; }
.stt-cell.editable:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent); }
.stt-cell.selected { box-shadow: 0 0 0 2px var(--primary); }
.stt-cell.conflict { box-shadow: 0 0 0 2px var(--red-fg); background: var(--red-bg); }
.stt-cell .stt-subj { display: block; font-weight: 700; font-size: 13px; color: color-mix(in srgb, var(--stt-c, var(--primary)) 70%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stt-cell .stt-who { display: block; font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stt-cell .stt-where { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stt-cell .stt-add { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 18px; }
.stt-cell.off { background: var(--gray-bg); border-color: transparent; color: var(--muted); }
td.stt-break { border-radius: 8px; background: repeating-linear-gradient(180deg, var(--gray-bg) 0 6px, transparent 6px 12px); writing-mode: vertical-rl; text-align: center;
    font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
html[dir="rtl"] td.stt-break { writing-mode: vertical-lr; }
td.stt-holiday-row { border-radius: 10px; padding: 0 14px; height: 62px;
    background: repeating-linear-gradient(135deg, var(--amber-bg) 0 12px, color-mix(in srgb, var(--amber-bg) 60%, var(--surface)) 12px 24px);
    color: var(--amber-fg); font-weight: 600; font-size: 13.5px; }
td.stt-holiday-row span { display: inline-flex; align-items: center; gap: 8px; }
.stt-cell.holiday { background: repeating-linear-gradient(135deg, var(--amber-bg) 0 8px, var(--surface) 8px 16px); border-color: transparent; }
.stt-cell.holiday .stt-subj { color: var(--amber-fg); text-decoration: line-through; }
.stt-side-list { display: flex; flex-direction: column; gap: 6px; }
.stt-side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.stt-conflicts { margin: 0 0 12px; }
.stt-conflicts ul { margin: 6px 0 0; padding-inline-start: 18px; }
.stt-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- bell schedule editor ---------- */
.stt-bell { width: 100%; border-collapse: collapse; }
.stt-bell td, .stt-bell th { padding: 4px 4px; border-bottom: 1px solid var(--row-line); font-size: 13px; text-align: start; }
.stt-bell input, .stt-bell select { width: 100%; min-width: 0; }
.stt-bell td.no { width: 52px; } .stt-bell td.t { width: 92px; } .stt-bell td.k { width: 112px; } .stt-bell td.x { width: 34px; }
.stt-bell tr.break td { background: var(--gray-bg); }

/* ---------- holidays calendar ---------- */
.stt-cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.stt-cal-head h2 { margin: 0; min-width: 160px; text-align: center; }
.stt-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.stt-cal .stt-wd { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 0; }
.stt-cal .stt-d { min-height: 92px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stt-cal .stt-d.out { opacity: .45; }
.stt-cal .stt-d.weekend { background: var(--gray-bg); }
.stt-cal .stt-d.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.stt-cal .stt-d .stt-dn { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stt-cal .stt-d.today .stt-dn { color: var(--primary); }
.stt-ev { display: block; border: 0; width: 100%; text-align: start; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.25; padding: 3px 6px; border-radius: 6px; cursor: pointer;
    background: color-mix(in srgb, var(--stt-c) 16%, var(--surface)); color: color-mix(in srgb, var(--stt-c) 80%, var(--text)); border-inline-start: 3px solid var(--stt-c);
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.stt-ev.k1 { --stt-c: #dc2626; } .stt-ev.k2 { --stt-c: #2563eb; } .stt-ev.k3 { --stt-c: #9333ea; } .stt-ev.k4 { --stt-c: #ea580c; } .stt-ev.k5 { --stt-c: #0d9488; } .stt-ev.k9 { --stt-c: #64748b; }
.stt-kind { --stt-c: #64748b; }
.stt-kind.k1 { --stt-c: #dc2626; } .stt-kind.k2 { --stt-c: #2563eb; } .stt-kind.k3 { --stt-c: #9333ea; } .stt-kind.k4 { --stt-c: #ea580c; } .stt-kind.k5 { --stt-c: #0d9488; }
.stt-upcoming { display: flex; flex-direction: column; }
.stt-up { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--row-line); }
.stt-up:last-child { border-bottom: 0; }
.stt-datebox { width: 46px; flex: none; border-radius: 10px; text-align: center; padding: 4px 0; background: color-mix(in srgb, var(--stt-c) 14%, var(--surface));
    color: color-mix(in srgb, var(--stt-c) 80%, var(--text)); }
.stt-datebox strong { display: block; font-size: 17px; line-height: 1.1; }
.stt-datebox small { font-size: 11px; text-transform: uppercase; }
.stt-up .stt-up-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stt-up .stt-up-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- print: A4 landscape class / teacher sheets ---------- */
.stt-print-sheet { break-after: page; }
.stt-print-sheet:last-child { break-after: auto; }
.stt-print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.stt-print-head h2 { margin: 0; font-size: 18px; }
@media print {
    .stt-table { min-width: 0; border-spacing: 3px; }
    .stt-cell { height: 54px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    td.stt-holiday-row, td.stt-break, .stt-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .stt-noprint { display: none !important; }
}
@media (max-width: 760px) {
    .stt-cal .stt-d { min-height: 64px; }
    .stt-ev { font-size: 10.5px; }
}
.stt-nowrap { white-space: nowrap; }
.stt-ellipsis { display: block; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
