:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --line: #dee2e6;
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --accent: #ffc107;
  --danger: #dc3545;
  --ok: #198754;
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.auth-pending .sidebar,
body.auth-pending .main,
body.auth-required .sidebar,
body.auth-required .main {
  display: none;
}

body.authenticated .login-screen {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #e7f1ff, #f8f9fa);
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 28px;
  background: white;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.16);
}

.login-card h1 {
  margin: 12px 0 4px;
}

.login-card p {
  color: var(--muted);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.user-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #f8f9fa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--primary);
  border-radius: 0.375rem;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.ghost:hover {
  background: #f8f9fa;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
}

.danger-button {
  border-color: var(--danger);
  color: var(--danger);
}

.danger-button:hover {
  background: #f8d7da;
  color: #842029;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-toggle,
.menu-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  overflow-y: auto;
  padding: 22px;
  background: #212529;
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 0.5rem;
  background: var(--primary);
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #adb5bd;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  border-color: transparent;
  border-radius: 0.375rem;
  color: #ced4da;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary);
  color: white;
}

.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 14px 16px;
  background: white;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.year-picker {
  display: flex;
  max-width: 270px;
  align-items: center;
  grid-template-columns: none;
  gap: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.year-picker select {
  min-height: 34px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

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

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  padding: 0 12px;
  background: white;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.18);
}

#search {
  width: min(320px, 42vw);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 22px;
}

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

.metric,
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  font-size: 28px;
}

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

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fa;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.inline-field {
  display: flex;
  min-width: 210px;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
}

.file-input {
  max-width: 240px;
  padding: 8px;
}

.import-help {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  background: #f8f9fa;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 0.65rem;
  background: #cfe2ff;
  color: #084298;
  font-size: 12px;
  font-weight: 800;
}

.badge.danger {
  background: #f8d7da;
  color: #842029;
}

.badge.ok {
  background: #d1e7dd;
  color: #0f5132;
}

.badge.info {
  background: #cff4fc;
  color: #055160;
}

.badge.warning {
  background: #fff3cd;
  color: #664d03;
}

.list,
.cards,
.attendance,
.grade-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.list-item,
.attendance-row,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-item p,
.card p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.report-summary-cards {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.analytics-filters {
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) minmax(180px, 240px);
}

.report-document-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.report-document-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.report-document-head p {
  margin-bottom: 4px;
}

.card {
  padding: 16px;
  box-shadow: none;
}

.class-card {
  display: grid;
  gap: 4px;
}

.card strong {
  display: block;
  margin-bottom: 6px;
}

.class-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.class-print-button {
  min-height: 42px;
  border: 1px solid var(--primary);
  background: white;
  color: var(--primary);
  padding: 0 10px;
}

.class-print-button:hover {
  background: #e7f1ff;
  color: var(--primary-dark);
}

.class-print-button.primary {
  background: var(--primary);
  color: white;
}

.class-print-button.primary:hover {
  background: var(--primary-dark);
  color: white;
}

.class-print-area {
  display: none;
}

.student-card-print-area {
  display: none;
}

.student-card-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, max-content));
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.student-card-preview .student-id-card {
  transform-origin: top left;
}

.student-id-card {
  position: relative;
  display: grid;
  width: 86mm;
  height: 54mm;
  overflow: hidden;
  border: 1px solid #0b1f3a;
  border-radius: 4mm;
  padding: 5mm 5mm 4mm 8mm;
  background:
    linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.08)),
    #ffffff;
  color: #101820;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18);
  break-inside: avoid;
}

.id-card-stripe {
  position: absolute;
  top: -15mm;
  left: -17mm;
  width: 18mm;
  height: 78mm;
  border: 1px solid rgba(11, 31, 58, 0.25);
  background: linear-gradient(90deg, #14a44d 0 33%, #ffd43b 33% 66%, #d63333 66%);
  transform: rotate(32deg);
  transform-origin: center;
}

.id-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4mm;
}

.id-country,
.id-motto,
.id-card-head h2,
.id-card-head span {
  margin: 0;
}

.id-country {
  color: #101820;
  font-size: 8.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.id-motto {
  margin-top: 0.5mm;
  color: #0b5ed7;
  font-size: 7.5px;
  font-weight: 900;
}

.id-card-head h2 {
  margin-top: 1mm;
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
}

.id-card-head span,
.id-year {
  color: #5f6b7a;
  font-size: 8px;
  font-weight: 800;
}

.id-year {
  border: 1px solid #b8c3cf;
  border-radius: 999px;
  padding: 1mm 2mm;
  background: #f8fafc;
  white-space: nowrap;
}

.id-card-title {
  width: max-content;
  border-radius: 999px;
  padding: 1.5mm 3mm;
  background: #0d6efd;
  color: white;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.id-card-body {
  display: grid;
  grid-template-columns: 23mm 1fr;
  gap: 4mm;
  align-items: center;
}

.id-photo {
  display: grid;
  width: 23mm;
  height: 27mm;
  place-items: center;
  border: 1px solid #9aa7b5;
  border-radius: 3mm;
  background: linear-gradient(145deg, #f8fafc, #e7eef8);
  color: #0b5ed7;
  text-align: center;
}

.id-photo img {
  width: 100%;
  height: 100%;
  border-radius: 3mm;
  object-fit: cover;
}

.id-photo span {
  font-size: 20px;
  font-weight: 900;
}

.id-photo small {
  color: #5f6b7a;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.id-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2mm 3mm;
}

.id-details div {
  min-width: 0;
}

.id-details span {
  display: block;
  color: #6c757d;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.id-details strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.15;
}

.id-card-foot {
  display: grid;
  grid-template-columns: 1fr 13mm 22mm;
  gap: 3mm;
  align-items: end;
  font-size: 7px;
  font-weight: 800;
}

.id-card-foot span {
  display: block;
  color: #5f6b7a;
}

.id-qr {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: 13mm;
  height: 13mm;
  border: 1px solid #0b1f3a;
  padding: 1mm;
  background: white;
}

.id-qr span:nth-child(odd),
.id-qr span:nth-child(6),
.id-qr span:nth-child(10),
.id-qr span:nth-child(13) {
  background: #0b1f3a;
}

.id-signature {
  border-top: 1px solid #0b1f3a;
  padding-top: 1.5mm;
  text-align: center;
}

.class-print-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 12px;
}

.class-print-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.class-print-meta {
  display: grid;
  gap: 4px;
  min-width: 230px;
  text-align: right;
}

.class-print-meta span {
  color: var(--muted);
}

.blank-grade-info {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 800;
}

.class-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.class-print-table th,
.class-print-table td {
  border: 1px solid var(--text);
  padding: 8px 10px;
  white-space: normal;
}

.blank-grade-table td {
  height: 34px;
}

.attendance-row select {
  width: 150px;
}

.grade-entry {
  display: grid;
}

.grade-filters {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.subject-filters {
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) minmax(130px, 170px) auto;
}

.schedule-filters {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
}

.establishment-filters {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) minmax(120px, auto);
}

.establishment-filters button {
  align-self: end;
}

.account-filters {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.school-license-filters {
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
}

.note-input {
  width: 120px;
}

.exemption-cell label {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
  font-weight: 800;
}

.exemption-cell input {
  min-height: auto;
}

.exempt-row {
  background: #fff8e1;
}

.coefficient-input {
  width: 110px;
}

.subject-name-input {
  min-width: 180px;
}

.summary-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.score {
  font-weight: 800;
}

.decision-select {
  display: block;
  width: 150px;
  min-height: 32px;
  margin-top: 6px;
  font-size: 13px;
}

.report-filters {
  grid-template-columns: minmax(180px, 240px);
}

#reports .report-filters {
  grid-template-columns: repeat(4, minmax(160px, 240px));
}

.report-cards {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: white;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 14px;
}

.school-name {
  margin-bottom: 6px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
}

.establishment-info {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.establishment-info div {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-header h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.report-header p {
  margin-bottom: 0;
}

.report-meta {
  display: grid;
  gap: 5px;
  min-width: 190px;
  text-align: right;
}

.report-meta span {
  color: var(--muted);
}

.report-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.report-table th,
.report-table td {
  border: 0;
  border-top: 1px solid var(--text);
  border-left: 1px solid var(--text);
  padding: 10px 12px;
  white-space: normal;
}

.report-table th:last-child,
.report-table td:last-child {
  border-right: 1px solid var(--text);
}

.report-table tbody tr:last-child td {
  border-bottom: 1px solid var(--text);
}

.report-table th {
  background: #f4f6f2;
}

.report-table th:nth-child(2),
.report-table th:nth-child(3),
.report-table th:nth-child(4),
.report-table th:nth-child(5),
.report-number {
  text-align: center;
}

.report-number {
  vertical-align: middle;
}

.report-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.report-footer div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.report-footer span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

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

.annual-period-block {
  display: grid;
  gap: 8px;
  break-inside: avoid;
}

.annual-period-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--text);
  background: #f4f6f2;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
}

.period-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.period-summary div {
  border: 1px solid var(--text);
  padding: 7px 8px;
}

.period-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.annual-footer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 4px;
}

.decision-lists {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.honor-roll-wrap {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.honor-roll {
  break-inside: avoid;
}

.honor-roll h3 {
  margin: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 12px 14px;
  background: #f8f9fa;
  font-size: 17px;
}

.honor-roll p {
  margin: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 0 14px 10px;
  color: var(--muted);
  font-weight: 700;
}

.honor-roll table {
  border: 1px solid var(--line);
}

.decision-list {
  break-inside: avoid;
}

.decision-list h3 {
  margin: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 12px 14px;
  background: #f8f9fa;
  font-size: 17px;
}

.decision-list table {
  border: 1px solid var(--line);
}

.signature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 54px;
  color: var(--muted);
}

.signature-row span {
  border-top: 1px solid var(--text);
  padding-top: 8px;
  text-align: center;
}

dialog {
  width: min(480px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

dialog::backdrop {
  background: rgba(16, 26, 30, 0.45);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

label input,
label select {
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.photo-form-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-photo-preview {
  display: grid;
  width: 78px;
  height: 88px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-transform: uppercase;
}

.student-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
}

.inline-check input {
  min-height: auto;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  body.menu-open {
    overflow: hidden;
  }

  .menu-toggle {
    display: grid;
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    place-items: center;
    padding: 0 14px;
    font-size: 15px;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: rgba(16, 26, 30, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.menu-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(82vw, 310px);
    min-height: 100vh;
    overflow-y: auto;
    transform: translateX(-100%);
    box-shadow: 18px 0 45px rgba(0, 0, 0, 0.22);
    transition: transform 200ms ease;
  }

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

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

  .topbar {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #search {
    width: 100%;
  }

  .metrics,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .grade-filters {
    grid-template-columns: 1fr;
  }

  .class-actions {
    grid-template-columns: 1fr;
  }

  .report-header,
  .report-footer,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .report-header {
    display: grid;
  }

  .report-meta {
    text-align: left;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  @page two-bulletins-landscape {
    size: A4 landscape;
    margin: 8mm;
  }

  @page annual-report-landscape {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    display: block;
    background: white;
  }

  .sidebar,
  .topbar,
  .panel:not(.print-panel),
  .print-panel > .panel-head,
  .report-filters {
    display: none !important;
  }

  .main {
    padding: 0;
  }

  .view {
    display: block !important;
  }

  .view:not(#reports),
  #reports > .panel:not(.print-panel) {
    display: none !important;
  }

  body.print-analytics-report .view:not(#analytics),
  body.print-analytics-report #analytics > .panel:not(.analytics-print-panel) {
    display: none !important;
  }

  body.print-analytics-report #analytics {
    display: block !important;
  }

  body.print-analytics-report #reports {
    display: none !important;
  }

  body.print-analytics-report .analytics-print-panel {
    display: block !important;
  }

  body.print-analytics-report .panel-head,
  body.print-analytics-report .analytics-filters {
    display: none !important;
  }

  body.print-analytics-report .decision-select {
    display: none !important;
  }

  body.print-honor-roll .report-summary-cards,
  body.print-honor-roll .analytics-print-panel > .table-wrap,
  body.print-honor-roll .decision-lists {
    display: none !important;
  }

  body.print-honor-roll .honor-roll-wrap {
    display: block;
    padding: 0;
    border-top: 0;
  }

  body.print-honor-roll .honor-roll h3 {
    border-color: var(--text);
    padding: 8px 10px;
    font-size: 18px;
    text-align: center;
  }

  body.print-honor-roll .honor-roll p {
    border-color: var(--text);
    padding: 0 10px 8px;
    text-align: center;
  }

  body.print-decision-lists .report-summary-cards,
  body.print-decision-lists .analytics-print-panel > .table-wrap,
  body.print-decision-lists .honor-roll-wrap {
    display: none !important;
  }

  body.print-decision-lists .decision-lists {
    display: block;
    padding: 0;
    border-top: 0;
  }

  body.print-decision-lists .decision-list {
    page-break-before: always;
    margin: 0;
  }

  body.print-decision-lists .decision-list:first-child {
    page-break-before: auto;
  }

  body.print-decision-lists .decision-list h3 {
    border-color: var(--text);
    padding: 8px 10px;
    font-size: 18px;
    text-align: center;
  }

  body.print-class-document .view,
  body.print-class-document #reports,
  body.print-class-document .panel {
    display: none !important;
  }

  body.print-class-document #class-print-area {
    display: block !important;
  }

  body.print-student-cards .view,
  body.print-student-cards #reports,
  body.print-student-cards .panel,
  body.print-student-cards #class-print-area {
    display: none !important;
  }

  body.print-student-cards #student-card-print-area {
    display: grid !important;
    grid-template-columns: repeat(2, 86mm);
    gap: 8mm;
    align-content: start;
  }

  body.print-student-cards .student-id-card {
    box-shadow: none;
    page-break-inside: avoid;
  }

  .panel,
  .report-card {
    border: 0;
    box-shadow: none;
  }

  .report-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(48mm, 64mm);
    align-items: start;
  }

  .report-meta {
    min-width: 0;
  }

  .report-cards {
    display: block;
    padding: 0;
  }

  .report-card {
    min-height: 260mm;
    page-break-after: always;
    padding: 0;
  }

  .report-card,
  .report-card * {
    overflow-wrap: anywhere;
  }

  .report-table th,
  .report-table td {
    white-space: normal;
  }

  .annual-report-card {
    page: annual-report-landscape;
    min-height: 185mm;
    gap: 4px;
    font-size: 9px;
  }

  .annual-report-card .report-header {
    grid-template-columns: minmax(0, 1fr) minmax(42mm, 55mm);
    gap: 10px;
    margin-bottom: 4px;
    padding-bottom: 6px;
  }

  .annual-report-card .report-header h3 {
    font-size: 18px;
  }

  .annual-report-card .establishment-info {
    margin-bottom: 6px;
  }

  .annual-periods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3mm;
  }

  .annual-period-block {
    gap: 4px;
  }

  .annual-period-head {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .period-summary {
    gap: 4px;
  }

  .period-summary div {
    padding: 4px 5px;
  }

  .period-summary span {
    font-size: 8px;
  }

  .annual-report-card .report-table {
    font-size: 8px;
    table-layout: fixed;
  }

  .annual-report-card .report-table th,
  .annual-report-card .report-table td {
    padding: 2px 3px;
    line-height: 1.12;
  }

  .annual-report-card .report-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 2px;
  }

  .annual-report-card .report-footer div {
    padding: 5px;
  }

  .annual-report-card .signature-row {
    margin-top: 12px;
  }

  .report-card:last-child {
    page-break-after: auto;
  }

  th,
  td {
    padding: 8px 10px;
  }

  body.print-analytics-report .report-document-head,
  body.print-analytics-report .report-summary-cards {
    padding: 0 0 8px;
    border-bottom: 1px solid var(--text);
  }

  body.print-analytics-report .report-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
  }

  body.print-analytics-report .card {
    border: 1px solid var(--text);
    padding: 8px;
  }

  body.print-analytics-report table {
    font-size: 12px;
  }

  body.print-analytics-report th,
  body.print-analytics-report td {
    border: 1px solid var(--text);
    padding: 7px 8px;
    white-space: normal;
  }

  body.print-class-document .class-print-header {
    display: flex;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  body.print-class-document .class-print-header h2 {
    font-size: 22px;
  }

  body.print-class-document .class-print-table {
    font-size: 12px;
  }

  body.print-class-document .class-print-table th,
  body.print-class-document .class-print-table td {
    border: 1px solid var(--text);
    padding: 7px 8px;
  }

  body.print-class-document .blank-grade-table td {
    height: 32px;
  }

  body.print-two-bulletins .report-cards {
    display: block;
    padding: 0;
    font-size: 0;
  }

  body.print-two-bulletins .report-card {
    page: two-bulletins-landscape;
    display: inline-block;
    width: calc(50% - 4mm);
    height: 185mm;
    min-height: auto;
    overflow: hidden;
    border: 2px inset var(--text);
    page-break-after: auto;
    break-inside: avoid;
    vertical-align: top;
    padding: 5mm;
    font-size: 10px;
    line-height: 1.18;
  }

  body.print-two-bulletins .report-card:nth-child(odd) {
    margin-right: 8mm;
  }

  body.print-two-bulletins .report-card:nth-child(2n) {
    margin-right: 0;
    page-break-after: always;
    break-after: page;
  }

  body.print-two-bulletins .report-card:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  body.print-two-bulletins .report-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(38mm, 48mm);
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  body.print-two-bulletins .report-header h3 {
    font-size: 16px;
  }

  body.print-two-bulletins .establishment-info {
    margin-bottom: 6px;
  }

  body.print-two-bulletins .establishment-info div,
  body.print-two-bulletins .report-meta {
    font-size: 9.5px;
  }

  body.print-two-bulletins .report-meta {
    gap: 3px;
    min-width: 0;
    text-align: left;
  }

  body.print-two-bulletins .report-table {
    font-size: 9.5px;
    table-layout: fixed;
  }

  body.print-two-bulletins .report-table th,
  body.print-two-bulletins .report-table td {
    padding: 4px 5px;
    line-height: 1.15;
    white-space: normal;
  }

  body.print-two-bulletins .report-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  body.print-two-bulletins .report-footer div {
    padding: 6px;
  }

  body.print-two-bulletins .report-footer span {
    margin-bottom: 3px;
    font-size: 9px;
  }

  body.print-two-bulletins .signature-row {
    gap: 18px;
    margin-top: 24px;
  }
}
