:root {
  --bg: #08111b;
  --bg-alt: #060e17;
  --panel: #101b2a;
  --panel-hover: #16243a;
  --line: #223247;
  --line-subtle: #182030;
  --text: #f4f7fb;
  --muted: #9eabbc;
  --muted2: #6b7c90;
  --cyan: #00c8ff;
  --cyan-dim: rgba(0, 200, 255, .12);
  --green: #35d394;
  --green-dim: rgba(53, 211, 148, .12);
  --warn: #f59e0b;
  --warn-dim: rgba(245, 158, 11, .12);
  --danger: #ff5c68;
  --danger-dim: rgba(255, 92, 104, .12);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-lg: 0 12px 48px rgba(0,0,0,.45);
  --sidebar-w: 220px;
  --header-h: 60px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.edu-shell {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "header header" "sidebar main";
  min-height: 100vh;
}
.edu-shell.no-sidebar { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }

.edu-header {
  grid-area: header;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,17,27,.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.edu-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.edu-brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: #172234; color: var(--cyan);
  display: grid; place-items: center; font-size: 20px; font-weight: 900;
}
.edu-header-right { display: flex; align-items: center; gap: 12px; }
.edu-user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  font-size: 13px; color: var(--muted);
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--cyan-dim);
  border: 1px solid var(--cyan); color: var(--cyan); display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}

.edu-sidebar {
  grid-area: sidebar;
  width: var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 16px 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}
.edu-nav-section { padding: 0 12px; }
.edu-nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted2); padding: 10px 8px 4px;
}
.edu-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 1px;
}
.edu-nav-item:hover { background: var(--panel-hover); color: var(--text); }
.edu-nav-item.active { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,200,255,.18); }
.edu-nav-spacer { flex: 1; }

.edu-main { grid-area: main; padding: 28px 32px; min-height: calc(100vh - var(--header-h)); }
.edu-page-title { font-size: 22px; font-weight: 800; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.edu-page-title small { font-size: 13px; font-weight: 500; color: var(--muted); }

.edu-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; transition: border-color .18s ease, background .18s ease;
}
.edu-card:hover { border-color: #304060; }
.edu-card.clickable { cursor: pointer; }
.edu-card.clickable:hover { background: var(--panel-hover); }
.edu-card-title {
  font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 12px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 18px; height: 40px; border-radius: var(--radius); font-size: 14px; font-weight: 700;
  border: 1px solid transparent; background: transparent; color: var(--text); white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--cyan); color: #04101a; }
.btn-success { background: var(--green); color: #04100a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--panel-hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 28px; font-size: 15px; }
.btn-full { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge-lan { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }
.badge-webrtc { background: var(--cyan-dim); border: 1px solid var(--cyan); color: var(--cyan); }
.badge-warn { background: var(--warn-dim); border: 1px solid var(--warn); color: var(--warn); }
.badge-danger { background: var(--danger-dim); border: 1px solid var(--danger); color: var(--danger); }
.badge-muted { background: var(--line); border: 1px solid var(--line); color: var(--muted); }
.badge-online { background: var(--green-dim); color: var(--green); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.form-input, .form-select, textarea {
  width: 100%; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--line);
  background: #0b1421; color: var(--text); padding: 0 13px; outline: none;
}
.form-input:focus, .form-select:focus, textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,200,255,.12);
}
textarea { padding: 12px 13px; min-height: 96px; resize: vertical; }

.radio-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #0b1421; cursor: pointer;
}
.radio-card:has(input:checked) { border-color: var(--cyan); background: var(--cyan-dim); }
.radio-card input[type="radio"] { margin-top: 2px; accent-color: var(--cyan); }
.radio-card-title { font-size: 14px; font-weight: 700; }
.radio-card-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; cursor: pointer; }
.check-row input { accent-color: var(--cyan); }

.edu-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.edu-table th {
  text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--line); background: #0b1421;
}
.edu-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-subtle); }
.edu-table tr:hover td { background: rgba(255,255,255,.02); }

.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.text-muted { color: var(--muted); }
.text-muted2 { color: var(--muted2); }
.text-cyan { color: var(--cyan); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.font-heavy { font-weight: 800; }
.grid { display: grid; }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--cyan);
  border-radius: 50%; animation: eduSpin .8s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.empty-state { display: grid; place-items: center; text-align: center; padding: 44px 16px; color: var(--muted); }
.empty-state .icon { font-size: 34px; margin-bottom: 12px; color: var(--muted2); }

.edu-modal-backdrop {
  position: fixed; inset: 0; z-index: 8000; background: rgba(0,0,0,.6);
  display: grid; place-items: center; animation: eduFadeIn .2s ease;
}
.edu-modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; max-width: 480px; width: calc(100% - 40px); box-shadow: var(--shadow-lg);
}
#edu-toast-root {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}

@keyframes eduSpin { to { transform: rotate(360deg); } }
@keyframes eduFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes eduSlideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .edu-shell { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .edu-sidebar { display: none; }
  .edu-main { padding: 22px 18px; }
  .edu-header { padding: 0 16px; }
}
