:root {
  --bg: #f3f2ec;
  --panel: #fffdf8;
  --line: #ddd7cb;
  --text: #171613;
  --muted: #676154;
  --accent: #0f766e;
  --accent-2: #dd6b20;
  --accent-3: #123b35;
  --soft: #f0ebe1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 24%),
    radial-gradient(circle at bottom right, rgba(221, 107, 32, 0.09), transparent 22%),
    linear-gradient(180deg, #f8f6f0 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.layout-public {
  grid-template-columns: 1fr;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid rgba(221, 215, 203, 0.7);
  background:
    linear-gradient(180deg, rgba(18, 59, 53, 0.98) 0%, rgba(16, 50, 46, 0.98) 100%);
  position: sticky;
  top: 0;
  height: 100vh;
  color: #f3f6f3;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(145deg, #14b8a6 0%, #fb923c 100%);
  color: #102421;
}

.sidebar-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(243, 246, 243, 0.62);
}

.sidebar h1 {
  margin: 0;
  font-size: 1.45rem;
}

.sidebar nav {
  display: grid;
  gap: 10px;
}

.sidebar nav a {
  text-decoration: none;
  font-weight: 700;
  color: rgba(243, 246, 243, 0.84);
  padding: 12px 14px;
  border-radius: 14px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-footer {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
}

.user-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.user-card span {
  display: block;
  font-size: 0.76rem;
  color: rgba(243, 246, 243, 0.62);
  margin-bottom: 6px;
}

.user-card strong {
  color: #fff;
}

.content {
  padding: 36px;
}

.content-public {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 40px 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(37, 31, 22, 0.07);
}

.login-panel {
  width: 100%;
  max-width: 520px;
  justify-self: center;
  align-self: center;
}

.login-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 520px);
  gap: 36px;
  align-items: center;
}

.login-shell-single {
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.login-shell-single > * {
  width: 100%;
  max-width: none;
}

.login-hero {
  width: 100%;
  min-height: 560px;
  padding: 36px;
  border-radius: 30px;
  color: #f7f9f7;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16), transparent 0 18%),
    linear-gradient(145deg, #092f31 0%, #0f5e5a 48%, #d06a2c 100%);
  box-shadow: 0 24px 70px rgba(23, 22, 19, 0.18);
}

.login-hero-compact {
  min-height: auto;
  padding: 28px 30px;
}

.login-shell-single .login-hero h2 {
  max-width: 12ch;
}

.login-hero h2 {
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 16px 0 18px;
  max-width: 11ch;
  text-wrap: balance;
}

.login-hero p,
.login-hero li {
  color: rgba(247, 249, 247, 0.88);
  font-size: 1.04rem;
}

.login-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero-chip {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.hero-copy {
  max-width: 52ch;
  margin-bottom: 24px;
}

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

.hero-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.hero-card span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(247, 249, 247, 0.72);
  margin-bottom: 8px;
}

.hero-card strong {
  font-size: 1.08rem;
}

.login-panel-wide {
  width: min(980px, 100%);
  max-width: none;
}

.login-shell-single .login-panel {
  max-width: none;
  justify-self: stretch;
  align-self: stretch;
}

.login-simple {
  width: 100%;
  max-width: 720px;
}

.login-simple-card {
  width: 100%;
  padding: 36px;
  border-radius: 30px;
}

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

.login-simple-header h1 {
  margin: 6px 0 0;
  max-width: 9ch;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.login-simple-eyebrow {
  color: var(--accent);
}

.login-simple-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--accent);
  background: #eaf8f5;
  border: 1px solid rgba(15, 118, 110, 0.16);
  white-space: nowrap;
}

.login-simple-copy {
  max-width: 34ch;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.login-simple-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.login-simple-section {
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffefb 0%, #faf7f0 100%);
}

.login-simple-step {
  margin: 0 0 16px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.login-simple-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.access-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.access-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 16px 40px rgba(37, 31, 22, 0.07);
}

.access-page h1,
.access-page h2,
.access-page p,
.access-page label,
.access-page button {
  overflow-wrap: normal;
  word-break: normal;
}

.access-header {
  margin-bottom: 28px;
}

.access-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 700;
}

.access-header h1 {
  margin: 0 0 14px;
  max-width: 12ch;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.access-intro {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.access-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.access-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.access-block h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.access-form {
  display: grid;
  gap: 16px;
}

.access-form .button,
.access-form .button-secondary {
  width: 100%;
}

.access-footer {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.access-footer p {
  margin: 0 0 8px;
}

.access-footer p:last-child {
  margin-bottom: 0;
}

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

.login-badge {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: #ecfaf8;
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: #b7ddd8;
}

.login-panel .eyebrow {
  color: var(--accent);
}

.modern-card {
  padding: 30px;
}

.login-copy {
  margin-bottom: 20px;
}

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

.login-action-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fffefb 0%, #faf7f0 100%);
}

.login-step {
  margin: 0 0 16px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.login-note {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.login-note strong {
  color: var(--text);
}

.page-header,
.panel-header,
.toolbar,
.actions,
.actions-inline,
.stats-grid,
.detail-grid {
  display: flex;
  gap: 16px;
}

.page-header,
.panel-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-copy h2 {
  margin: 4px 0 6px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-eyebrow {
  color: var(--accent);
}

.actions-inline {
  align-items: center;
  flex-wrap: wrap;
}

.stats-grid {
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  min-width: 220px;
  flex: 1 1 220px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.stat-card span,
.muted {
  color: var(--muted);
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 1.45em;
}

.field-help-placeholder {
  visibility: hidden;
}

.required-mark {
  color: #b9382a;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2.3rem;
  letter-spacing: -0.04em;
}

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

.stat-card-teal {
  background: linear-gradient(180deg, #effbf8 0%, #f9fdfb 100%);
}

.stat-card-sand {
  background: linear-gradient(180deg, #fff7ea 0%, #fffdf8 100%);
}

.stat-card-amber {
  background: linear-gradient(180deg, #fff2e8 0%, #fffdf8 100%);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 24px;
}

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

.form-grid.compact {
  grid-template-columns: 1fr;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.checkbox input {
  width: auto;
}

.button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.button-danger {
  background: #b9382a;
  color: white;
  box-shadow: 0 10px 24px rgba(185, 56, 42, 0.18);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.link-button {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.link-danger {
  color: #b9382a;
}

.student-picker {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfaf4;
}

.student-picker select {
  min-height: 280px;
}

.student-picker-help {
  margin: 0;
}

.picker-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfaf4;
}

.picker-panel select {
  min-height: 220px;
  border-width: 2px;
}

.picker-panel-compact {
  padding: 14px;
  background: white;
}

.picker-panel select option:checked,
.student-picker select option:checked {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.picker-selection {
  margin: 2px 0 0;
  color: var(--accent-3);
  font-weight: 700;
}

.inline-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f4ed;
  border: 1px solid rgba(221, 215, 203, 0.8);
}

.flow-hint {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f3faf8;
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.flow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(221, 215, 203, 0.7);
}

.table th,
.table td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(221, 215, 203, 0.7);
  vertical-align: top;
}

.table thead th {
  background: #faf7f1;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table tbody tr:hover {
  background: rgba(15, 118, 110, 0.03);
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.mini-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
}

.mini-pill {
  background: #eef5f2;
  color: var(--accent-3);
  font-size: 0.82rem;
}

.status-pill {
  background: #e9f8f5;
  color: var(--accent);
  font-size: 0.84rem;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.flash {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash-success {
  border-color: #78a091;
}

.flash-error {
  border-color: #c66a5e;
}

.content-public .flash-stack {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.summary-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 14px;
  margin: 0;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
}

.panel-emphasis {
  background: linear-gradient(180deg, #fffefb 0%, #f9f6ef 100%);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.pre-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.panel p,
.panel dd,
.panel li,
.cell-stack,
.muted,
.summary-list dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .sidebar-footer {
    position: static;
    margin-top: 24px;
  }

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

  .login-shell {
    grid-template-columns: 1fr;
    width: min(920px, 100%);
  }

  .login-panel {
    max-width: 620px;
  }

  .login-actions-grid {
    grid-template-columns: 1fr;
  }

  .login-simple-grid {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 28px;
  }

  .login-hero h2 {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    max-width: 13ch;
  }

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

  .page-header,
  .panel-header,
  .toolbar,
  .actions,
  .actions-inline,
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table-wrap {
    overflow: visible;
    border: none;
  }

  .table,
  .table thead,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: grid;
    gap: 14px;
  }

  .table tr {
    background: #fffdf8;
    border: 1px solid rgba(221, 215, 203, 0.8);
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 10px 24px rgba(37, 31, 22, 0.05);
  }

  .table td {
    border: none;
    padding: 10px 0;
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .button,
  .button-secondary,
  .button-danger {
    width: 100%;
    text-align: center;
  }

  .summary-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .summary-list dt {
    margin-top: 10px;
  }
}

@media (max-width: 720px) {
  .content-public {
    padding: 18px;
  }

  .login-shell {
    gap: 18px;
  }

  .login-hero {
    padding: 24px;
    border-radius: 26px;
  }

  .login-hero-top {
    align-items: flex-start;
  }

  .login-hero h2 {
    font-size: clamp(2.1rem, 9vw, 3.1rem);
    max-width: none;
    margin-bottom: 14px;
  }

  .hero-copy {
    font-size: 0.98rem;
    margin-bottom: 18px;
  }

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

  .hero-card {
    padding: 16px;
    border-radius: 18px;
  }

  .hero-card strong {
    font-size: 0.98rem;
    line-height: 1.2;
  }
}

@media (max-width: 560px) {
  .content-public {
    padding: 16px;
  }

  .access-card {
    padding: 22px;
    border-radius: 22px;
  }

  .access-header h1 {
    max-width: none;
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .access-intro {
    max-width: none;
    font-size: 0.98rem;
  }

  .login-panel {
    max-width: none;
  }

  .login-simple-card {
    padding: 22px;
    border-radius: 22px;
  }

  .login-simple-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-simple-header h1 {
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .login-simple-section {
    padding: 18px;
  }

  .login-hero-compact {
    padding: 20px;
  }

  .login-action-card {
    padding: 18px;
  }

  .login-hero {
    padding: 20px;
    border-radius: 22px;
  }

  .login-hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero-chip {
    padding: 7px 12px;
  }

  .login-hero h2 {
    font-size: clamp(1.9rem, 10vw, 2.7rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
  }

  .login-hero p,
  .login-hero li {
    font-size: 0.96rem;
  }

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

  .hero-card {
    padding: 14px;
  }

  .hero-card span {
    font-size: 0.72rem;
  }
}
