:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667280;
  --line: #d8dedc;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --navy: #082545;
  --green: #17473b;
  --gold: #c7a970;
  --rose: #6f1d2d;
  --blue: #5d7f96;
  --shadow: 0 22px 60px rgba(8, 37, 69, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.is-hidden {
  display: none !important;
}

button,
input {
  font: inherit;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  background:
    linear-gradient(90deg, rgba(8, 37, 69, 0.88), rgba(23, 71, 59, 0.46)),
    url("./assets/login-education-background.png") center / cover;
}

.login-brand {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(26px, 5vw, 54px);
  color: #ffffff;
}

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

.login-brand strong {
  font-size: 22px;
}

.login-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  text-transform: uppercase;
}

.login-panel {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 32px));
  border: 1px solid rgba(216, 222, 220, 0.9);
  border-radius: 8px;
  padding: clamp(26px, 5vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 26px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.login-panel label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.login-panel button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.login-panel button:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.login-panel button,
.primary-button {
  width: 100%;
  margin-top: 22px;
  padding: 13px 16px;
  background: var(--green);
  color: #ffffff;
}

.login-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--rose);
  font-size: 13px;
  font-weight: 750;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px;
  background: var(--navy);
  color: #f8f6ef;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(199, 169, 112, 0.65);
  border-radius: 8px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

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

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 3px;
  color: rgba(248, 246, 239, 0.72);
  font-size: 11px;
  text-transform: uppercase;
}

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

.nav-list a {
  border-radius: 8px;
  padding: 12px 13px;
  color: rgba(248, 246, 239, 0.74);
  font-weight: 650;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.advisor-note {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(199, 169, 112, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.advisor-note span,
.advisor-note small,
.eyebrow,
.metric-grid span,
.task-meta,
.doc-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.advisor-note span,
.advisor-note small {
  color: rgba(248, 246, 239, 0.65);
}

.advisor-note strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 17px;
}

.portal-main {
  width: min(100%, 1500px);
  min-width: 0;
  padding: 28px clamp(22px, 3vw, 42px) 46px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1,
.hero-copy h2,
.panel h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.02;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
}

.topbar-actions {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 10px;
}

.session-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.parent-session {
  min-width: 150px;
  text-align: right;
}

.parent-session span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-session strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 11px 13px;
  background: #ffffff;
  color: var(--navy);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 37, 69, 0.46);
}

.modal-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 29px;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-panel label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.primary-button {
  margin-top: 0;
}

.secondary-button {
  border: 1px solid var(--line);
  padding: 13px 16px;
  background: #ffffff;
  color: var(--navy);
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.form-message.is-error {
  color: var(--rose);
}

.form-message.is-success {
  color: var(--green);
}

.select-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: stretch;
  min-height: 276px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--green);
  box-shadow: 0 18px 42px rgba(8, 37, 69, 0.1);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 3vw, 40px);
  color: #ffffff;
}

.status-chip,
.panel-badge,
.task-state,
.doc-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip {
  margin: 0 0 18px;
  background: rgba(199, 169, 112, 0.18);
  color: #f3d89c;
}

.hero-copy h2 {
  font-size: clamp(30px, 2.6vw, 42px);
  line-height: 1.08;
}

.hero-copy p:not(.status-chip) {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.68;
}

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

.primary-action,
.secondary-action {
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
}

.primary-action {
  background: var(--gold);
  color: var(--navy);
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.hero-media {
  position: relative;
  min-height: 100%;
  background: #f8f6ef;
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 0;
  opacity: 0.84;
}

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

.metric-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.metric-grid article {
  min-height: 132px;
  padding: 18px;
}

.metric-grid strong {
  display: block;
  margin: 10px 0 8px;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.05;
}

.metric-grid small {
  color: var(--muted);
  line-height: 1.4;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.content-grid.reverse {
  grid-template-columns: minmax(0, 1.24fr) minmax(340px, 0.76fr);
}

.panel {
  padding: clamp(20px, 2.1vw, 28px);
}

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

.panel h3 {
  font-size: 25px;
}

.panel-badge {
  background: rgba(93, 127, 150, 0.15);
  color: #36576f;
}

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

.score-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffdfa;
}

.score-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.score-card strong {
  display: block;
  margin: 9px 0;
  color: var(--green);
  font-size: 27px;
}

.score-card p,
.insight-list p,
.timeline p,
.task-card p,
.document-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.insight {
  border-left: 4px solid var(--gold);
  padding: 4px 0 4px 14px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  margin-top: 5px;
  border: 4px solid rgba(199, 169, 112, 0.35);
  border-radius: 999px;
  background: var(--green);
}

.timeline h4,
.task-card h4,
.document-card h4 {
  margin: 0 0 7px;
  font-size: 17px;
}

.timeline small {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-weight: 800;
}

.task-list,
.document-list {
  display: grid;
  gap: 12px;
}

.task-card,
.document-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffdfa;
}

.task-head,
.doc-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.task-state {
  flex: 0 0 auto;
  background: rgba(23, 71, 59, 0.12);
  color: var(--green);
}

.task-meta,
.doc-meta {
  margin-top: 12px;
  text-transform: none;
}

.doc-link {
  margin-top: 12px;
  background: rgba(111, 29, 45, 0.11);
  color: var(--rose);
}

@media (max-width: 980px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-brand,
  .login-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .login-brand {
    justify-self: start;
    padding-bottom: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    min-width: 0;
    overflow: hidden;
  }

  .nav-list {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-list a {
    min-width: 88px;
    text-align: center;
  }

  .advisor-note {
    display: none;
  }

  .overview-grid,
  .hero-section,
  .content-grid,
  .content-grid.reverse {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 190px;
    order: -1;
  }

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

@media (max-width: 640px) {
  .portal-main {
    padding: 20px 14px 34px;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .score-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .session-tools {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .parent-session {
    text-align: left;
  }

  .nav-list {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }

  .nav-list a {
    flex: 0 0 96px;
  }

  .hero-copy {
    padding: 26px 20px 30px;
  }

  .task-head,
  .doc-head,
  .panel-header {
    flex-direction: column;
  }
}
