:root {
  color-scheme: light;
  --primary: #0f5f5c;
  --primary-dark: #073f3d;
  --primary-soft: #d9efe9;
  --primary-pale: #edf7f3;
  --accent: #c8a35f;
  --accent-soft: #fff7e5;
  --bg: #f5faf8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647184;
  --line: #dce8e4;
  --danger: #b94a48;
  --danger-soft: #fff1f0;
  --success: #1f7a61;
  --warning: #a87024;
  --blue-green: #14776f;
  --shadow: 0 18px 48px rgba(7, 63, 61, 0.1);
  --shadow-soft: 0 10px 28px rgba(7, 63, 61, 0.07);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 95, 92, 0.12), transparent 30%),
    linear-gradient(225deg, rgba(200, 163, 95, 0.11), transparent 28%),
    linear-gradient(180deg, #fbfefd 0%, var(--bg) 48%, #edf6f2 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    linear-gradient(120deg, rgba(7, 63, 61, 0.9), rgba(15, 95, 92, 0.72)),
    linear-gradient(180deg, #eef7f3, #ffffff);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: "YANTAI VOCATIONAL COLLEGE";
  position: absolute;
  left: clamp(18px, 5vw, 72px);
  bottom: clamp(18px, 5vw, 60px);
  color: rgba(255, 255, 255, 0.08);
  font-size: clamp(42px, 9vw, 112px);
  font-weight: 900;
  line-height: 0.95;
  max-width: 860px;
}

.login-hero {
  width: min(1040px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.login-brand,
.login-panel {
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 70px rgba(5, 38, 37, 0.28);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.login-brand .school-en {
  color: rgba(255, 255, 255, 0.82);
}

.login-brand h1 {
  color: #ffffff;
  font-size: clamp(32px, 5vw, 52px);
}

.login-logo {
  width: 104px;
  height: 104px;
  flex-basis: 104px;
}

.login-subtitle {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  font-weight: 700;
}

.login-panel {
  align-self: center;
  min-height: 430px;
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
}

.login-panel h2 {
  color: var(--primary-dark);
  font-size: 24px;
}

.login-tip {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
}

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

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px clamp(16px, 4vw, 48px) 0;
  padding: 22px 26px;
  min-height: 138px;
  border: 1px solid rgba(220, 232, 228, 0.9);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(217, 239, 233, 0.92)),
    linear-gradient(120deg, #ffffff, #f8f1e3);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.app-header {
  border-top: 4px solid var(--primary);
}

.app-header::before {
  content: "YVCCCT";
  position: absolute;
  right: 34px;
  bottom: -14px;
  color: rgba(7, 63, 61, 0.055);
  font-size: clamp(42px, 8vw, 104px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.app-header::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  border: 1px solid rgba(15, 95, 92, 0.08);
  pointer-events: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 17px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.school-logo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border-radius: 50%;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(15, 95, 92, 0.18);
  box-shadow: 0 12px 28px rgba(7, 63, 61, 0.14);
  overflow: hidden;
}

.school-logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  display: block;
}

.logo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.school-en,
.section-kicker {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.12;
  color: var(--primary-dark);
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

.system-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.system-title strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
}

.system-title span {
  color: var(--muted);
  font-size: 14px;
}

.header-actions,
.toolbar,
.modal-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
}

.install-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px clamp(16px, 4vw, 48px) 0;
  padding: 14px 16px;
  border: 1px solid rgba(15, 95, 92, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.install-prompt div {
  display: grid;
  gap: 4px;
}

.install-prompt strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.install-prompt span {
  color: var(--muted);
  font-size: 13px;
}

.header-btn {
  min-height: 40px;
  box-shadow: none;
}

.layout {
  padding: 20px clamp(16px, 4vw, 48px) 24px;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.security-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px 18px;
  align-items: start;
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: var(--radius);
}

.security-panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 18px;
}

.inline-check {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.privacy-check {
  justify-self: end;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.rule-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.rule-title {
  flex-basis: 100%;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.panel,
.stat {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 232, 228, 0.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.panel {
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--primary), rgba(200, 163, 95, 0.68), transparent);
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 106px;
  padding: 18px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat {
  border-left: 4px solid rgba(15, 95, 92, 0.45);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(7, 63, 61, 0.1);
}

.stat::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: rgba(15, 95, 92, 0.07);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 900;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 7px;
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1;
}

.stat small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 30%) minmax(0, 70%);
  gap: 22px;
  align-items: start;
}

.student-form,
.list-panel {
  border-radius: var(--radius);
}

.student-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 12px;
  padding: 20px;
  position: sticky;
  top: 18px;
}

.form-title,
.list-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.form-title {
  padding-bottom: 2px;
}

.editing-notice {
  margin: 8px 0 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

label em {
  color: var(--danger);
  font-style: normal;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 95, 92, 0.13);
}

input.invalid,
select.invalid {
  border-color: var(--danger);
  background: #fffafa;
}

.field-error {
  min-height: 14px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 15px;
  font-weight: 900;
  color: var(--ink);
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(200, 163, 95, 0.36);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  min-height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 95, 92, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(220, 232, 228, 0.95);
}

.btn-danger,
.btn-danger-soft {
  color: var(--danger);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger-soft {
  background: var(--danger-soft);
  border-color: #ffd8d6;
}

.btn-text {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--primary);
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.list-panel {
  min-width: 0;
  overflow: hidden;
}

.list-head {
  padding: 20px 22px 0;
}

.list-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  padding: 14px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding-left: 13px;
  padding-right: 6px;
  background: #ffffff;
}

.search-box span {
  color: var(--primary);
  font-size: 20px;
}

.search-box input {
  border: 0;
  box-shadow: none;
  min-height: 42px;
  padding-left: 0;
}

.clear-search {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
}

.toolbar select {
  width: auto;
  min-width: 138px;
  min-height: 42px;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
  width: 100%;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  min-width: 1560px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin-right: 18px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 15%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 11%;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  width: 6%;
}

th:nth-child(5),
td:nth-child(5),
th:nth-child(6),
td:nth-child(6) {
  width: 13%;
}

th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9) {
  width: 8%;
}

th:nth-child(10),
td:nth-child(10) {
  width: 14%;
}

.student-data-table th:nth-child(1),
.student-data-table td:nth-child(1) {
  width: 8%;
}

.student-data-table th:nth-child(2),
.student-data-table td:nth-child(2) {
  width: 9%;
}

.student-data-table th:nth-child(3),
.student-data-table td:nth-child(3),
.student-data-table th:nth-child(4),
.student-data-table td:nth-child(4) {
  width: 5%;
}

.student-data-table th:nth-child(5),
.student-data-table td:nth-child(5) {
  width: 9%;
}

.student-data-table th:nth-child(6),
.student-data-table td:nth-child(6),
.student-data-table th:nth-child(7),
.student-data-table td:nth-child(7) {
  width: 12%;
}

.student-data-table th:nth-child(8),
.student-data-table td:nth-child(8),
.student-data-table th:nth-child(9),
.student-data-table td:nth-child(9) {
  width: 11%;
}

.student-data-table th:nth-child(10),
.student-data-table td:nth-child(10) {
  width: 8%;
}

.student-data-table th:nth-child(11),
.student-data-table td:nth-child(11) {
  width: 9%;
}

.student-data-table th:nth-child(12),
.student-data-table td:nth-child(12) {
  width: 12%;
}

.student-data-table th:nth-child(13),
.student-data-table td:nth-child(13) {
  width: 8%;
}

.student-data-table th:nth-child(14),
.student-data-table td:nth-child(14) {
  width: 12%;
}

.result-table th:nth-child(1),
.result-table td:nth-child(1) {
  width: 8%;
}

.result-table th:nth-child(2),
.result-table td:nth-child(2) {
  width: 7%;
}

.result-table th:nth-child(3),
.result-table td:nth-child(3) {
  width: 8%;
}

.result-table th:nth-child(4),
.result-table td:nth-child(4),
.result-table th:nth-child(5),
.result-table td:nth-child(5) {
  width: 12%;
}

.result-table th:nth-child(6),
.result-table td:nth-child(6) {
  width: 8%;
}

.result-table th:nth-child(7),
.result-table td:nth-child(7) {
  width: 9%;
}

.result-table th:nth-child(8),
.result-table td:nth-child(8) {
  width: 8%;
}

.result-table th:nth-child(9),
.result-table td:nth-child(9) {
  width: 9%;
}

.result-table th:nth-child(10),
.result-table td:nth-child(10) {
  width: 19%;
}

.result-table th:nth-child(11),
.result-table td:nth-child(11) {
  width: 13%;
}

.student-data-table th:last-child,
.student-data-table td:last-child,
.result-table th:last-child,
.result-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 150px;
  overflow: visible;
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(7, 63, 61, 0.08);
}

.student-data-table th:last-child,
.result-table th:last-child {
  z-index: 3;
  background: #f2f8f6;
}

.error-table {
  min-width: 980px;
}

.error-table th:nth-child(1),
.error-table td:nth-child(1) {
  width: 13%;
}

.error-table th:nth-child(2),
.error-table td:nth-child(2) {
  width: 8%;
}

.error-table th:nth-child(3),
.error-table td:nth-child(3),
.error-table th:nth-child(4),
.error-table td:nth-child(4),
.error-table th:nth-child(5),
.error-table td:nth-child(5) {
  width: 12%;
}

.error-table th:nth-child(6),
.error-table td:nth-child(6) {
  width: 18%;
}

.error-table th:nth-child(7),
.error-table td:nth-child(7) {
  width: 25%;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f8f6;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f7fcfa;
}

td {
  color: #263247;
  font-size: 14px;
}

.student-name {
  display: block;
  font-weight: 900;
  color: var(--ink);
}

.student-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  font-weight: 900;
  padding: 0 10px;
  font-size: 12px;
}

.status-pass {
  background: #e7f6ef;
  color: #167253;
}

.status-mismatch {
  background: #e9f3ff;
  color: #236a9f;
}

.status-missing,
.status-absent {
  background: #fff7e5;
  color: var(--warning);
}

.status-duplicate,
.status-format,
.status-invalid {
  background: #fff1f0;
  color: var(--danger);
}

.small-btn {
  min-height: 32px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

td .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 7px;
  min-width: max-content;
}

.student-data-table td:last-child .row-actions,
.result-table td:last-child .row-actions {
  justify-content: center;
}

.student-data-table td:last-child .small-btn {
  min-width: 48px;
}

.result-table td:last-child .small-btn {
  min-width: 56px;
}

.small-btn.edit {
  background: var(--primary);
  color: #ffffff;
}

.small-btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #ffd8d6;
}

.student-cards {
  display: none;
}

.student-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(7, 63, 61, 0.07);
}

.student-card + .student-card {
  margin-top: 12px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-badges {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 22px 0;
}

.tab-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 900;
}

.tab-btn.active {
  border-color: rgba(15, 95, 92, 0.28);
  background: var(--primary);
  color: #ffffff;
}

.wide-card {
  grid-column: 1 / -1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.card-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.card-actions .row-actions {
  width: 100%;
}

.card-actions .btn {
  flex: 1;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 236px;
  margin: 18px 22px 22px;
  padding: 28px 24px;
  border: 1px dashed rgba(15, 95, 92, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(237, 247, 243, 0.72));
  color: var(--muted);
  text-align: center;
}

.empty-state::before {
  content: "学";
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(217, 239, 233, 0.95), rgba(255, 247, 229, 0.95));
  color: var(--primary-dark);
  font-size: 24px;
  font-weight: 900;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state span {
  max-width: 420px;
  line-height: 1.6;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 clamp(16px, 4vw, 48px) 28px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.app-footer strong {
  color: var(--primary-dark);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  min-width: 220px;
  max-width: calc(100vw - 36px);
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--primary-dark);
  color: #ffffff;
  text-align: center;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 35, 39, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(420px, 100%);
  border-radius: 20px;
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-card p {
  margin: 12px 0 18px;
  color: var(--muted);
}

.modal-actions {
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .login-hero {
    grid-template-columns: 1fr;
  }

  .login-panel {
    align-self: stretch;
  }

  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .security-panel {
    grid-template-columns: 1fr;
  }

  .privacy-check {
    justify-self: start;
  }

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

  .student-form {
    position: static;
  }

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

  table {
    min-width: 920px;
  }
}

@media (max-width: 760px) {
  .login-screen {
    padding: 16px;
  }

  .login-hero {
    min-height: auto;
    gap: 16px;
  }

  .login-brand {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
    border-radius: 24px;
  }

  .login-logo {
    width: 84px;
    height: 84px;
    flex-basis: 84px;
  }

  .login-panel {
    min-height: auto;
    padding: 22px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 14px;
    padding: 22px;
  }

  .brand-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .school-logo {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
  }

  .system-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .stats-panel,
  .student-form,
  .security-panel {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .header-actions,
  .toolbar,
  .install-prompt {
    width: 100%;
  }

  .install-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions > *,
  .toolbar select {
    flex: 1 1 0;
  }

  .search-box {
    flex-basis: 100%;
  }

  .table-wrap {
    display: none;
  }

  .student-cards {
    display: block;
    padding: 16px;
  }

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

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
