/* ServePanda — Ghibli style: pastoral palette, soft watercolor wash, gentle serifs. */

:root {
  /* warm paper backgrounds */
  --bg: #FBF7EC;
  --bg-deep: #F5EFD9;
  --surface: #FFFDF5;
  --surface-warm: #FAF3DF;
  --surface-soft: #F0E8CF;

  /* line / border — warm browns instead of cool greys */
  --border: #E2D6B5;
  --border-strong: #C9B98A;

  /* ink — warm near-black */
  --text: #3A2F26;
  --text-soft: #5C4A3F;
  --muted: #8C7A5C;

  /* dusty sage greens (Mononoke / Totoro forest) */
  --sage: #A7C4A0;
  --sage-deep: #6B8E6B;
  --sage-ink: #3F5A3F;
  --sage-bg: #DDE8D0;
  --sage-wash: #EAF1DE;

  /* warm earth accents (Kiki bow / Spirited dusk) */
  --terra: #C2826B;
  --terra-deep: #9C5B4B;
  --terra-bg: #F2D9CC;
  --terra-ink: #6E3A2C;

  /* muted sky (Castle in the Sky) */
  --sky: #A8C5D6;
  --sky-bg: #DCE9F0;

  /* warm yellow-ochre accent */
  --ochre: #C9A875;
  --ochre-deep: #A78850;
  --ochre-bg: #F0E2C2;

  /* row hover — barely-there sage wash */
  --row-hover: #EFF4E5;

  --error: #9A3A2A;
  --error-bg: #F2D9CC;

  /* warm-tinted shadows, never pure black */
  --shadow-sm: 0 1px 2px rgba(90, 70, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(90, 70, 40, 0.12);
  --shadow-lg: 0 22px 48px rgba(90, 70, 40, 0.18);

  --radius: 11px;
  --radius-lg: 14px;

  /* font stacks */
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Apple Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Avenir Next", "Avenir", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  /* paper-grain wash: very subtle SVG noise overlaid on the paper color */
  background-image:
    radial-gradient(circle at 20% 12%, rgba(167, 196, 160, 0.18), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(201, 168, 117, 0.14), transparent 48%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.36  0 0 0 0 0.30  0 0 0 0 0.20  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  background-repeat: repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

a { color: var(--sage-deep); text-decoration: none; transition: color 280ms ease; }
a:hover { color: var(--sage-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  gap: 24px;
  box-shadow: 0 1px 0 rgba(140, 122, 92, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand .panda-mark { width: 42px; height: 42px; flex-shrink: 0; }
.brand .panda-mark-sm { width: 38px; height: 38px; }
.brand-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
}
.brand-text .school {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 300ms ease, color 300ms ease;
}
.topbar nav a:hover {
  background: var(--sage-wash);
  color: var(--sage-ink);
  text-decoration: none;
}
.topbar nav a.active {
  background: var(--sage-bg);
  color: var(--sage-ink);
}

main {
  max-width: 1240px;
  margin: 28px auto 72px;
  padding: 0 32px;
}

/* ---------- Buttons ---------- */

button, .btn {
  font: inherit;
  background: var(--sage-deep);
  color: var(--surface);
  border: 1px solid var(--sage-deep);
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 320ms ease-out, border-color 320ms ease-out, color 320ms ease-out, transform 120ms ease-out, box-shadow 320ms ease-out;
  box-shadow: 0 1px 2px rgba(63, 90, 63, 0.18);
}
button:hover, .btn:hover {
  background: var(--sage-ink);
  border-color: var(--sage-ink);
  box-shadow: 0 2px 8px rgba(63, 90, 63, 0.22);
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

button.btn-secondary, .btn.btn-secondary {
  background: var(--surface);
  color: var(--sage-ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
button.btn-secondary:hover, .btn.btn-secondary:hover {
  background: var(--sage-wash);
  border-color: var(--sage-deep);
  color: var(--sage-ink);
}

button.btn-accent, .btn.btn-accent {
  background: var(--ochre);
  color: var(--text);
  border-color: var(--ochre);
}
button.btn-accent:hover, .btn.btn-accent:hover {
  background: var(--ochre-deep);
  border-color: var(--ochre-deep);
  color: var(--surface);
}

button.btn-ghost, .btn.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}
button.btn-ghost:hover, .btn.btn-ghost:hover {
  background: var(--surface-warm);
  color: var(--text);
}

/* ---------- Soft divider (vine) ---------- */

.divider {
  display: block;
  width: 100%;
  height: 24px;
  margin: 8px 0 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 24' preserveAspectRatio='none'><path d='M 0 12 Q 60 4 120 12 T 240 12 T 360 12 T 480 12 T 600 12' fill='none' stroke='%238C7A5C' stroke-opacity='0.35' stroke-width='1.1' stroke-linecap='round'/><g fill='%23A7C4A0' opacity='0.7'><path d='M 100 12 Q 106 6 114 10 Q 110 16 100 12 Z'/><path d='M 240 12 Q 234 6 226 10 Q 230 16 240 12 Z'/><path d='M 380 12 Q 386 6 394 10 Q 390 16 380 12 Z'/><path d='M 500 12 Q 494 6 486 10 Q 490 16 500 12 Z'/></g></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

/* ---------- Summary cards ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.summary .card-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.summary .card-stat .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.summary .card-stat .value {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

/* ---------- Toolbar / filters ---------- */

.toolbar {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toolbar select,
.toolbar input[type=search],
.toolbar input[type=text],
.toolbar input[type=number],
.toolbar input[type=date] {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  min-width: 170px;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 280ms ease, box-shadow 280ms ease;
}
.toolbar select:focus,
.toolbar input:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px var(--sage-wash);
}
.toolbar .spacer { flex: 1; }
.toolbar .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Table ---------- */

.tablewrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface-warm);
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th.num { text-align: right; }
thead th[data-sort]:hover { color: var(--sage-ink); }
thead th[data-sort].sorted-asc::after { content: " \25B2"; font-size: 9px; }
thead th[data-sort].sorted-desc::after { content: " \25BC"; font-size: 9px; }

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 280ms ease; }
tbody tr:hover { background: var(--row-hover); }
tbody tr.clickable { cursor: pointer; }

.status-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}
.status-pill.on-track {
  background: var(--sage-bg);
  color: var(--sage-ink);
  border-color: rgba(107, 142, 107, 0.3);
}
.status-pill.short {
  background: var(--terra-bg);
  color: var(--terra-ink);
  border-color: rgba(156, 91, 75, 0.3);
}

footer.app-footer {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ---------- Generic card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}
.card p {
  margin: 6px 0 14px;
  color: var(--text-soft);
  font-size: 14.5px;
}
.card code {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--terra-ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.importer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.importer input[type=file] {
  font-size: 14px;
  padding: 10px 14px;
  background: var(--surface-warm);
  border: 2px dashed var(--ochre);
  border-radius: 10px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 280ms ease, border-color 280ms ease;
}
.importer input[type=file]:hover {
  background: var(--ochre-bg);
  border-color: var(--ochre-deep);
}
.importer .checkbox {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-soft);
}

.result {
  margin-top: 16px;
  font-size: 14px;
}
.result.ok {
  background: var(--sage-bg);
  color: var(--sage-ink);
  border: 1px solid rgba(107, 142, 107, 0.3);
  padding: 12px 16px;
  border-radius: 9px;
}
.result.err {
  background: var(--terra-bg);
  color: var(--terra-ink);
  border: 1px solid rgba(156, 91, 75, 0.3);
  padding: 12px 16px;
  border-radius: 9px;
}
.result ul { margin: 8px 0 0; padding-left: 22px; }
.result li { margin: 2px 0; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 47, 38, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 320ms ease-out;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 360ms ease-out;
}
.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}
.modal header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}
.modal header .close-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: none;
}
.modal header .close-btn:hover { background: var(--bg-deep); color: var(--text); }
.modal form { padding: 20px 22px 22px; }
.modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal .form-grid .full { grid-column: 1 / -1; }
.modal label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.modal label small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.modal input, .modal select, .modal textarea {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 280ms ease, box-shadow 280ms ease;
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px var(--sage-wash);
}
.modal textarea { resize: vertical; min-height: 64px; }
.modal .form-error {
  margin-top: 14px;
  background: var(--terra-bg);
  color: var(--terra-ink);
  border: 1px solid rgba(156, 91, 75, 0.3);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}
.modal .form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Combobox ---------- */

.combobox { position: relative; }
.combobox .options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-md);
}
.combobox .options[hidden] { display: none; }
.combobox .option {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 400;
  transition: background 240ms ease;
}
.combobox .option:hover, .combobox .option.active {
  background: var(--sage-wash);
  color: var(--sage-ink);
}
.combobox .option .meta { color: var(--muted); font-size: 12px; margin-left: 6px; }
.combobox .empty-option {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Landing ---------- */

body.landing {
  background-color: var(--bg);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  max-width: 1180px;
  margin: 0 auto;
}
.landing-nav .brand-text h1 { font-size: 22px; }
.landing-nav .nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 60px 36px 36px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}
.hero h2 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}
.hero h2 .accent { color: var(--sage-deep); font-style: italic; }
.hero p.lede {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 0 26px;
  line-height: 1.6;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panda-art {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 253, 245, 0.85), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(168, 197, 214, 0.4), transparent 60%),
    linear-gradient(160deg, var(--sage-wash) 0%, var(--ochre-bg) 60%, var(--terra-bg) 100%);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 36px;
  aspect-ratio: 1 / 1;
  max-width: 440px;
  margin-left: auto;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
/* watercolor wash inside the hero card */
.panda-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='wn'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.22  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23wn)'/></svg>");
  opacity: 0.6;
  pointer-events: none;
}
/* soft hill silhouette behind panda */
.panda-art::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 160' preserveAspectRatio='none'><path d='M 0 160 L 0 90 Q 80 50 160 80 Q 240 110 320 70 Q 380 45 400 70 L 400 160 Z' fill='%236B8E6B' fill-opacity='0.22'/><path d='M 0 160 L 0 120 Q 100 95 200 115 Q 300 135 400 110 L 400 160 Z' fill='%236B8E6B' fill-opacity='0.30'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.panda-art .panda-mark {
  width: 100%;
  height: auto;
  max-width: 320px;
  position: relative;
  z-index: 1;
  animation: float 5s ease-in-out infinite;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 36px;
}
.section.alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: none;
  padding: 64px 36px;
}
.section .inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.section h3 .accent { color: var(--sage-deep); font-style: italic; }
.section .lede {
  margin: 0 0 32px;
  font-size: 16.5px;
  color: var(--text-soft);
  max-width: 720px;
  line-height: 1.65;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 320ms ease-out, box-shadow 320ms ease-out;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.section.alt .feature-card { background: var(--surface-warm); }
.feature-card .step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  background: var(--sage-wash);
  border-radius: 14px;
}
.feature-card .step-icon svg { width: 36px; height: 36px; }
.feature-card .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--ochre-bg);
  color: var(--terra-ink);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  margin-right: 8px;
  border: 1px solid var(--ochre);
}
.feature-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.feature-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.6;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.callout h4 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}
.callout ul {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--text-soft);
  font-size: 15px;
}
.callout li { margin: 7px 0; }
.callout.warm { background: var(--ochre-bg); border-color: var(--ochre); }

.landing-footer {
  background: var(--surface-warm);
  color: var(--text-soft);
  padding: 40px 36px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.landing-footer .inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.landing-footer .brand-text h1 { color: var(--text); }
.landing-footer .panda-mark { width: 38px; height: 38px; }
.landing-footer p { margin: 0; font-size: 14px; font-style: italic; }
.landing-footer a { color: var(--terra-deep); }

/* ---------- Login ---------- */

.login-main {
  max-width: 920px;
  margin: 28px auto 56px;
  padding: 0 32px;
}
.login-card {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.login-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 253, 245, 0.85), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(168, 197, 214, 0.4), transparent 60%),
    linear-gradient(160deg, var(--sage-wash) 0%, var(--ochre-bg) 60%, var(--terra-bg) 100%);
  padding: 36px 28px;
  overflow: hidden;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='wn'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='9'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.22  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23wn)'/></svg>");
  opacity: 0.55;
  pointer-events: none;
}
.login-art::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 160' preserveAspectRatio='none'><path d='M 0 160 L 0 90 Q 80 50 160 80 Q 240 110 320 70 Q 380 45 400 70 L 400 160 Z' fill='%236B8E6B' fill-opacity='0.22'/><path d='M 0 160 L 0 120 Q 100 95 200 115 Q 300 135 400 110 L 400 160 Z' fill='%236B8E6B' fill-opacity='0.30'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.login-art .panda-mark {
  width: 100%;
  max-width: 240px;
  height: auto;
  position: relative;
  z-index: 1;
  animation: float 5s ease-in-out infinite;
}
.login-body {
  padding: 44px 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-body h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}
.login-body p.lede {
  font-size: 15.5px;
  color: var(--text-soft);
  margin: 0 0 22px;
  line-height: 1.6;
}
.login-body .login-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.login-body input[type="password"] {
  font: inherit;
  font-size: 15px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 280ms ease, box-shadow 280ms ease;
  letter-spacing: 0.04em;
}
.login-body input[type="password"]:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px var(--sage-wash);
}
.login-body .form-error {
  margin-top: 14px;
  background: var(--terra-bg);
  color: var(--terra-ink);
  border: 1px solid rgba(156, 91, 75, 0.3);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
}
.login-body .form-actions {
  margin-top: 18px;
}
.login-body .form-actions button {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
}
.login-body .login-help {
  margin: 22px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}
.login-body .login-help a { color: var(--terra-deep); }

/* ---------- Topbar logout link ---------- */

.topbar .nav-logout {
  margin-left: 4px;
  color: var(--terra-deep);
}
.topbar .nav-logout:hover {
  background: var(--terra-bg);
  color: var(--terra-ink);
}

/* ---------- Student detail ---------- */

.student-header {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.student-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.student-info h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}
.student-info .meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  font-style: italic;
}
.student-info .meta span + span::before { content: " \00B7 "; margin: 0 6px; color: var(--border-strong); }
.student-status {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.student-status .req-name {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.student-status .progress-row { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 14px; }
.student-status .progress-row .num {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--text);
}
.student-status .progress-row .of { color: var(--muted); font-size: 14px; font-style: italic; }
.progress-bar {
  height: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage-deep) 100%);
  border-radius: 999px;
  transition: width 360ms ease-out;
}
.progress-bar .fill.short {
  background: linear-gradient(90deg, #D9A48F 0%, var(--terra) 100%);
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; background-image: none; }
  .topbar, .toolbar, .actions, .modal-backdrop, .landing-footer { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  .card, .student-info, .student-status, .tablewrap { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  table { font-size: 12px; }
}

/* ---------- Reduced motion ---------- */

/* ---------- Iter-4 additions: data notice, demo controls, empty-state mascot,
              CSV column mapping, import-card spot illustration, config form. ---------- */

.data-notice {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 auto;
  max-width: 760px;
  box-shadow: var(--shadow-sm);
}
.data-notice-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}
.data-notice-icon svg { width: 100%; height: 100%; display: block; }
.data-notice-body h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text);
}
.data-notice-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
}

.app-footer .data-disclosure {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.demo-controls {
  margin: 18px 0 22px;
  background: var(--surface-warm);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-soft);
}
.demo-controls summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11.5px;
  padding: 4px 0;
  list-style: none;
  outline: none;
}
.demo-controls summary::-webkit-details-marker { display: none; }
.demo-controls summary::before {
  content: "▸ ";
  color: var(--muted);
  margin-right: 4px;
  display: inline-block;
  transition: transform 220ms ease;
}
.demo-controls[open] summary::before { content: "▾ "; }
.demo-controls p {
  margin: 8px 0 10px;
  color: var(--text-soft);
}

.empty-mascot {
  text-align: center;
  padding: 48px 20px 32px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.empty-mascot .panda-mark { margin: 0 auto 12px; max-width: 180px; }
.empty-mascot p {
  font-size: 15px;
  color: var(--text-soft);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.55;
}

.csv-mapping {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.csv-mapping .mapping-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.csv-mapping .mapping-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  color: var(--text-soft);
}
.csv-mapping code {
  background: var(--ochre-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.import-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  align-items: start;
}
.import-card .card-illust {
  width: 64px;
  height: 64px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.import-card .card-illust svg { width: 100%; height: 100%; }
.import-card .card-body { min-width: 0; }

.config-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.config-form .config-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.config-form .text-input {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  min-width: 180px;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 280ms ease, box-shadow 280ms ease;
}
.config-form .text-input:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(107, 142, 107, 0.18);
}
.config-form .config-checkbox {
  align-self: center;
  font-size: 13px;
  color: var(--text-soft);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.config-table { margin-bottom: 14px; }
.config-subhead {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .panda-art .panda-mark { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 36px 24px 8px; gap: 24px; }
  .panda-art { margin: 0 auto; max-width: 320px; }
  .hero h2 { font-size: 34px; }
  .three-col, .two-col { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .student-header { grid-template-columns: 1fr; }
  .modal .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 18px; gap: 12px; }
  main { padding: 0 18px; margin: 18px auto 48px; }
  .section { padding: 40px 24px; }
  .section.alt { padding: 48px 24px; }
  .login-card { grid-template-columns: 1fr; }
  .login-art { padding: 28px; }
  .login-art .panda-mark { max-width: 180px; }
  .login-body { padding: 32px 28px 30px; }
  .login-body h2 { font-size: 26px; }
  .login-main { padding: 0 18px; margin: 18px auto 48px; }
  .import-card { grid-template-columns: 1fr; }
  .import-card .card-illust { margin: 0 auto; }
  .data-notice { flex-direction: column; }
}
