:root {
  color-scheme: dark;
  --bg: #071012;
  --panel: #102024;
  --panel-strong: #172b30;
  --text: #f4f8f6;
  --muted: #afbfbb;
  --line: #294148;
  --accent: #82d5b2;
  --accent-strong: #b1f1d5;
  --danger: #ff8f8f;
  --warning: #ffd180;
  --radius: 18px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-style: normal;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body,
button,
input,
textarea,
select {
  font-style: normal;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, rgba(130, 213, 178, .12), transparent 36rem),
    var(--bg);
}

a { color: var(--accent-strong); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.portal-shell {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

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

.portal-brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.portal-brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #071012;
  background: var(--accent);
  font-size: 1.5rem;
  font-weight: 900;
}
.portal-brand-copy strong { display: block; font-size: 1rem; font-style: normal; }
.portal-brand-copy span { display: block; color: var(--muted); font-size: .84rem; font-style: normal; }

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

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.hero { padding: clamp(24px, 5vw, 54px); margin-bottom: 20px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -.05em; font-style: normal; }
.hero p { max-width: 68ch; color: var(--muted); font-size: 1.05rem; font-style: normal; }

.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 14px; }
.panel { padding: 20px; }
.panel h1, .panel h2, .panel h3, .panel p { font-style: normal; }
.panel h2, .panel h3 { margin: 0 0 10px; }
.panel-copy, .muted { color: var(--muted); }

.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-weight: 700; font-size: .92rem; font-style: normal; }
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #09171a;
  padding: 11px 12px;
  font-style: normal;
}
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }

.password-input {
  position: relative;
}
.password-input input {
  padding-right: 76px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 58px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 9px;
  color: var(--accent-strong);
  background: var(--panel-strong);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
}
.password-toggle:hover {
  border-color: var(--accent);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button,
.button-secondary,
.button-danger {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 800;
  font-style: normal;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}
.button { background: var(--accent); color: #071012; }
.button-secondary { background: var(--panel-strong); border-color: var(--line); color: var(--text); }
.button-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 65%, var(--line)); color: var(--danger); }

.status {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #09171a;
  font-style: normal;
}
.status[data-tone="success"] { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); color: var(--accent-strong); }
.status[data-tone="error"] { border-color: color-mix(in srgb, var(--danger) 70%, var(--line)); color: var(--danger); }
.status[data-tone="warning"] { border-color: color-mix(in srgb, var(--warning) 70%, var(--line)); color: var(--warning); }

.list { display: grid; gap: 10px; }
.list-card {
  width: 100%;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #0b191c;
  font-style: normal;
}
.list-card[data-active="true"] { border-color: var(--accent); }
.list-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.list-card h3, .list-card p { margin: 0; font-style: normal; }
.list-card p { margin-top: 7px; color: var(--muted); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: .82rem;
  font-style: normal;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  font-weight: 900;
  font-style: normal;
  color: var(--accent-strong);
}
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; font-style: normal; }

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

.student-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(36px, 6vw, 64px) 24px;
  min-height: 480px;
}

.student-empty-placeholder-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 15%, var(--panel-strong));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--accent-strong);
  font-size: 2rem;
  margin-bottom: 16px;
}

.student-empty-placeholder h2 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.student-empty-placeholder p {
  max-width: 48ch;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  margin: 0;
}

@media (min-width: 801px) {
  .dashboard-sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    padding-right: 4px;
  }
}

@media (max-width: 800px) {
  .portal-header { align-items: flex-start; }
  .portal-grid,
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .portal-shell { width: min(100% - 18px, 1180px); padding-top: 12px; }
  .portal-header { flex-direction: column; }
  .portal-actions { justify-content: flex-start; }
  .button, .button-secondary, .button-danger { width: 100%; }
  .inline-actions .button,
  .inline-actions .button-secondary,
  .inline-actions .button-danger { width: auto; }
}
