/* //comment// Global reset and typography baseline. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: #f3f6fb;
  color: #0f172a;
}

a {
  color: inherit;
}

/* //comment// Utility styles used across pages. */
.muted {
  color: #64748b;
}

.hidden {
  display: none;
}

.small-note {
  font-size: 12px;
}

/* //comment// Setup/login layout and cards. */
.auth-body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 16px;
}

.auth-wrap {
  width: 100%;
  max-width: 860px;
}

.setup-wrap {
  max-width: 1080px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
  padding: 24px;
}

.auth-card h1 {
  margin-top: 0;
}

/* //comment// Login page secondary action row spacing and responsive layout. */
.auth-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-actions .btn {
  width: 100%;
  min-height: 40px;
  text-align: center;
}

/* //comment// Main app shell using dark sidebar and light content area like references. */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  position: relative;
}

.sidebar {
  background: linear-gradient(180deg, #0b2e63 0%, #071a38 100%);
  color: #dbeafe;
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar-backdrop {
  display: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #e0ecff;
  background: rgba(255, 255, 255, 0.12);
}

.brand-logo-image {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  color: #f8fbff;
}

.brand p {
  margin: 4px 0 0;
  color: #9db5d8;
  font-size: 12px;
}

.menu-group {
  margin-top: 12px;
}

.group-title {
  margin: 0 8px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9db5d8;
}

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

.nav a {
  text-decoration: none;
  font-size: 13px;
  color: #d7e7ff;
  border-radius: 7px;
  padding: 9px 10px;
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.footer-role {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.main {
  padding: 0;
}

/* //comment// Topbar styling based on white utility bar from references. */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e3e9f3;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-title-wrap {
  display: grid;
  gap: 2px;
}

.sidebar-toggle-btn {
  display: none;
  width: 38px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.sidebar-toggle-btn span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 3px;
  background: #1e293b;
}

.sidebar-toggle-btn:hover {
  background: #f8fafc;
}

.topbar h2 {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.toolbar > h3,
.toolbar > p {
  margin: 0;
}

.toolbar .inline-form {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar .inline-form input,
.toolbar .inline-form select {
  width: clamp(170px, 24vw, 290px);
  max-width: 100%;
}

.icon-pill,
.avatar-pill {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #d6dfed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.icon-pill {
  position: relative;
  text-decoration: none;
  font-size: 12px;
  color: #334155;
}

.icon-pill:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.avatar-pill {
  font-size: 11px;
  font-weight: 700;
  color: #0b2e63;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  border: 1px solid #ffffff;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.user-meta {
  display: inline-grid;
  line-height: 1.1;
}

.user-meta strong {
  font-size: 13px;
}

.user-meta small {
  font-size: 11px;
  color: #64748b;
}

/* //comment// Main content container spacing after topbar. */
.main > .alert,
.main > .panel,
.main > .panel-grid-two,
.main > .panel-grid-three,
.main > .report-grid {
  margin-left: 16px;
  margin-right: 16px;
  margin-top: 16px;
}

/* //comment// Core surface/panel styles. */
.panel {
  background: #ffffff;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  padding: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  min-width: 0;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 21px;
}

.subpanel {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  overflow-x: auto;
  min-width: 0;
}

.subpanel h3,
.subpanel h4 {
  margin-top: 0;
}

.subpanel hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 14px 0;
}

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

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

/* //comment// Form controls and responsive field grids. */
.grid-form {
  display: grid;
  gap: 14px;
}

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

.grid > *,
.toolbar > *,
.bulk-actions > *,
.bulk-upload-form > *,
.bulk-export-actions > * {
  min-width: 0;
}

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

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

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

.grid-form label {
  font-size: 13px;
  color: #1e293b;
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.grid-form .full,
.grid .full {
  grid-column: 1 / -1;
}

.grid-form input,
.grid-form select,
.grid-form textarea,
.bulk-upload-form input,
.bulk-upload-form select,
.bulk-upload-form textarea,
.inline-form input,
.inline-form select,
.table td input,
.table td select,
.table td textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  padding: 9px 11px;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.grid-form textarea,
.table td textarea {
  resize: vertical;
  min-height: 76px;
}

.grid-form input::placeholder,
.grid-form textarea::placeholder,
.bulk-upload-form input::placeholder,
.bulk-upload-form textarea::placeholder,
.table td input::placeholder,
.table td textarea::placeholder {
  color: #94a3b8;
}

.grid-form input:focus,
.grid-form select:focus,
.grid-form textarea:focus,
.bulk-upload-form input:focus,
.bulk-upload-form select:focus,
.bulk-upload-form textarea:focus,
.inline-form input:focus,
.inline-form select:focus,
.table td input:focus,
.table td select:focus,
.table td textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.grid-form input:disabled,
.grid-form select:disabled,
.grid-form textarea:disabled,
.bulk-upload-form input:disabled,
.bulk-upload-form select:disabled,
.bulk-upload-form textarea:disabled,
.table td input:disabled,
.table td select:disabled,
.table td textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.grid-form select,
.bulk-upload-form select,
.inline-form select,
.table td select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.2em 100%;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.grid-form input[type="number"],
.bulk-upload-form input[type="number"],
.table td input[type="number"] {
  text-align: right;
}

.grid-form input[type="file"] {
  border-style: dashed;
  padding: 7px 8px;
}

.bulk-upload-form input[type="file"] {
  border-style: dashed;
  padding: 7px 8px;
}

.grid-form input[type="file"]::file-selector-button {
  border: 1px solid #c6d2e6;
  border-radius: 7px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 7px 11px;
  margin-right: 10px;
  cursor: pointer;
}

.bulk-upload-form input[type="file"]::file-selector-button {
  border: 1px solid #c6d2e6;
  border-radius: 7px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 7px 11px;
  margin-right: 10px;
  cursor: pointer;
}

.grid-form input[type="file"]::file-selector-button:hover {
  background: #e2e8f0;
}

.bulk-upload-form input[type="file"]::file-selector-button:hover {
  background: #e2e8f0;
}

.inline-form {
  margin: 0;
}

.inline-form select {
  min-width: 180px;
  border-radius: 999px;
  font-size: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
  background-color: #ffffff;
}

.inline-form input {
  min-width: 180px;
  border-radius: 999px;
  font-size: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
  background-color: #ffffff;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.table td .password-field input {
  min-width: 130px;
}

.password-toggle {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
}

.password-toggle:hover {
  background: #eef2f7;
}

.inline-check {
  display: flex !important;
  gap: 8px;
  align-items: center;
  font-weight: 500 !important;
}

.inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

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

.student-name-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.student-name-fields input:last-child {
  grid-column: 1 / -1;
}

.table td .student-name-fields input {
  min-width: 0;
}

.table td pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
}

.bulk-actions {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
}

.bulk-upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: end;
  gap: 10px 12px;
}

.bulk-upload-form label {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
}

.bulk-upload-form .btn {
  justify-self: start;
}

.bulk-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.recover-panel {
  border-color: #d9e3f3;
  background: #fbfdff;
}

.recover-form input {
  min-height: 40px;
  border-radius: 10px;
}

.recover-form .password-field {
  grid-template-columns: minmax(160px, 1fr) auto;
}

/* //comment// Buttons, chips, and alerts. */
.btn {
  border: 1px solid #c6d2e6;
  border-radius: 7px;
  padding: 8px 12px;
  background: #f8fbff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

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

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn.primary {
  background: linear-gradient(90deg, #1570ef 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #ffffff;
}

.btn.primary:hover {
  background: linear-gradient(90deg, #0f63d9 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
}

.btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn.tiny {
  font-size: 12px;
  padding: 6px 9px;
}

.chip {
  border-radius: 999px;
  border: 1px solid #d5e0ef;
  padding: 5px 10px;
  background: #ffffff;
  font-size: 12px;
}

.alert {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 12px;
  font-size: 13px;
}

.alert.success {
  background: #ecfdf3;
  border-color: #86efac;
  color: #14532d;
}

.alert.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.alert.warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

/* //comment// Tables for CRUD modules and score/report previews. */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 840px;
}

.table th,
.table td {
  border: 1px solid #e2e8f0;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #f5f8fd;
  color: #0f172a;
  font-weight: 600;
}

.table td input,
.table td select {
  min-width: 90px;
}

.table td input + input,
.table td input + select,
.table td select + input,
.table td select + select {
  margin-top: 6px;
}

.table tbody tr:hover {
  background: #f8fbff;
}

.table.compact td,
.table.compact th {
  padding: 6px;
}

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

.actions form {
  margin: 0;
}

.score-table .score-input {
  min-width: 76px;
  max-width: 88px;
  text-align: center !important;
  font-weight: 600;
}

.score-table {
  min-width: 1280px;
}

.score-table [data-cell="status"].error {
  color: #b91c1c;
}

.score-table [data-cell="status"] {
  font-weight: 600;
}

.grade-muted {
  color: #64748b;
}

.grade-green {
  color: #15803d;
  font-weight: 700;
}

.grade-blue {
  color: #1d4ed8;
  font-weight: 700;
}

.grade-amber {
  color: #b45309;
  font-weight: 700;
}

.grade-orange {
  color: #c2410c;
  font-weight: 700;
}

.grade-purple {
  color: #7e22ce;
  font-weight: 700;
}

.grade-red {
  color: #b91c1c;
  font-weight: 700;
}

/* //comment// Dashboard metric cards with color accents from reference UI. */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  padding: 13px;
}

.card h3 {
  margin: 0;
  font-size: 13px;
  color: #334155;
}

.card p {
  margin: 8px 0 10px;
  font-size: 40px;
  font-weight: 700;
}

.card-link {
  font-size: 12px;
  color: #3b82f6;
}

.tone-blue {
  background: linear-gradient(135deg, #e8f1ff 0%, #f6f9ff 100%);
}

.tone-green {
  background: linear-gradient(135deg, #eafbf2 0%, #f7fefb 100%);
}

.tone-amber {
  background: linear-gradient(135deg, #fff5e8 0%, #fffaf2 100%);
}

.tone-purple {
  background: linear-gradient(135deg, #f3ecff 0%, #faf7ff 100%);
}

.line-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.line-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

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

.pagination-bar {
  justify-content: space-between;
  margin-top: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #ffffff;
  text-decoration: none;
  padding: 14px;
  min-height: 142px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.admin-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.admin-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #0f172a;
}

.admin-card p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.admin-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.admin-card-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-card-meta h4 {
  margin: 0 0 6px;
}

.admin-card-meta p {
  margin: 0;
}

.admin-card-arrow {
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
  flex: 0 0 auto;
}

.admin-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #f8fbff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  min-height: 24px;
  padding: 0 9px;
}

.admin-card-open {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

/* //comment// Report cards page split layout. */
.report-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
}

.report-controls {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
  min-width: 0;
  overflow-x: auto;
}

.report-preview-pane {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
  min-width: 0;
  overflow-x: auto;
}

.summary-card {
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.result-preview {
  margin-top: 14px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.report-heading {
  padding: 10px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
  margin-bottom: 10px;
}

.report-heading h4 {
  margin: 0 0 4px;
  color: #0b2e63;
}

/* //comment// Template builder canvas and draggable placeholders. */
.builder-wrap {
  width: 100%;
  border: 1px solid #d1dae8;
  border-radius: 10px;
  background: #e2e8f0;
  padding: 10px;
  overflow: auto;
}

.builder-canvas {
  width: min(100%, 920px);
  aspect-ratio: 210 / 297;
  position: relative;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d1dae8;
}

.builder-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.builder-canvas img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  pointer-events: none;
}

.map-field {
  position: absolute;
  z-index: 2;
  border: 1px dashed #1570ef;
  background: rgba(21, 112, 239, 0.12);
  color: #0f172a;
  font-size: 11px;
  padding: 2px 4px;
  user-select: none;
  cursor: move;
  overflow: hidden;
}

.map-field.active {
  outline: 2px solid #22c55e;
}

.feature-list {
  margin: 0 0 12px;
  padding-left: 18px;
}

/* //comment// Notification center list styling for read/unread messaging states. */
.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.notification-list li {
  border: 1px solid #dbe5f1;
  border-radius: 9px;
  padding: 10px 11px;
  background: #ffffff;
}

.notification-list li.is-unread {
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}

.notification-list li.is-read {
  opacity: 0.92;
}

.notification-list p {
  margin: 8px 0;
  white-space: pre-wrap;
}

.notification-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

/* //comment// Responsive rules for tablet/mobile breakpoints. */
@media (max-width: 1180px) {
  .topbar h2 {
    font-size: 24px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-grid-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    max-width: 86vw;
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    z-index: 1100;
    height: 100vh;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(2, 6, 23, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1090;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .topbar-title-wrap {
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
  }
  .sidebar-toggle-btn {
    display: inline-flex;
    grid-row: 1 / span 2;
  }
  .topbar-title-wrap h2 {
    margin: 0;
  }
  .topbar-title-wrap .muted {
    margin: 0;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
  }
  .toolbar {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .inline-form {
    width: 100%;
  }
  .toolbar .inline-form {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .inline-form select,
  .inline-form input {
    width: min(100%, 320px);
    min-width: 0;
  }
  .bulk-actions {
    overflow-x: auto;
  }
  .bulk-upload-form {
    min-width: 0;
  }
  .bulk-export-actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .bulk-export-actions .btn {
    flex: 0 0 auto;
  }
  .panel-grid-two,
  .panel-grid-three,
  .admin-grid {
    overflow-x: auto;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .panel-grid-two {
    grid-template-columns: 1fr;
  }
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }
  .inline-three {
    grid-template-columns: 1fr;
  }
  .bulk-upload-form {
    grid-template-columns: 1fr;
  }
  .table {
    min-width: 760px;
  }
  .score-table {
    min-width: 1080px;
  }
  .report-preview-pane iframe {
    min-height: 520px;
    height: 72vh !important;
  }
}

@media (max-width: 560px) {
  .auth-body {
    padding: 12px;
  }
  .auth-card {
    padding: 16px;
  }
  .auth-actions {
    grid-template-columns: 1fr;
  }
  .topbar h2 {
    font-size: 18px;
  }
  .topbar {
    padding: 8px 10px;
  }
  .main > .alert,
  .main > .panel,
  .main > .panel-grid-two,
  .main > .panel-grid-three,
  .main > .report-grid {
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 10px;
  }
  .panel {
    padding: 12px;
  }
  .toolbar .inline-form input,
  .toolbar .inline-form select,
  .inline-form input,
  .inline-form select {
    width: min(100%, 260px);
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .table {
    min-width: 680px;
  }
  .score-table {
    min-width: 960px;
  }
  .report-preview-pane iframe {
    min-height: 460px;
    height: 68vh !important;
  }
  .admin-card {
    min-height: 0;
  }
  .admin-card-head {
    gap: 8px;
  }
}
