/* ProctorPool: one small stylesheet, no framework. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1d2229;
  --muted: #667085;
  --line: #dde1e7;
  --brand: #b3141c;        /* GASQ red */
  --brand-dark: #8e0f16;
  --accent: #e8912d;       /* the orange buttons of the old tool */
  --accent-dark: #c97614;
  --focus: #2f6fde;
  --ok: #1f8a4c;
  --warn: #9a6400;
  --warn-bg: #fff4dc;
  --err: #b42318;
  --err-bg: #fdecea;
  --info-bg: #e8f1fd;
  /* marker colours */
  --pin-venue: #d92d20;
  --pin-available: #22a447;
  --pin-contacted: #2f6fde;
  --pin-assigned: #f5c518;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--focus); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
h1 { font-size: 1.5rem; margin: 0; font-weight: 650; }
h2 { font-size: 1.1rem; margin: 0 0 .9rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); font-weight: 400; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: #1d2229; color: #fff; padding: .6rem 1.25rem;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.brand__mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand); font-size: .95rem;
}
.brand__sub { color: #aab2bf; font-weight: 400; font-size: .85rem; margin-left: .35rem; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a { color: #d6dae1; text-decoration: none; padding: .4rem .75rem; border-radius: 6px; }
.nav a:hover { background: #2c333d; color: #fff; }
.nav a.is-active { background: #353d49; color: #fff; }
.userbox { display: flex; align-items: center; gap: .5rem; margin: 0; }
.userbox__name { color: #aab2bf; font-size: .9rem; }
.userbox .btn--link { color: #fff; }

/* --- page --- */
.page { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; flex-wrap: wrap; }
.pagehead small { font-size: .95rem; margin-left: .35rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card--narrow { max-width: 420px; margin: 3rem auto; }
.tagline { margin: .35rem 0 1.25rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cols > .card { margin-bottom: 0; }
.cols + .card { margin-top: 1rem; }
.empty { color: var(--muted); padding: 2rem; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- flashes --- */
.flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .65rem .9rem; border-radius: 6px; background: var(--info-bg); border: 1px solid #c5d9f6; }
.flash--success { background: #e7f6ec; border-color: #b7e2c4; }
.flash--warning { background: var(--warn-bg); border-color: #f2d9a4; color: #5c3d00; }
.flash--error { background: var(--err-bg); border-color: #f5c2bd; color: var(--err); }
.card .flash { margin: .75rem 0 0; }

/* --- forms --- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.5rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field--check { justify-content: flex-end; padding-bottom: .5rem; }
.field label { font-weight: 600; font-size: .88rem; }
.req { color: var(--brand); }
.input {
  width: 100%; padding: .5rem .65rem; font: inherit; color: inherit;
  border: 1px solid #c8ced8; border-radius: 6px; background: #fff;
}
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.input:disabled { background: #eef0f3; color: var(--muted); }
textarea.input { resize: vertical; }
.input--mail { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.input--search { max-width: 340px; }
.input--grow { flex: 1; min-width: 220px; }
.input--auto { width: auto; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; }
.hint { color: var(--muted); font-size: .82rem; }
.error { color: var(--err); font-size: .85rem; }
.has-error .input { border-color: var(--err); }
.position { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.position summary { cursor: pointer; font-weight: 600; }
.position .grid { margin-top: .5rem; }
.minimap { height: 220px; border-radius: 6px; border: 1px solid var(--line); margin-top: .75rem; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .9rem;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2; text-decoration: none;
  color: var(--text); background: #fff; border: 1px solid #c8ced8; border-radius: 6px; cursor: pointer;
}
.btn:hover { background: #f1f3f6; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn--danger { color: var(--err); border-color: #f0b4ae; }
.btn--danger:hover { background: var(--err-bg); }
.btn--link { background: none; border-color: transparent; color: var(--focus); padding-left: .4rem; padding-right: .4rem; }
.btn--link:hover { background: none; text-decoration: underline; }
.btn--small { padding: .3rem .6rem; font-size: .82rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.actions--sticky {
  position: sticky; bottom: 0; background: rgba(244, 245, 247, .95);
  padding: .75rem 0; margin: 0; border-top: 1px solid var(--line); z-index: 500;
}
.actions--inline { margin-top: .75rem; }
form.inline { display: inline; margin: 0; }
.danger-zone { margin-top: 2rem; text-align: right; }

/* --- filters --- */
.filterbar, .searchbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.segmented { display: inline-flex; border: 1px solid #c8ced8; border-radius: 6px; overflow: hidden; background: #fff; }
.segmented a { padding: .45rem .8rem; text-decoration: none; color: var(--text); font-size: .88rem; border-right: 1px solid #c8ced8; }
.segmented a:last-child { border-right: 0; }
.segmented a.is-active { background: #1d2229; color: #fff; }

/* --- tables --- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .tablewrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .6rem .75rem; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: .6rem .75rem; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfd; }
.table--compact td, .table--compact th { padding: .4rem .6rem; }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-assigned td { background: #fffbe6; }
.table td .btn + .inline, .table td .inline + .btn { margin-left: .25rem; }

/* --- tags, dots --- */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: #eef0f3; color: var(--muted); vertical-align: middle; white-space: nowrap; }
.tag--sent, .tag--ok { background: #e3f4e9; color: var(--ok); }
.tag--logged, .tag--approx { background: var(--warn-bg); color: var(--warn); }
.tag--failed { background: var(--err-bg); color: var(--err); }
.tag--manual { background: #eef0f3; color: #475467; }
.tag--contacted { background: #e5eefc; color: #1d4fb0; }
.tag--assigned { background: #fff3bf; color: #7a5b00; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--ok); }
.dot--approx { background: var(--accent); }

/* --- definition lists, pre --- */
.dl { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; }
.pre { white-space: pre-wrap; font: inherit; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: .6rem .75rem; margin: 0; }

/* --- the examiner map --- */
.examline { margin: -.25rem 0 1rem; color: var(--muted); }
.map { height: 62vh; min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); background: #e9eef2; }
.legend { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.listhead { margin: 1.25rem 0 .6rem; }
.pin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 1.5px solid rgba(0, 0, 0, .45); vertical-align: middle;
  background: var(--pin-available);
}
.pin--big { width: 22px; height: 22px; border-width: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.pin--big::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 0, 0, .35); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pin { position: relative; }
.pin--venue { background: var(--pin-venue); }
.pin--available { background: var(--pin-available); }
.pin--contacted { background: var(--pin-contacted); }
.pin--assigned { background: var(--pin-assigned); }
.pin.is-clickable { cursor: pointer; }
.pinicon { background: none; border: 0; }
.pinicon .pin { position: absolute; left: 0; top: 0; }
.leaflet-container path.radius { stroke: var(--brand); stroke-dasharray: 6 6; fill: var(--brand); fill-opacity: .04; }

.popup { display: grid; gap: .35rem; font-size: .88rem; min-width: 200px; }
.popup__assign { margin: 0; }
.linkbutton { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); text-decoration: underline; cursor: pointer; text-align: left; }
.popup__request { font-weight: 700; }
.popup__name { font-style: italic; }
.popup__address { color: #344054; }
.popup__facts { color: var(--muted); font-size: .8rem; }
.popup .tag { justify-self: start; }

/* --- request mail --- */
.sentbox { background: #e3f1f8; border: 1px solid #bcdcec; border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1rem; color: #1f5f7a; }
.sentbox ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.sentbox li { margin: .15rem 0; }

@media (max-width: 760px) {
  .grid, .cols { grid-template-columns: 1fr; }
  .page { padding: 1rem; }
  .brand__sub { display: none; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: .35rem; }
}
