/* ==========================================================================
   Recruiting tracker - layered on top of style.css
   ========================================================================== */

.tracker-body { background: var(--bg-soft); }

/* The site pages cap at 1080px for readable prose. The tracker is a data table
   and needs the room, so it gets a much wider container. */
.tracker-body .wrap { max-width: 1680px; }

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

.gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  text-align: left;
}

.gate-card h1 {
  font-size: 26px;
  margin: 0 0 8px;
}

.gate-card p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 24px;
}

.gate-card label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.gate-error {
  color: #b3261e;
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

.gate-note {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Form controls ---------- */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}

textarea { resize: vertical; min-height: 76px; }

button {
  font: inherit;
  cursor: pointer;
}

.btn-sm {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-sm:hover { border-color: var(--ink); }

.btn-sm.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-sm.danger { color: #b3261e; }

/* ---------- App shell ---------- */

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.app-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-title { font-size: 20px; font-weight: 700; margin: 0; }
.app-title span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.app-main { padding: 24px 0 80px; }

/* ---------- Sync status ---------- */

.sync {
  font-size: 13px;
  margin: 0 0 14px;
  color: var(--ink-soft);
}

.sync::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
  background: currentColor;
}

.sync.ok   { color: #166534; }
.sync.busy { color: #9a3412; }
.sync.bad  { color: #b3261e; font-weight: 600; }

/* ---------- Summary tiles ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.summary div {
  background: #fff;
  padding: 16px 14px;
  text-align: center;
}

.summary b {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.summary span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: -1px;
}

.tabs button.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Filters ---------- */

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

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

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

.grid-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

table.grid th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  background: #fff;
}

table.grid td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.grid tbody tr:hover { background: var(--bg-soft); }

/* ---------- Sortable headers ---------- */

table.grid th[data-sort] {
  cursor: pointer;
  user-select: none;
}

table.grid th[data-sort]:hover { color: var(--ink); }

table.grid th .arrow {
  margin-left: 5px;
  opacity: 0.3;
  font-size: 10px;
}

table.grid th.sorted { color: var(--ink); }
table.grid th.sorted .arrow { opacity: 1; color: var(--accent); }

table.grid .col-name { min-width: 240px; }
table.grid .col-name strong { display: block; font-weight: 600; }
table.grid .col-name em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 12px;
}

table.grid select { padding: 5px 8px; font-size: 13px; border-radius: 6px; }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}

.pill.juco { border-color: #c2410c33; color: var(--accent); }

.cat-stretch   { color: #9a3412; }
.cat-target    { color: #166534; }
.cat-safety    { color: #1e40af; }
.cat-nottarget { color: var(--ink-soft); }

.tick {
  font-size: 18px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  color: var(--line);
}
.tick.on { color: #166534; }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.more-row { padding: 16px; text-align: center; }

.count-line {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 12px 2px 0;
}

/* ==========================================================================
   College detail page
   ========================================================================== */

.detail-wrap { max-width: 1080px; }

.back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.back-link:hover { color: var(--ink); }

.detail-sub {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 0 0 20px;
}

.panel-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 14px 0 0;
}

/* ---------- Fact grid ---------- */

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 28px;
  margin: 0;
}

.fact-grid div {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.fact-grid dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

.fact-grid dd { margin: 3px 0 0; font-size: 16px; font-weight: 600; }

/* ---------- Climate ---------- */

.climate-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}

.climate-tiles div { background: #fff; padding: 16px 18px; }

.climate-tiles span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 5px;
}

.climate-tiles b { font-size: 15px; font-weight: 600; }

.climate-compare {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 15px;
  margin: 0 0 22px;
}

.climate-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.climate-chart .grid { stroke: var(--line); stroke-width: 1; }
.climate-chart .grid.zero { stroke: #b9bec8; stroke-dasharray: 3 3; }
.climate-chart .axis { fill: var(--ink-soft); font-size: 11px; font-family: inherit; }
.climate-chart .range { stroke: #d8dde4; stroke-width: 9; stroke-linecap: round; }
.climate-chart .dot-hi { fill: var(--accent); }
.climate-chart .dot-lo { fill: #2563eb; }

.chart-key { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.chart-key span {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: -1px;
  margin-right: 3px;
}
.chart-key .k-hi { background: var(--accent); }
.chart-key .k-lo { background: #2563eb; }

/* ---------- Contact history ---------- */

.history-row {
  display: grid;
  grid-template-columns: 140px 160px 140px 1fr 2fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .history-row { grid-template-columns: 1fr 1fr; }
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.history-table td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.dir {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.dir-sent     { background: #fdf1e8; color: #9a3412; }
.dir-received { background: #e8f3ec; color: #166534; }

/* ---------- Save confirmation ---------- */

.saved-flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
}

.saved-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Clickable rows in the tracker grid ---------- */

table.grid tbody tr[data-href] { cursor: pointer; }

table.grid .col-name a {
  color: inherit;
  text-decoration: none;
}

table.grid .col-name a:hover { color: var(--accent); text-decoration: underline; }

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 26, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 150;
}

.modal.is-open { display: flex; }

.modal-card {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 760px;
  padding: 28px;
}

.modal-card h2 {
  font-size: 20px;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 4px;
}

.modal-sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .field-grid { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.field.full { grid-column: 1 / -1; }

.modal fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 20px;
}

.modal legend {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 0 6px;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

@media (max-width: 700px) {
  .contact-row { grid-template-columns: 1fr; }
}

.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Admin page ---------- */

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 0; }
.admin-table th, .admin-table td { white-space: normal; padding: 10px 8px; }
.admin-table td:nth-child(2) { word-break: break-all; }
.admin-row-actions { text-align: right; white-space: nowrap !important; }

.admin-add { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-add h3 { font-size: 15px; margin: 0 0 12px; }

.admin-tpl-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-tpl-bar select { max-width: 320px; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.admin-msg { font-size: 13px; color: #b3261e; }
