@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono:wght@500&display=swap");

:root {
  --brand: #a20b1b;
  --brand-strong: #690715;
  --brand-tint: #f5e3e2;
  --gold: #da4024;
  --ink: #1c1d1f;
  --ink-faint: #6a6b6e;
  --line: #e4e1df;
  --line-strong: #cfc9c6;
  --surface: #ffffff;
  --bg: #faf7f6;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow: 0 1px 2px rgba(28,29,31,0.06);
  --good: #1e7a4c; --good-tint: #e5f5ec;
  --bad: #c0202f; --bad-tint: #fbe9ea;
  --warn: #a15c00; --warn-tint: #fbefdc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Roboto", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--brand); }
.mono { font-family: "Roboto Mono", monospace; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: var(--brand-strong); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brandmark { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brandmark-logo { height: 26px; width: auto; display: block; }
.brandmark small { font-weight: 400; opacity: 0.85; font-size: 11px; border-left: 1px solid rgba(255,255,255,0.35); padding-left: 10px; }
.topbar-admin-link, .link-button { color: #fff; opacity: 0.9; font-size: 13px; text-decoration: none; }
.link-button { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.inline-form { display: inline; }

.shell { max-width: 520px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 60px; }
.shell-wide { max-width: 1100px; }

.eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em; color: var(--brand); font-weight: 700; margin: 0 0 6px; }
.page-title { font-size: 22px; margin: 0 0 6px; }
.lede { color: var(--ink-faint); margin: 0 0 18px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-title { font-weight: 700; margin: 0 0 12px; }

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field.required > label::after { content: " *"; color: var(--brand); }
.field .hint { font-size: 12px; color: var(--ink-faint); margin: 5px 0 0; line-height: 1.4; }
.field-error { color: var(--bad); font-size: 12px; margin: 4px 0 0; }

.field input[type=text], .field input[type=email], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font: inherit; font-size: 14px; background: var(--surface); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}

.field ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.field ul li label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.field input[type=radio], .field input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }

.auth-box { background: var(--brand-tint); border-radius: var(--radius-m); padding: 14px; margin: 18px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; border-radius: var(--radius-s);
  padding: 12px 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-strong); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }

.alert { padding: 10px 14px; border-radius: var(--radius-s); font-size: 14px; margin-bottom: 14px; }
.alert-error { background: var(--bad-tint); color: var(--bad); }
.alert-success { background: var(--good-tint); color: var(--good); }

.helper-row { font-size: 12px; color: var(--ink-faint); margin: 10px 0 0; }

.student-strip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 14px; margin-bottom: 22px; }
.student-strip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.student-strip .meta { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.student-strip .meta span { font-size: 12px; color: var(--ink-faint); }
.student-strip a { font-size: 13px; }

.option-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 20px; margin-bottom: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.option-card .duration { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; }
.option-card h3 { margin: 6px 0 4px; }
.option-card p { margin: 0; color: var(--ink-faint); font-size: 14px; }
.option-card:hover { border-color: var(--brand); }

.auth-shell { display: flex; justify-content: center; padding-top: 40px; }
.auth-box { width: 100%; max-width: 380px; }

/* ---- Panel de resultados ---- */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); }
.who .av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; box-shadow: var(--shadow); }
.stat-tile .label { font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }
.stat-tile .value { font-size: 22px; font-weight: 700; }
.stat-tile .value small { font-size: 13px; font-weight: 400; color: var(--ink-faint); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; box-shadow: var(--shadow); }
.filters input, .filters select { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); min-width: 0; }
.filters .grow { flex: 1; min-width: 160px; }
.filters-actions { display: flex; gap: 8px; margin-left: auto; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.row-detail-link { font-weight: 600; text-decoration: none; }
.empty-row td { text-align: center; color: var(--ink-faint); padding: 30px; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-tipo-rapido { background: var(--brand-tint); color: var(--brand); }
.pill-tipo-ampliado { background: var(--good-tint); color: var(--good); }
.pill-prioridad-alto { background: var(--bad-tint); color: var(--bad); }
.pill-prioridad-medio { background: var(--warn-tint); color: var(--warn); }
.pill-prioridad-bajo { background: var(--line); color: var(--ink-faint); }
.pill-ok { background: var(--good-tint); color: var(--good); }
.pill-no { background: var(--line); color: var(--ink-faint); }

.status-btn { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--surface); }
.status-btn.pendiente { color: var(--warn); border-color: var(--warn); }
.status-btn.contactado { color: var(--brand); border-color: var(--brand); }
.status-btn.cerrado { color: var(--good); border-color: var(--good); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(28,29,31,0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 40; padding: 0; }
.modal { background: var(--surface); border-radius: var(--radius-l) var(--radius-l) 0 0; max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 10px; }
.modal-head h2 { margin: 4px 0 0; font-size: 18px; }
.modal-close { border: none; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); margin-bottom: 2px; }
.detail-item .v { font-size: 14px; }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius-l); }
}
