:root {
  --ink: #152034;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --navy: #13294b;
  --green: #1f7a58;
  --gold: #d59b24;
  --red: #bd3b35;
  --blue: #2368b4;
  --shadow: 0 18px 48px rgba(21, 32, 52, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: #101b30;
  color: #ffffff;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--green));
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 4px;
  color: #bdc6d6;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  background: transparent;
  color: #dbe4f3;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-icon,
.spark-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
}

.dashboard-icon {
  border-radius: 4px;
  box-shadow: inset 7px 0 0 currentColor;
}

.attendance-icon {
  border-radius: 50%;
}

.bible-icon {
  border-radius: 2px;
  border-left-width: 6px;
}

.pathfinder-icon {
  transform: rotate(45deg);
}

.quiz-icon {
  border-radius: 50%;
  border-bottom-color: transparent;
}

.report-icon {
  border-radius: 2px;
  border-top-width: 6px;
}

.spark-icon {
  border-radius: 50%;
  border-color: var(--gold);
  box-shadow: inset 0 0 0 4px #fff;
}

.side-note {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.side-note span {
  color: #bdc6d6;
  font-size: 0.88rem;
}

.main-area {
  min-width: 0;
  padding: 24px;
}

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

.eyebrow,
.hero-kicker {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border-radius: var(--radius);
  border: 1px solid transparent;
  min-height: 42px;
  padding: 0 15px;
  font-weight: 700;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover {
  background: #176447;
}

.secondary-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--navy);
}

.secondary-button:hover {
  border-color: var(--green);
}

.text-button {
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
}

.text-button.danger {
  color: var(--red);
}

.icon-button {
  display: grid;
  width: 42px;
  place-items: center;
  padding: 0;
  background: #ffffff;
  border-color: var(--line);
}

.full-width {
  width: 100%;
}

.hero-band {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f1c32;
  box-shadow: var(--shadow);
}

.hero-band img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(15, 28, 50, 0.88), rgba(15, 28, 50, 0.18));
}

.hero-overlay h2 {
  max-width: 720px;
  font-size: clamp(1.55rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.view-panel {
  display: none;
  margin-top: 22px;
}

.view-panel.active {
  display: block;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.workspace-panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(21, 32, 52, 0.06);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 122, 88, 0.22);
  outline-offset: 2px;
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-grid,
.report-layout,
.chat-layout,
.learning-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.chat-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.learning-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-panel,
.chat-panel,
.prompt-panel,
.tutor-panel,
.quiz-panel,
.report-card {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  min-height: 460px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.message {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: var(--radius);
  line-height: 1.45;
}

.message.user {
  align-self: flex-end;
  background: var(--navy);
  color: #ffffff;
}

.message.ai {
  align-self: flex-start;
  background: #eef6f1;
  color: #173d2d;
}

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

.prompt-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.prompt-panel button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  padding: 0 12px;
}

.segmented-control {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.segmented-control button {
  min-height: 38px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.segmented-control button.active {
  background: var(--navy);
  color: #ffffff;
}

.lesson-output {
  display: grid;
  gap: 10px;
  min-height: 220px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

.lesson-output p,
.tutor-panel p {
  color: #344054;
  line-height: 1.55;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef6f1;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 700;
}

.quiz-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.quiz-output {
  display: grid;
  gap: 12px;
}

.quiz-question {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

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

.option-grid button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  padding: 0 12px;
}

.option-grid button.correct {
  border-color: var(--green);
  background: #eef6f1;
  color: var(--green);
}

.option-grid button.incorrect {
  border-color: var(--red);
  background: #fff1f0;
  color: var(--red);
}

.answer-note {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.report-card {
  align-self: start;
}

.report-title {
  margin-bottom: 18px;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 800;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

dd {
  margin: 0;
  font-weight: 800;
}

.rating-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #ffffff;
}

.rating-band strong {
  color: #ffe08a;
}

@media print {
  .sidebar,
  .topbar,
  .hero-band,
  .section-heading,
  .form-panel,
  .view-panel:not(#reports) {
    display: none !important;
  }

  .app-shell,
  .main-area,
  .report-layout {
    display: block;
    padding: 0;
  }

  #reports,
  .report-card {
    display: block;
    box-shadow: none;
  }
}
