:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --bg: #f4f7fb;
  --card: #fff;
  --blue: #3157d5;
  --blue-dark: #263f9f;
  --teal: #0e9384;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 28px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.brand strong { display: block; font-size: 18px; }
.brand small, .sidebar-foot small { display: block; color: var(--muted); margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav a {
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
}
.nav a.active, .nav a:hover { background: #eef3ff; color: var(--blue); }
.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sidebar-foot a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
}
.main { padding: 34px; min-width: 0; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-head h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.05; }
.page-head p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.55; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 800;
}
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 18px; font-size: 18px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-size: 13px; }
label { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 9px 11px;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, .12);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; }
.btn {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.list { display: grid; gap: 10px; }
.list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.list-item strong { display: block; margin-bottom: 4px; }
.list-item span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.muted { color: var(--muted); }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.module-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
}
.module-card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 87, 213, .08); }
.module-card span, .module-card small { color: var(--muted); }
.module-card strong { font-size: 17px; }
.inline-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.compact-form, .series-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.compact-form select { flex: 1; min-width: 180px; }
.series-form select { width: auto; min-width: 115px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--blue);
  font-weight: 700;
}
.lesson-output {
  white-space: pre-wrap;
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  background: #101828;
  color: #f2f4f7;
  line-height: 1.55;
  overflow: auto;
}
.login-body {
  background:
    linear-gradient(90deg, rgba(23, 32, 51, .78), rgba(23, 32, 51, .34)),
    radial-gradient(circle at 28% 62%, #d9eef2 0, #d9eef2 22%, transparent 23%),
    linear-gradient(135deg, #c8d6f5, #eef5ff);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center end;
  padding: 48px 11vw;
}
.login-card {
  width: min(100%, 460px);
  padding: 42px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.login-brand strong { display: block; font-size: 26px; }
.login-brand small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.form-stack { display: grid; gap: 18px; }
.alert {
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #991b1b;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 22px; }
  .grid.two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-shell { place-items: center; padding: 24px; }
}

