:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-2: #f5fbf9;
  --ink: #10262c;
  --muted: #5d7078;
  --line: #d7e6e7;
  --green: #0c8f65;
  --green-dark: #075943;
  --blue: #1e8df2;
  --blue-dark: #0f61b8;
  --cyan: #12b8c8;
  --amber: #f2b63d;
  --coral: #ec6b5a;
  --danger: #c4493a;
  --shadow: 0 18px 46px rgba(28, 55, 67, 0.11);
  --shadow-strong: 0 24px 70px rgba(28, 55, 67, 0.16);
  --glow: 0 12px 28px rgba(30, 141, 242, 0.18);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(236, 107, 90, 0.08) 0%, transparent 26%),
    linear-gradient(45deg, rgba(18, 184, 200, 0.13) 0%, transparent 34%),
    linear-gradient(145deg, #f8fcff 0%, #eef9f3 42%, #fff8e6 74%, #eef5ff 100%);
  background-attachment: fixed;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(8, 43, 37, 0.9) 0%, rgba(8, 43, 37, 0.64) 48%, rgba(248, 252, 250, 0.8) 100%),
    url("assets/siap-login-hero.png") center / cover no-repeat;
  background-color: #0d3f35;
}

.auth-layout {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: center;
  gap: 34px;
}

.auth-panel {
  min-height: 560px;
  color: #f7fffb;
  display: grid;
  align-content: center;
  gap: 26px;
  text-shadow: 0 1px 18px rgba(2, 18, 15, 0.32);
}

.auth-panel-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-panel-brand strong,
.auth-panel-brand span {
  display: block;
}

.auth-panel-brand span {
  margin-top: 2px;
  color: rgba(247, 255, 251, 0.78);
  font-size: 0.86rem;
}

.auth-panel-copy h1 {
  max-width: 610px;
  margin: 10px 0 0;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-panel .eyebrow {
  color: #f5c247;
}

.auth-lead {
  max-width: 560px;
  margin: 16px 0 0;
  color: rgba(247, 255, 251, 0.86);
  font-size: 1.03rem;
  line-height: 1.6;
}

.auth-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.auth-flow span {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 9px 12px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-flow svg {
  color: #f5c247;
}

.auth-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  max-width: 440px;
}

.auth-status-grid div {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 28, 24, 0.42);
  padding: 13px;
  backdrop-filter: blur(10px);
}

.auth-status-grid span {
  display: block;
  color: rgba(247, 255, 251, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-status-grid strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 0.98rem;
}

.auth-card {
  width: 100%;
  min-height: auto;
  justify-self: end;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(5, 33, 30, 0.24);
  backdrop-filter: blur(16px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.auth-card-compact {
  width: min(100%, 430px);
  min-height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.auth-card-note {
  margin: -4px 0 2px;
  color: #51686a;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: #31484a;
  font-size: 0.82rem;
}

.auth-form input {
  min-height: 48px;
  border-radius: 8px;
  padding: 11px 12px;
  background: #f8fbfa;
  border-color: #cfdcda;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-form input:focus {
  outline: 3px solid rgba(22, 133, 229, 0.16);
  border-color: #1685e5;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
}

.auth-siap-note {
  display: grid;
  gap: 3px;
  border-left: 4px solid #f5c247;
  border-radius: 8px;
  background: #f1faf6;
  padding: 12px 14px;
}

.auth-siap-note strong,
.auth-siap-note span {
  display: block;
}

.auth-siap-note strong {
  color: #0c4f33;
  font-size: 0.9rem;
}

.auth-siap-note span {
  color: #5d6f71;
  font-size: 0.84rem;
  line-height: 1.4;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 700;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(165deg, #073a3b 0%, #087761 52%, #123a79 100%);
  color: #f7fffb;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 10px 0 36px rgba(20, 48, 65, 0.16);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0f4b3f;
  color: transparent;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 75, 63, 0.24);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: rgba(247, 255, 251, 0.72);
  font-size: 0.85rem;
  margin-top: 2px;
}

.nav-tabs {
  display: grid;
  gap: 7px;
}

.nav-tab {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(247, 255, 251, 0.82);
  min-height: 43px;
  padding: 0 11px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.nav-tab:hover,
.nav-tab.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(18, 184, 200, 0.16));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 3px 0 0 #f5c247, 0 12px 26px rgba(4, 23, 32, 0.18);
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.scan-summary {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(247, 255, 251, 0.86);
  font-size: 0.9rem;
}

.session-card {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
  display: grid;
  gap: 4px;
}

.session-card span,
.session-card small {
  color: rgba(247, 255, 251, 0.68);
  font-size: 0.75rem;
  font-weight: 700;
}

.session-card strong {
  color: #ffffff;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f5c247;
  box-shadow: 0 0 0 4px rgba(245, 194, 71, 0.16);
}

.status-dot.running {
  background: #49d17d;
  box-shadow: 0 0 0 4px rgba(73, 209, 125, 0.16);
}

.main {
  position: relative;
  padding: 26px;
  min-width: 0;
}

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 46%, rgba(255, 255, 255, 0.38) 100%),
    url("assets/teacher-workspace-accent.png") right center / cover no-repeat;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue), var(--amber), var(--coral));
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.7rem, 2.1vw, 2.35rem);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 0.73rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.topbar-actions,
.scan-actions,
.section-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.table-actions {
  gap: 6px;
}

.role-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(30, 141, 242, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #edf7ff);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(30, 141, 242, 0.1);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.segmented button,
.upload-zone label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.primary-button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green) 0%, var(--cyan) 48%, var(--blue) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--glow);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--green-dark) 0%, #0f9cae 48%, var(--blue-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(30, 141, 242, 0.24);
}

.secondary-button {
  background: linear-gradient(135deg, #ffffff, #f2fbf8);
  color: var(--green-dark);
  border-color: #b8d8d0;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  background: linear-gradient(135deg, #edf7f3, #eaf5ff);
  border-color: #8bcfbd;
  transform: translateY(-1px);
}

.danger-button {
  background: linear-gradient(135deg, #fff7f4, #fff0eb);
  border-color: #efb3a8;
  color: var(--danger);
  font-weight: 800;
}

.danger-button:hover {
  background: #ffe5e0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.view {
  display: none;
}

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

.content-band {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 252, 0.94)),
    linear-gradient(135deg, rgba(12, 143, 101, 0.08), rgba(30, 141, 242, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.content-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue), var(--amber), var(--coral));
}

.content-band > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.section-heading h2 {
  color: #12343c;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.admin-kpis div,
.user-strip div {
  border: 1px solid rgba(215, 230, 231, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 255, 0.88)),
    linear-gradient(135deg, rgba(242, 182, 61, 0.16), transparent);
  padding: 12px;
  box-shadow: 0 12px 26px rgba(33, 73, 85, 0.08);
}

.admin-kpis span,
.user-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-kpis strong,
.user-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 1.25rem;
}

.admin-school-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) 160px auto;
}

.access-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-grid-button {
  align-self: end;
}

.pdf-import-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.import-message {
  min-height: 0;
}

.import-message.ok {
  color: var(--green-dark);
}

.import-message.loading {
  color: var(--muted);
}

.active-row {
  background: #eaf9f3;
}

.blocked-row {
  background: #fff8f6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.status-pill.ok {
  background: linear-gradient(135deg, #dff8ed, #edf9ff);
  color: var(--green-dark);
}

.status-pill.danger {
  background: linear-gradient(135deg, #ffe8e3, #fff3e6);
  color: var(--danger);
}

.table-action {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.superbackup-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: end;
}

.superbackup-summary {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(30, 141, 242, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 255, 0.88)),
    linear-gradient(135deg, rgba(12, 143, 101, 0.12), transparent);
  padding: 12px 14px;
}

.superbackup-summary strong,
.superbackup-summary span {
  display: block;
}

.superbackup-summary strong {
  color: var(--blue-dark);
}

.superbackup-summary span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.superbackup-panel .backup-actions {
  grid-column: 1 / -1;
}

.backup-message {
  margin-top: 12px;
}

.school-identity,
.logo-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.school-identity span,
.logo-preview-row span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.school-identity strong,
.logo-preview-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.school-identity small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.school-logo-preview,
.table-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #edf7f3, #e8f3ff);
  border: 1px solid #b9d8cf;
  color: var(--green-dark);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(17, 91, 75, 0.1);
}

.media-thumb {
  width: 92px;
  height: 52px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-logo-preview {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  font-size: 1.25rem;
}

.school-logo-preview.small {
  width: 58px;
  height: 58px;
}

.school-logo-preview img,
.table-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.table-logo {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.compact-heading {
  margin-top: 18px;
}

.subject-blocks-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.subject-blocks-grid {
  display: grid;
  gap: 10px;
}

.subject-block-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(92px, 0.25fr) minmax(92px, 0.25fr) 38px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.subject-block-row .icon-button {
  width: 38px;
  height: 38px;
  justify-content: center;
  padding: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 39px;
  padding: 8px 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #fbfefe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

select[multiple] {
  min-height: 96px;
}

.wide-field {
  grid-column: span 2;
}

.class-picker-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.class-check-dropdown {
  position: relative;
}

.class-check-dropdown summary {
  list-style: none;
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 38px 9px 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #fbfefe);
  cursor: pointer;
}

.class-check-dropdown summary::-webkit-details-marker {
  display: none;
}

.class-check-dropdown summary::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.class-check-dropdown[open] summary::after {
  top: 20px;
  transform: rotate(225deg);
}

.class-check-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 230px;
  overflow: auto;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(10, 35, 30, 0.16);
}

.class-check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.class-check-list label:hover {
  background: var(--surface-2);
}

.class-check-list input {
  width: auto;
  min-height: auto;
}

.elective-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.elective-summary div {
  border: 1px solid rgba(215, 230, 231, 0.86);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f2fbf8 58%, #eef7ff);
  padding: 13px;
  box-shadow: 0 12px 24px rgba(33, 73, 85, 0.08);
}

.elective-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.elective-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 1.35rem;
}

.elective-topics-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.elective-topics-panel.hidden {
  display: none;
}

.topic-list {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 16px;
}

.topic-choice {
  display: grid;
  gap: 6px;
}

.activity-table {
  min-width: 1040px;
}

.activity-table caption {
  caption-side: top;
  padding: 10px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}

.activity-table th {
  background: linear-gradient(135deg, #eaf9f3, #e8f3ff);
  color: #12343c;
  font-size: 0.74rem;
  text-align: center;
}

.activity-table td {
  vertical-align: middle;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.activity-id {
  width: 70px;
  color: var(--blue-dark);
  text-align: center;
  white-space: nowrap;
}

.drag-mark {
  display: inline-block;
  margin-right: 6px;
  color: #22313c;
  font-weight: 900;
}

.activity-title-cell {
  display: flex;
  gap: 10px;
  min-width: 250px;
}

.activity-title-cell strong {
  color: var(--blue-dark);
  font-weight: 700;
}

.activity-title-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.activity-dot {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin-top: 2px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.activity-dot-1 { border-color: #ec6b5a; }
.activity-dot-2 { border-color: #f7b500; }
.activity-dot-3 { border-color: #0c8f65; }
.activity-dot-4 { border-color: #111827; }

.activity-status {
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
}

.activity-teacher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.teacher-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(12, 143, 101, 0.8);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7d7, #eaf9f3);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.audience-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-width: 260px;
}

.audience-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge-0 { background: linear-gradient(135deg, #12b8c8, #1e8df2); }
.badge-1 { background: linear-gradient(135deg, #ec6b5a, #ef8f6a); }
.badge-2 { background: linear-gradient(135deg, #f2b63d, #ffe08a); color: #101820; }
.badge-3 { background: linear-gradient(135deg, #6c7af2, #8e68d9); }
.badge-4 { background: linear-gradient(135deg, #0c8f65, #4fc486); }
.badge-5 { background: linear-gradient(135deg, #12343c, #315765); }
.badge-muted { background: linear-gradient(135deg, #6c757d, #8b99a3); }

.activity-vacancies {
  color: var(--green-dark);
  font-weight: 900;
  text-align: center;
}

.activity-enrolled,
.enrollment-count-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 900;
}

.enrollment-count-button {
  background: #fff;
}

.enrollment-count-button:hover,
.enrollment-count-button[aria-expanded="true"] {
  background: #eaf3ff;
  border-color: #004ebf;
  color: #004ebf;
}

.enrollment-detail-row td {
  background: #f7faf9;
  border-top: 0;
}

.enrollment-detail-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.enrollment-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.enrollment-detail-heading strong {
  font-size: 1rem;
}

.enrollment-detail-heading span,
.enrollment-topic-group h3 span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.enrollment-topic-group {
  display: grid;
  gap: 8px;
}

.enrollment-topic-group h3 {
  margin: 0;
  font-size: 0.95rem;
}

.enrollment-student-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.enrollment-student-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.enrollment-student-list li:last-child {
  border-bottom: 0;
}

.enrollment-student-list span {
  display: grid;
  gap: 2px;
}

.enrollment-student-list small,
.enrollment-student-list time {
  color: var(--muted);
  font-size: 0.85rem;
}

.dashboard-choice-button {
  margin-bottom: 14px;
}

.student-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.student-profile-grid section {
  border: 1px solid rgba(215, 230, 231, 0.86);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #f7fcff);
  box-shadow: 0 10px 22px rgba(33, 73, 85, 0.08);
}

.student-profile-grid h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.student-profile-grid p {
  margin: 0 0 6px;
}

.student-grade-list {
  display: grid;
  gap: 8px;
}

.student-grade-list article {
  border: 1px solid rgba(215, 230, 231, 0.86);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #f8fbfa, #eef8ff);
}

.student-grade-list span,
.student-grade-list small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.student-grade-list strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
}

.student-notes-panel {
  overflow-x: auto;
}

.student-notes-filter {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}

.student-notes-filter label {
  min-width: 220px;
}

.filter-row,
.frequency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-row label {
  min-width: 160px;
  flex: 1 1 160px;
}

.attendance-sheet {
  width: 760px;
  min-height: 1045px;
  margin: 18px auto;
  padding: 34px 42px;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.attendance-header {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.attendance-school-logo {
  width: 52px;
  height: 52px;
  border: 1px solid #111;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.8rem;
}

.attendance-school-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attendance-header strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.attendance-header h2 {
  margin: 0 0 3px;
  font-size: 1.08rem;
}

.attendance-header p {
  margin: 2px 0;
  font-size: 0.78rem;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--attendance-font-size, 12px);
  table-layout: fixed;
}

.attendance-table th,
.attendance-table td {
  border: 1px solid #111;
  height: var(--attendance-row-height, 28px);
  padding: 2px 6px;
  text-align: left;
  line-height: 1.08;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  width: 55%;
}

.attendance-sheet + .attendance-sheet {
  page-break-before: always;
}

.capture-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(22, 133, 229, 0.18);
  border-color: var(--blue);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.5fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(215, 230, 231, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.table-wrap.compact {
  max-height: 430px;
}

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

.data-table th,
.data-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: linear-gradient(135deg, #f1fbf7, #eef7ff);
  color: #315765;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.data-table tbody tr:hover td {
  background: #f8fcff;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dff8ed, #e8f3ff);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}

.student-code-preview {
  min-height: 240px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  background:
    linear-gradient(90deg, rgba(12, 143, 101, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 141, 242, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(239, 249, 255, 0.68));
  background-size: 28px 28px;
  border: 1px dashed #9bcfc2;
  border-radius: 8px;
}

.code-block {
  width: min(190px, 100%);
  border: 2px solid #1d2d2f;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 9px;
}

.code-block strong {
  font-size: 1.2rem;
}

.code-pattern {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.code-pattern span {
  aspect-ratio: 1;
  border: 1px solid #263436;
  background: #fff;
}

.code-pattern span.on {
  background: #263436;
}

.segmented {
  display: inline-flex;
  background: linear-gradient(135deg, #eef8f4, #eef7ff);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.segmented button {
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0 12px;
}

.segmented button.active {
  background: #ffffff;
  color: var(--blue-dark);
  box-shadow: 0 8px 18px rgba(17, 47, 45, 0.12);
}

.key-mode {
  display: none;
}

.key-mode.active {
  display: block;
}

.answer-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
}

.key-column {
  display: grid;
  gap: 8px;
}

.key-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px repeat(5, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfefe, #f1fbf7);
}

.key-row > span {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.82rem;
}

.bubble-button {
  min-width: 0;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  border: 2px solid #9cb8bd;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: transparent;
  padding: 0;
  justify-self: center;
}

.bubble-button.selected {
  border-color: var(--blue-dark);
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: inset 0 0 0 4px #ffffff;
}

.image-import {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.upload-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone label {
  min-height: 120px;
  width: 100%;
  border-style: dashed;
  background: linear-gradient(135deg, rgba(12, 143, 101, 0.08), rgba(30, 141, 242, 0.08));
  color: var(--blue-dark);
  font-weight: 800;
}

.image-preview {
  min-height: 160px;
  max-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbfa, #eef7ff);
  display: grid;
  place-items: center;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.scanner-controls {
  align-self: stretch;
}

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

.scan-metrics div,
.latest-read {
  border: 1px solid rgba(215, 230, 231, 0.86);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f2fbf8 52%, #eef7ff);
  padding: 12px;
  box-shadow: 0 12px 26px rgba(33, 73, 85, 0.08);
}

.scan-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scan-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-read {
  margin-top: 12px;
}

.mini-answer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.mini-answer-strip span {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-answer-strip .hit {
  background: linear-gradient(135deg, #e8f3ff, #e9fbf5);
  border-color: #8fc4f7;
  color: var(--blue-dark);
}

.mini-answer-strip .miss {
  background: linear-gradient(135deg, #fff1ee, #fff7e5);
  border-color: #edb7ac;
  color: var(--danger);
}

.phone-frame,
.scanner-camera-panel {
  width: 100%;
  min-height: 660px;
  margin-inline: auto;
  background: #1b1f1d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(16, 35, 36, 0.32);
  border: 1px solid #111a18;
}

.scanner-camera-panel .phone-status {
  display: none;
}

.phone-status {
  height: 54px;
  background: #146b2a;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.phone-status span:nth-child(2) {
  font-weight: 800;
}

.phone-status span:last-child {
  justify-self: end;
  font-size: 1rem;
}

.camera-stage {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  background: #595d59;
}

.camera-stage video,
.camera-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-stage video {
  z-index: 1;
}

.camera-fallback {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(240, 240, 240, 0.2), transparent 18%),
    linear-gradient(100deg, #6e736e, #3f4542 52%, #777a75);
  filter: blur(0.2px);
}

.fiducial-target {
  position: absolute;
  z-index: 2;
  width: 76px;
  height: 76px;
  background: #d9d9d2;
  opacity: 0.86;
}

.fiducial-target.top-left {
  top: 0;
  left: 0;
}

.fiducial-target.top-right {
  top: 0;
  right: 0;
}

.fiducial-target.bottom-left {
  top: 290px;
  left: 0;
}

.fiducial-target.bottom-right {
  top: 290px;
  right: 0;
}

.scan-line {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  background: rgba(73, 209, 125, 0.82);
  box-shadow: 0 0 16px rgba(73, 209, 125, 0.8);
  animation: scanline 2.6s ease-in-out infinite;
}

@keyframes scanline {
  0%,
  100% {
    transform: translateY(-120px);
    opacity: 0.2;
  }

  50% {
    transform: translateY(120px);
    opacity: 1;
  }
}

.scan-toast {
  position: absolute;
  z-index: 4;
  left: 22px;
  right: 22px;
  bottom: 14px;
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  background: rgba(245, 245, 245, 0.84);
  color: #182124;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.answer-card-stage {
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(12, 143, 101, 0.12), rgba(30, 141, 242, 0.12)),
    #e6f0f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.card-print-panel {
  margin-bottom: 14px;
  align-items: end;
}

.answer-sheet {
  position: relative;
  width: 760px;
  height: var(--sheet-height, 1045px);
  margin: 18px auto;
  background: #fff;
  border: 1px solid #d7d7d7;
  box-shadow: none;
  padding: 0;
  color: #12191a;
  font-family: Arial, Helvetica, sans-serif;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.answer-sheet * {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.sheet-inner-border {
  position: absolute;
  inset: 42px 54px 38px 30px;
  border: 2px solid #101010;
  pointer-events: none;
}

.sheet-header {
  position: absolute;
  left: 56px;
  top: 92px;
  right: 56px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.sheet-header > div:first-child {
  padding-right: 0;
}

.sheet-header h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 800;
}

.sheet-school-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 300px;
  margin-bottom: 8px;
  color: #101010;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 900;
}

.sheet-school-logo {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  border: 1px solid #111;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  font-size: 8px;
}

.sheet-school-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sheet-header p {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
}

.student-marker {
  display: none;
}

.student-marker span {
  font-size: 0.68rem;
  font-weight: 800;
}

.marker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.marker-grid i {
  aspect-ratio: 1;
  border: 1px solid #1b2020;
  display: block;
}

.marker-grid i.on {
  background: #1b2020;
}

.fiducial {
  position: absolute;
  z-index: 6;
  width: 19px;
  height: 19px;
  display: block;
  background: #101010;
  fill: #101010;
  border-radius: 0;
}

.fiducial rect {
  fill: #101010;
}

.fiducial-top-left { left: 144px; top: var(--fiducial-top-top, 220px); }
.fiducial-top-right { right: 136px; top: calc(var(--fiducial-top-top, 220px) + 2px); }
.fiducial-bottom-left { left: 143px; top: var(--fiducial-bottom-top, 688px); }
.fiducial-bottom-right { right: 138px; top: calc(var(--fiducial-bottom-top, 688px) + 3px); }

.fiducial-code {
  position: absolute;
  left: 50%;
  right: auto;
  top: var(--student-code-top, 165px);
  width: 96px;
  height: 136px;
  background: transparent;
  padding: 0;
  display: grid;
  z-index: 9;
  transform: translateX(-50%);
}

.fiducial-code::before {
  content: none;
}

.code-marking {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.code-digit-column {
  display: grid;
  gap: 2px;
  align-items: center;
  justify-items: center;
}

.code-digit-label {
  font-size: 0.65rem;
  font-weight: 900;
  text-align: center;
  color: #202426;
}

.code-bubble {
  width: 10px;
  height: 10px;
  border: 1px solid #202426;
  border-radius: 999px;
  display: block;
  background: #fff;
}

.code-bubble.filled {
  background: #202426;
}

.student-code-marker {
  width: 96px;
  display: grid;
  gap: 3px;
  background: #fff;
  color: #101010;
}

.student-code-marker span {
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.sheet-body {
  position: absolute;
  z-index: 1;
  top: var(--sheet-body-top, 350px);
  left: 0;
  right: 0;
  max-width: 386px;
  margin-inline: auto;
}

.sheet-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  width: 100%;
}

.sheet-subject-block + .sheet-subject-block {
  margin-top: 12px;
}

.sheet-column h4 {
  margin: 0 0 15px;
  text-align: center;
  color: #5f5155;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.sheet-options {
  display: grid;
  grid-template-columns: 24px repeat(var(--option-count, 5), 17px);
  justify-content: center;
  gap: 5px 8px;
  align-items: center;
}

.option-head {
  text-align: center;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}

.question-no {
  text-align: right;
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}

.paper-bubble {
  width: 16px;
  height: 16px;
  border: 1.8px solid #121212;
  border-radius: 999px;
  display: block;
  background: #fff;
}

.paper-bubble.filled {
  background: #121212;
}

.sheet-footer {
  display: none;
}

.official-form {
  background: #fff;
}

.account-panel {
  max-width: 860px;
}

.user-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.official-fields {
  display: grid;
  grid-template-columns: 1fr 0.55fr 0.48fr 0.45fr;
  gap: 10px;
  margin-bottom: 12px;
}

.official-field {
  display: grid;
  gap: 3px;
  font-size: 0.68rem;
  color: #2a5592;
}

.official-field strong {
  min-height: 24px;
  padding: 4px 6px;
  border: 1px solid #cdd3da;
  background: #f2f3f5;
  color: #4a4f56;
  font-size: 0.75rem;
  font-weight: 600;
}

.notes-wrap {
  max-height: calc(100vh - 260px);
  border-radius: 0;
}

.notes-copy-message {
  margin-bottom: 12px;
}

.notes-actions-panel {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.notes-last-change {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
}

.notes-return-button {
  display: none;
}

.notes-groups {
  display: grid;
  gap: 18px;
  min-width: 100%;
}

.notes-subject {
  min-width: 100%;
}

.notes-subject-heading {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.notes-subject-heading span,
.notes-subject-heading small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.notes-subject-heading strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
}

.notes-table {
  min-width: 1180px;
  font-size: 0.68rem;
  color: #253034;
}

.notes-table th,
.notes-table td {
  border: 1px solid #cfd6dc;
  padding: 3px 4px;
  text-align: center;
  min-width: 26px;
  height: 22px;
}

.notes-table th {
  background: #f4f6f8;
  font-weight: 700;
  color: #59636a;
}

.notes-table .student-cell {
  min-width: 165px;
  max-width: 165px;
  text-align: left;
  color: #1d5d9b;
  font-size: 0.66rem;
  line-height: 1.15;
}

.notes-table .student-cell span {
  display: block;
  color: #68727a;
}

.notes-table .score-cell {
  font-weight: 800;
}

.mark-button {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 4px;
}

.mark-button:hover,
.mark-button:focus-visible {
  background: #e8f3ff;
}

.mark {
  width: 11px;
  height: 11px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #c9d0d6;
  background: #fff;
  vertical-align: middle;
}

.mark.correct {
  background: var(--blue);
  border-color: var(--blue-dark);
  color: #fff;
}

.mark.correct::after {
  content: "";
  width: 5px;
  height: 3px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -1px;
}

.mark.absent {
  background: #f4f6f8;
}

.mark.siap-empty {
  background: #f8fafb;
  border-color: #d8dee3;
}

body.notes-fullscreen-mode {
  overflow: hidden;
  background: #ffffff;
}

body.notes-fullscreen-mode .sidebar,
body.notes-fullscreen-mode .topbar {
  display: none !important;
}

body.notes-fullscreen-mode .app-shell,
body.notes-fullscreen-mode .main {
  display: block;
  height: 100vh;
  min-height: 0;
  padding: 0;
}

body.notes-fullscreen-mode .view[data-panel="notas"].active {
  display: block;
  height: 100vh;
  min-height: 0;
}

body.notes-fullscreen-mode .official-form {
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

body.notes-fullscreen-mode .official-form .section-heading {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

body.notes-fullscreen-mode .notes-return-button {
  display: inline-flex;
}

body.notes-fullscreen-mode .notes-copy-message {
  margin-bottom: 8px;
}

body.notes-fullscreen-mode .notes-actions-panel {
  gap: 4px;
}

body.notes-fullscreen-mode .notes-last-change {
  font-size: 0.72rem;
}

body.notes-fullscreen-mode .official-fields {
  grid-template-columns: 0.4fr 0.4fr 0.4fr 1fr 1.6fr 0.35fr 0.7fr 0.6fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

body.notes-fullscreen-mode .notes-wrap {
  flex: 1;
  max-height: none;
  height: auto;
  min-height: 0;
  overflow: auto;
}

.success-text {
  color: var(--green-dark);
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .auth-layout {
    max-width: 660px;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .auth-panel {
    min-height: auto;
    gap: 18px;
  }

  .auth-panel-copy h1 {
    font-size: 2.2rem;
  }

  .auth-card {
    width: min(100%, 430px);
    justify-self: center;
    min-height: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
    gap: 12px;
    box-shadow: none;
  }

  .nav-tabs {
    grid-template-columns: repeat(8, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .nav-tab {
    justify-content: center;
    padding: 0 6px;
    font-size: 0.78rem;
  }

  .nav-icon {
    display: none;
  }

  .scan-summary {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .form-grid,
  .split-layout,
  .admin-grid,
  .scanner-layout,
  .image-import,
  .official-fields,
  .user-strip {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .admin-school-form,
  .superbackup-panel,
  .subject-block-row {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }
}

body.mobile-scanner-mode {
  background: #0c1210;
}

body.mobile-scanner-mode .sidebar,
body.mobile-scanner-mode .topbar,
body.mobile-scanner-mode .scanner-controls .section-heading,
body.mobile-scanner-mode .nav-tabs,
body.mobile-scanner-mode .view:not([data-panel="leitor"]) {
  display: none !important;
}

body.mobile-scanner-mode .app-shell,
body.mobile-scanner-mode .main,
body.mobile-scanner-mode .view[data-panel="leitor"] {
  display: block !important;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

body.mobile-scanner-mode .scanner-layout {
  display: flex;
  min-height: 100vh;
  flex-direction: column-reverse;
  gap: 0;
}

body.mobile-scanner-mode .scanner-controls {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body.mobile-scanner-mode .scanner-camera-panel,
body.mobile-scanner-mode .camera-stage {
  min-height: 68vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

@media (max-width: 640px) {
  .auth-screen {
    padding: 16px;
    background-position: 42% center;
  }

  .auth-panel {
    display: grid;
  }

  .auth-card {
    border-radius: 8px;
    padding: 24px;
  }

  .auth-panel-brand {
    display: none;
  }

  .auth-panel-copy h1 {
    font-size: 1.64rem;
    line-height: 1.12;
  }

  .auth-lead {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .auth-flow {
    gap: 7px;
  }

  .auth-flow span {
    padding: 7px 9px;
    font-size: 0.68rem;
  }

  .auth-flow svg {
    width: 15px;
    height: 15px;
  }

  .auth-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-status-grid div {
    padding: 10px;
  }

  .auth-status-grid span {
    font-size: 0.65rem;
  }

  .auth-status-grid strong {
    font-size: 0.84rem;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 16px;
  }

  .topbar::before {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.9) 68%, rgba(255, 255, 255, 0.72) 100%),
      url("assets/teacher-workspace-accent.png") right center / cover no-repeat;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .primary-button,
  .topbar-actions .secondary-button {
    flex: 1 1 130px;
  }

  .notes-actions-panel {
    justify-items: start;
  }

  .notes-last-change {
    text-align: left;
  }

  .nav-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(8, minmax(104px, 1fr));
  }

  .content-band {
    padding: 14px;
  }

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

  .phone-frame {
    min-height: 600px;
  }

  .camera-stage {
    min-height: 540px;
  }

  .sheet-header {
    grid-template-columns: 1fr;
  }

  .student-marker {
    justify-self: start;
    width: 130px;
  }

  .sheet-columns {
    gap: 70px;
    margin-top: 0;
  }

  .sheet-options {
    grid-template-columns: 24px repeat(var(--option-count, 5), 17px);
    gap: 5px 8px;
  }

  .paper-bubble {
    width: 16px;
    height: 16px;
  }

  .sheet-footer {
    font-size: 0.62rem;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html,
  body {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .sidebar,
  .auth-screen,
  .topbar,
  .section-heading,
  .card-print-panel,
  .view:not([data-panel="cartao"]) {
    display: none !important;
  }

  .app-shell,
  .main,
  .view[data-panel="cartao"],
  .content-band,
  .answer-card-stage {
    display: block !important;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .answer-card-stage,
  #answerCardPreview {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .answer-sheet {
    width: 760px;
    height: var(--sheet-height, 1045px);
    margin: 0 auto !important;
    box-shadow: none;
    page-break-inside: avoid;
    break-inside: avoid;
    transform-origin: top left;
  }

  .answer-sheet + .answer-sheet {
    page-break-before: always;
  }

  .attendance-sheet {
    width: 100%;
    max-width: none;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    box-shadow: none;
    page-break-inside: avoid;
    page-break-after: auto;
    break-inside: avoid;
    break-after: auto;
    overflow: hidden;
  }

  .attendance-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}
