/* Admin-only layout. Reuses tokens/.card/.field/.submit-btn/.form-error
   from style.css so the admin page stays visually consistent with the
   public site without duplicating the design system. */

.admin-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px clamp(20px, 5vw, 32px) 48px;
}

/* ---------- Password gate ---------- */
.admin-gate { padding: 40px 0; }
.admin-gate-card { max-width: 360px; margin: 0 auto; }
.admin-hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }

/* ---------- Panel header ---------- */
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-panel-header .card-title { margin: 0; }
.admin-groups-header { margin-top: 40px; }
.admin-new-btn {
  background: var(--main-green);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.admin-new-btn:hover { background: #0f7d14; }

/* ---------- Create/edit form ---------- */
.admin-form-card { margin-bottom: 24px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row .field { min-width: 0; }
.field-row input[type="time"] { min-width: 0; }
.admin-form-card input,
.admin-form-card select {
  height: 47px; /* fixed so date/time inputs can't size themselves off their
    (empty vs filled) content — iOS Safari otherwise collapses them until
    a value is entered, and even Chromium sizes them a couple px taller
    than text inputs by default. */
}
/* Strip the native control chrome so date/time inputs render like the text
   fields (compact, left-aligned, respecting our font/height) instead of iOS
   Safari's tall centered native widget. The tap-to-open picker still works. */
.admin-form-card input[type="date"],
.admin-form-card input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
}
.admin-form-card input[type="time"]::-webkit-calendar-picker-indicator,
.admin-form-card input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.admin-form-actions .submit-btn { width: auto; padding: 12px 24px; }
.admin-cancel-btn {
  background: var(--white);
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.admin-cancel-btn:hover { border-color: var(--muted); }

/* ---------- Event table ---------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.admin-topic { font-weight: 600; color: var(--dark-green); }
.admin-group-header-row td {
  background: var(--light-green);
  color: var(--dark-green);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
}
.admin-time { color: var(--muted); font-size: 0.82rem; }
.admin-series-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--light-green);
  color: var(--dark-green);
  font-size: 0.7rem;
  font-weight: 600;
}
.admin-table td.admin-actions-cell { vertical-align: middle; white-space: nowrap; }
/* #event-table only: keep the Date + time-range column from wrapping mid-line
   when the table has to squeeze against a long Location value — the address
   should be the one to wrap, not the date. */
#event-table td:nth-child(2),
#event-table th:nth-child(2) {
  white-space: nowrap;
}
.admin-row-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.admin-row-actions button {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 12px;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.12s ease, color 0.12s ease;
}
.admin-row-actions button:hover { border-color: var(--main-green); color: var(--main-green); }
.admin-row-actions button.delete:hover { border-color: #b3261e; color: #b3261e; }

@media (max-width: 560px) {
  .admin-table th,
  .admin-table td { padding-left: 8px; padding-right: 8px; }
  .admin-table th:first-child,
  .admin-table td:first-child { padding-right: 4px; }
  /* #event-table only: Topic, Date, Location, Actions — hide Location on
     small screens. #group-table has a different column layout (Name,
     Location, Actions), so this must not be a generic .admin-table rule
     or it clobbers the wrong column there. */
  #event-table th:nth-child(3),
  #event-table td:nth-child(3) { display: none; }
  #event-table th:nth-child(2),
  #event-table td:nth-child(2) { padding-left: 4px; }
}
