:root {
  --bg: #f3f5f8;
  --bg-accent: #e7edf5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: #d9e0ea;
  --text: #172033;
  --muted: #687386;
  --primary: #174a7c;
  --primary-2: #1d5b97;
  --primary-3: #2a7c9f;
  --success: #13814a;
  --danger: #c83434;
  --shadow: 0 1px 2px rgba(16, 32, 56, 0.06);
  --shadow-soft: 0 8px 24px rgba(16, 32, 56, 0.08);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;
}

body::before {
  content: none;
}

a {
  color: var(--primary-2);
}

img {
  max-width: 100%;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #132033;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: padding 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

body.sidebar-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.app-main {
  min-width: 0;
}

.app-body .container {
  width: min(1280px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.system-banner {
  margin: 0.75rem auto 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid #b91c1c;
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

body.sidebar-collapsed .container {
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.menu-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  background: #eef3f8 !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  box-shadow: none;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.auth-topbar {
  background: #132033;
  color: #fff;
}

.topbar-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title {
  margin-top: 0.16rem;
  font-weight: 800;
  font-size: 1rem;
}

.brand-wrap,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-brand {
  padding: 0.35rem 0.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #2b7a9b;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.1;
}

.subtitle {
  font-size: 0.88rem;
  opacity: 0.82;
  margin-top: 0.2rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.78rem;
  border-radius: 8px;
  background: #eef3f8;
  color: var(--text);
  font-size: 0.88rem;
  border: 1px solid var(--border);
}

.user-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #dbe8f1;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.56rem 0.9rem;
  min-height: 38px;
  font-size: 0.88rem;
  line-height: 1.15;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease,
    opacity 160ms ease;
}

.nav a:hover,
.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 32, 56, 0.12);
}

.nav a,
.button,
button,
.button:visited,
.nav a:visited {
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  color: #fff;
}

.sidebar-nav {
  flex-direction: column;
  gap: 0.35rem;
  justify-content: flex-start;
}

.sidebar-nav a,
.sidebar-nav a:visited {
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: 42px;
  padding: 0.58rem 0.65rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.sidebar-nav a span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: none;
}

.sidebar-nav a.active span {
  background: #2b7a9b;
}

.sidebar-logout {
  margin-top: auto;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.button.primary,
button.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  color: #fff;
}

.nav a {
  padding: 0.46rem 0.8rem;
  min-height: 34px;
  font-size: 0.84rem;
}

.button.secondary,
button.secondary {
  background: rgba(16, 32, 56, 0.08);
  color: var(--text);
  box-shadow: none;
}

.button.utility,
button.utility {
  background: rgba(18, 58, 114, 0.08);
  color: var(--primary);
  box-shadow: none;
}

.button.small,
button.small {
  padding: 0.42rem 0.7rem;
  min-height: 32px;
  font-size: 0.79rem;
}

.danger {
  background: linear-gradient(135deg, var(--danger), #f05a5a) !important;
  color: #fff !important;
}

.container {
  max-width: 1280px;
  margin: 0;
  padding: 1rem 1.2rem 2rem;
}

.page-hero,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.page-hero {
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.page-hero::after {
  content: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: #e8f1f7;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  margin: 0.65rem 0 0.35rem;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.6;
}

.hero-side {
  display: grid;
  gap: 0.65rem;
  justify-items: end;
  position: relative;
  z-index: 1;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: rgba(17, 33, 58, 0.06);
  border-radius: 8px;
  font-weight: 700;
  color: var(--text);
}

.card {
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.card h1,
.card h2 {
  margin-top: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title h2,
.section-title h1 {
  margin: 0;
}

.section-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.grid,
.two-col {
  display: grid;
  gap: 0.9rem;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-span {
  grid-column: 1 / -1;
}

.field-group-title {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.stat::before {
  content: none;
}

.stat > * {
  position: relative;
  z-index: 1;
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.stat .label {
  display: inline-flex;
  margin-top: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: #e8f1f7;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace-head h1 {
  margin: 0.55rem 0 0.25rem;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-status {
  min-width: 150px;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f0f7f2;
  border: 1px solid #cfe5d5;
  text-align: right;
}

.workspace-status span {
  display: block;
  color: #52745b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-status strong {
  display: block;
  margin-top: 0.2rem;
  color: #143f20;
}

.dashboard-panel {
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analytics-panel {
  display: grid;
  gap: 1rem;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 1rem;
}

.analytics-block {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.mini-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.mini-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.mini-heading span,
.bar-label span,
.grade-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.class-bars,
.grade-bars {
  display: grid;
  gap: 0.75rem;
}

.bar-row,
.grade-row {
  display: grid;
  align-items: center;
  gap: 0.65rem;
}

.bar-row {
  grid-template-columns: minmax(110px, 0.8fr) minmax(160px, 1.5fr) 58px;
}

.grade-row {
  grid-template-columns: 32px minmax(120px, 1fr) 46px;
}

.bar-label strong {
  display: block;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf3;
}

.bar-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b7a9b, #1eb53a);
}

.bar-value {
  text-align: right;
  font-weight: 800;
}

.class-analysis-table {
  overflow-x: auto;
}

.compact-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.module-tile {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.25rem 0.75rem;
  min-height: 104px;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
}

.module-tile span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e8f1f7;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
}

.module-tile strong {
  color: var(--text);
}

.module-tile small {
  color: var(--muted);
  line-height: 1.4;
}

.module-tile:hover {
  border-color: #b9c7d7;
  box-shadow: var(--shadow-soft);
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-nav a {
  padding: 0.62rem 0.7rem;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.settings-nav a:hover {
  background: #eef3f8;
  color: var(--primary);
}

.settings-content {
  min-width: 0;
}

.module-section {
  scroll-margin-top: 86px;
}

.actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.actions .button,
.actions button,
.filters button {
  padding: 0.5rem 0.78rem;
  min-height: 35px;
  font-size: 0.83rem;
}

.actions.action-row {
  gap: 0.45rem;
  align-items: center;
}

.sticky-toolbar-shell {
  position: sticky;
  top: 88px;
  z-index: 14;
  margin-bottom: 0.8rem;
}

.sticky-panel {
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(16, 32, 56, 0.08);
  box-shadow: 0 8px 20px rgba(16, 32, 56, 0.08);
  backdrop-filter: blur(10px);
}

.compact-panel {
  gap: 0.5rem;
  margin-bottom: 0;
}

.compact-panel input,
.compact-panel select {
  min-width: 0;
}

.toolbar-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(31, 94, 255, 0.08);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.83rem;
}

.toolbar-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.filters {
  margin-bottom: 1rem;
}

.filters input,
.filters select,
label input,
label select,
textarea,
input,
select {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 32, 56, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.filters input,
.filters select {
  min-width: 180px;
  flex: 1 1 180px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 94, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text);
}

label span,
.note,
.help-text {
  color: var(--muted);
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

th,
td {
  padding: 0.85rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(16, 32, 56, 0.08);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(31, 94, 255, 0.03);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
}

.marks-table-wrap {
  max-height: min(72vh, 860px);
  overflow: auto;
  border: 1px solid rgba(16, 32, 56, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.marks-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(246, 249, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 rgba(16, 32, 56, 0.08);
}

.general-results-sheet {
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.general-results-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.45fr);
  align-items: start;
  gap: 1.2rem;
  min-width: 1180px;
  padding: 0.9rem 0.8rem 1.2rem;
  background: #fff;
}

.general-title-block {
  text-align: center;
  color: #f00;
  font-family: Impact, "Arial Black", "Trebuchet MS", sans-serif;
  text-transform: uppercase;
  justify-self: center;
  width: min(980px, 100%);
}

.general-title-block h1,
.general-title-block h2,
.general-title-block h3,
.general-title-block h4 {
  margin: 0 0 0.65rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.general-title-block h1 {
  font-size: 2rem;
}

.general-title-block h2,
.general-title-block h3 {
  font-size: 1.55rem;
}

.general-title-block h4 {
  text-align: center;
  font-size: 1.45rem;
}

.division-matrix {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #f00;
  font-family: Impact, "Arial Black", "Trebuchet MS", sans-serif;
}

.division-matrix th,
.division-matrix td {
  border: 2px double #f00;
  padding: 0.22rem 0.32rem;
  text-align: center;
  vertical-align: middle;
  font-size: 1.08rem;
}

.division-matrix thead th {
  background: #ffc000;
}

.division-matrix thead th:first-child {
  background: transparent;
  border-left-color: transparent;
  border-top-color: transparent;
}

.division-matrix tbody th {
  background: #ffe599;
}

.division-matrix tbody tr:nth-child(2) td {
  background: #dbe5f1;
}

.division-matrix tbody tr:nth-child(3) td {
  background: #00b0f0;
}

.division-matrix td:last-child {
  background: #fff !important;
  font-size: 1.35rem;
}

.general-results-wrap {
  overflow: auto;
}

.general-results-table {
  min-width: 1500px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Courier New", Consolas, monospace;
}

.general-results-table th,
.general-results-table td {
  border: 2px double #9b4fd3;
  padding: 0.1rem 0.18rem;
  color: #0070c0;
  font-size: 0.9rem;
  line-height: 1.05;
  vertical-align: middle;
}

.general-results-table thead th {
  height: 150px;
  color: #f00;
  background: #fff;
  font-weight: 400;
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
  vertical-align: bottom;
}

.general-results-table th:nth-child(1),
.general-results-table td:nth-child(1) {
  width: 42px;
  text-align: center;
}

.general-results-table th:nth-child(2),
.general-results-table td:nth-child(2) {
  width: 104px;
}

.general-results-table th:nth-child(3),
.general-results-table td:nth-child(3) {
  width: 34px;
  text-align: center;
}

.general-results-table th:nth-child(4),
.general-results-table td:nth-child(4) {
  width: 96px;
}

.general-results-table th:nth-child(5),
.general-results-table td:nth-child(5) {
  width: 108px;
}

.general-results-table th:nth-child(6),
.general-results-table td:nth-child(6) {
  width: 96px;
}

.general-results-table .vertical-subject {
  width: 38px;
  text-align: center;
  white-space: nowrap;
}

.general-results-table .vertical-subject span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.general-results-table tbody tr:hover {
  background: transparent;
}

.general-results-table .screen-report-col {
  width: 48px;
  max-width: 48px;
  text-align: center;
}

.general-results-table .screen-message-col {
  width: 70px;
  max-width: 70px;
  text-align: center;
}

.message-cell {
  min-width: 0;
  padding-left: 0.08rem;
  padding-right: 0.08rem;
}

.message-actions {
  display: flex;
  gap: 0.12rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.icon-text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 22px;
  color: #0f6fb8;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.message-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 22px;
  padding: 0 0.12rem;
  border: 1px solid rgba(15, 111, 184, 0.32);
  border-radius: 4px;
  color: #0f6fb8;
  background: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.whatsapp-chip {
  color: #087a3a;
  border-color: rgba(8, 122, 58, 0.32);
}

.sms-chip {
  color: #7a4d08;
  border-color: rgba(122, 77, 8, 0.32);
}

.muted-text {
  color: #748094;
  font-size: 0.78rem;
}

.subject-performance-sheet {
  margin-top: 1rem;
}

.subject-performance-head {
  display: inline-block;
  min-width: 0;
  padding: 0.65rem 0.85rem 0.35rem;
  background: #fff;
}

.subject-performance-head .general-title-block h2,
.subject-performance-head .general-title-block h3 {
  margin-bottom: 0.55rem;
}

.subject-performance-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

.subject-performance-table thead th {
  height: 58px;
}

.subject-performance-table th:nth-child(1),
.subject-performance-table td:nth-child(1) {
  width: 34px;
  text-align: center;
}

.subject-performance-table th:nth-child(2),
.subject-performance-table td:nth-child(2) {
  width: auto;
  min-width: 108px;
  white-space: nowrap;
}

.subject-performance-table .vertical-subject {
  width: 32px;
}

.subject-performance-table th:nth-child(n + 3):nth-child(-n + 7),
.subject-performance-table td:nth-child(n + 3):nth-child(-n + 7) {
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  text-align: center;
}

.subject-performance-table th:nth-child(8),
.subject-performance-table td:nth-child(8),
.subject-performance-table th:nth-child(9),
.subject-performance-table td:nth-child(9) {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
}

.subject-performance-table th:nth-child(10),
.subject-performance-table td:nth-child(10) {
  width: 104px;
  min-width: 104px;
  white-space: nowrap;
}

.sticky-status {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0.85rem 1rem;
  margin-bottom: 0.8rem;
  border-radius: 16px;
  background: rgba(239, 245, 255, 0.95);
  border: 1px solid rgba(31, 94, 255, 0.12);
  backdrop-filter: blur(10px);
}

#marks-save-status[data-tone="success"] {
  color: var(--success);
  border-color: rgba(19, 129, 74, 0.12);
  background: rgba(235, 251, 242, 0.95);
}

#marks-save-status[data-tone="error"] {
  color: var(--danger);
  border-color: rgba(200, 52, 52, 0.12);
  background: rgba(255, 240, 240, 0.95);
}

.alerts {
  margin-bottom: 1rem;
}

.alert {
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
}

.alert.success {
  background: #ebfbf2;
  color: var(--success);
  border-color: rgba(19, 129, 74, 0.12);
}

.alert.error {
  background: #fff0f0;
  color: var(--danger);
  border-color: rgba(200, 52, 52, 0.12);
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(31, 94, 255, 0.08);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
}

.panel {
  display: grid;
  gap: 0.65rem;
}

.panel-figure {
  background: linear-gradient(135deg, rgba(31, 94, 255, 0.1), rgba(54, 179, 255, 0.08));
  border-radius: 22px;
  min-height: 160px;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.panel-stat {
  display: grid;
  gap: 0.2rem;
}

.panel-stat strong {
  font-size: 1.4rem;
}

.grid-report {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.report-card {
  padding: 1.35rem;
}

.report-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: min(100%, 420px);
}

.report-crest {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--primary), var(--primary-3));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(31, 94, 255, 0.28);
  flex: 0 0 auto;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.report-toolbar .compact-panel {
  flex: 1 1 320px;
}

.report-toolbar .action-row {
  justify-content: flex-end;
  flex: 1 1 420px;
}

.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.report-card-page {
  page-break-after: always;
  break-after: page;
}

.sample-report-card {
  position: relative;
  overflow: hidden;
  max-width: 980px;
  margin: 0 auto 1rem;
  padding: 1.4rem 1.6rem 1.2rem !important;
  color: #000;
  background: #fff !important;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.sample-corner {
  position: absolute;
  inset: 0 auto auto 0;
  width: 240px;
  height: 240px;
  background: linear-gradient(135deg, #1eb53a 0 34%, #fcd116 34% 42%, #000 42% 58%, #fcd116 58% 66%, #00a3dd 66% 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  opacity: 0.98;
}

.sample-report-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.2rem;
  align-items: center;
  min-height: 142px;
}

.sample-logo {
  width: 178px;
  height: 178px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.1rem;
  background: #f8fafc;
  border: 8px solid #fff;
  outline: 2px solid #00a3dd;
  box-shadow: 0 12px 28px rgba(0, 163, 221, 0.2);
}

.sample-logo strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  color: #1eb53a;
  border-bottom: 4px solid #fcd116;
  line-height: 0.95;
}

.sample-logo span {
  display: block;
  margin-top: 0.4rem;
  max-width: 130px;
  color: #000;
  font-size: 0.8rem;
}

.sample-title-block {
  text-align: center;
  padding-top: 1.2rem;
}

.sample-title-block h1,
.sample-title-block h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.08em;
  color: #000;
  text-transform: uppercase;
}

.sample-title-block h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
}

.sample-title-block h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0.04em;
}

.sample-student-lines {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.3fr) minmax(82px, 0.45fr);
  gap: 0.55rem;
  margin: 0.75rem 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
}

.line-field {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  min-width: 0;
}

.line-field.wide {
  grid-column: span 2;
}

.line-field span {
  color: #000;
  white-space: nowrap;
}

.line-field strong {
  flex: 1;
  min-width: 0;
  min-height: 1.25rem;
  border-bottom: 1.5px solid #000;
  font-weight: 600;
  padding: 0 0.25rem 0.12rem;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-table-wrap {
  border-radius: 0;
  margin-top: 0.8rem;
}

.sample-report-table,
.sample-behavior-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Georgia, "Times New Roman", serif;
  background: #fff;
}

.sample-report-table {
  table-layout: fixed;
}

.sample-report-table th,
.sample-report-table td,
.sample-behavior-table th,
.sample-behavior-table td {
  border: 1.5px solid #000;
  padding: 0.46rem 0.55rem;
  font-size: 0.98rem;
}

.sample-report-table th,
.sample-behavior-table th {
  background: #d9f2df;
  color: #000;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.sample-report-table th:first-child,
.sample-report-table td:first-child {
  text-align: left;
}

.sample-report-table .report-subject-col {
  width: 34%;
}

.sample-report-table .report-exam-col {
  width: auto;
}

.sample-report-table .report-average-col {
  width: 14%;
}

.sample-report-table .report-grade-col {
  width: 10%;
}

.sample-report-table .report-comment-col {
  width: 22%;
}

.sample-report-table th:not(:first-child),
.sample-report-table td:not(:first-child),
.sample-behavior-table td:nth-child(2),
.sample-behavior-table td:nth-child(4) {
  text-align: center;
}

.sample-behavior-table {
  margin-top: 1rem;
}

.sample-behavior-table th {
  text-align: left;
}

.sample-behavior-table td {
  width: 25%;
}

.sample-feedback {
  margin-top: 1.15rem;
  font-family: Georgia, "Times New Roman", serif;
}

.sample-feedback h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.sample-feedback p {
  margin: 0.2rem 0;
  color: #000;
}

.feedback-line {
  height: 1.45rem;
  border-bottom: 1.5px solid #000;
}

.sample-signatures {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  justify-content: end;
  gap: 1.8rem;
  margin-top: 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

.sample-signatures span {
  display: block;
  margin-bottom: 1.6rem;
  font-weight: 600;
}

.sample-signatures i {
  display: block;
  border-bottom: 1.5px solid #000;
}

.report-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.report-card-heading h1 {
  margin: 0.45rem 0 0.25rem;
}

.report-card-heading p {
  margin: 0;
  color: var(--muted);
}

.report-card-stamp {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--primary), var(--primary-3));
  color: #fff;
  font-weight: 900;
}

.report-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.report-card-meta div,
.report-card-comments div {
  border: 1px solid rgba(16, 32, 56, 0.1);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.report-card-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.report-card-meta strong {
  display: block;
  margin-top: 0.28rem;
}

.report-card-comments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.report-card-comments p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.exam-setup-list {
  display: grid;
  gap: 0.85rem;
}

.exam-setup-card {
  display: grid;
  gap: 0.8rem;
}

.exam-setup-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.checkbox-list {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.checkbox-list label,
.checkbox-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-tile {
  background: #fff;
}

.summary-tile span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-tile strong {
  display: block;
  margin-top: 0.55rem;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.summary-tile small {
  color: var(--muted);
  display: block;
  margin-top: 0.35rem;
}

.auth-shell {
  max-width: 520px;
  margin: 3rem auto;
}

.auth-card {
  padding: 1.4rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #2445bd 0 49%, #edf3f8 49% 100%);
}

.auth-body::after {
  content: "";
  position: fixed;
  inset: 0 0 42% 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, transparent 0 56%, rgba(255, 255, 255, 0.12) 56% 58%, transparent 58%),
    linear-gradient(150deg, transparent 0 65%, rgba(255, 255, 255, 0.09) 65% 67%, transparent 67%),
    radial-gradient(circle at 92% 28%, rgba(0, 177, 255, 0.28), transparent 32%);
}

.auth-topbar {
  position: relative;
  z-index: 2;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  padding: 1.25rem 1.8rem;
}

.auth-topbar .brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: #2445bd;
  border: 3px solid rgba(255, 255, 255, 0.75);
}

.auth-topbar .brand {
  font-size: 1.85rem;
}

.auth-topbar .subtitle {
  max-width: 440px;
  font-size: 1.02rem;
  font-weight: 700;
  opacity: 0.96;
}

.auth-header-links {
  display: flex;
  gap: 2.2rem;
  align-items: center;
  font-weight: 800;
}

.auth-header-links a {
  color: #fff;
  text-decoration: none;
}

.portal-login {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.25rem;
  min-height: calc(100vh - 106px);
}

.portal-login > h1 {
  margin: 0 0 1.2rem;
  color: #fff;
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.portal-card {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(360px, 0.82fr);
  width: min(1180px, 100%);
  min-height: 430px;
  padding: 0.8rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(26, 38, 70, 0.28);
}

.portal-poster {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(24, 125, 176, 0.86), rgba(7, 91, 139, 0.94)),
    linear-gradient(135deg, #2b93c4, #0c5e96);
}

.portal-poster::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 72%;
  height: 45%;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-8deg);
}

.poster-ribbon {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem 0.8rem;
}

.poster-ribbon > div:last-child {
  margin-left: auto;
  text-align: right;
}

.poster-ribbon strong,
.poster-ribbon span {
  display: block;
}

.poster-ribbon strong {
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.poster-ribbon span {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.92;
}

.poster-seal {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  color: #17608c;
  font-weight: 900;
  border: 5px solid rgba(255, 255, 255, 0.45);
}

.poster-body {
  position: relative;
  z-index: 1;
  padding: 1.2rem 2.2rem 0.8rem;
  text-align: center;
}

.poster-brand-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 260px;
  padding: 2rem;
  text-align: center;
}

.poster-brand-panel strong {
  max-width: 620px;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.poster-kicker {
  margin-bottom: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.poster-body h2 {
  margin: 0 auto 0.75rem;
  max-width: 620px;
  font-size: 1.78rem;
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.poster-body p {
  margin: 0 auto;
  max-width: 560px;
  padding: 0.6rem 0.9rem;
  background: #b90808;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.poster-schedule {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 1.8rem 1.1rem;
  padding: 1rem;
  background: #fff;
  color: var(--text);
}

.poster-schedule div {
  padding: 0.65rem;
  border-left: 3px solid #2b7a9b;
  border-bottom: 1px solid #c7d7e6;
}

.poster-schedule span {
  display: block;
  color: #b90808;
  font-size: 0.78rem;
  font-weight: 900;
}

.poster-schedule strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.poster-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: auto;
  padding: 0.85rem 1rem 1.05rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.7rem 1.2rem 2.2rem 2.4rem;
}

.portal-welcome h2 {
  margin: 0 0 1rem;
  color: #3547c8;
  font-size: 2rem;
  letter-spacing: 0;
}

.portal-welcome p {
  margin: 0 0 1.8rem;
  color: #252525;
  font-size: 1.1rem;
  font-weight: 700;
}

.portal-form {
  display: grid;
  gap: 1.2rem;
}

.portal-field {
  position: relative;
  display: block;
}

.portal-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.portal-field input {
  height: 64px;
  padding: 1rem 3.7rem 1rem 3.35rem;
  border: 1px solid #d8d8d8;
  border-radius: 5px;
  background: #fff;
  font-size: 1.05rem;
}

.portal-field input:focus ~ .portal-field-icon,
.portal-field:focus-within .password-toggle {
  color: #3547c8;
}

.portal-field input:focus {
  border-color: #3547c8;
  box-shadow: 0 0 0 3px rgba(53, 71, 200, 0.12);
}

.portal-field-icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #56657a;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: color 160ms ease, stroke 160ms ease;
}

.portal-field input:focus ~ .portal-field-icon {
  stroke: currentColor;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent !important;
  color: #56657a !important;
  box-shadow: none !important;
}

.password-toggle:hover,
.password-toggle:focus {
  background: #eef3fb !important;
  color: #3547c8 !important;
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .password-eye-off {
  display: none;
}

.password-toggle.showing-password .password-eye {
  display: none;
}

.password-toggle.showing-password .password-eye-off {
  display: block;
}

.portal-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: #252525;
  font-size: 1.05rem;
  font-weight: 700;
}

.portal-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.portal-options input {
  width: 18px;
  height: 18px;
}

.portal-options a,
.portal-register a {
  color: #3547c8;
  text-decoration: none;
  font-weight: 800;
}

.portal-login-button {
  width: 100%;
  min-height: 58px;
  border-radius: 5px;
  background: #3b49c4;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.portal-register {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.portal-default {
  margin-top: 0.7rem;
  text-align: center;
  color: var(--muted);
}

.portal-footer {
  margin-top: auto;
  padding-top: 1.4rem;
  text-align: center;
  color: #6f7987;
  font-size: 0.98rem;
}

.portal-footer p {
  margin: 0.4rem 0;
}

.login-powered-footer {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 750;
  text-align: center;
}

.student-profile-shell {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.student-profile-hero,
.student-profile-grid,
.student-detail-grid {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.student-profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, auto);
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 86, 133, 0.12), rgba(255, 255, 255, 0) 48%),
    #fff;
  box-shadow: var(--shadow);
}

.student-photo-card {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
}

.student-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0b5685;
  color: #fff;
  font-size: 1.85rem;
  font-weight: 950;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(16, 32, 56, 0.14);
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.student-photo-form label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 34px;
  padding: 0.42rem 0.62rem;
  border-radius: 8px;
  background: #eef6fb;
  color: #0b5685;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.guardian-inline-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #f8fbfe;
}

.guardian-form-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: end;
}

.guardian-form-head strong {
  color: #11213a;
}

.guardian-form-head span {
  color: #687386;
  font-size: 0.82rem;
  font-weight: 750;
}

.guardian-inline-form label {
  gap: 0.35rem;
  color: #48596f;
  font-size: 0.82rem;
  font-weight: 900;
}

.guardian-inline-form input {
  min-height: 42px;
  padding: 0.68rem 0.78rem;
  border-radius: 8px;
}

.student-photo-form svg,
.profile-open-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-photo-form input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.student-profile-title {
  min-width: 0;
}

.student-profile-title > span {
  display: block;
  color: #0b5685;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.student-profile-title h1 {
  margin: 0.2rem 0 0.55rem;
  color: #11213a;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.student-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.student-profile-tags strong {
  display: inline-flex;
  padding: 0.38rem 0.58rem;
  border-radius: 7px;
  background: #eef6fb;
  color: #44576b;
  font-size: 0.8rem;
}

.student-status-card {
  display: grid;
  gap: 0.28rem;
  min-width: 190px;
  padding: 0.9rem;
  border-radius: 8px;
  background: #10233f;
  color: #fff;
}

.student-status-card span,
.student-metric-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.student-status-card strong {
  font-size: 1.15rem;
}

.student-status-card small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.student-profile-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(160px, 1fr));
  gap: 0.85rem;
}

.student-metric-card,
.student-info-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.student-metric-card {
  display: grid;
  align-content: space-between;
  gap: 0.55rem;
  min-height: 132px;
}

.student-metric-card span {
  color: #687386;
}

.student-metric-card > strong {
  color: #11213a;
  font-size: 2rem;
  line-height: 1;
}

.student-metric-card small {
  color: #687386;
  font-weight: 750;
}

.score-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.score-card span,
.score-card small {
  grid-column: 1;
}

.profile-score-ring {
  grid-row: 1 / span 3;
  grid-column: 2;
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(#0b5685 var(--score), #dfeaf2 0);
}

.profile-score-ring strong {
  color: #11213a;
  font-size: 1rem;
}

.student-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 0.85rem;
}

.profile-detail-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.profile-detail-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.65rem;
  border-radius: 8px;
  background: #f8fbfe;
}

.profile-detail-list dt {
  color: #687386;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-detail-list dd {
  margin: 0;
  color: #11213a;
  font-weight: 800;
}

.subject-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.65rem;
}

.subject-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.78rem;
  border-radius: 8px;
  background: #f8fbfe;
  border: 1px solid rgba(16, 32, 56, 0.06);
}

.subject-progress-card strong,
.subject-progress-card span {
  display: block;
}

.subject-progress-card strong {
  color: #0b5685;
  font-size: 0.9rem;
}

.subject-progress-card span {
  margin-top: 0.16rem;
  color: #687386;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-progress-card b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8f1f7;
  color: #0b5685;
}

.subject-progress-card i {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #0b5685 var(--subject-score), #dfeaf2 0);
}

.student-name-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.profile-open-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.34rem 0.52rem;
  border-radius: 8px;
  background: #eef6fb;
  color: #0b5685;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.profile-open-link:hover {
  background: #dff0f9;
  color: #083f66;
}

.guardian-status-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.32rem 0.52rem;
  border-radius: 8px;
  background: #fff4d8;
  color: #8a5a00;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.guardian-status-link:hover {
  background: #ffe8a3;
  color: #684200;
}

.guardian-assignment-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.guardian-assignment-status > span {
  color: #687386;
  font-weight: 900;
}

.whatsapp-test-actions {
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.whatsapp-test-result {
  min-height: 1.4rem;
  color: #687386;
  font-size: 0.9rem;
  font-weight: 800;
}

.whatsapp-test-result[data-tone="success"] {
  color: #177245;
}

.whatsapp-test-result[data-tone="error"] {
  color: #b42318;
}

.whatsapp-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.whatsapp-status-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #f8fbff;
}

.whatsapp-status-list .webhook-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr;
}

.whatsapp-status-list dt {
  color: #687386;
  font-weight: 800;
}

.whatsapp-status-list dd {
  margin: 0;
  color: #10233f;
  font-weight: 900;
  text-align: right;
}

.whatsapp-status-list dd.configured {
  color: #177245;
}

.whatsapp-status-list dd.missing {
  color: #b42318;
}

.whatsapp-status-list code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.guardian-module-head,
.guardian-module-grid {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.guardian-module-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.guardian-module-head h1 {
  margin: 0.55rem 0 0.25rem;
  font-size: 1.7rem;
  letter-spacing: 0;
}

.guardian-module-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guardian-module-stats {
  min-width: 160px;
  padding: 0.82rem;
  border-radius: 8px;
  background: #10233f;
  color: #fff;
  text-align: right;
}

.guardian-module-stats span,
.guardian-module-stats small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.guardian-module-stats strong {
  display: block;
  margin: 0.15rem 0;
  font-size: 2rem;
  line-height: 1;
}

.guardian-module-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 0.85rem;
}

.guardian-form-card,
.guardian-list-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.guardian-selected-student {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f8fbfe;
}

.small-avatar {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
}

.guardian-selected-student strong,
.guardian-selected-student span,
.guardian-selected-student small {
  display: block;
}

.guardian-selected-student span,
.guardian-selected-student small {
  color: var(--muted);
  font-weight: 750;
}

.guardian-registration-form {
  display: grid;
  gap: 0.85rem;
}

.guardian-registration-form input {
  min-height: 46px;
  border-radius: 8px;
}

.guardian-list {
  display: grid;
  gap: 0.5rem;
  max-height: 64vh;
  overflow: auto;
}

.guardian-student-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--text);
  text-decoration: none;
}

.guardian-student-row:hover,
.guardian-student-row.active {
  border-color: #9fc8dd;
  background: #eef7fc;
}

.guardian-student-row strong,
.guardian-student-row span {
  display: block;
}

.guardian-student-row span {
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.guardian-ok,
.guardian-missing {
  flex: 0 0 auto;
  padding: 0.32rem 0.48rem;
  border-radius: 999px;
  font-weight: 900;
}

.guardian-ok {
  background: #e6f7ed;
  color: #136b3a;
}

.guardian-missing {
  background: #fff4d8;
  color: #8a5a00;
}

@media (max-width: 860px) {
  .guardian-module-head,
  .guardian-module-grid {
    grid-template-columns: 1fr;
  }

  .guardian-module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .guardian-module-stats {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .student-profile-hero,
  .student-profile-grid,
  .student-detail-grid {
    grid-template-columns: 1fr;
  }

  .score-card {
    grid-template-columns: 1fr;
  }

  .profile-score-ring {
    grid-row: auto;
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .student-profile-hero {
    text-align: center;
  }

  .student-avatar,
  .profile-score-ring {
    justify-self: center;
  }

  .student-profile-tags {
    justify-content: center;
  }

  .profile-detail-list div {
    grid-template-columns: 1fr;
  }
}

.note-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.9rem 1rem;
  border-radius: 8px;
}

.footer-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.teacher-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.teacher-create-panel,
.teacher-profile-card {
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fbfdff;
}

.teacher-create-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.teacher-panel-head,
.teacher-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.teacher-panel-head strong,
.teacher-card-head strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.teacher-panel-head span,
.teacher-card-head span,
.teacher-card-head em {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.teacher-profile-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.9rem;
}

.teacher-profile-list {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.teacher-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fbfdff;
}

.teacher-profile-row strong,
.teacher-profile-row span {
  display: block;
}

.teacher-profile-row span {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.teacher-profile-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
}

.teacher-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.teacher-edit-form label:nth-child(1),
.teacher-edit-form label:nth-child(7),
.teacher-card-actions {
  grid-column: 1 / -1;
}

.teacher-card-actions,
.teacher-delete-form {
  display: flex;
  justify-content: flex-end;
}

.teacher-delete-form {
  padding-top: 0.2rem;
  border-top: 1px solid #e5ebf3;
}

@media (max-width: 720px) {
  .teacher-edit-form {
    grid-template-columns: 1fr;
  }

  .teacher-toolbar,
  .teacher-card-actions,
  .teacher-delete-form,
  .teacher-profile-row {
    justify-content: stretch;
  }

  .teacher-toolbar button,
  .teacher-card-actions button,
  .teacher-delete-form button,
  .teacher-profile-row .button {
    width: 100%;
  }

  .teacher-profile-row {
    align-items: stretch;
    flex-direction: column;
  }
}

pre {
  overflow: auto;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 3mm;
  }

  body {
    background: #fff !important;
    font-size: 9px;
  }

  .app-shell,
  .app-main {
    display: block !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  body::before,
  .sidebar,
  .topbar,
  .nav,
  .print-hide,
  .sticky-toolbar-shell,
  button,
  .button.secondary,
  .actions a[href*="import-marks"] {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .card,
  .page-hero,
  .report-card {
    box-shadow: none !important;
    border: 1px solid #cfd6e4;
    background: #fff !important;
    border-radius: 0 !important;
    margin-bottom: 8mm;
    padding: 6mm !important;
    break-inside: avoid;
  }

  .timetable-control-card,
  .timetable-load-card,
  .timetable-warning,
  .timetable-status,
  .timetable-head {
    display: none !important;
  }

  .timetable-sheet {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  .timetable-print-footer {
    display: block !important;
    margin-top: 1.5mm !important;
    text-align: right !important;
    color: #111 !important;
    font-size: 7px !important;
    font-weight: 700 !important;
  }

  .timetable-title {
    gap: 1px !important;
    margin-bottom: 3px !important;
  }

  .timetable-title strong {
    font-size: 11px !important;
  }

  .timetable-title span {
    font-size: 9px !important;
  }

  .timetable-scroll {
    overflow: visible !important;
  }

  .class-timetable {
    min-width: 0 !important;
    width: 100% !important;
    height: 166mm !important;
    table-layout: fixed !important;
  }

  .class-timetable th,
  .class-timetable td {
    border: 1px solid #000 !important;
    padding: 1px !important;
    color: #000 !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere !important;
    height: auto !important;
  }

  .class-timetable .timetable-cell {
    position: relative !important;
    padding: 0 2px 5px !important;
  }

  .class-timetable thead th,
  .class-timetable .day-col,
  .class-timetable .day-name,
  .class-timetable .break,
  .class-timetable .fixed {
    background: #f0f0f0 !important;
  }

  .class-timetable thead th {
    height: 7mm !important;
    font-size: 6.5px !important;
  }

  .class-timetable thead th small,
  .timetable-cell small {
    font-size: 4.3px !important;
  }

  .timetable-cell small {
    position: absolute !important;
    left: 2px !important;
    bottom: 0 !important;
    max-width: calc(100% - 4px) !important;
    line-height: 1 !important;
    color: #c00000 !important;
  }

  .timetable-cell strong {
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .class-timetable .day-col,
  .class-timetable .day-name {
    width: 28px !important;
  }

  .class-timetable .stream-col,
  .class-timetable .stream-name {
    width: 25px !important;
  }

  .class-timetable .break-col,
  .class-timetable .break {
    width: 28px !important;
  }

  .class-timetable .merged-break strong {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 75% !important;
    font-size: 13px !important;
    letter-spacing: 0.08em !important;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .class-timetable .merged-fixed strong {
    font-size: 13px !important;
    line-height: 1.15 !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
    letter-spacing: 0 !important;
  }

  .grid-report,
  .summary-grid,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    overflow: visible;
    border: 0 !important;
    max-height: none !important;
  }

  .general-results-sheet {
    border: 0 !important;
    box-shadow: none !important;
    width: 100%;
  }

  .general-results-head {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 6mm;
    padding: 0 0 6mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .general-title-block h1 {
    font-size: 18px;
  }

  .general-title-block h2,
  .general-title-block h3 {
    font-size: 15px;
  }

  .general-title-block h4 {
    font-size: 14px;
  }

  .division-matrix th,
  .division-matrix td {
    font-size: 10px;
    padding: 1px 2px;
    border-color: #f00 !important;
    border-style: double !important;
  }

  .division-matrix td:last-child {
    font-size: 13px;
  }

  .general-results-wrap {
    overflow: visible;
  }

  .general-results-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .general-results-table th,
  .general-results-table td {
    border-color: #9b4fd3 !important;
    border-style: double !important;
    color: #0070c0 !important;
    font-size: 7px;
    padding: 0 1px;
  }

  .general-results-table thead th {
    height: 92px;
    color: #f00 !important;
    background: #fff !important;
    font-size: 7px;
  }

  .general-results-table th:nth-child(1),
  .general-results-table td:nth-child(1) {
    width: 22px;
  }

  .general-results-table th:nth-child(2),
  .general-results-table td:nth-child(2) {
    width: 58px;
  }

  .general-results-table th:nth-child(3),
  .general-results-table td:nth-child(3) {
    width: 16px;
  }

  .general-results-table th:nth-child(4),
  .general-results-table td:nth-child(4) {
    width: 54px;
  }

  .general-results-table th:nth-child(5),
  .general-results-table td:nth-child(5) {
    width: 62px;
  }

  .general-results-table th:nth-child(6),
  .general-results-table td:nth-child(6) {
    width: 54px;
  }

  .general-results-table .vertical-subject {
    width: 18px;
  }

  .subject-performance-sheet {
    margin-top: 6mm;
    page-break-before: always;
    break-before: page;
  }

  .subject-performance-head {
    display: inline-block;
    min-width: 0;
    padding: 0 0 4mm;
  }

  .subject-performance-table {
    width: auto;
    min-width: 0;
    table-layout: auto;
  }

  .subject-performance-table thead th {
    height: 46px;
  }

  .subject-performance-table th:nth-child(1),
  .subject-performance-table td:nth-child(1) {
    width: 18px;
  }

  .subject-performance-table th:nth-child(2),
  .subject-performance-table td:nth-child(2) {
    width: auto;
    min-width: 62px;
    white-space: nowrap;
  }

  .subject-performance-table th:nth-child(n + 3):nth-child(-n + 7),
  .subject-performance-table td:nth-child(n + 3):nth-child(-n + 7) {
    width: 14px;
    min-width: 14px;
    max-width: 14px;
  }

  .subject-performance-table th:nth-child(8),
  .subject-performance-table td:nth-child(8),
  .subject-performance-table th:nth-child(9),
  .subject-performance-table td:nth-child(9) {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
  }

  .subject-performance-table th:nth-child(10),
  .subject-performance-table td:nth-child(10) {
    width: 48px;
    min-width: 48px;
    white-space: nowrap;
  }

  a {
    color: #000 !important;
    text-decoration: none;
  }

  table {
    border-collapse: collapse;
    table-layout: auto;
    width: 100%;
  }

  th,
  td {
    padding: 3px 5px;
    border: 1px solid #cfd6e4;
    font-size: 10px;
  }

  thead th {
    position: static !important;
    background: #eef3fb !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  tbody tr:hover {
    background: transparent !important;
  }

  .report-top,
  .report-brand,
  .report-actions,
  .report-toolbar,
  .report-badges,
  .section-title {
    display: block;
  }

  .report-actions,
  .actions {
    margin-top: 4mm;
  }

  .actions .button:not(.print-keep),
  .actions button:not(.print-keep) {
    display: none !important;
  }

  .hero-title {
    font-size: 18px;
  }

  .hero-subtitle,
  .section-meta,
  .chip {
    color: #000 !important;
  }

  .report-card-page {
    page-break-after: always;
    break-after: page;
  }

  .report-card-page:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }

  .sample-report-card {
    max-width: none;
    min-height: 277mm;
    padding: 8mm !important;
    border: 0 !important;
    margin: 0 !important;
  }

  .sample-corner {
    width: 190px;
    height: 190px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sample-report-head {
    grid-template-columns: 178px 1fr;
    min-height: 118px;
  }

  .sample-logo {
    width: 132px;
    height: 132px;
  }

  .sample-logo strong {
    font-size: 2.2rem;
  }

  .sample-student-lines {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.3fr) minmax(72px, 0.45fr);
    gap: 0.35rem;
    margin-left: 0;
    font-size: 9px;
  }

  .sample-report-table th,
  .sample-report-table td,
  .sample-behavior-table th,
  .sample-behavior-table td {
    font-size: 10px;
    padding: 4px 5px;
  }

  .sample-report-table thead th,
  .sample-behavior-table thead th {
    background: #d9f2df !important;
    color: #000 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sample-signatures {
    margin-top: 10mm;
  }

  .report-card-meta,
  .report-card-comments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 0.85rem;
  }

  .sidebar-brand {
    padding-bottom: 0.75rem;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .sidebar-nav a {
    width: auto;
    min-width: max-content;
  }

  .sidebar-logout {
    display: inline-flex;
    margin-top: 0.35rem;
  }

  .sticky-toolbar-shell {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .compact-stats,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .settings-nav a {
    min-width: max-content;
  }

  .workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-status {
    text-align: left;
  }

  .analytics-summary,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: minmax(88px, 0.8fr) minmax(120px, 1.4fr) 52px;
  }

  .auth-topbar {
    align-items: flex-start;
    padding: 1rem;
  }

  .auth-topbar .brand {
    font-size: 1.25rem;
  }

  .auth-header-links {
    gap: 1rem;
  }

  .portal-login {
    padding-top: 2rem;
  }

  .portal-login > h1 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    text-align: center;
  }

  .portal-card {
    grid-template-columns: 1fr;
    padding: 0.55rem;
  }

  .portal-form-panel {
    order: -1;
    padding: 1.6rem 1rem;
  }

  .portal-poster {
    min-height: 0;
  }

  .poster-schedule {
    grid-template-columns: 1fr;
  }

  .poster-ribbon {
    padding: 1rem;
  }

  .poster-body {
    padding: 1rem;
  }

  .poster-body h2 {
    font-size: 1.55rem;
  }

  .page-hero,
  .hero-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-side {
    justify-items: start;
  }

  .report-toolbar,
  .report-actions {
    align-items: stretch;
  }

  .sample-report-head,
  .sample-signatures {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .sample-student-lines {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.3fr) minmax(64px, 0.45fr);
    gap: 0.3rem;
    margin-left: 0;
    font-size: 0.76rem;
  }

  .line-field.wide {
    grid-column: span 1;
  }

  .sample-logo {
    width: 120px;
    height: 120px;
  }
}

.hide-admission-numbers .admission-number {
  display: none !important;
}

@media (max-width: 720px) {
  .marks-table-wrap {
    max-height: 58vh;
  }

  .container {
    padding: 0.85rem;
  }

  .card,
  .page-hero {
    border-radius: 8px;
    padding: 1rem;
  }

  .nav:not(.sidebar-nav) a,
  .button,
  button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .filters input,
  .filters select {
    min-width: 100%;
  }

  .toolbar-summary {
    margin-left: 0;
    width: 100%;
  }
}

/* Browser-style dashboard and mega menu */
.app-body {
  background: #6bb8ed;
}

.app-shell,
body.sidebar-collapsed .app-shell {
  display: block;
  min-height: 100vh;
}

.app-main {
  min-height: 100vh;
}

.app-body .topbar {
  align-items: center;
  min-height: 72px;
  padding: 0.72rem 1.55rem;
  background: rgba(247, 253, 255, 0.96);
  border-bottom: 1px solid rgba(24, 130, 168, 0.25);
  box-shadow: 0 1px 0 rgba(18, 80, 120, 0.08);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-brand .brand-mark {
  width: 42px;
  height: 42px;
  background: #0b5685;
  color: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.topbar-link {
  padding: 0.55rem 0.74rem;
  border-radius: 8px;
  color: #173760;
  font-weight: 850;
  text-decoration: none;
}

.topbar-link:hover,
.topbar-link.active {
  background: #e4f4fd;
  color: #0b5685;
}

.menu-toggle {
  width: 44px;
  height: 40px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #dff3fb !important;
  color: #0b5685 !important;
  border-color: #b8dceb;
}

.menu-toggle span {
  flex: 0 0 auto;
  transition: transform 160ms ease, opacity 160ms ease;
}

.module-menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.module-menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.module-menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.module-mega-menu[hidden] {
  display: none;
}

.module-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 1.35rem 1.8rem 2rem;
  background: #fff;
  border-bottom: 1px solid #d9e0ea;
  box-shadow: 0 18px 34px rgba(16, 32, 56, 0.12);
}

.module-menu-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
  color: #0b4074;
}

.module-menu-bar strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.15rem;
}

.menu-kicker {
  color: #53627a;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-menu-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d9e0ea;
  background: #fff !important;
  color: #4b5565 !important;
  font-size: 1rem;
  box-shadow: none;
}

.module-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: clamp(1rem, 3vw, 3.5rem);
}

.module-menu-column {
  display: grid;
  align-content: start;
  gap: 0.72rem;
}

.module-menu-column h2 {
  width: max-content;
  margin: 0 0 0.3rem;
  padding-bottom: 0.24rem;
  border-bottom: 2px solid #f4b000;
  color: #0a4a81;
  font-size: 1.08rem;
  font-weight: 750;
}

.module-menu-column a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #3a3f48;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.module-menu-column a svg {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-menu-column a:hover {
  color: #f4a800;
}

.app-body .container {
  width: 100%;
  max-width: none;
  padding: 0;
}

.app-body .alerts {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
}

.browser-dashboard {
  min-height: calc(100vh - 72px);
  padding: clamp(1.4rem, 4vw, 3.2rem) clamp(1rem, 6vw, 5.5rem) 3rem;
  background:
    linear-gradient(180deg, #6bb8ed 0%, #65b2e8 56%, #6bb8ed 100%);
  color: #11213a;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.school-wordmark {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.school-logo {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #0b5685;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(19, 66, 112, 0.16);
}

.school-wordmark h1 {
  margin: 0;
  color: #141747;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 900;
  letter-spacing: 0;
}

.school-wordmark p {
  margin: 0.2rem 0 0;
  color: rgba(17, 33, 58, 0.74);
  font-size: 1rem;
  font-weight: 750;
}

.weather-card {
  display: grid;
  gap: 0.4rem;
  width: min(230px, 100%);
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #574f6d;
  box-shadow: 0 12px 28px rgba(19, 66, 112, 0.12);
}

.weather-card strong {
  color: #272142;
}

.weather-card small {
  color: #0b5685;
  font-weight: 850;
}

.module-search {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: min(1160px, 78vw);
  margin: 0 auto 3rem;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(19, 66, 112, 0.12);
}

.module-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.module-search input {
  height: 68px;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 999px 0 0 999px;
  background: #fff;
  color: #27445d;
  font-size: 1.08rem;
  box-shadow: none;
}

.module-search button {
  min-width: 94px;
  height: 52px;
  margin-right: 0.5rem;
  border-radius: 999px;
  background: #0b5685 !important;
  color: #fff !important;
}

.shortcut-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 1.1rem;
  width: min(940px, 100%);
  margin: 0 auto 3.2rem;
}

.shortcut-card {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  color: #15304a;
  text-align: center;
  text-decoration: none;
  font-weight: 750;
}

.shortcut-card span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #fff;
  color: #0b5685;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(19, 66, 112, 0.12);
}

.shortcut-card span svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shortcut-card strong {
  display: block;
  max-width: 120px;
  min-height: 2.6em;
  color: #15304a;
  font-size: 0.92rem;
  line-height: 1.3;
}

.widgets-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto 1.3rem;
}

.widgets-heading h2 {
  margin: 0;
  color: #143747;
  font-size: 1.75rem;
  letter-spacing: 0;
}

.widgets-heading span {
  color: rgba(17, 33, 58, 0.74);
  font-weight: 750;
}

.widget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr) minmax(230px, 0.55fr);
  gap: 0.85rem;
  width: min(1180px, 100%);
  margin: 0 auto 0.9rem;
}

.school-widget {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(19, 66, 112, 0.1);
}

.dashboard-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-stats .stat {
  background: #f7fbff;
}

.performance-widget {
  display: grid;
  align-content: space-between;
  gap: 1rem;
}

.performance-score {
  color: #141747;
  font-size: 3.3rem;
  font-weight: 900;
  letter-spacing: 0;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.performance-metrics div {
  padding: 0.7rem;
  border-radius: 8px;
  background: #f5f8fb;
}

.performance-metrics span,
.clock-widget span {
  display: block;
  color: #687386;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.performance-metrics strong,
.clock-widget strong {
  display: block;
  margin-top: 0.25rem;
  color: #141747;
  font-size: 1.12rem;
}

.clock-widget {
  display: grid;
  gap: 0.85rem;
}

.clock-widget > div {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d9e0ea;
}

.clock-widget > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analysis-widget {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.analysis-widget .analytics-block {
  background: #f8fbfe;
}

.modern-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1rem;
}

.class-ring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 0.8rem;
}

.class-ring-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  min-height: 138px;
  padding: 0.85rem;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 86, 133, 0.08), rgba(255, 255, 255, 0) 48%),
    #fff;
}

.score-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(#0b5685 var(--score), #dfeaf2 0);
  box-shadow: inset 0 0 0 1px rgba(16, 32, 56, 0.06);
}

.score-ring span {
  color: #141747;
  font-size: 1.05rem;
  font-weight: 900;
}

.class-ring-copy {
  min-width: 0;
}

.class-ring-copy h4 {
  margin: 0;
  color: #11213a;
  font-size: 1rem;
}

.class-ring-copy p {
  margin: 0.18rem 0 0.65rem;
  color: #687386;
  font-size: 0.86rem;
  font-weight: 750;
}

.micro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.micro-stats span {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.32rem 0.45rem;
  border-radius: 7px;
  background: #eef6fb;
  color: #486174;
  font-size: 0.75rem;
  font-weight: 800;
}

.micro-stats strong {
  color: #0b5685;
}

.completion-strip {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.95) 10px 13px),
    #dce8f0;
}

.completion-strip i {
  display: block;
  width: var(--pass);
  min-width: 4px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b5685, #20a36b);
}

.grade-density-panel {
  display: grid;
  align-content: space-between;
  gap: 1rem;
}

.grade-orbit {
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.9rem;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 86, 133, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11, 86, 133, 0.06) 1px, transparent 1px),
    #f7fbff;
  background-size: 28px 28px;
}

.grade-bubble {
  width: var(--bubble);
  height: var(--bubble);
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.26) 34%, transparent 35%),
    color-mix(in srgb, #0b5685 var(--fill), #dfeaf2);
  color: #10233f;
  border: 1px solid rgba(16, 32, 56, 0.08);
  box-shadow: 0 12px 24px rgba(19, 66, 112, 0.12);
}

.grade-bubble strong {
  font-size: clamp(1rem, 2.4vw, 1.7rem);
  line-height: 1;
}

.grade-bubble span {
  margin-top: 0.18rem;
  color: rgba(17, 33, 58, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.grade-density-note {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(16, 32, 56, 0.08);
}

.grade-density-note strong {
  color: #0b5685;
  font-size: 1.7rem;
  line-height: 1;
}

.grade-density-note span {
  color: #687386;
  font-weight: 750;
  line-height: 1.35;
}

.timetable-head,
.timetable-control-card,
.timetable-load-card,
.timetable-warning,
.timetable-status {
  width: min(1220px, calc(100% - 2rem));
  margin: 1rem auto;
}

.timetable-filters {
  align-items: end;
  margin-bottom: 0;
}

.timetable-sheet {
  width: min(1220px, calc(100% - 2rem));
  margin: 1rem auto;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #111;
  box-shadow: var(--shadow);
}

.timetable-title {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.55rem;
  color: #111;
  text-align: center;
  text-transform: uppercase;
}

.timetable-status.needs-work {
  border-color: #f1c96a;
  background: #fff9e8;
}

.timetable-status.ok {
  border-color: #a9d6b0;
  background: #f0fbf2;
}

.timetable-ok-note {
  margin: 0;
  color: #245b2a;
  font-weight: 800;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timetable-suggestion-panel {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid #f1d898;
}

.timetable-suggestion-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.timetable-suggestion {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid #d4e2f4;
  border-radius: 8px;
  background: #f6f9fd;
}

.timetable-suggestion strong {
  color: var(--text);
}

.timetable-suggestion span {
  color: var(--primary);
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.timetable-suggestion p {
  margin: 0;
  color: #203047;
  line-height: 1.45;
}

.timetable-suggestion small {
  color: var(--muted);
  line-height: 1.35;
}

.timetable-title strong {
  font-size: 1.05rem;
}

.timetable-title span {
  font-size: 0.9rem;
  font-weight: 800;
}

.timetable-scroll {
  overflow-x: auto;
}

.timetable-print-footer {
  display: none;
}

.class-timetable {
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.class-timetable th,
.class-timetable td {
  border: 1px solid #222;
  padding: 0.25rem 0.28rem;
  text-align: center;
  vertical-align: middle;
}

.class-timetable .timetable-cell {
  position: relative;
  padding-bottom: 0.9rem;
}

.class-timetable thead th {
  background: #d9e8f5;
  color: #111;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.class-timetable thead th span,
.class-timetable thead th small {
  display: block;
}

.class-timetable thead th small {
  margin-top: 0.12rem;
  color: #333;
  font-size: 0.68rem;
  font-weight: 700;
}

.class-timetable .day-col,
.class-timetable .day-name {
  width: 44px;
  background: #eef3f8;
  color: #111;
  font-weight: 900;
}

.class-timetable .stream-col,
.class-timetable .stream-name {
  width: 64px;
  background: #f8fafc;
  color: #111;
  font-weight: 900;
}

.class-timetable .vertical-day {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-timetable .break-col,
.class-timetable .break {
  width: 48px;
  background: #f5f5f5;
}

.class-timetable .break strong,
.class-timetable .fixed strong {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
}

.class-timetable .merged-break {
  color: #111;
  background: #f1f1f1;
}

.class-timetable .merged-break strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 75%;
  font-size: 1rem;
  line-height: 1;
}

.class-timetable .merged-fixed {
  color: #111;
  background: #f0f0f0;
}

.class-timetable .merged-fixed strong {
  font-size: 0.92rem;
  line-height: 1.15;
  writing-mode: horizontal-tb;
  transform: none;
  letter-spacing: 0;
}

.class-timetable .lesson {
  background: #fff;
}

.class-timetable .lesson.double {
  background: #f7fbff;
}

.class-timetable .fixed {
  background: #f0f0f0;
}

.class-timetable .free {
  color: #999;
}

.timetable-cell strong {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 1.1rem;
  line-height: 1;
  min-height: 1.15rem;
  text-align: center;
}

.timetable-cell small {
  display: block;
  position: absolute;
  left: 0.28rem;
  bottom: 0.18rem;
  margin-top: 0;
  color: #c00000;
  font-size: 0.62rem;
  line-height: 1.1;
  text-align: left;
}

.unplaced-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.unplaced-list span {
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  background: #fff4d8;
  color: #71520b;
  font-weight: 800;
  font-size: 0.82rem;
}

.unplaced-table {
  display: grid;
  gap: 0.35rem;
}

.unplaced-row {
  display: grid;
  grid-template-columns: 105px 96px 86px minmax(120px, 0.8fr) 118px minmax(220px, 1.6fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid #f1d898;
  border-radius: 6px;
  background: #fff9e8;
  color: #4f3b08;
  font-size: 0.84rem;
}

.unplaced-head {
  background: #f8e7b5;
  color: #3d2b00;
  font-weight: 900;
}

.timetable-load-card input[type="number"] {
  max-width: 110px;
}

.timetable-load-card input[type="checkbox"] {
  width: auto;
}

@media (max-width: 1080px) {
  .topbar-actions .topbar-link {
    display: none;
  }

  .module-menu-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .widget-grid {
    grid-template-columns: 1fr;
  }

  .modern-analysis-grid {
    grid-template-columns: 1fr;
  }

  .module-search {
    width: min(900px, 100%);
  }
}

@media (max-width: 720px) {
  .app-body .topbar {
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 0.85rem;
  }

  .topbar-title {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions .user-pill {
    display: none;
  }

  .module-mega-menu {
    padding: 1rem;
  }

  .module-menu-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .browser-dashboard {
    padding: 1rem 0.85rem 2rem;
  }

  .dashboard-hero,
  .widgets-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .school-logo {
    width: 56px;
    height: 56px;
  }

  .weather-card {
    width: 100%;
  }

  .module-search {
    grid-template-columns: 1fr;
    border-radius: 8px;
    margin-bottom: 2rem;
  }

  .module-search input {
    height: 56px;
    border-radius: 8px 8px 0 0;
  }

  .module-search button {
    width: auto;
    margin: 0.5rem;
  }

  .shortcut-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .shortcut-card span {
    width: 64px;
    height: 64px;
  }

  .dashboard-stats,
  .performance-metrics {
    grid-template-columns: 1fr;
  }
}


select {
  min-height: 46px;
  line-height: 1.2;
}

.grid.two-col select {
  cursor: pointer;
  background-color: #fff;
}


/* Clean login refresh */
.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23, 74, 124, 0.08), rgba(19, 129, 74, 0.08)),
    #eef3f8;
}

.auth-body::after {
  content: none;
}

.auth-body .auth-topbar {
  display: none;
}

.auth-body .container {
  width: min(100%, 1120px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.clean-login {
  width: 100%;
  min-height: auto;
  padding: 0;
  display: grid;
  place-items: center;
}

.clean-login-card {
  width: min(440px, 100%);
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  padding: 1.35rem;
  background: #fff;
  border: 1px solid rgba(16, 32, 56, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(16, 32, 56, 0.14);
}

.clean-login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.clean-login-brand .brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.clean-login-brand strong,
.clean-login-brand span {
  display: block;
}

.clean-login-brand strong {
  font-size: 1.02rem;
  line-height: 1.2;
}

.clean-login-brand span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.clean-login-card .portal-welcome h2 {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 1.55rem;
}

.clean-login-card .portal-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.clean-login-form {
  gap: 0.85rem;
}

.clean-login-card .portal-field input {
  height: 50px;
  padding: 0.78rem 3.25rem 0.78rem 3rem;
  border-radius: 8px;
  border-color: var(--border);
  background: #fbfcfe;
  font-size: 0.96rem;
}

.clean-login-card .portal-field input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(29, 91, 151, 0.12);
  background: #fff;
}

.clean-login-card .portal-field input:focus ~ .portal-field-icon,
.clean-login-card .portal-field:focus-within .password-toggle {
  color: var(--primary-2);
}

.clean-login-card .portal-field-icon {
  left: 0.95rem;
  width: 20px;
  height: 20px;
}

.clean-login-card .password-toggle {
  right: 0.45rem;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

.clean-login-card .portal-login-button {
  min-height: 48px;
  margin-top: 0.15rem;
  border-radius: 8px;
  background: var(--primary);
  font-size: 0.96rem;
  letter-spacing: 0;
}

.clean-login-card .portal-login-button:hover,
.clean-login-card .portal-login-button:focus {
  background: var(--primary-2);
}

@media (max-width: 720px) {
  .auth-body .container {
    padding: 1rem;
  }

  .clean-login-card {
    padding: 1.05rem;
  }

  .clean-login-brand {
    align-items: flex-start;
  }
}
