/* Teacher console styling. Desktop-first; shares Vera's palette/typography with
   the student page. */
:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --brand: #82FF00;
  --muted: #9a9a9a;
  --line: #e7e7e7;
  --bg: #fafaf7;
  --danger: #d33;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 2rem 1rem;
}
[hidden] { display: none !important; }
a { color: var(--ink); }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; }
/* Two panel columns: create (left) · manage (right); stacks when narrow. */
.cols { display: flex; gap: 2.5rem; align-items: flex-start; flex-wrap: wrap; }
.cols > section { flex: 1; min-width: 320px; }
.card { max-width: 380px; margin: 8vh auto 0; }
h1 { font-size: 1.4rem; letter-spacing: 0.02em; margin: 0 0 1.5rem; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.5rem 0 0.75rem; }

label.field { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; }
label.field span { display: block; margin-bottom: 0.3rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; }
input {
  width: 100%; font: inherit; font-size: 0.95rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}

button {
  font: inherit; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.65rem 1.2rem; border-radius: 999px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; cursor: pointer;
}
button.ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); padding: 0.35rem 0.8rem; font-size: 0.72rem; }
button.mini { padding: 0.35rem 0.8rem; font-size: 0.72rem; }
button:disabled { opacity: 0.5; cursor: progress; }

.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }

/* Drop zone + free-text box for new instructions; picked files chip up in
   between, right-aligned. */
.dropzone {
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  padding: 0.6rem 0.7rem; margin-bottom: 0.75rem; cursor: pointer;
}
.dropzone.drag { border-color: var(--brand); }
.dropzone p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.file-chips { justify-content: flex-start; }
.file-chips:empty { display: none; }
.typed {
  width: 100%; min-height: 180px; font: inherit; font-size: 0.9rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); resize: vertical; margin-bottom: 0.75rem;
  overflow-y: hidden;
}

/* One card per assigned instruction file. */
.cards { list-style: none; padding: 0; margin: 0.5rem 0; }
.cards li { position: relative; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0.7rem 2rem 0.7rem 0.8rem; margin-bottom: 0.75rem; }
.card-trash {
  position: absolute; top: 0.5rem; right: 0.5rem;
  border: 0; background: transparent; color: var(--danger);
  padding: 0.2rem; line-height: 0; cursor: pointer;
}
.card-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.chip.file { background: var(--bg); font-weight: 600; }
.cards .chips { margin: 0; }
.tag { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

.err { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; margin-top: 0.5rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; }

/* Typeahead dropdown under the student search input. */
.typeahead-wrap { position: relative; }
.typeahead {
  position: absolute; left: 0; right: 0; z-index: 10;
  list-style: none; margin: 0.15rem 0 0; padding: 0.25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.typeahead li {
  display: flex; justify-content: space-between; gap: 0.6rem;
  padding: 0.45rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem;
}
.typeahead li:hover { background: var(--bg); }

/* Selected-student chips (and per-instruction student chips). */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.9rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.8rem;
}
.chip button {
  border: 0; background: transparent; color: var(--muted);
  padding: 0; font-size: 0.95rem; line-height: 1; text-transform: none; letter-spacing: 0;
}

/* "+ Alumno" picker: a small modal view hosting its own searcher. */
.picker-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 999;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 18vh;
}
.picker-overlay[hidden] { display: none; }
.picker-box {
  background: #fff; border-radius: 10px; padding: 1rem;
  width: min(380px, 92vw); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.picker-results { position: static; margin-top: 0.5rem; box-shadow: none; }
