:root {
  --bg: #f3efe6;
  --ink: #1c1a16;
  --muted: #5c564c;
  --card: #fffdf8;
  --line: #d7d0c3;
  --accent: #0f5c4c;
  --accent-2: #b45309;
  --warn: #92400e;
  --err: #991b1b;
  --ok: #065f46;
  --shadow: 0 10px 30px rgba(28, 26, 22, 0.06);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 92, 76, 0.08), transparent 40%),
    linear-gradient(180deg, #ebe4d7 0%, var(--bg) 30%, #efe9dc 100%);
  min-height: 100vh;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

.top {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.5fr 1fr;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--accent); font-family: system-ui, sans-serif; }
h1 { margin: 0.2rem 0; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; }
.sub { margin: 0.4rem 0 0; color: var(--muted); max-width: 42rem; }

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
}
.auth label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}
.auth input, .field input, .field textarea, .field select, td input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.field textarea { resize: vertical; min-height: 5.5rem; }
button {
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  background: #e8e1d4;
  color: var(--ink);
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-weight: 600;
}
button.primary { background: var(--accent); color: #fff; }
button.ghost { background: transparent; border: 1px dashed var(--line); }
button.danger { background: #fee2e2; color: var(--err); padding: 0.3rem 0.55rem; }
.status {
  grid-column: 1 / -1;
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}
.status[data-kind="ok"] { color: var(--ok); }
.status[data-kind="warn"] { color: var(--warn); }
.status[data-kind="err"] { color: var(--err); }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
}
.toc a {
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

main, #profesores { padding: 0 clamp(1rem, 3vw, 2.5rem) 2rem; }
.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.block h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.hint { color: var(--muted); margin-top: -0.4rem; }
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
}

.grid-actions { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 1100px; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 0.35rem; vertical-align: middle; }
th {
  position: sticky;
  top: 0;
  background: #f7f1e6;
  text-align: left;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
td input { border: 0; border-radius: 6px; background: transparent; padding: 0.4rem; }
td input:focus { outline: 2px solid rgba(15, 92, 76, 0.25); background: #fff; }

footer {
  padding: 1rem 2rem 2rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .top, .auth { grid-template-columns: 1fr; }
}
