:root {
  --surface: #f3f5f7;
  --card: #ffffff;
  --soft: #f1f4f7;
  --soft-strong: #e6ebf0;
  --line: #d7dee6;
  --line-soft: #e9edf2;
  --primary: #527da8;
  --primary-bright: #6f9bc3;
  --primary-soft: #edf4fa;
  --secondary: #5d9c99;
  --warning: #f59e0b;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --text: #273746;
  --muted: #627180;
  --faint: #919da8;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-soft: rgba(248, 250, 252, 0.62);
  --glass-line: rgba(255, 255, 255, 0.88);
  --glass-highlight: rgba(255, 255, 255, 0.98);
  --shadow: 0 24px 56px rgba(73, 103, 132, 0.14), 0 8px 20px rgba(39, 55, 70, 0.08);
  --shadow-soft: 0 16px 34px rgba(82, 125, 168, 0.1), 0 4px 12px rgba(39, 55, 70, 0.06);
  --glass-blur: blur(28px) saturate(165%);
  --radius-window: 18px;
  --radius-card: 16px;
  --radius-inner: 12px;
  --radius-control: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background:
    linear-gradient(118deg, rgba(147, 180, 211, 0.24) 0%, rgba(224, 234, 243, 0.08) 33%, transparent 50%),
    linear-gradient(242deg, rgba(202, 163, 171, 0.18) 0%, rgba(247, 232, 235, 0.07) 36%, transparent 54%),
    linear-gradient(165deg, transparent 40%, rgba(225, 190, 132, 0.11) 60%, transparent 78%),
    linear-gradient(18deg, rgba(164, 190, 184, 0.1) 0%, transparent 36%),
    linear-gradient(180deg, #f6f8fa 0%, #f2f4f7 52%, #f7f5f5 100%),
    var(--surface);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.btn.is-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 50%;
  top: 50%;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--primary);
  animation: login-spin 0.7s linear infinite;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 380px);
  display: grid;
  gap: 14px;
  padding: 34px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-card);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
}

.login-card h1, .login-card p { margin: 0; }
.login-card p, .login-error, .admin-indicator { color: var(--muted); font-size: 13px; }
.login-logo {
  width: 126px;
  height: 64px;
  justify-self: center;
  object-fit: contain;
}
.login-error { min-height: 18px; color: var(--danger); }
.login-record {
  justify-self: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.login-record:hover { color: var(--primary); text-decoration: underline; }
.login-submit { position: relative; min-height: 42px; }
.login-submit .login-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.42); border-top-color: #fff; border-radius: 50%; animation: login-spin 0.7s linear infinite; }
.login-submit.is-loading .login-button-label { display: none; }
.login-submit.is-loading .login-spinner { display: block; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-actions { display: flex; gap: 10px; margin-top: 8px; }
.login-actions .btn { flex: 1; }
.admin-indicator { padding: 0 4px; white-space: nowrap; }
.permission-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.permission-matrix fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: rgba(255, 255, 255, 0.48); }
.permission-matrix legend { padding: 0 4px; color: var(--text); font-size: 13px; font-weight: 800; }
.permission-options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.permission-matrix label { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 5px 7px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(255, 255, 255, 0.7); font-size: 12px; color: var(--muted); }
.permission-matrix label:has(input:checked) { border-color: #92b0ca; color: var(--primary); background: var(--primary-soft); }
.permission-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-legend span { display: inline-flex; gap: 5px; align-items: center; padding: 6px 8px; border-radius: 6px; color: var(--muted); background: var(--soft-strong); font-size: 12px; }
.permission-legend b { color: var(--text); }
@media (max-width: 640px) { .permission-matrix { grid-template-columns: 1fr; } }

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

.sidebar {
  position: sticky;
  top: 12px;
  height: calc(100vh - 24px);
  margin: 12px 0 12px 12px;
  padding: 22px 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.54));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-window);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
  overflow: hidden;
}

.sidebar::before,
.topbar::before,
.card::before,
.taxonomy-pane::before,
.sheet::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.12) 22%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0, transparent 2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 16px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.58);
}

.brand img {
  width: 108px;
  height: auto;
}

.brand strong {
  display: block;
  font-size: 13px;
  color: var(--primary);
}

.app-version {
  display: inline-block;
  margin-left: 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
}

.login-card h1 .app-version {
  color: var(--primary);
  font-size: 11px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s var(--ease-out);
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(82, 125, 168, 0.11), inset 0 1px 0 #fff;
  transform: translateX(3px);
}

.nav button.active {
  background: linear-gradient(135deg, rgba(225, 235, 245, 0.92), rgba(242, 232, 234, 0.68));
  border-color: rgba(255, 255, 255, 0.96);
  color: var(--primary);
  box-shadow: 0 12px 26px rgba(82, 125, 168, 0.16), inset 0 1px 0 var(--glass-highlight);
}

.nav button:focus-visible,
.btn:focus-visible,
.field:focus-visible,
.select:focus-visible,
.taxonomy-row-main:focus-visible {
  outline: 3px solid rgba(82, 125, 168, 0.28);
  outline-offset: 2px;
}

.main {
  min-width: 0;
  padding: 12px 32px 40px;
}

.topbar {
  min-height: 72px;
  margin-bottom: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.48));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 34px;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.data-source-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.data-source-badge.success {
  border-color: #a7f3d0;
  color: #047857;
  background: #ecfdf5;
}

.data-source-badge.warning {
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}

.data-source-badge.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.data-source-badge.neutral {
  border-color: #dbe4ee;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.86);
}

.compact {
  width: 148px;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(82, 125, 168, 0.17);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-out);
}

.btn:hover:not(:disabled) {
  background: #416b94;
  border-color: #416b94;
  box-shadow: 0 12px 24px rgba(82, 125, 168, 0.22);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #bfdbfe;
  box-shadow: none;
}

.btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  box-shadow: none;
}

.btn.danger:hover:not(:disabled) {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.metrics {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.metric {
  min-height: 98px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.48));
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 rgba(148, 163, 184, 0.12);
  transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s var(--ease-out);
}

.metric:hover {
  border-color: rgba(155, 183, 208, 0.9);
  box-shadow: 0 22px 42px rgba(82, 125, 168, 0.17), inset 0 1px 0 #fff;
  transform: translateY(-3px);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 26px;
  line-height: 32px;
  letter-spacing: 0;
}

.panel {
  min-width: 0;
  padding: 20px;
  overflow-x: auto;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.73), rgba(255, 255, 255, 0.52));
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 rgba(148, 163, 184, 0.1);
}

.panel-content { min-width: 0; }
.panel--scroll-workspace {
  height: min(680px, calc(100vh - 190px));
  min-height: 300px;
  display: flex;
  flex-direction: column;
}
.panel--scroll-workspace .panel-content {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0;
}

.panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.forum-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.forum-announcement-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.forum-announcement-admin strong,
.forum-announcement-admin p {
  display: block;
  margin: 0;
}

.forum-announcement-admin p {
  margin-top: 6px;
  color: var(--muted);
  white-space: pre-wrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.table-actions .btn {
  min-width: 38px;
}

.forum-post-content {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 180px;
}

.forum-post-content > span:not(.forum-post-tag) {
  color: var(--muted);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-bargain-details {
  min-width: 0;
  width: 100%;
}

.market-bargain-table {
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-bargain-table .table {
  min-width: 1500px;
  table-layout: fixed;
}

.market-bargain-table th:nth-child(1),
.market-bargain-table td:nth-child(1) { width: 360px; }
.market-bargain-table th:nth-child(2),
.market-bargain-table td:nth-child(2) { width: 230px; }
.market-bargain-table th:nth-child(3),
.market-bargain-table td:nth-child(3) { width: 190px; }
.market-bargain-table th:nth-child(4),
.market-bargain-table td:nth-child(4),
.market-bargain-table th:nth-child(5),
.market-bargain-table td:nth-child(5) { width: 190px; }
.market-bargain-table th:nth-child(6),
.market-bargain-table td:nth-child(6) { width: 120px; }
.market-bargain-table th:nth-child(7),
.market-bargain-table td:nth-child(7) { width: 220px; }

.market-bargain-table .muted-code,
.market-bargain-table td > br + * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.market-bargain-table td:nth-child(2),
.market-bargain-table td:nth-child(3),
.market-bargain-table td:nth-child(4),
.market-bargain-table td:nth-child(5),
.market-bargain-table td:nth-child(7) {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
}

.market-bargain-details summary {
  display: grid;
  gap: 4px;
  cursor: pointer;
  list-style-position: inside;
  min-width: 0;
}

.market-bargain-details summary::marker {
  color: var(--primary);
}

.market-bargain-details summary strong {
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.market-bargain-messages {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 12px 14px 12px 28px;
  border-left: 2px solid var(--line);
  background: rgba(248, 250, 252, 0.72);
}

.market-bargain-messages li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.market-bargain-messages li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.market-bargain-messages li > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.market-bargain-messages time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  margin-left: auto;
}

.market-bargain-messages p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 5px 0 0;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.market-bargain-text {
  white-space: pre-wrap;
}

.market-bargain-image-label {
  color: var(--muted);
  font-style: italic;
}

.forum-post-tag {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.forum-image-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.forum-image-thumb {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
}

.forum-image-thumb:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.forum-image-thumb.is-cover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface-tint, rgba(242, 91, 67, 0.08));
}

.forum-tag-sheet {
  width: min(560px, calc(100vw - 32px));
}

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

.forum-tag-form label,
.forum-tag-school {
  display: grid;
  gap: 7px;
}

.forum-tag-form label > span,
.forum-tag-school > span {
  color: var(--muted);
  font-size: 13px;
}

.forum-tag-school {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.58);
}

.field,
.select,
.textarea {
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-control);
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(39, 55, 70, 0.05), 0 5px 14px rgba(82, 125, 168, 0.06);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: #9bb7d0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(82, 125, 168, 0.14);
}

.textarea {
  width: 100%;
  min-height: 86px;
  padding: 12px;
  resize: vertical;
}

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

.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field-group {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-group > span {
  min-height: 18px;
  color: var(--text);
}

.field-group .field,
.field-group .select,
.field-group .textarea {
  min-width: 0;
}

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

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.feedback-content {
  min-width: 240px;
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.table th {
  color: var(--muted);
  background: rgba(241, 245, 249, 0.64);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th:first-child {
  border-top-left-radius: 8px;
}

.table th:last-child {
  border-top-right-radius: 8px;
}

.table td {
  color: #334155;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.72);
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Keep long order identifiers inside their own column on the admin order list. */
.orders-table {
  min-width: 1260px;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
  width: 190px;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
  width: 270px;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
  width: 210px;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
  width: 90px;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
  width: 110px;
}

.orders-table th:nth-child(6),
.orders-table td:nth-child(6) {
  width: 90px;
}

.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
  width: 390px;
}

.orders-table__number,
.orders-table__school {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep long withdrawal identifiers and errors inside their own columns. */
.withdrawals-table {
  min-width: 1160px;
}

.withdrawals-table th,
.withdrawals-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.withdrawals-table th:nth-child(1),
.withdrawals-table td:nth-child(1) { width: 180px; }

.withdrawals-table th:nth-child(2),
.withdrawals-table td:nth-child(2) { width: 230px; }

.withdrawals-table th:nth-child(3),
.withdrawals-table td:nth-child(3) { width: 112px; }

.withdrawals-table th:nth-child(4),
.withdrawals-table td:nth-child(4) {
  width: 96px;
  white-space: nowrap;
}

.withdrawals-table th:nth-child(5),
.withdrawals-table td:nth-child(5) { width: 250px; }

.withdrawals-table th:nth-child(6),
.withdrawals-table td:nth-child(6) { width: 292px; }

.withdrawals-table__review-id,
.withdrawals-table__user-id {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.withdrawals-table__amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.withdrawals-table__reason { line-height: 1.6; }

.withdrawals-table__reason .badge {
  vertical-align: middle;
  margin-top: 4px;
}

.withdrawals-table__error {
  margin-top: 6px;
  color: #b45309;
  font-size: 12px;
  line-height: 1.5;
}

.withdrawals-table__actions .row-actions { justify-content: flex-start; }

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.primary {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge.success {
  color: #047857;
  background: #d1fae5;
}

.badge.warning {
  color: #b45309;
  background: #fef3c7;
}

.badge.danger {
  color: #b91c1c;
  background: #fee2e2;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-inner);
  background: rgba(244, 246, 248, 0.76);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.finance-controls,
.finance-record-filters,
.finance-record-type-tabs,
.finance-record-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.finance-controls {
  margin-bottom: 14px;
}

.finance-controls .muted-code {
  align-self: center;
  max-width: none;
}

.finance-tabs,
.finance-record-type-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.finance-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.finance-tab:hover,
.finance-tab.active {
  border-color: rgba(155, 183, 208, 0.9);
  background: var(--primary-soft);
  color: var(--primary);
}

.finance-summary {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 14px;
}

.finance-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

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

.finance-svg-wrap {
  min-width: 0;
}

.finance-svg {
  display: block;
  width: 100%;
  min-height: 230px;
  overflow: visible;
}

.finance-svg polyline {
  vector-effect: non-scaling-stroke;
}

.finance-svg text {
  fill: var(--muted);
  font-size: 11px;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.finance-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 0 46px;
  color: var(--muted);
  font-size: 12px;
}

.finance-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.finance-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.finance-bars {
  display: grid;
  gap: 13px;
  padding-top: 8px;
}

.finance-bar-row > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.finance-bar-row b {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.finance-bar-row > i {
  display: block;
  height: 9px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--soft-strong);
}

.finance-bar-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-bright), var(--secondary));
}

.finance-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 180px;
  color: var(--muted);
  font-size: 13px;
}

.finance-loading .login-spinner {
  display: inline-block;
  border: 2px solid rgba(82, 125, 168, 0.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: login-spin 0.7s linear infinite;
}

.finance-record-filters {
  margin-bottom: 14px;
}

.finance-record-filters .field {
  min-width: min(280px, 100%);
  flex: 1 1 220px;
}

.finance-records-table {
  min-width: 920px;
}

.finance-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.finance-record-footer {
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.finance-record-footer > div {
  display: flex;
  gap: 8px;
}

.chart-box {
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-inner);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.38));
  box-shadow: 0 12px 28px rgba(82, 125, 168, 0.09), inset 0 1px 0 var(--glass-highlight);
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s ease, border-color 0.24s ease;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.todo-card {
  width: 100%;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.todo-card:hover {
  border-color: #c4d5e4;
  background: rgba(237, 244, 250, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(82, 125, 168, 0.12), inset 0 1px 0 #fff;
}

.chart-box h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.chart-box strong {
  color: var(--primary);
  font-size: 24px;
}

.bar {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bar i {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-bright), var(--secondary));
}

.link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.muted-code {
  display: inline-block;
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.school-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 16px;
  margin-top: 16px;
}

.taxonomy-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) minmax(320px, 1.25fr);
  gap: 12px;
  height: clamp(420px, calc(100vh - 330px), 640px);
  min-height: 0;
  margin-top: 16px;
}

.taxonomy-pane {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  background: linear-gradient(150deg, rgba(246, 248, 250, 0.72), rgba(237, 244, 250, 0.5));
  box-shadow: 0 12px 28px rgba(82, 125, 168, 0.09), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.taxonomy-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 12px;
}

.taxonomy-pane-head strong {
  font-size: 15px;
}

.taxonomy-pane-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taxonomy-list,
.major-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.taxonomy-list {
  flex: 1;
}

.taxonomy-row {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-inner);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 7px 16px rgba(82, 125, 168, 0.07), inset 0 1px 0 #fff;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
}

.taxonomy-row-main {
  flex: 1 1 auto;
}

.taxonomy-row > .btn {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}

.taxonomy-row.active {
  border-color: rgba(255, 255, 255, 0.98);
  background: linear-gradient(135deg, rgba(225, 235, 245, 0.9), rgba(242, 232, 234, 0.7));
  box-shadow: 0 12px 24px rgba(82, 125, 168, 0.14), inset 0 1px 0 #fff;
  transform: translateX(2px);
}

.taxonomy-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.taxonomy-row-main strong,
.taxonomy-row-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taxonomy-row-main strong {
  font-size: 13px;
}

.taxonomy-row-main span {
  color: var(--muted);
  font-size: 12px;
}

.taxonomy-row .btn {
  min-height: 34px;
  padding: 0 10px;
}

.taxonomy-pane .school-admin-form,
.taxonomy-pane .major-admin-form {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.taxonomy-pane--major .major-section {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
}

.taxonomy-pane--major .major-list {
  min-height: 0;
  max-height: 100%;
}

.school-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1.2fr) 120px 132px 160px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  background: rgba(248, 250, 252, 0.54);
  box-shadow: 0 12px 28px rgba(82, 125, 168, 0.08), inset 0 1px 0 #fff;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.section {
  animation: section-in 220ms var(--ease-standard) both;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.school-create-form .btn {
  width: 100%;
}

.school-admin-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.college-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-inner);
  background: rgba(248, 250, 252, 0.52);
  box-shadow: 0 9px 22px rgba(82, 125, 168, 0.08), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.college-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.school-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.school-admin-head strong {
  min-width: 0;
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.school-admin-head .muted-code {
  flex: 1;
  margin-top: 3px;
}

.school-admin-head .btn {
  flex: 0 0 auto;
}

.school-admin-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 132px 144px;
  gap: 10px;
  margin-bottom: 14px;
}

.school-admin-form .btn {
  width: 100%;
}

.major-section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.major-section-head,
.major-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 96px;
  align-items: center;
  gap: 10px;
}

.major-section-head {
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.major-row {
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 6px 14px rgba(82, 125, 168, 0.06), inset 0 1px 0 #fff;
}

.major-row strong {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.major-row .btn {
  width: 100%;
  min-height: 34px;
}

.major-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 144px;
  gap: 10px;
}

.major-admin-form .btn {
  width: 100%;
}

.banner-admin-toolbar {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  background: rgba(248, 250, 252, 0.54);
  box-shadow: 0 12px 28px rgba(82, 125, 168, 0.09), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.banner-admin-toolbar .field {
  width: 140px;
  background: #fff;
}

.banner-admin-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.banner-admin-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s ease;
}

.banner-admin-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 42px rgba(82, 125, 168, 0.14), inset 0 1px 0 #fff;
}

.banner-admin-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eaf2ff;
  border-bottom: 1px solid var(--line);
}

.banner-admin-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
}

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

.banner-slot-heading label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.banner-copy-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 2px;
}

.banner-copy-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.banner-upload-btn {
  position: relative;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
}

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

.banner-upload-btn.is-uploading {
  cursor: wait;
  opacity: 0.68;
  pointer-events: none;
}

.banner-admin-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.banner-crop-stage {
  width: min(520px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8edf3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  touch-action: none;
}

.banner-crop-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: grab;
  touch-action: none;
}

.banner-crop-stage canvas:active {
  cursor: grabbing;
}

.banner-crop-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.banner-crop-controls input[type="range"] {
  width: 100%;
}

.banner-crop-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.data-metrics {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.data-collection-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.data-collection-tabs button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.data-collection-tabs button strong {
  min-width: 26px;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text);
  background: var(--soft-strong);
  text-align: center;
}

.data-collection-tabs button.active {
  border-color: #9bb7d0;
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(82, 125, 168, 0.1);
}

.data-collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.data-record-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.data-record-toolbar .data-collection-head {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.data-record-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.data-record-tools .field {
  width: min(280px, 38vw);
}

.data-collection-head h3 {
  margin: 0;
  font-size: 15px;
}

.data-collection-head span,
.data-limit-note {
  color: var(--muted);
  font-size: 12px;
}

.data-record-list {
  display: grid;
  gap: 8px;
}

.data-record-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.data-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.data-record-select {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.data-record-select-placeholder {
  display: block;
  width: 16px;
  height: 16px;
}

.data-record {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.data-record summary {
  min-height: 46px;
  display: grid;
  grid-template-columns: 20px minmax(180px, 1fr) 120px 190px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.data-record summary strong,
.data-record summary span,
.data-record summary time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-record summary span,
.data-record summary time {
  color: var(--muted);
  font-size: 12px;
}

.data-record pre {
  max-height: 420px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
  color: #334155;
  background: #f8fafc;
  font: 12px/1.65 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.data-record-body {
  border-top: 1px solid var(--line-soft);
  background: rgba(248, 250, 252, 0.78);
}

.data-record-body pre {
  border-top: 0;
  background: transparent;
}

.data-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
}

.data-summary section { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-inner); background: rgba(255, 255, 255, 0.62); }
.data-summary h4 { margin: 0 0 8px; font-size: 13px; }
.data-summary dl { display: grid; gap: 6px; margin: 0; }
.data-summary dl div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
.data-summary dt { color: var(--muted); font-size: 12px; }
.data-summary dd { margin: 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }

.data-record-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.data-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.data-editor-sheet {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.data-editor-sheet .data-editor-fields { overflow-y: auto; min-height: 0; padding: 2px 4px 14px 0; }
.data-editor-sheet .data-editor-footer { flex: 0 0 auto; }

.data-editor-sheet .sheet-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  padding-bottom: 14px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.sheet-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.data-editor-fields {
  display: grid;
  gap: 10px;
}

.data-field-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 120px minmax(240px, 1.5fr) 76px;
  align-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-inner);
  background: rgba(255, 255, 255, 0.58);
}

.data-field-row .field,
.data-field-row .select {
  width: 100%;
}

.data-field-row .textarea {
  min-height: 74px;
}

.data-field-json {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.data-field-remove {
  width: 100%;
}

.data-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.data-delete-sheet {
  width: min(560px, 100%);
}

.data-delete-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-inner);
  background: rgba(248, 250, 252, 0.76);
}

.data-delete-summary span,
.data-confirm-field span {
  color: var(--muted);
  font-size: 12px;
}

.data-confirm-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.data-confirm-field code {
  color: var(--danger);
  font-weight: 800;
}

.data-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #78350f;
  background: #fffbeb;
  font-size: 13px;
  line-height: 1.6;
}

.data-safety-note strong {
  flex: 0 0 auto;
}

.section {
  display: none;
}

.section.active {
  display: grid;
  gap: 16px;
}

.shell.is-entering .sidebar,
.shell.is-entering .topbar,
.shell.is-entering .section.active > * {
  animation: surface-enter 0.56s var(--ease-out) both;
}

.shell.is-entering .topbar {
  animation-delay: 0.04s;
}

.shell.is-entering .section.active > :nth-child(1) {
  animation-delay: 0.09s;
}

.shell.is-entering .section.active > :nth-child(2) {
  animation-delay: 0.15s;
}

.shell.is-entering .section.active > :nth-child(3) {
  animation-delay: 0.21s;
}

.shell.is-entering .metric:nth-child(2),
.shell.is-entering .banner-admin-item:nth-child(2) {
  animation-delay: 0.13s;
}

.shell.is-entering .metric:nth-child(3),
.shell.is-entering .banner-admin-item:nth-child(3) {
  animation-delay: 0.17s;
}

.shell.is-entering .metric:nth-child(n + 4) {
  animation-delay: 0.21s;
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.modal.active {
  display: flex;
}

.sheet {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-window);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.24), inset 0 1px 0 #fff;
  backdrop-filter: blur(36px) saturate(175%);
  -webkit-backdrop-filter: blur(36px) saturate(175%);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet h3 {
  margin: 0;
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  min-width: 220px;
  padding: 14px 18px;
  border-radius: 12px;
  color: #fff;
  background: #172033;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.proof-preview {
  display: block;
  width: 100%;
  max-height: 68vh;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.proof-preview__open {
  display: inline-block;
  margin-top: 14px;
}

@media (max-width: 1200px) {
  .grid.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .banner-admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    margin: 10px;
    padding: 16px;
  }

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

  .main {
    padding: 8px 18px 24px;
  }

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

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .actions .btn {
    min-width: 96px;
  }

  .grid.metrics,
  .grid.two,
  .grid.three,
  .charts,
  .finance-summary,
  .finance-chart-grid,
  .form-grid,
  .school-create-form,
  .school-admin-form,
  .major-admin-form,
  .banner-admin-list {
    grid-template-columns: 1fr;
  }

  .data-record summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .data-record-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .data-record-tools {
    justify-content: flex-start;
  }

  .data-record-tools .field {
    width: 100%;
  }

  .data-field-row {
    grid-template-columns: 1fr 110px;
  }

  .data-field-value {
    grid-column: 1;
    grid-row: 2;
  }

  .data-field-remove {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .taxonomy-workspace {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .taxonomy-pane {
    height: 360px;
    max-height: min(360px, 42vh);
  }

  .finance-controls,
  .finance-record-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-controls .select,
  .finance-controls .muted-code,
  .finance-record-filters .field,
  .finance-record-filters .select {
    width: 100%;
  }

  .major-section-head {
    display: none;
  }

  .major-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .panel-head,
  .school-admin-head {
    flex-direction: column;
    align-items: stretch;
  }

  .school-admin-head .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .nav button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .sidebar {
    gap: 14px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .brand img {
    width: 96px;
  }

  .topbar h1 {
    font-size: 22px;
    line-height: 30px;
  }

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

  .banner-admin-toolbar .field,
  .compact {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .panel--scroll-workspace { height: min(620px, calc(100vh - 150px)); }

  .data-field-row {
    grid-template-columns: 1fr;
  }

  .data-field-remove {
    width: auto;
    justify-self: start;
  }

  .data-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .data-editor-footer .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .metric:hover {
    transform: none;
  }

  .shell.is-entering .sidebar,
  .shell.is-entering .topbar,
  .shell.is-entering .section.active > * {
    animation: none !important;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .sidebar,
  .topbar,
  .card,
  .taxonomy-pane,
  .banner-admin-toolbar,
  .sheet {
    background: #fff;
  }
}
