:root {
  color-scheme: light;
  --ink: #18342d;
  --muted: #64746e;
  --line: #d9e2dd;
  --paper: #ffffff;
  --canvas: #f2f6f3;
  --green: #176b4c;
  --green-dark: #12352d;
  --mint: #e7f4ec;
  --gold: #d9a544;
  --red: #a33a35;
  --strong:#12352d; --link:#176b4c; --field-bg:#fff; --field-border:#cbd7d0; --focus-ring:#b8dfcc;
  --table-head:#f7faf8; --row-hover:#fbfdfb; --soft-line:#e7ece9; --button-hover:#125a40;
  --success-ink:#174d39; --success-bg:#e9f5ed; --success-line:#cfe2d6;
  --error-ink:#7b2925; --error-bg:#fff0ee; --error-line:#efd0cc;
  --grade-ink:#165039; --count-ink:#7f3a19; --count-bg:#fff0d4; --auth-glow:#d9eddf;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
input,select,textarea {color:var(--ink);background-color:var(--field-bg);accent-color:var(--green);}
a {color:var(--link);}
button:focus-visible,textarea:focus-visible,input[type="checkbox"]:focus-visible {outline:3px solid var(--focus-ring);outline-offset:2px;}
.app-shell { min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem); color: #fff; background: var(--green-dark);
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .8rem;
  color: var(--green-dark); background: #d8eeb9; font-weight: 900; letter-spacing: -.08em;
}
.brand-title { margin: 0; font-size: 1.03rem; font-weight: 750; }
.brand-subtitle { margin: .15rem 0 0; color: #c5d6ce; font-size: .82rem; }
.user-actions { display: flex; align-items: center; gap: .85rem; }
.topbar-user {display:flex;align-items:center;gap:.7rem;margin-left:auto;min-width:0;}
.birthday-topbar-button {min-height:2.4rem;padding:.45rem .7rem;white-space:nowrap;}
.problem-report-button {min-height:2.4rem;padding:.45rem .7rem;white-space:nowrap;}
.user-name { color: #e4eee9; font-size: .9rem; }
.user-identity {display:flex;flex-direction:column;align-items:flex-end;gap:.12rem;}
.user-role {color:#c6d8d1;font-size:.78rem;}
.test-mode-badge {padding:.35rem .6rem;border:1px solid #e2b23e;border-radius:999px;color:#ffe7a3;background:#59430d;font-size:.75rem;font-weight:700;white-space:nowrap;}
.catalog-direct-heading {display:flex;align-items:flex-start;gap:1rem;}
.catalog-direct-heading .page-heading {flex:1;}
.catalog-direct-form {align-items:end;}
.my-subject {margin-bottom:1rem;}
.my-subject-classes {display:grid;gap:.55rem;}
.my-class-row {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem;border:1px solid var(--line);border-radius:.65rem;}
.my-class-row > div {display:flex;flex-direction:column;gap:.2rem;}
.my-class-row > div span {color:var(--muted);font-size:.9rem;}
.birthday-notice {display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;border-color:#e6b94c;background:var(--paper);}
.birthday-notice h2 {margin-top:0;}
.birthday-notice ul {margin-bottom:0;}
.birthday-dialog {width:min(42rem,calc(100% - 1.5rem));max-width:none;max-height:85vh;padding:0;border:0;background:transparent;color:var(--ink);}
.birthday-dialog::backdrop {background:rgba(8,18,24,.68);}
.birthday-dialog .card {max-height:85vh;overflow:auto;margin:0;}
.birthday-dialog-heading {display:flex;align-items:center;justify-content:space-between;gap:1rem;}
.birthday-dialog-heading h2 {margin:.1rem 0;}
.birthday-dialog-list {padding-left:1.3rem;line-height:1.7;}
.problem-report-dialog {width:min(52rem,calc(100% - 1.5rem));max-width:none;max-height:88vh;padding:0;border:0;background:transparent;color:var(--ink);}
.problem-report-dialog::backdrop {background:rgba(8,18,24,.68);}
.problem-report-dialog > .card {max-height:88vh;overflow:auto;margin:0;}
.problem-report-heading,.problem-report-item-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;}
.problem-report-heading h2,.problem-report-admin-item h2 {margin:.1rem 0;}
.problem-report-form,.problem-report-admin-form {grid-template-columns:minmax(0,1fr);margin:1rem 0;}
.problem-report-form .field,.problem-report-admin-form .field {min-width:0;}
.problem-report-form textarea,.problem-report-admin-form textarea {width:100%;resize:vertical;}
.problem-report-list,.problem-report-admin-list {display:grid;gap:.7rem;}
.problem-report-item,.problem-report-admin-item {margin:.75rem 0;padding:1rem;border:1px solid var(--line);border-radius:.75rem;background:var(--table-head);}
.problem-report-item-heading {align-items:center;}
.problem-report-item-heading h2 {font-size:1.05rem;}
.problem-report-item small {display:block;margin-top:.25rem;color:var(--muted);}
.problem-report-description {white-space:pre-wrap;overflow-wrap:anywhere;}
.problem-report-response {padding:.7rem;border-left:3px solid var(--green);background:var(--paper);white-space:pre-wrap;overflow-wrap:anywhere;}
.problem-report-status {display:inline-flex;flex:0 0 auto;padding:.3rem .6rem;border:1px solid var(--line);border-radius:999px;font-size:.82rem;font-weight:750;}
.problem-report-status.status-new {border-color:var(--error-line);background:var(--error-bg);color:var(--error-ink);}
.problem-report-status.status-in_progress {border-color:#e8d39c;background:#fff6dc;color:#70530c;}
.problem-report-status.status-resolved {border-color:var(--success-line);background:var(--success-bg);color:var(--success-ink);}
.problem-report-admin-form {padding-top:.5rem;border-top:1px solid var(--line);}
.practice-warning {margin-bottom:1rem;border-color:#e6b94c;background:var(--paper);}
.practice-warning ul {margin:.5rem 0;padding-left:1.3rem;}
.practice-warning p {margin-bottom:0;}
.class-practice-form {align-items:end;}
.class-practice-actions {grid-column:1/-1;}
.class-practice-row-actions {margin:0;}
.class-practice-table td {vertical-align:middle;}
.practice-module-state {display:flex;align-items:center;justify-content:space-between;gap:1rem;}
.practice-module-state p {margin:.35rem 0 0;color:var(--muted);}
.class-practice-import {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:.5rem 1rem;margin-top:1.4rem;padding:1rem;border:1px solid var(--line);border-radius:.8rem;background:var(--table-head);}
.class-practice-import .section-title {margin:.15rem 0;}
.class-practice-import .hint {margin:.35rem 0;}
.class-practice-import > a {white-space:nowrap;}
.social-scholarship-controls {align-items:end;}
.social-scholarship-controls .field {min-width:min(100%,13rem);}
.social-scholarship-controls .is-disabled {pointer-events:none;opacity:.55;}
.social-scholarship-summary {display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;margin:1rem 0;}
.social-scholarship-stat {display:grid;gap:.18rem;min-width:12rem;padding:.75rem .9rem;border:1px solid var(--line);border-radius:.7rem;background:var(--table-head);}
.social-scholarship-stat span {color:var(--muted);font-size:.82rem;}
.social-scholarship-stat strong {font-size:1.35rem;}
.social-scholarship-summary > .hint {flex:1 1 16rem;margin:.25rem 0;}
.social-scholarship-table {min-width:520px;}
.social-scholarship-switch {display:inline-flex;align-items:center;gap:.6rem;min-height:2.6rem;cursor:pointer;}
.social-scholarship-switch input {width:1.15rem;height:1.15rem;min-height:1.15rem;flex:0 0 auto;}
.social-scholarship-switch input:disabled {cursor:default;}
.social-scholarship-save {align-items:center;}
.social-scholarship-save .hint {margin:.25rem 0;}
.scholarship-legal-note {margin:0 0 1rem;padding:1rem 1.1rem;line-height:1.6;}
.scholarship-absence-report h2 {margin-top:0;}
.scholarship-absence-report .hint {max-width:78rem;}
.class-practice-import form {grid-column:1/-1;align-items:end;}
.class-practice-import input[type="file"] {max-width:100%;}
.main-layout { width: min(1240px, calc(100% - 2rem)); margin: 1.7rem auto 3rem; }
.nav-tabs { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .5rem; min-width: 0; margin: 0 0 1.1rem; }
.nav-tab {
  border: 1px solid var(--line); border-radius: 999px; padding: .65rem 1rem;
  color: var(--muted); background: var(--paper); font-weight: 650;
}
.nav-tab[aria-current="page"] { color: #fff; border-color: var(--green); background: var(--green); }
.navigation-toggle {display:none;}
.nav-group {min-width:0;border:1px solid var(--line);border-radius:.8rem;background:var(--paper);}
.nav-tabs > .nav-group {width:100%;max-width:100%;flex:0 0 auto;}
.nav-group summary {display:flex;align-items:center;justify-content:space-between;gap:.65rem;min-height:3rem;padding:.65rem .8rem;cursor:pointer;list-style:none;color:var(--ink);font-size:.88rem;font-weight:750;}
.nav-group summary > span:first-child {min-width:0;overflow-wrap:anywhere;}
.nav-group summary::-webkit-details-marker {display:none;}
.nav-group summary:focus-visible {outline:3px solid var(--focus-ring);outline-offset:2px;border-radius:.7rem;}
.nav-group[data-current="true"] summary {color:var(--green);}
.nav-group-chevron {font-size:1.4rem;line-height:1;transition:transform .15s;}
.nav-group[open] .nav-group-chevron {transform:rotate(90deg);}
.nav-group-items {display:grid;gap:.25rem;padding:0 .4rem .4rem;}
.nav-group .nav-tab {width:100%;min-height:2.65rem;text-align:left;border-radius:.5rem;border-color:transparent;padding:.55rem .7rem;font-size:.86rem;line-height:1.4;}
.nav-group .nav-tab:hover {background:var(--mint);color:var(--ink);}
.nav-group .nav-tab[aria-current="page"] {color:#fff;background:var(--green);}
@media screen and (max-width:999px) {
 .navigation-toggle {display:flex;align-items:center;gap:.7rem;width:100%;min-height:3rem;padding:.65rem .85rem;margin-bottom:1rem;border:1px solid var(--line);border-radius:.8rem;background:var(--paper);color:var(--ink);font-weight:750;text-align:left;}
 #navigation-current {flex:1;font-size:.88rem;color:var(--muted);overflow-wrap:anywhere;}
 .nav-tabs {display:none;}
 .nav-tabs[data-mobile-open="true"] {display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;width:100%;min-width:0;max-width:100%;max-height:65vh;overflow-x:hidden;overflow-y:auto;padding:.2rem;margin-bottom:1rem;}
}
.page-heading { margin: 0 0 1rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 2rem); letter-spacing: -.035em; }
.page-heading p { margin: .4rem 0 0; color: var(--muted); }
.card {
  border: 1px solid var(--line); border-radius: 1.15rem; padding: clamp(1rem, 2.2vw, 1.5rem);
  background: var(--paper); box-shadow: 0 8px 28px rgba(23, 57, 44, .045);
}
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { min-height: 8rem; }
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-value { margin-top: .65rem; color: var(--strong); font-size: 2rem; font-weight: 800; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; margin-bottom: 1rem;
}
.field { display: grid; gap: .38rem; min-width: min(100%, 12rem); }
.field.grow { flex: 1 1 14rem; }
.field label { color: var(--muted); font-size: .83rem; font-weight: 700; }
.field input, .field select {
  width: 100%; min-height: 2.8rem; border: 1px solid var(--field-border); border-radius: .65rem;
  padding: .62rem .75rem; color: var(--ink); background: var(--paper);
}
.field input:focus, .field select:focus { outline: 3px solid var(--focus-ring); border-color: var(--green); }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: .45rem;
  min-height: 2.7rem; border: 1px solid var(--green); border-radius: .68rem;
  padding: .6rem .95rem; color: #fff; background: var(--green); font-weight: 700;
}
.button:hover { background: var(--button-hover); }
.button.secondary { color: var(--strong); border-color: var(--line); background: var(--paper); }
.button.secondary:hover { background: var(--mint); }
.button.danger { border-color: #8f302a; background: #8f302a; }
.button:disabled { cursor: wait; opacity: .65; }
.notice {
  margin: 0 0 1rem; border: 1px solid var(--success-line); border-radius: .75rem; padding: .8rem 1rem;
  color: var(--success-ink); background: var(--success-bg);
}
.notice.error { color: var(--error-ink); border-color: var(--error-line); background: var(--error-bg); }
.notice:empty { display: none; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .8rem; }
.grid-column-hidden { display: none !important; }
.grid-column-controls { position: relative; z-index: 8; display: inline-block; max-width: 100%; margin: .55rem 0; color: var(--ink); }
.grid-column-controls > summary { width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: .55rem; padding: .4rem .72rem; color: var(--strong); background: var(--paper); cursor: pointer; font-size: .82rem; font-weight: 700; list-style: none; }
.grid-column-controls > summary::-webkit-details-marker { display: none; }
.grid-column-controls > summary::before { content: '☷'; margin-right: .4rem; }
.grid-column-panel { position: absolute; top: calc(100% + .35rem); left: 0; width: min(25rem, calc(100vw - 2rem)); max-height: min(65vh, 30rem); overflow: auto; border: 1px solid var(--line); border-radius: .75rem; padding: .8rem; background: var(--paper); box-shadow: 0 12px 30px #0003; }
.grid-column-panel > .hint { margin: 0 0 .6rem; }
.grid-column-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .75rem; margin-bottom: .65rem; }
.grid-column-option { display: flex; min-width: 0; align-items: flex-start; gap: .4rem; padding: .25rem 0; color: var(--text); font-size: .84rem; line-height: 1.35; }
.grid-column-option input { width: 1rem; min-width: 1rem; min-height: 1rem; height: 1rem; margin: .12rem 0 0; }
.assignment-week-slots { display: block; max-width: 17rem; margin-top: .35rem; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.assignment-week-slots.is-empty { font-style: italic; }
.assignment-schedule-day label.is-slot-occupied { border-color: var(--soft-line); background: var(--table-head); opacity: .78; }
.assignment-schedule-day label.is-slot-occupied input { cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: .78rem .75rem; border-bottom: 1px solid var(--soft-line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--table-head); font-size: .78rem; letter-spacing: .045em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
.student-name { min-width: 12rem; font-weight: 720; }
.student-id { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; font-weight: 450; }
.grade-form, .attendance-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.grade-input { width: 4.3rem !important; min-width: 4.3rem !important; min-height: 2.45rem !important; }
.tiny-select { min-width: 7.3rem !important; width: 7.3rem !important; min-height: 2.45rem !important; padding: .4rem !important; }
.mini-button { min-height: 2.35rem; padding: .42rem .65rem; font-size: .82rem; }
.grade-list { display: flex; flex-direction:column;align-items:flex-start;gap:.16rem; }
.grade-pill { border-radius: 999px; padding: .17rem .4rem; color: var(--grade-ink); background: var(--mint); font-size: .72rem; line-height:1.2; font-weight: 750; }
.count-pill { display: inline-block; min-width: 1.55rem; margin-right: .25rem; border-radius: 999px; padding: .16rem .42rem; text-align: center; color: var(--count-ink); background: var(--count-bg); font-size: .8rem; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-grid > * { min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 3.7rem); padding: 1.2rem; background: radial-gradient(circle at 75% 15%, var(--auth-glow) 0, transparent 32%), var(--canvas); }
.auth-card { width: min(100%, 30rem); padding: clamp(1.4rem, 5vw, 2.3rem); }
.auth-card h1 { margin: .2rem 0 .4rem; font-size: 1.8rem; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 1.35rem; color: var(--muted); line-height: 1.55; }
.auth-card .field { margin: .9rem 0; }
.auth-footer { margin-top: 1.2rem; color: var(--muted); font-size: .8rem; text-align: center; }
.loading-card { width: min(100% - 2rem, 34rem); margin: 18vh auto; border-radius: 1rem; padding: 2rem; text-align: center; background: var(--paper); }
.empty-state { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.section-title { margin: 0 0 .8rem; font-size: 1.08rem; }
.account-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: .7rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--soft-line); }
.account-row:last-child { border-bottom: 0; }
.assignment-list-title { margin-top: 1.4rem; }
.assignment-form {margin-top:1rem;}
.assignment-class-choices {grid-column:1/-1;width:100%;min-width:0;margin:0;padding:1rem;}
.assignment-class-choices legend {padding:0 .35rem;font-weight:750;}
.assignment-class-tools {grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;margin-bottom:.7rem;}
.assignment-class-tools .form-actions {margin:0;}
.assignment-class-choices label {min-width:0;align-items:center;overflow-wrap:anywhere;}
.assignment-class-choices input[type="checkbox"] {width:1.1rem;min-height:1.1rem;height:1.1rem;flex:0 0 auto;}
.assignment-form > .form-actions {margin-top:.9rem;}
.assignment-group-option {display:flex;align-items:flex-start;gap:.7rem;max-width:100%;margin:.9rem 0;padding:.9rem 1rem;border:1px solid var(--line);border-radius:.75rem;background:var(--table-head);cursor:pointer;}
.assignment-group-option input {width:1.15rem;min-width:1.15rem;height:1.15rem;margin:.15rem 0 0;}
.assignment-group-option span {display:grid;gap:.2rem;min-width:0;}
.assignment-group-option small {color:var(--muted);font-size:.84rem;line-height:1.4;}
.assignment-row-actions {margin:0;}
.assignment-row-actions .button {max-width:100%;white-space:normal;}
.assignment-group-title {display:block;margin-bottom:.35rem;}
.assignment-class-list {display:grid;gap:.35rem;}
.assignment-class-item {display:grid;gap:.05rem;line-height:1.3;}
.assignment-academic-year {color:var(--muted);font-size:.86rem;white-space:nowrap;}
.assignment-class-name {white-space:nowrap;}
.interest-form-card,.interest-confirm-card,.interest-documents-card,.interest-admin-controls,.interest-admin-upload,.interest-admin-documents {display:grid;gap:1rem;}
.interest-form-heading,.interest-section-heading,.interest-admin-toolbar {display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;}
.interest-form-heading h2,.interest-section-heading h3,.interest-confirm-card h2,.interest-documents-card h2,.interest-admin-upload h2,.interest-admin-documents h2 {margin:0;}
.interest-year-field {min-width:min(15rem,100%);}
.interest-personal-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
.interest-personal-grid .field:last-child {grid-column:1/-1;}
.interest-assignment-section,.interest-external-section {display:grid;gap:.75rem;margin-top:.5rem;}
.interest-assignment-section h3,.interest-external-section h3 {margin:0;}
.interest-table {min-width:760px;}
.interest-external-row {display:grid;gap:.8rem;margin:0 0 .8rem;padding:1rem;border:1px solid var(--line);border-radius:.8rem;}
.interest-external-row legend {padding:0 .35rem;font-weight:700;}
.interest-external-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem;}
.interest-confirm-check {display:flex;align-items:flex-start;gap:.7rem;max-width:65rem;}
.interest-confirm-check input {width:1.15rem;min-width:1.15rem;height:1.15rem;margin:.2rem 0 0;}
.declaration-email-form {display:grid;grid-template-columns:minmax(8rem,.8fr) minmax(12rem,1.2fr) auto;align-items:center;gap:.5rem;min-width:30rem;}
.declaration-email-form select,.declaration-email-form input {min-width:0;width:100%;}
.interest-admin-toolbar {align-items:center;}
.interest-admin-toolbar .field {min-width:min(23rem,100%);}
.interest-admin-toolbar .hint {max-width:48rem;margin:0;}
.interest-admin-file {grid-column:span 2;}
.hours-input { min-width: 6rem !important; max-width: 8rem; }
.status { color: var(--muted); font-size: .82rem; }
.footer-note { margin-top: 1.1rem; color: var(--muted); font-size: .8rem; }
.print-heading { display: none; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .topbar-user {margin-left:0;flex:1;justify-content:flex-end;flex-wrap:wrap;}
  .user-actions { align-items: flex-end; flex-direction: column; gap: .4rem; }
  .main-layout { width: min(100% - 1rem, 1240px); margin-top: 1rem; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat { min-height: 6.6rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .assignment-class-choices {grid-column:auto;}
  .account-row { grid-template-columns: 1fr; align-items: stretch; }
  .nav-tab { padding: .58rem .82rem; }
  .interest-form-heading,.interest-section-heading,.interest-admin-toolbar {align-items:stretch;flex-direction:column;}
  .interest-personal-grid,.interest-external-grid {grid-template-columns:minmax(0,1fr);}
  .interest-personal-grid .field:last-child,.interest-admin-file {grid-column:auto;}
  .interest-year-field,.interest-admin-toolbar .field {width:100%;}
  .declaration-email-form {grid-template-columns:minmax(0,1fr);min-width:15rem;}
}

@media print {
  .grid-column-controls { display: none !important; }
  body { min-width: 0; background: var(--paper); color: #111; }
  .topbar, .nav-tabs, .navigation-toggle, #notice, #view > .page-heading, #view > .card:first-of-type,
  #print-catalog, .grade-form, .attendance-form { display: none !important; }
  .main-layout { width: 100%; margin: 0; }
  #catalog-results.card { border: 0; padding: 0; box-shadow: none; }
  #catalog-results .toolbar { display: none; }
  #catalog-results .print-heading { display: block; margin: 0 0 1rem; }
  .print-heading h2 { margin: 0; font-size: 1.25rem; }
  .print-heading p { margin: .35rem 0; font-size: .9rem; }
  .table-wrap { overflow: visible; border: 0; }
  table { width: 100%; min-width: 0; font-size: 9pt; }
  th, td { border: 1px solid #999; padding: .35rem; }
  th { background: #eee !important; color: #111; }
  #catalog-results th:nth-child(3), #catalog-results td:nth-child(3), #catalog-results th:nth-child(5), #catalog-results td:nth-child(5) { display: none; }
  .student-id { color: #333; }
}

@media screen and (min-width: 1000px) {
  .main-layout {display:grid;grid-template-columns:230px minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:1.3rem;align-items:start;}
  .nav-tabs {position:sticky;top:1rem;grid-column:1;grid-row:1/span 2;width:auto;flex-direction:column;max-height:calc(100vh - 2rem);overflow:auto;margin:0;padding:.2rem;}
  .main-layout > #notice {grid-column:2;grid-row:1;min-width:0;}
  .main-layout > #view {grid-column:2;grid-row:2;min-width:0;}
  .nav-tab { border-radius: .6rem; text-align: left; }
}
.report-section { margin-top: 1.5rem; }
.teacher-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: .65rem; max-height: 22rem; overflow: auto; border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; }
.teacher-choices label { display: flex; align-items: start; gap: .4rem; font-size: .9rem; }
.subject-name-edit { min-width: 17rem; width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: .5rem; }
.statistics-menu { margin-top: 1.2rem; border-radius: 1.2rem; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.statistics-section + .statistics-section { border-top: 1px solid var(--line); }
.statistics-section summary { list-style: none; display: flex; align-items: center; gap: .9rem; padding: 1.3rem; cursor: pointer; font-size: 1.08rem; }
.statistics-section summary::-webkit-details-marker { display: none; }
.statistics-icon { color: #7a858d; font-size: 1.5rem; width: 1.8rem; text-align: center; }
.statistics-chevron { margin-left: auto; font-size: 1.5rem; color: #7a858d; }
.statistics-section[open] .statistics-chevron { transform: rotate(180deg); }
.statistics-content { padding: 0 1rem 1rem; }
.statistics-content table { min-width: 720px; }
.statistics-controls input[type="checkbox"], .teacher-choices input[type="checkbox"] { width: 1.1rem; min-height: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.statistics-controls label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: .4rem; }
.grid > .card { margin-top: 0; }
.document-draft { border: 1px solid var(--line); padding: .6rem; font-weight: 600; }
.document-signatures { display: flex; justify-content: space-between; gap: 2rem; margin-top: 3rem; }
#admin-document { line-height: 1.65; margin-top: 1.4rem; }
#print-output { display: none; }
.message-link { background: none; border: 0; color: var(--link); text-align: left; cursor: pointer; text-decoration: underline; }
.message-body { white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; }
textarea { font: inherit; padding: .7rem; border: 1px solid var(--line); border-radius: .5rem; width: 100%; }
.statistics-controls .field { flex: 1 1 170px; }
.admin-roster { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.admin-roster > .card { margin: 0; min-width: 0; }
.roster-level + .roster-level { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.roster-level h3 { font-size: 1rem; color: var(--muted); font-weight: 600; }
.roster-level .nav-tab { padding: .45rem .6rem; }
@media (max-width: 760px) { .admin-roster { grid-template-columns: minmax(0,1fr); } }
@media print {
  body.printing-document > * { display: none !important; }
  body.printing-document > #print-output { display: block !important; }
  #print-output table { min-width: 0; }
  #print-output .table-wrap { overflow: visible; }
  #print-output h2, #print-output h3 { break-after: avoid; }
  #print-output tr { break-inside: avoid; }
  #print-output thead { display: table-header-group; }
  #print-output .no-print { display: none; }
}
.report-title h1 { font-size: 1.5rem; }
.activation-qr { max-width: 100%; height: auto; }
.access-code { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.access-grid { max-width: 100%; min-width: 0; }
.access-grid table { width: 100%; min-width: 0; table-layout: fixed; }
.learning-form {display:grid;gap:1rem;min-width:0;}
.learning-form > h2 {margin:.2rem 0 .25rem;font-size:1.25rem;}
.learning-form-grid {gap:1rem 1.2rem;align-items:start;}
.learning-form .learning-field {display:grid;align-content:start;gap:.4rem;min-width:0;color:var(--muted);font-size:.88rem;font-weight:700;line-height:1.4;}
.learning-form .learning-field input,.learning-form .learning-field select,.learning-form .learning-field textarea {display:block;width:100%;min-width:0;min-height:2.8rem;border:1px solid var(--field-border);border-radius:.65rem;padding:.62rem .75rem;color:var(--ink);background:var(--field-bg);font:inherit;font-weight:450;}
.learning-form .learning-field select[multiple] {min-height:11rem;padding:.4rem;}
.learning-form .learning-field small {color:var(--muted);font-size:.78rem;font-weight:450;line-height:1.4;}
.learning-content-field textarea {min-height:10rem;resize:vertical;}
.learning-audience {display:flex;flex-wrap:wrap;gap:.65rem 1rem;min-width:0;margin:0;padding:.85rem 1rem;border:1px solid var(--line);border-radius:.75rem;}
.learning-audience legend {padding:0 .35rem;font-weight:700;}
.learning-audience .learning-role-label {display:inline-flex;align-items:center;gap:.4rem;min-width:0;}
.learning-audience input {width:1.05rem;height:1.05rem;}
.learning-form-actions {margin-top:.15rem;}
.access-grid th, .access-grid td { vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.access-grid th:nth-child(1) { width: 19%; }
.access-grid th:nth-child(2), .access-grid th:nth-child(3), .access-grid th:nth-child(4), .access-grid th:nth-child(5) { width: 13%; }
.access-grid th:nth-child(6) { width: 29%; }
.contact-value { overflow-wrap: anywhere; margin-bottom: .55rem; min-width: 0; }
.contact-value small { display: block; color: var(--muted); }
.contact-value.inactive { color: var(--muted); text-decoration: line-through; }
.contact-activation { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; font-size: .85rem; min-width: 0; }
.access-import-actions { align-items: center; margin: .8rem 0; }
.file-button { cursor: pointer; }
.file-button.busy { opacity: .65; pointer-events: none; }
.access-contact-edit { border: 1px solid var(--line); border-radius: .65rem; padding: 1rem; margin-bottom: 1rem; }
.contact-options { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.contact-options label { display: flex; align-items: center; gap: .4rem; }
.contact-options input[type="checkbox"] { width: 1.1rem; height: 1.1rem; min-height: 1.1rem; }
.report-footer { margin-top: 2rem; }
@media (max-width: 960px) {
  .access-grid .table-wrap { overflow: visible; border: 0; }
  .access-grid table, .access-grid tbody, .access-grid tr, .access-grid td { display: block; width: 100%; }
  .access-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .access-grid tr { border: 1px solid var(--line); border-radius: .8rem; margin: 0 0 .85rem; overflow: hidden; }
  .access-grid td { display: grid; grid-template-columns: minmax(8rem, 34%) minmax(0,1fr); gap: .65rem; padding: .7rem; border-bottom: 1px solid var(--line); }
  .access-grid td:last-child { border-bottom: 0; }
  .access-grid td::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .8rem; }
  .access-grid .contact-activation .form-actions { flex-wrap: wrap; }
}
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .report-controls { display: none !important; }
  #report-results { display: block !important; border: 0; padding: 0; box-shadow: none; }
  #report-results[hidden] { display: none !important; }
  .report-section + .report-section { break-before: page; }
  .report-section h2 { break-after: avoid; }
  .report-table thead { display: table-header-group; }
  .report-table tr { break-inside: avoid; }
  .report-table th, .report-table td { white-space: normal; overflow-wrap: anywhere; }
  .report-title { margin-bottom: 1rem; }
}
.final-validation {display:flex;gap:12px;align-items:center;margin-top:18px;}
.final-validation input {width:auto;}
.permission-teacher-list {max-height: 36rem; overflow: auto;}
.permission-teacher-list table {min-width: 24rem;}
.permission-teacher-list th {position: sticky; top: 0; background: var(--table-head);}
.permission-teacher-list tr[hidden] {display: none;}
.permission-teacher-list input[type="checkbox"], .permission-module-list input[type="checkbox"] {width: 1.2rem; height: 1.2rem; flex: 0 0 auto;}
.permission-module-list {min-width: 0; border: 1px solid var(--line); border-radius: .8rem; padding: 1rem;}
.permission-module-list legend {font-weight: 700; padding: 0 .4rem;}
.permission-module-list > label {display: flex; align-items: center; gap: .6rem; min-height: 2.75rem;}

.content-preserve-whitespace {white-space:pre-wrap;overflow-wrap:anywhere;}
#learning-detail pre,#learning-responses pre {white-space:pre-wrap;overflow-wrap:anywhere;}

.grade-form {display:flex;flex-wrap:wrap;gap:.35rem;align-items:flex-start;}
.grade-form .grade-input {max-width:5.5rem;}
.grade-form .assessment-type {min-width: 175px; max-width: 220px; width: auto;}
.absence-dates {display:flex;flex-direction:column;align-items:flex-start;gap:.18rem;margin-top: .4rem; white-space: normal;}
#observation-form textarea {min-height: 100px; resize: vertical; width: 100%;}

.grade-form > input, .grade-form > select {padding: .65rem .7rem; border: 1px solid var(--field-border,var(--line)); border-radius: .6rem; background: var(--field-bg,var(--paper)); color: var(--ink); font: inherit; min-height: 44px;}
select option,select optgroup {background:var(--field-bg,var(--paper));color:var(--ink);}
.catalog-date-control {position:relative;display:inline-block;min-width:165px;max-width:100%;}
.field > .catalog-date-control {display:block;width:100%;}
.catalog-date-control > input[type="date"] {width:100%;min-width:165px;color:transparent;caret-color:transparent;}
.catalog-date-control > input[type="date"]::-webkit-datetime-edit {color:transparent;}
.catalog-date-display {position:absolute;left:1rem;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--ink);white-space:nowrap;font:inherit;}
.date-disabled .catalog-date-display {opacity:.55;}
.catalog-date-control:has(input:invalid:not(:placeholder-shown)) .catalog-date-display {color:var(--ink);}
.record-chip {display:flex;align-items:center;gap:.25rem;margin:.08rem 0;max-width:100%;vertical-align:middle;}
.grade-date {font-size:.72rem;white-space:nowrap;}
.delete-record {min-width:30px;min-height:30px;padding:.2rem .4rem;line-height:1;border:1px solid var(--line);border-radius:.4rem;background:var(--paper);color:var(--ink);cursor:pointer;}
.absence-pill {border:1px solid #c16631;border-radius:.4rem;padding:.23rem .4rem;color:var(--ink);white-space:nowrap;font-size:.78rem;}
.absence-pill.excused {border-color:var(--green);text-decoration:line-through;}
.attendance-toolbar {display:flex;flex-wrap:wrap;align-items:center;gap:.7rem;margin:1rem 0;}
.attendance-multipliers {display:flex;flex-wrap:wrap;gap:.35rem;}
.attendance-multipliers button[aria-pressed="true"] {background:var(--green);color:#fff;border-color:var(--green);}
.attendance-switch {display:inline-flex;align-items:center;gap:.6rem;cursor:pointer;white-space:nowrap;min-height:44px;}
.attendance-switch input {appearance:none;width:48px;height:28px;min-height:28px;border-radius:30px;background:var(--green);border:1px solid var(--field-border,var(--line));position:relative;cursor:pointer;padding:0;flex-shrink:0;}
.attendance-switch input::after {content:'';position:absolute;width:22px;height:22px;left:2px;top:2px;border-radius:50%;background:white;}
.attendance-switch input:checked {background:#b23f34;}
.attendance-switch input:checked::after {left:22px;}
.attendance-switch input:focus-visible {outline:3px solid var(--green);outline-offset:3px;}
.attendance-batch-footer {position:sticky;bottom:0;background:var(--paper);padding:1rem 0;display:flex;align-items:center;gap:1rem;flex-wrap:wrap;z-index:2;border-top:1px solid var(--line);}
#catalog-deletion-editor {margin:1rem 0;}
.teacher-esign-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.1rem;max-width:980px;margin:1.5rem auto;}
.teacher-esign-tile {position:relative;display:grid;justify-items:center;align-content:center;gap:.7rem;min-height:205px;padding:1.2rem;border:0;border-radius:1.5rem;background:linear-gradient(145deg,#0864dc,#2998ed);color:#fff;text-align:center;box-shadow:0 12px 24px #07142130;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease;}
.teacher-esign-tile:not(:disabled):hover {transform:translateY(-3px);box-shadow:0 16px 28px #07142142;}
.teacher-esign-tile strong {max-width:15rem;font-size:1.05rem;line-height:1.3;}
.teacher-esign-tile small {max-width:17rem;color:#eff7ff;font-size:.82rem;line-height:1.35;}
.teacher-esign-icon {display:grid;place-items:center;width:3.4rem;height:3.4rem;border:2px solid currentColor;border-radius:1rem;font-size:2rem;font-weight:750;}
.teacher-esign-tile.is-unavailable {background:linear-gradient(145deg,#556b7e,#788da0);cursor:default;opacity:.72;}
.teacher-coming-soon {position:absolute;top:.65rem;right:.65rem;padding:.2rem .42rem;border-radius:999px;background:#10273d65;color:white;font-size:.68rem;font-weight:700;}
.teacher-esign-notice {max-width:980px;margin:0 auto 1.4rem;}
.teacher-signature-card {display:grid;gap:.85rem;max-width:1000px;}
.teacher-signature-info {padding:1rem 1.1rem;border:1px solid var(--line);border-radius:.9rem;background:var(--table-head);}
.teacher-signature-info h2,.teacher-signature-card h3 {margin:.1rem 0 .45rem;}
.teacher-signature-info p {margin:.2rem 0;color:var(--muted);}
.teacher-signature-preview {display:grid;place-items:center;min-height:150px;padding:1rem;border:1px solid var(--line);border-radius:.8rem;background:#fff;}
.teacher-signature-preview img {display:block;width:min(100%,600px);max-height:200px;object-fit:contain;}
#teacher-signature-canvas {display:block;width:100%;height:auto;aspect-ratio:2.5/1;border:1px solid var(--line);border-radius:.8rem;background:#fff;touch-action:none;}
.teacher-signature-actions {justify-content:flex-start;flex-wrap:wrap;}
.teacher-register-controls {display:grid;grid-template-columns:minmax(12rem,18rem) auto;align-items:end;gap:.7rem 1rem;}
.teacher-register-controls>.hint {grid-column:1/-1;margin:.1rem 0;}
.teacher-register-table {min-width:760px;}
.teacher-timetable-year-field {max-width:18rem;margin-bottom:1rem;}
.teacher-timetable-table {min-width:760px;}
.teacher-timetable-table td:first-child small {display:block;margin-top:.25rem;color:var(--muted);}
.teacher-timetable-table td .button {white-space:nowrap;}
.teacher-register-table td {vertical-align:top;}
.teacher-register-table td:first-child small {display:block;margin-top:.3rem;color:var(--muted);white-space:nowrap;}
.teacher-register-table td select,.teacher-register-table td input {display:block;width:100%;min-width:9rem;margin:.2rem 0;}
.teacher-register-actions {margin-top:1rem;}
.teacher-register-actions .hint {max-width:32rem;}
.schedule-issues {margin-bottom:1rem;}
.schedule-issues p {margin:.35rem 0;}
.schedule-issues ul {margin:.45rem 0 0;padding-left:1.3rem;}
.schedule-issues li+li {margin-top:.3rem;}
.assignment-schedule-panel {display:grid;gap:1rem;margin-top:1rem;scroll-margin:1rem;}
.assignment-schedule-heading {display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;}
.assignment-schedule-heading h2 {margin:0;}
.assignment-schedule-heading p {margin:.35rem 0 0;}
.assignment-schedule-days {display:grid;grid-template-columns:repeat(5,minmax(9rem,1fr));gap:.6rem;overflow-x:auto;padding-bottom:.35rem;}
.assignment-schedule-day {display:grid;align-content:start;gap:.28rem;min-width:9rem;margin:0;padding:.6rem;border:1px solid var(--line);border-radius:.75rem;}
.assignment-schedule-day legend {padding:0 .25rem;font-weight:750;}
.assignment-schedule-day label {display:flex;align-items:center;gap:.45rem;padding:.28rem;border-radius:.45rem;cursor:pointer;}
.assignment-schedule-day label:has(input:checked) {background:var(--success-bg);}
.assignment-schedule-day label span {display:grid;font-size:.8rem;font-weight:650;}
.assignment-schedule-day label small {color:var(--muted);font-size:.7rem;font-weight:450;}
.timetable-toolbar {align-items:end;justify-content:flex-start;}
.timetable-toolbar .field {min-width:min(14rem,100%);}
.timetable-overview-table {min-width:980px;table-layout:fixed;}
.timetable-overview-table th:first-child {width:6rem;}
.timetable-overview-table td {vertical-align:top;}
.timetable-entry {display:grid;gap:.2rem;margin:.1rem 0 .35rem;padding:.55rem;border:1px solid var(--line);border-radius:.6rem;background:var(--surface-2,rgba(127,127,127,.08));font-size:.82rem;}
.timetable-entry span,.timetable-entry small {color:var(--muted);}
.timetable-entry small {font-size:.72rem;}
.timetable-empty {color:var(--muted);}
.timetable-issues {margin-bottom:1rem;}
.timetable-issues ul {margin:.5rem 0 0;padding-left:1.3rem;}
.schedule-status {display:inline-flex;align-items:center;max-width:13rem;padding:.3rem .5rem;border:1px solid var(--line);border-radius:999px;font-size:.78rem;font-weight:700;}
.schedule-status.is-complete {border-color:var(--success-line);background:var(--success-bg);color:var(--success-ink);}
.schedule-status.is-warning,.schedule-count-note.has-schedule-mismatch {border-color:var(--error-line);background:var(--error-bg);color:var(--error-ink);}
.schedule-count-note {display:inline-flex;padding:.35rem .55rem;border:1px solid var(--success-line);border-radius:.5rem;background:var(--success-bg);color:var(--success-ink);font-weight:700;}
.register-signature {display:block;max-width:220px;max-height:90px;object-fit:contain;}
.register-print-signature {display:flex;align-items:center;gap:1rem;margin-top:2rem;}
.register-draft {margin-top:2rem;color:#666;font-size:9pt;}
@media print {.attendance-toolbar,.attendance-batch-footer,.delete-record,#catalog-deletion-editor {display:none!important;}.grade-date {font-size:8pt;}}
@media screen and (max-width:650px) {
 .topbar {flex-wrap:wrap;}
 .user-identity {align-items:flex-start;}
 .topbar-user {justify-content:space-between;flex-basis:100%;}
 .practice-module-state {align-items:flex-start;flex-direction:column;}
 .class-practice-import {grid-template-columns:1fr;}
 .class-practice-import > a {justify-self:start;}
 .test-mode-badge {font-size:.68rem;}
 .catalog-direct-heading {display:block;}
 .my-class-row {align-items:flex-start;flex-direction:column;}
 .birthday-notice {flex-direction:column;}
 #catalog-results .table-wrap {overflow:visible;}
 #catalog-results table,#catalog-results tbody {display:block;width:100%;min-width:0;}
 #catalog-results thead {display:none;}
 #catalog-results tr {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;margin:.75rem 0;padding:.8rem;border:1px solid var(--line);border-radius:.8rem;}
 #catalog-results td {display:block;border:0;padding:.25rem;min-width:0;overflow-wrap:anywhere;}
 #catalog-results td:nth-child(1) {grid-column:1;grid-row:1;}
 #catalog-results td:nth-child(2),#catalog-results td:nth-child(3),#catalog-results td:nth-child(4) {grid-column:1/-1;}
 #catalog-results td:nth-child(5) {grid-column:2;grid-row:1;}
 #catalog-results td:nth-child(2)::before {content:'Note';display:block;font-weight:700;font-size:.85rem;}
 #catalog-results td:nth-child(4)::before {content:'Absențe';display:block;font-weight:700;font-size:.85rem;}
 #catalog-results .grade-form {flex-wrap:wrap;}
 #catalog-results .assessment-type {min-width:170px;max-width:100%;}
 #catalog-results .attendance-switch {flex-direction:column;gap:.2rem;font-size:.85rem;}
 #catalog-results .absence-dates {white-space:normal;}
 .social-scholarship-table,.social-scholarship-table tbody {display:block;width:100%;min-width:0;}
 .social-scholarship-table thead {display:none;}
 .social-scholarship-table tr {display:grid;gap:.25rem;padding:.6rem;border-bottom:1px solid var(--soft-line);}
 .social-scholarship-table td {display:block;min-width:0;padding:.2rem .25rem;border:0;overflow-wrap:anywhere;}
 .social-scholarship-table td:nth-child(2)::before {content:'Beneficiar bursă';display:block;margin-bottom:.16rem;color:var(--muted);font-size:.76rem;font-weight:700;}
 .social-scholarship-recipients .social-scholarship-table td:nth-child(2)::before {content:'Clasa';}
 .social-scholarship-recipients .social-scholarship-table td:nth-child(3)::before {content:'Tip bursă';}
}
@media screen and (max-width:900px) {.teacher-esign-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;}.teacher-esign-tile {min-height:175px;}}
@media screen and (max-width:650px) {.teacher-esign-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;}.teacher-esign-tile {min-height:148px;padding:.85rem;border-radius:1.15rem;}.teacher-esign-tile strong {font-size:.9rem;}.teacher-esign-tile small {font-size:.72rem;}.teacher-esign-icon {width:2.8rem;height:2.8rem;font-size:1.6rem;}.teacher-register-controls {grid-template-columns:1fr;}.teacher-register-controls>.hint {grid-column:auto;}.assignment-schedule-heading {align-items:center;}}
@media print {.teacher-esign-grid,.teacher-signature-actions,.teacher-register-controls,.teacher-register-actions,.register-draft {display:none!important;}.teacher-register-table {min-width:0;width:100%;}.register-signature {max-width:180px;}}
