:root {
  --bg: #ece5d8;
  --paper: rgba(255, 251, 245, 0.92);
  --paper-strong: #fffdf8;
  --text: #1d1f1b;
  --muted: #5f6358;
  --line: rgba(35, 38, 31, 0.12);
  --line-strong: rgba(35, 38, 31, 0.22);
  --brand: #1b5e57;
  --brand-deep: #113e3a;
  --brand-soft: #d8efe7;
  --accent: #b64926;
  --danger: #9c2f2f;
  --danger-soft: #f8dddd;
  --success: #1d6a4f;
  --success-soft: #def4e8;
  --shadow: 0 28px 60px rgba(21, 24, 18, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(182, 73, 38, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(27, 94, 87, 0.18), transparent 22%),
    linear-gradient(180deg, #f5efe4 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(245, 239, 228, 0.78);
  border-bottom: 1px solid rgba(35, 38, 31, 0.08);
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.brand__title {
  font-size: 1.4rem;
  font-weight: 700;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar__nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.topbar__nav a.is-active,
.topbar__nav a:hover {
  color: var(--text);
  background: rgba(17, 62, 58, 0.08);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar__user span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-shell,
.auth-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.auth-shell {
  display: grid;
  align-items: center;
  min-height: 100vh;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 28px;
}

.auth-panel__intro,
.auth-card,
.hero-panel,
.panel,
.stat-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-panel__intro,
.hero-panel {
  padding: 34px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(247, 240, 228, 0.94)),
    var(--paper);
}

.auth-card,
.panel,
.stat-card {
  background: var(--paper);
  border-radius: 26px;
}

.auth-card {
  padding: 28px;
  align-self: stretch;
}

.auth-card h2,
.panel h2,
.panel h1 {
  margin: 0;
}

.auth-card__credentials {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.auth-card__credentials strong,
.detail-list dt {
  display: block;
  margin-bottom: 2px;
}

.auth-card__credentials span,
.detail-list dd,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}

.stack-form,
.lead-form {
  display: grid;
  gap: 18px;
}

.stack-form label,
.lead-form label {
  display: grid;
  gap: 8px;
}

.stack-form span,
.lead-form span {
  font-size: 0.94rem;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(27, 94, 87, 0.15);
  border-color: var(--brand);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.button--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
}

.button--small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.hero-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-panel--compact {
  align-items: start;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.flash {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.flash p {
  margin: 0;
}

.flash--success {
  background: var(--success-soft);
  border-color: rgba(29, 106, 79, 0.24);
}

.flash--error {
  background: var(--danger-soft);
  border-color: rgba(156, 47, 47, 0.2);
  color: #612020;
}

.flash--info {
  background: rgba(17, 62, 58, 0.08);
  border-color: rgba(17, 62, 58, 0.14);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 2.1rem;
  line-height: 1;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.stat-card--accent {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.stat-card--accent span,
.stat-card--accent p {
  color: rgba(255, 255, 255, 0.82);
}

.panel {
  padding: 28px;
}

.panel--narrow {
  max-width: 640px;
}

.subpanel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.panel__header--tight {
  align-items: center;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

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

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

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.pill,
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 62, 58, 0.12);
  background: rgba(27, 94, 87, 0.08);
  color: var(--brand-deep);
  font-size: 0.92rem;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.filter-pill.is-active {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.empty-state {
  padding: 28px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.45);
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.status-note {
  display: inline-grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.status-note span {
  font-size: 0.82rem;
}

.conversion-banner {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(17, 62, 58, 0.14);
  background: linear-gradient(135deg, rgba(27, 94, 87, 0.08), rgba(216, 239, 231, 0.7));
}

.conversion-banner h2 {
  margin: 0 0 8px;
}

.lead-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.lead-form__full,
.lead-form__actions {
  grid-column: 1 / -1;
}

.lead-form__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.detail-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.detail-list--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.detail-list dd {
  margin: 0;
}

.student-overview-grid {
  align-items: stretch;
}

.student-detail-grid {
  align-items: start;
}

.rich-note {
  min-height: 100%;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.rich-note p {
  margin: 0;
  line-height: 1.75;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.timeline-card__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}

.timeline-card__head strong {
  display: block;
}

.timeline-card__head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline-card p,
.timeline-card small {
  margin: 0;
}

.timeline-card p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.timeline-card small {
  color: var(--muted);
}

.comment-thread {
  display: grid;
  gap: 18px;
}

.comment-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.comment-card--reply {
  margin-top: 12px;
  background: rgba(216, 239, 231, 0.28);
}

.comment-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}

.comment-card__meta span,
.comment-card__attachment {
  color: var(--muted);
  font-size: 0.9rem;
}

.comment-card__message {
  margin: 0 0 10px;
  line-height: 1.75;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.reaction-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
}

.reaction-button strong {
  color: var(--text);
  font-size: 0.9rem;
}

.reaction-button--active {
  border-color: rgba(27, 94, 87, 0.28);
  background: rgba(216, 239, 231, 0.9);
  color: var(--brand-deep);
}

.comment-replies {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reply-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.check-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-panel,
  .content-grid,
  .lead-form,
  .stats-grid,
  .detail-list--grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .panel__header,
  .topbar__inner,
  .topbar__user {
    align-items: start;
  }

  .hero-panel,
  .panel__header,
  .topbar__inner {
    flex-direction: column;
  }

  .topbar__nav {
    margin-left: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .timeline-card__head {
    flex-direction: column;
  }

  .comment-card__meta {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell,
  .auth-shell {
    padding: 24px 16px 48px;
  }

  .auth-panel__intro,
  .auth-card,
  .hero-panel,
  .panel,
  .stat-card {
    padding: 22px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.3rem;
  }
}
