/* volunteer_standard explorer — simple, serious, print-friendly */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1c1e21;
  --muted: #6b7178;
  --accent: #0f5132;
  --accent-soft: #dcefe4;
  --border: #d9dcd6;
  --radius: 6px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.wrap, header, section, footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  padding-top: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--accent);
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* per-site stat chips */
.pacing-info { color: var(--muted); font-size: 0.9rem; }

.state {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.state-running { background: var(--accent-soft); color: var(--accent); }
.state-paused { background: #f4ecd8; color: #7a5b00; }
.state-idle { background: #e2e8f2; color: #2c4a7a; }
.state-stopped { background: #ececea; color: var(--muted); }

.bad { color: #a12622; font-weight: 600; }
.muted { color: var(--muted); font-size: 0.8rem; }
.url-col { font-family: ui-monospace, monospace; font-size: 0.8rem; max-width: 320px; overflow-wrap: anywhere; }
.controls-cell { white-space: nowrap; }
.controls-cell .ctl { margin-right: 0.25rem; padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.stat-chip b { color: var(--ink); font-weight: 600; }
.stat-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.stat-chip.active b { color: var(--accent); }

/* controls */
.controls { padding-top: 0.75rem; }

#search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

#search-input {
  flex: 1 1 320px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

#site-filter {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.95rem;
}

button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.95rem;
  cursor: pointer;
}

button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:hover { filter: brightness(0.96); }
button:disabled { opacity: 0.45; cursor: default; }

/* results */
.results { padding-top: 1rem; }

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#pager { display: flex; align-items: center; gap: 0.6rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  background: #efefec;
  border-bottom: 2px solid var(--border);
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f4f6f2; }
tbody tr.clickable { cursor: pointer; }

td.empty { text-align: center; color: var(--muted); padding: 1.5rem; }

td.id-col { color: var(--muted); white-space: nowrap; }
td.site-col .site-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
.null { color: var(--muted); font-style: italic; }

/* detail panel */
.detail-panel {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.detail-header h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
#detail-close {
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
}

.detail-attrs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
}

.detail-attrs dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.detail-attrs dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }

details summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
pre {
  background: #f1f1ee;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.78rem;
  overflow: auto;
  max-height: 420px;
}

footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

code {
  background: #ececea;
  border-radius: 3px;
  padding: 0 0.3em;
  font-size: 0.9em;
}

@media print {
  .controls, #pager, footer { display: none; }
}

/* govo formatted template view */
.detail-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
}

.detail-view-toggle button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.detail-view-toggle button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#detail-formatted[hidden] { display: none; }

.govo-section { margin: 0 0 1rem; }
.govo-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
}

.govo-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
}

.govo-fields dt { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.govo-fields dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }

.govo-image {
  max-width: 220px;
  max-height: 160px;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 0.75rem;
}

.govo-shifts {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.govo-shifts th,
.govo-shifts td {
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  text-align: left;
}

/* ---- top-right nav (admin / log out) ---- */
header { position: relative; }

.top-right {
  position: absolute;
  top: 2rem;
  right: 1.25rem;
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.top-right a { color: var(--accent); }

/* ---- login page ---- */
.login-card {
  max-width: 22rem;
  margin: 3rem auto 0;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.login-card label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

.login-card button { margin-top: 1.25rem; width: 100%; }

.login-error { color: #a4262c; font-size: 0.9rem; margin: 0.75rem 0 0; }

/* ---- admin page ---- */
.admin-section { padding-top: 1.25rem; }
.admin-section h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

.admin-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.admin-form input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.admin-msg { color: #a4262c; font-size: 0.9rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-actions { white-space: nowrap; }
.admin-actions button {
  margin-right: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
}
