:root {
  --bg: #08101f;
  --bg-soft: #0e1730;
  --panel: rgba(18, 28, 58, 0.92);
  --panel-2: rgba(14, 22, 46, 0.95);
  --muted: #97a8d6;
  --text: #eef4ff;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #7ea8ff;
  --accent-2: #9fbcff;
  --accent-text: #091225;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(98, 128, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(126, 168, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #07101e 0%, #0a1430 100%);
  color: var(--text);
}

.page-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 24, 0.72);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.brand-wrap {
  margin-bottom: 24px;
}

.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.small-text {
  font-size: 13px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.sidebar-card,
.hero-card,
.dashboard-card,
.subjects-panel,
.builder-card,
.output-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 18px;
  margin-bottom: 18px;
}

.sidebar-card h3 {
  margin: 0 0 12px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 12px 14px;
  font-weight: 700;
}

.main {
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-card {
  padding: 28px;
  min-height: 220px;
  display: flex;
  align-items: center;
}

.hero-card h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 760px;
  margin: 0 0 18px;
  line-height: 1.6;
}

.hero-actions,
.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 103px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-card {
  padding: 20px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.recent-lessons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-lesson-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.recent-lesson-item strong {
  display: block;
  margin-bottom: 4px;
}

.recent-lesson-item small {
  color: var(--muted);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.subjects-panel {
  padding: 20px;
  margin-bottom: 20px;
}

.subject-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.subject-card {
  width: auto;
  min-width: 150px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.subject-card:hover {
  transform: translateY(-1px);
  opacity: 0.98;
  border-color: rgba(126, 168, 255, 0.45);
}

.builder-section {
  margin-bottom: 24px;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.builder-header h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(360px, 560px) 1fr;
  gap: 20px;
}

.builder-card,
.output-card {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

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

.field-full {
  grid-column: 1 / -1;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
}

select option {
  color: #000;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 22px rgba(126, 168, 255, 0.18);
}

button:hover {
  opacity: 0.97;
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line-strong);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.status {
  margin-top: 12px;
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.output-header {
  margin-bottom: 12px;
}

.output-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.output-actions button {
  width: auto;
  min-width: 145px;
}

.output-textarea {
  width: 100%;
  min-height: 720px;
  white-space: pre-wrap;
  line-height: 1.65;
  font-family: "Consolas", "Courier New", monospace;
  background: rgba(255, 255, 255, 0.03);
}

.saved-lessons-list,
.admin-framework-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-lesson-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.saved-lesson-card strong {
  display: block;
  margin-bottom: 4px;
}

.saved-lesson-card small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.lesson-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lesson-buttons button {
  width: auto;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.saved-lesson-card hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0 0;
}

.admin-filter-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1240px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .hero,
  .dashboard-row,
  .builder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .form-grid,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .field-full {
    grid-column: auto;
  }

  .hero-actions,
  .output-actions,
  .sidebar-actions {
    flex-direction: column;
  }

  .hero-actions button,
  .output-actions button,
  .sidebar-actions button {
    width: 100%;
  }

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

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

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

  .subject-cards {
    flex-direction: column;
  }

  .subject-card {
    width: 100%;
  }

  .hero-card h1 {
    font-size: 30px;
  }
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.auth-subtext {
  margin: 0 0 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-switch {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
}

.auth-switch a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

.auth-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 120, 120, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.2);
  color: #ffd0d0;
}

.account-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.plan-row span {
  color: var(--muted);
  font-size: 13px;
}

.plan-row strong {
  font-size: 13px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.pricing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
}

.pricing-card-featured {
  border-color: rgba(126, 168, 255, 0.35);
  box-shadow: 0 20px 60px rgba(126, 168, 255, 0.12);
}

.pricing-card-active {
  outline: 2px solid rgba(126, 168, 255, 0.45);
}

.pricing-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(126, 168, 255, 0.16);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pricing-card h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

.pricing-price {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.pricing-subprice {
  margin-bottom: 12px;
  font-size: 14px;
}

.pricing-features {
  margin: 18px 0 22px;
  padding-left: 18px;
  line-height: 1.9;
}

.pricing-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}
.ad-banner-row {
  margin-bottom: 20px;
}

.ad-placeholder {
  border: 1px dashed rgba(126, 168, 255, 0.45);
  background: linear-gradient(180deg, rgba(126, 168, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-radius: 18px;
  padding: 18px;
}

.ad-placeholder-sidebar {
  padding: 16px;
}

.ad-placeholder-horizontal {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ad-label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.ad-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}