:root {
  --bg: #081122;
  --bg-2: #0f1f3a;
  --ink: #e2e8f0;
  --muted: #93a4c7;
  --card: rgba(15, 31, 58, 0.78);
  --line: rgba(148, 163, 184, 0.25);
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --lime: #84cc16;
  --orange: #f97316;
  --rose: #fb7185;
  --radius: 18px;
  --shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(251, 113, 133, 0.2), transparent 40%),
    radial-gradient(900px 380px at 5% 0%, rgba(34, 211, 238, 0.2), transparent 45%),
    linear-gradient(155deg, var(--bg), var(--bg-2));
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  margin: 0 0 8px;
  line-height: 1.2;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #c7d7f2;
  font-weight: 600;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #f8fafc;
}

::-moz-selection {
  background: rgba(34, 211, 238, 0.3);
  color: #f8fafc;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 4px 4px;
  animation: drift 18s linear infinite;
  z-index: 0;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-120px); }
}

.app-wrap {
  width: min(1280px, 100%);
  margin: 20px auto;
  padding: 0 14px 24px;
  position: relative;
  z-index: 1;
}

.topbar {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(15, 31, 58, 0.95), rgba(8, 17, 34, 0.9));
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.topbar-name {
  color: var(--ink);
  font-weight: 600;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-btn {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.brand > div > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  color: var(--muted);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: grid;
  place-items: center;
  color: #001128;
  font-weight: 800;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 34, 0.6);
  padding: 3px;
}

.site-footer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 31, 58, 0.7);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--cyan);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 1500px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand {
    width: 100%;
  }

  .topbar-user {
    width: 100%;
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 72px;
    left: 10px;
    right: 10px;
    z-index: 40;
    display: none;
    max-height: calc(100vh - 90px);
    overflow: auto;
    backdrop-filter: blur(6px);
  }

  body.sidebar-open .sidebar {
    display: block;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .brand-subtitle {
    display: none;
  }
}

.sidebar,
.panel,
.card,
.table-wrap {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.sidebar {
  padding: 12px;
  align-self: start;
  position: sticky;
  top: 10px;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  border: 1px solid transparent;
  display: block;
  margin-bottom: 6px;
  transition: 0.2s;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(147, 164, 199, 0.08);
  text-decoration: none;
}

.main {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 31, 58, 0.6) 0%, rgba(15, 31, 58, 0.4) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 12px 48px rgba(34, 211, 238, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.panel > h3:first-child {
  margin-top: 0;
  color: #f0f9ff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.panel > h4:first-child {
  margin-top: 0;
  color: #e0f2fe;
  font-weight: 600;
}

.section-subtext {
  color: var(--muted);
  margin-top: 6px;
}

.section-subtext.compact {
  margin-top: 0;
}

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  color: #cfe9ff;
  padding: 10px 12px;
}

.panel-title {
  margin-top: 0;
}

.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-0 { margin-bottom: 0; }

.w-full { width: 100%; }

.flex-between-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.gap-8 { gap: 8px; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }

.justify-start { justify-content: flex-start; }
.items-center { align-items: center; }

.max-w-280 { max-width: 280px; }
.max-w-520 { max-width: 520px; }
.max-w-540 { max-width: 540px; }
.max-w-680 { max-width: 680px; }
.max-w-200 { max-width: 200px; }
.max-w-90 { max-width: 90px; }

.min-w-220 { min-width: 220px; }
.min-w-160 { min-width: 160px; }
.min-w-240 { min-width: 240px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-2-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto auto;
  gap: 10px;
  align-items: end;
}

.form-grid {
  display: grid;
  gap: 10px;
  align-items: end;
}

.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.grid-2fr-1fr-auto { grid-template-columns: 2fr 1fr auto; }
.grid-1_4fr-1fr-auto { grid-template-columns: 1.4fr 1fr auto; }
.grid-1_8fr-1fr-1_2fr-1_6fr-auto { grid-template-columns: 1.8fr 1fr 1.2fr 1.6fr auto; }
.grid-1fr-auto { grid-template-columns: 1fr auto; }
.grid-min220-360-auto { grid-template-columns: minmax(220px, 360px) auto; }
.grid-1_2fr-1_2fr-auto { grid-template-columns: 1.2fr 1.2fr auto; }
.grid-1_2fr-1_2fr-1_2fr-1_2fr-auto { grid-template-columns: 1.2fr 1.2fr 1.2fr 1.2fr auto; }
.grid-1_6fr-1_2fr-1_4fr-1fr-auto { grid-template-columns: 1.6fr 1.2fr 1.4fr 1fr auto; }
.grid-1_2fr-1fr-1fr-auto { grid-template-columns: 1.2fr 1fr 1fr auto; }
.grid-1_6fr-1_2fr-1_4fr-1_2fr-0_8fr-auto { grid-template-columns: 1.6fr 1.2fr 1.4fr 1.2fr 0.8fr auto; }
.grid-1_3fr-1fr-auto { grid-template-columns: 1.3fr 1fr auto; }

.grid-3x-auto-tight { grid-template-columns: 1fr 1fr 1fr auto; }
.grid-5x-auto { grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto; }
.grid-1_6fr-1fr-1fr-auto { grid-template-columns: 1.6fr 1fr 1fr auto; }
.grid-1fr-1fr-auto { grid-template-columns: 1fr 1fr auto; }

.grid-auto-fit-170 {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.grid-cycle-create { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-subject-add { grid-template-columns: 1.4fr 0.7fr 0.7fr auto; }
.grid-subject-bulk { grid-template-columns: 1.1fr 1.5fr 170px 170px 170px; }
.grid-subject-row { grid-template-columns: minmax(170px, 1.1fr) minmax(110px, 120px) minmax(110px, 120px) auto; }

.full-row { grid-column: 1 / -1; }

.text-center { text-align: center; }

.form-inline {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-toolbar-lg {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.tiny-muted {
  color: var(--muted);
  font-size: 0.95em;
}

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mb-14 { margin-bottom: 14px; }

.text-xs { font-size: 12px; }

.panel-canvas {
  background: #0a162b;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-stack form,
.action-stack a {
  display: inline-flex;
}

.action-stack .btn-secondary {
  min-width: 110px;
  justify-content: center;
}

.logo-preview-wrap {
  margin-top: 8px;
}

.logo-preview-img {
  max-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }

.dashboard-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-check-item {
  padding: 12px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.82);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-check-item strong {
  color: #f8fafc;
}

.dashboard-check-item p {
  margin: 0;
  font-size: 13px;
  color: #cbd5e1;
}

.dashboard-check-item .btn {
  width: fit-content;
  font-size: 12px;
}

.check-accent-blue { border-left: 4px solid #667eea; }
.check-accent-cyan { border-left: 4px solid #4facfe; }
.check-accent-pink { border-left: 4px solid #f093fb; }

.stat-card {
  color: #fff;
}

.stat-card small {
  color: rgba(255, 255, 255, 0.9);
}

.stat-card h2 {
  margin: 8px 0;
}

.stat-card a {
  color: #fff;
  text-decoration: underline;
  font-size: 12px;
}

.stat-card-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.status-box {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.status-box-primary {
  background: linear-gradient(135deg, #667eea10, #764ba210);
}

.status-box-alert {
  background: linear-gradient(135deg, #f5576c10, #f093fb10);
}

.status-box-ok {
  background: linear-gradient(135deg, #4facfe10, #00f2fe10);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icon {
  font-size: 24px;
}

.status-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: #cbd5e1;
}

.dashboard-hint {
  margin: 12px 0 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.summary-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}

.summary-box > div {
  margin-bottom: 4px;
}

.summary-box > div:last-child {
  margin-bottom: 0;
}

.publish-status-panel {
  background: rgba(14, 116, 144, 0.12);
  border-color: rgba(14, 116, 144, 0.4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card {
  padding: 12px;
  animation: rise 500ms ease both;
}

@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.card small {
  color: var(--muted);
}

.card h2, .card h3 {
  margin: 8px 0 0;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 31, 58, 0.6) 0%, rgba(15, 31, 58, 0.4) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 1px;
}

.marks-entry-table th:nth-child(n+4):not(:nth-last-child(-n+2)),
.marks-entry-table td:nth-child(n+4):not(:nth-last-child(-n+2)) {
  min-width: 110px;
  width: 110px;
}

.marks-entry-table td:nth-child(n+4):not(:nth-last-child(-n+2)) input,
.marks-entry-table td:nth-child(n+4):not(:nth-last-child(-n+2)) select {
  width: 100%;
  min-width: 100%;
  height: 42px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 680px;
}

tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

tbody tr:hover {
  background: rgba(34, 211, 238, 0.08);
}

tbody tr:last-child {
  border-bottom: none;
}

th, td {
  padding: 13px 14px;
  text-align: left;
}

th {
  background: rgba(8, 17, 34, 0.5);
  color: #a0c7f2;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 2px solid rgba(34, 211, 238, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

td strong {
  color: #f8fafc;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(8, 17, 34, 0.8) 0%, rgba(15, 31, 58, 0.6) 100%);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select {
  cursor: pointer;
}

select option {
  background: #0f1f3a;
  color: var(--ink);
}

select option:checked,
select option:hover,
select option:focus {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #001128;
}

select optgroup {
  background: #0f1f3a;
  color: #c7d7f2;
}

select[multiple] {
  min-height: 120px;
}

.input-auto {
  width: auto;
  min-height: auto;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.8);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(8, 17, 34, 0.9) 0%, rgba(15, 31, 58, 0.7) 100%);
}

button,
.btn {
  border: 0;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #001128;
  font-weight: 700;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.2);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, #06d6ff, #4a9eff);
}

.btn-secondary {
  background: rgba(147, 164, 199, 0.15);
  color: var(--ink);
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
  background: rgba(147, 164, 199, 0.25);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.15);
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.is-loading::after {
  content: '...';
  margin-left: 6px;
}

.alert {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.alert.success {
  border-color: rgba(132, 204, 22, 0.4);
  color: #d9f99d;
  background: rgba(132, 204, 22, 0.08);
}

.alert.error {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.08);
}

.input-invalid {
  border-color: rgba(251, 113, 133, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14) !important;
}

.footer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  background: rgba(8, 17, 34, 0.9);
  border-top: 1px solid var(--line);
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(147, 164, 199, 0.12);
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.badge-lg {
  font-size: 0.95rem;
  padding: 6px 13px;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.badge-ok:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.6);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.badge-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
}

.badge-info {
  background: rgba(14, 165, 233, 0.2);
  color: #a5f3fc;
  border-color: rgba(14, 165, 233, 0.4);
}

.badge-info:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(14, 165, 233, 0.6);
}

.text-success { color: var(--lime); }
.text-danger { color: var(--rose); }
.text-warning { color: var(--orange); }
.text-muted { color: var(--muted); }

.walkthrough-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.72);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 14px;
}

.walkthrough-dialog {
  width: min(640px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 31, 58, 0.97), rgba(8, 17, 34, 0.96));
  box-shadow: 0 18px 38px rgba(2, 8, 23, 0.45);
  padding: 16px;
}

.walkthrough-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.walkthrough-title {
  font-size: 1.1rem;
}

.walkthrough-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.walkthrough-body {
  margin: 0 0 14px;
  color: #dbeafe;
  line-height: 1.6;
}

.walkthrough-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

body.walkthrough-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand {
    width: 100%;
  }

  .topbar-user {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-name {
    max-width: 100%;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .topbar-user .btn {
    padding: 9px 12px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 72px;
    left: 10px;
    right: 10px;
    z-index: 40;
    display: none;
    max-height: calc(100vh - 90px);
    overflow: auto;
    backdrop-filter: blur(6px);
  }

  body.sidebar-open .sidebar {
    display: block;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-2-wide,
  .dashboard-checklist-grid,
  .dashboard-ops-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .form-grid-5,
  .form-grid-6 {
    grid-template-columns: 1fr;
  }

  .action-stack .btn-secondary {
    min-width: 90px;
  }

  button,
  .btn,
  input,
  select,
  textarea {
    min-height: 44px;
  }
}

.public-result-shell {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr;
  gap: 12px;
}

.public-notices,
.public-lookup {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

.public-head {
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  color: #021019;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.notice-list {
  list-style: none;
  padding: 10px;
  margin: 0;
  display: grid;
  gap: 8px;
  max-height: 68vh;
  overflow: auto;
}

.notice-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 17, 34, 0.45);
}

.notice-item.active {
  border-color: rgba(34, 211, 238, 0.8);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2) inset;
}

.notice-item a {
  display: block;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
}

.notice-item a:hover {
  text-decoration: none;
}

.notice-date {
  color: #93c5fd;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.notice-title {
  font-weight: 700;
  color: #e2e8f0;
}

.notice-text {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.notice-meta {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #67e8f9;
}

.public-lookup {
  padding-bottom: 10px;
}

.public-lookup form,
.lookup-note {
  margin: 10px;
}

.lookup-note {
  color: var(--muted);
}

@media (max-width: 980px) {
  .public-result-shell {
    grid-template-columns: 1fr;
  }
}

.auth-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 18px 0 28px;
}

.auth-glass {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  align-items: stretch;
}

.auth-hero,
.auth-card,
.result-closed-card {
  position: relative;
  overflow: hidden;
}

.auth-hero {
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 24px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.35), transparent 35%),
    radial-gradient(circle at bottom left, rgba(34, 211, 238, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(15, 31, 58, 0.96), rgba(8, 17, 34, 0.92));
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
}

.auth-badge,
.result-closed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.auth-hero h1,
.result-closed-card h1 {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.auth-hero p,
.result-closed-card p {
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 55ch;
}

.auth-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.auth-chips span {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
  color: #e2e8f0;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.auth-card {
  border-radius: 24px;
  background: rgba(15, 31, 58, 0.88);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-fields {
  display: grid;
  gap: 12px;
}

.auth-submit {
  width: 100%;
}

.auth-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-closed-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 18px 0 28px;
}

.result-closed-card {
  width: min(760px, 100%);
  text-align: left;
  border-radius: 24px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.22), transparent 35%),
    radial-gradient(circle at left, rgba(56, 189, 248, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(15, 31, 58, 0.96), rgba(8, 17, 34, 0.92));
  border: 1px solid rgba(251, 113, 133, 0.25);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
}

.result-closed-glow {
  position: absolute;
  inset: auto -10% -20% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.24), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.result-countdown {
  margin-top: 18px;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 14px;
  background: rgba(2, 28, 48, 0.62);
}

.result-countdown span {
  font-size: 0.98rem;
  color: #cceaff;
  letter-spacing: 0.02em;
}

.result-countdown strong {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #67e8f9;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.upcoming-live-panel {
  margin-top: 12px;
}

.upcoming-live-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.upcoming-live-card {
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 12px;
  background: rgba(8, 17, 34, 0.56);
  padding: 12px;
}

.upcoming-live-title {
  font-weight: 700;
  color: #e7f3ff;
}

.upcoming-live-meta {
  margin-top: 4px;
  color: #9fb6d9;
  font-size: 0.9rem;
}

.upcoming-live-timer {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.upcoming-live-timer span {
  color: #92dffd;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upcoming-live-timer strong {
  color: #38e6ff;
  font-size: 1.35rem;
  line-height: 1.1;
}

@media (max-width: 980px) {
  .auth-glass {
    grid-template-columns: 1fr;
  }
}

/* Enhanced visual improvements for admin dashboard */
.panel > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel p {
  margin: 8px 0;
  line-height: 1.6;
  color: #c7d7f2;
}

.panel small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

/* Callout style enhancements */
.callout {
  border: 1.5px solid rgba(34, 211, 238, 0.4);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0.06) 100%);
  backdrop-filter: blur(4px);
}

/* Checkbox improvements */
input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 18px;
  height: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
  filter: brightness(1.2);
}

/* Better spacing for form labels */
label {
  font-size: 0.93rem;
  font-weight: 600;
  color: #dae8f5;
  transition: color 0.2s ease;
}

/* Link button styles */
a.btn-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

a.btn-link:hover {
  border-bottom-color: var(--cyan);
}

/* Status badge improvements */
.text-success, .text-success strong {
  color: #86efac;
  font-weight: 600;
}

.text-danger, .text-danger strong {
  color: #fa8072;
  font-weight: 600;
}

.text-warning, .text-warning strong {
  color: #fbbf24;
  font-weight: 600;
}

.text-muted {
  color: #94a3b8;
}

/* Bulk actions form styling - 2-line button layout */
#bulkActionsForm {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

#bulkActionsForm > div {
  flex-basis: 100%;
}

#bulkActionsForm > button,
#bulkActionsForm > .btn-secondary {
  flex: 0 1 calc(50% - 5px);
  min-width: 140px;
}

@media (max-width: 1400px) {
  #bulkActionsForm > button,
  #bulkActionsForm > .btn-secondary {
    flex: 0 1 calc(50% - 5px);
  }
}

@media (max-width: 1024px) {
  #bulkActionsForm {
    gap: 8px;
  }
  
  #bulkActionsForm > button,
  #bulkActionsForm > .btn-secondary {
    flex: 0 1 calc(50% - 4px);
    min-width: 120px;
    font-size: 0.9rem;
  }
}

/* Bulk class select - 2 line horizontal layout */
#bulkClassSelect {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 10px !important;
  align-items: center;
  max-width: 100%;
  width: 100%;
}

#bulkClassSelect label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 0 !important;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

#bulkClassSelect label:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.4);
}

#bulkClassSelect input[type="checkbox"] {
  margin: 0 !important;
  flex-shrink: 0;
}

#bulkClassSelect span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #dae8f5;
}

/* Improved bulk actions section layout */
.panel-toolbar form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.panel-toolbar form > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-toolbar form > div > label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f0f9ff;
  margin-bottom: 0;
}

.panel-toolbar form select {
  max-width: 100%;
}

/* Button row in bulk actions */
.panel-toolbar form > button,
.panel-toolbar form > .btn-secondary {
  width: auto !important;
}

@media (max-width: 1200px) {
  #bulkClassSelect {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  #bulkClassSelect {
    grid-template-columns: 1fr !important;
  }
  
  #bulkClassSelect label {
    width: 100%;
  }
}
