:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #101827;
  --muted: #64748b;
  --line: #dbe3ee;
  --nav: #0b1220;
  --nav-soft: #111827;
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #047857;
  --red: #991b1b;
  --orange: #c2410c;
  --purple: #6d28d9;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.62)),
    url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-panel {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--nav);
  color: #fff7ed;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.login-panel h1 {
  margin: 22px 0 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 15px;
}

.form label,
.field label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 800;
  font-size: 13px;
}

.form input,
.form select,
.form textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

.form textarea {
  min-height: 92px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.form button,
.primary-button {
  border: 0;
  border-radius: 8px;
  background: var(--nav);
  color: #fff7ed;
  font-weight: 900;
  padding: 12px 16px;
}

.primary-button.danger {
  background: var(--red);
}

.form-error {
  min-height: 20px;
  color: var(--red);
  font-weight: 800;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 22px;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
}

.sidebar-brand strong {
  display: block;
  font-size: 16px;
}

.sidebar-brand span {
  color: #94a3b8;
  font-size: 12px;
}

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

.nav-item,
.logout-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 12px 13px;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: var(--nav-soft);
  border-color: #273449;
  color: #ffffff;
}

.logout-button {
  margin-top: auto;
  background: #1f2937;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 3px 0 0;
  font-size: 30px;
}

.topbar-user {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--nav);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.stat-card.green {
  border-left-color: var(--green);
}

.stat-card.blue {
  border-left-color: var(--blue);
}

.stat-card.red {
  border-left-color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.panel,
.table-shell,
.staff-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.panel {
  padding: 18px;
}

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

.panel h3 {
  margin: 0;
}

.grade-bars {
  display: grid;
  gap: 12px;
}

.grade-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px;
  gap: 10px;
  align-items: center;
}

.grade-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.grade-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.compact-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
  font-weight: 700;
}

.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.search-input {
  max-width: 480px;
}

.staff-board {
  display: grid;
  gap: 16px;
}

.staff-section {
  overflow: hidden;
}

.staff-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: var(--nav);
  color: white;
}

.staff-section-head h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 14px;
}

.staff-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-2);
}

.staff-card strong {
  display: block;
  font-size: 16px;
}

.staff-meta {
  display: grid;
  gap: 5px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 900;
}

.table-shell {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  background: var(--surface-2);
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

td a {
  color: var(--blue);
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
  font-size: 12px;
  background: #e2e8f0;
  color: #334155;
}

.pill.ok {
  background: #dcfce7;
  color: #166534;
}

.pill.bad {
  background: #fee2e2;
  color: #991b1b;
}

.pill.wait {
  background: #fef3c7;
  color: #92400e;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.62);
  padding: 20px;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  background: var(--nav);
  color: white;
}

.modal-head h3 {
  margin: 0;
}

.modal-close {
  border: 0;
  background: #1f2937;
  color: white;
  border-radius: 8px;
  padding: 8px 10px;
}

.modal-body {
  padding: 22px;
}

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

.span-2 {
  grid-column: span 2;
}

@media (max-width: 980px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .span-2 {
    grid-column: auto;
  }
}
