:root {
  --bg: #f2eadf;
  --paper: #fffdf8;
  --surface: #f8f2e8;
  --ink: #24201b;
  --muted: #675d50;
  --line: #d8c8b2;
  --green: #516f5c;
  --gold: #a56f2b;
  --red: #934a3d;
  --blue: #4d6c7e;
  --link: #7c4a28;
  --shadow: rgba(54, 41, 29, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(81, 111, 92, 0.06) 0, rgba(81, 111, 92, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 42%, #efe4d6 100%);
  background-size: 36px 36px, auto;
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 500; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-shell { width: min(100%, 620px); }
.login-panel {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 44px;
  box-shadow: 0 20px 52px var(--shadow);
}
.login-panel::before,
.doctoral-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: linear-gradient(180deg, var(--green), var(--gold), var(--red), var(--blue));
}
.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fffdf8;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  border-radius: 3px;
  margin-bottom: 18px;
}
.login-panel h1, .hero-panel h1, .page-header h1 {
  font-size: clamp(2.05rem, 4vw, 3.75rem);
  line-height: 1.02;
  margin-bottom: 14px;
}
.login-subtitle, .hero-panel p, .page-header p, .chapter-card p, .section-card p, .project-summary p {
  color: var(--muted);
  line-height: 1.58;
}
.login-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  font-family: Arial, Helvetica, sans-serif;
}
.login-form label { font-weight: 700; font-size: 0.9rem; }
.login-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
}
.login-form input:focus, button:focus, a:focus { outline: 3px solid rgba(81, 111, 92, 0.25); outline-offset: 2px; }
.login-form button, .topbar button, .card-link, .back-link {
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: #fffdf8;
  padding: 11px 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.form-message { min-height: 1.3em; color: var(--red); font-weight: 700; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 34px;
  background: rgba(248, 243, 234, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar-brand { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: Arial, Helvetica, sans-serif;
}
.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.topbar-nav a:hover { color: var(--link); }
.topbar button { background: var(--green); padding: 8px 11px; }

.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 66px;
}
.hero-panel {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  box-shadow: 0 18px 42px rgba(54, 41, 29, 0.1);
}
.doctoral-hero {
  min-height: 330px;
  display: flex;
  align-items: flex-end;
  padding: 42px 44px 40px 54px;
}
.doctoral-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -130px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(124, 74, 40, 0.18);
  border-radius: 50%;
}
.hero-copy { position: relative; max-width: 830px; z-index: 1; }
.page-header { margin-bottom: 24px; max-width: 900px; }
.eyebrow, .chapter-kicker {
  color: var(--link);
  text-transform: uppercase;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 9px;
}

.chapter-grid, .section-grid { display: grid; gap: 16px; }
.chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }
.metric-card, .chapter-card, .section-card, .project-summary, .empty-state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.project-summary {
  padding: 22px 24px;
  margin-bottom: 16px;
  background: rgba(255, 253, 248, 0.72);
}
.project-summary h2 { font-size: 1.3rem; margin-bottom: 8px; }
.chapter-card {
  min-height: 430px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 5px solid var(--green);
  box-shadow: 0 10px 24px rgba(55, 43, 31, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(55, 43, 31, 0.12);
}
.chapter-card h2 { font-size: 1.55rem; line-height: 1.18; margin-bottom: 10px; }
.section-card {
  min-height: 205px;
  padding: 20px;
  border-top: 4px solid var(--green);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.section-card h2 { font-size: 1.18rem; margin-bottom: 8px; }
.accent-green { border-top-color: var(--green); }
.accent-gold { border-top-color: var(--gold); }
.accent-red { border-top-color: var(--red); }
.accent-blue { border-top-color: var(--blue); }
.card-link, .back-link { display: inline-block; width: fit-content; }
.card-link { background: var(--link); }
.back-link { background: var(--green); margin-bottom: 22px; }

.chapter-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  font-family: Arial, Helvetica, sans-serif;
}
.chapter-meta div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  background: var(--surface);
}
.chapter-meta dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}
.chapter-meta dd { margin: 4px 0 0; font-weight: 700; }
.inline-meta { max-width: 520px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-family: Arial, Helvetica, sans-serif;
}
.section-footer span { color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.section-footer a { color: var(--link); font-weight: 800; text-decoration: none; }
.empty-state {
  border-style: dashed;
  padding: 30px;
  max-width: 760px;
}
.empty-state h2 { font-size: 1.25rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); line-height: 1.5; margin-bottom: 0; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  .topbar-nav { flex-wrap: wrap; }
  .chapter-grid, .section-grid, .chapter-meta, .inline-meta { grid-template-columns: 1fr; }
  .login-panel { padding: 28px; }
  .doctoral-hero { min-height: 360px; padding: 34px 28px 32px 38px; }
  .section-footer { align-items: flex-start; flex-direction: column; }
}
.chapter-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}
.chapter-card-body {
  padding: 20px 22px 8px;
}
.chapter-card > .card-link {
  margin: 0 22px 22px;
}
.project-summary p:last-child {
  margin-bottom: 0;
}
.chapter-phase {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}
.chapter-phase span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.chapter-phase strong {
  font-size: 0.92rem;
}
.compact-section-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.section-link-card {
  min-height: 132px;
  color: inherit;
  text-decoration: none;
}
.section-link-card h2 {
  margin-bottom: 0;
}
.section-link-card span {
  color: var(--link);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}
.section-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(55, 43, 31, 0.1);
}

@media (max-width: 760px) {
  .compact-section-grid { grid-template-columns: 1fr; }
}
.section-page-header {
  display: grid;
  gap: 10px;
}
.folder-link {
  display: inline-block;
  width: fit-content;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--link);
  color: #fffdf8;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  text-decoration: none;
}
.item-list {
  max-width: 860px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.item-list-row {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: Arial, Helvetica, sans-serif;
}
.item-list-row:last-child {
  border-bottom: 0;
}
.empty-row {
  color: var(--muted);
  font-weight: 700;
}
.admin-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 18px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(55, 43, 31, 0.07);
}
.admin-entry h2 {
  font-size: 1.55rem;
  margin-bottom: 8px;
}
.admin-entry p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .admin-entry {
    align-items: flex-start;
    flex-direction: column;
  }
}