/* ── Admin portal ── consistent with the main app design tokens */

html:has(body.admin-body) {
  height: auto;
  overflow: auto;
}

/* Body resets */
.admin-body {
  display: block;
  overflow-y: auto;
  height: auto;
  background: var(--sidebar-bg, #f9fafb);
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text, #111827);
  -webkit-font-smoothing: antialiased;
}

/* ── Top header ── */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--main-bg, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 20px;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-xs, 6px);
  padding: 4px 8px;
  margin-left: -8px;
  transition: background 0.12s, color 0.12s;
}

.admin-back:hover {
  background: var(--border-light, #f3f4f6);
  color: var(--text, #111827);
}

.admin-header-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.admin-header h1 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text, #111827);
}

.admin-header-divider {
  height: 20px;
  width: 1px;
  background: var(--border, #e5e7eb);
}

/* ── Denied state ── */
.admin-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 48px 24px;
  text-align: center;
}

.admin-denied-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fef2f2;
  color: #b91c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.admin-denied h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}

.admin-denied p {
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

/* ── Main layout ── */
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ── Tab nav ── */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.admin-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted, #6b7280);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
  letter-spacing: 0.01em;
}

.admin-tab:hover {
  color: var(--text, #111827);
}

.admin-tab.active {
  color: var(--brand, #0f766e);
  border-bottom-color: var(--brand, #0f766e);
}

/* ── Panel header ── */
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-panel-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text, #111827);
}

/* ── Search row ── */
.admin-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-light, #9ca3af);
  pointer-events: none;
}

.admin-search-input-wrap input {
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  font-size: 13.5px;
  min-width: 260px;
  background: var(--main-bg, #fff);
  color: var(--text, #111827);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.admin-search-input-wrap input:focus {
  outline: none;
  border-color: var(--brand, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

/* ── Buttons ── */
.admin-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--main-bg, #fff);
  color: var(--text, #111827);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.admin-btn:hover {
  background: var(--border-light, #f3f4f6);
  border-color: #d1d5db;
}

.admin-btn.primary {
  background: var(--brand, #0f766e);
  color: #fff;
  border-color: var(--brand, #0f766e);
}

.admin-btn.primary:hover {
  background: var(--brand-hover, #0d6b63);
  border-color: var(--brand-hover, #0d6b63);
}

.admin-btn.admin-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.admin-btn.admin-btn-danger:hover {
  color: #991b1b;
  border-color: #fca5a5;
  background: #ffe4e6;
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Card wrapper for table ── */
.admin-table-wrap {
  overflow-x: auto;
  background: var(--main-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.07));
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  background: var(--sidebar-bg, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.admin-table th:first-child { border-radius: var(--radius, 14px) 0 0 0; }
.admin-table th:last-child  { border-radius: 0 var(--radius, 14px) 0 0; }

.admin-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  color: var(--text, #111827);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr {
  transition: background 0.08s;
}

.admin-table tbody tr:hover td {
  background: var(--border-light, #f3f4f6);
}

.admin-table .admin-cell-actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ── Icon-only action buttons ── */
.admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  transition: background 0.12s, color 0.12s;
  position: relative;
  flex-shrink: 0;
  padding: 0;
}

.admin-icon-btn:hover {
  background: var(--border-light, #f3f4f6);
  color: var(--text, #111827);
}

.admin-icon-btn.danger {
  color: #dc2626;
}

.admin-icon-btn.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.admin-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* CSS tooltip */
.admin-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 200;
}

.admin-icon-btn[data-tooltip]:hover::after {
  opacity: 1;
}

.admin-table .admin-link {
  color: var(--brand, #0f766e);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.admin-table .admin-link:hover {
  text-decoration: underline;
}

/* ── View switcher ── */
.admin-view { }
.admin-view.hidden { display: none; }

/* ── Breadcrumb ── */
.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.admin-breadcrumb-link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.1s;
}
.admin-breadcrumb-link:hover { opacity: 0.75; text-decoration: underline; }

.admin-breadcrumb-sep {
  color: var(--text-light, #9ca3af);
  font-size: 14px;
  line-height: 1;
}

.admin-breadcrumb-current {
  font-weight: 600;
  color: var(--text, #111827);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Two-pane detail view ── */
.admin-detail-panes {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: 560px;
  min-height: 0;
}

.admin-sessions-pane,
.admin-convo-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  overflow: hidden;
  background: var(--main-bg, #fff);
  box-shadow: var(--shadow-sm);
}

.admin-pane-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  background: var(--sidebar-bg, #f9fafb);
  flex-shrink: 0;
  overflow: visible;
}

.admin-pane-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-pane-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111827);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Session filters (left pane) */
.admin-sessions-filters {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--sidebar-bg, #f9fafb);
}

.admin-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-filter-select {
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs, 6px);
  background: var(--main-bg, #fff);
  color: var(--text, #111827);
  width: 100%;
}

.admin-filter-turns {
  width: 100%;
}

.admin-filter-range {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.admin-filter-range-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-filter-range-col .admin-filter-select {
  width: 100%;
}

.admin-filter-sublabel {
  font-size: 10px;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
}

.admin-filter-range-sep {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  flex-shrink: 0;
  padding-bottom: 7px;
}

.admin-filter-apply {
  font-size: 12px;
  padding: 6px 12px;
  width: 100%;
}

.admin-session-feedback {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  line-height: 1;
}
.admin-session-feedback-up { opacity: 0.9; }
.admin-session-feedback-down { opacity: 0.8; }

.admin-session-checkin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  width: fit-content;
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.admin-session-checkin-no-reply {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
.admin-session-checkin-replied {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

/* Sessions list (left pane) */
.admin-sessions-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-session-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.admin-session-item:last-child { border-bottom: none; }
.admin-session-item:hover { background: var(--brand-xlight, #f0fdfa); }
.admin-session-item.active {
  background: var(--brand-xlight, #f0fdfa);
  border-right: 2px solid var(--brand, #0f766e);
}

.admin-session-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.admin-session-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-select-cell {
  width: 36px;
}

.admin-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand, #0f766e);
  cursor: pointer;
}

.admin-inline-danger {
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.admin-inline-danger:hover {
  text-decoration: underline;
}

.admin-session-title {
  font-size: 13px;
  color: var(--text, #111827);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-session-meta {
  font-size: 11.5px;
  color: var(--text-muted, #6b7280);
}

/* Conversation pane (right) */
.admin-messages-pane {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.admin-convo-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted, #6b7280);
}
.admin-convo-empty p {
  font-size: 13px;
  margin: 0;
}

/* Keep .admin-messages for backwards compat (not used as pane now) */
.admin-messages {
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  padding: 20px;
  background: var(--main-bg, #fff);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.admin-msg.user {
  align-self: flex-end;
}

.admin-msg.assistant {
  align-self: flex-start;
}

.admin-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  padding: 0 2px;
}

.admin-msg .role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light, #9ca3af);
}

.admin-msg.user .role { color: var(--brand, #0f766e); }

.admin-msg-time {
  font-size: 11px;
  color: var(--text-light, #9ca3af);
}

.admin-msg-body {
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.admin-msg.user .admin-msg-body {
  background: var(--brand, #0f766e);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.admin-msg.assistant .admin-msg-body {
  background: var(--sidebar-bg, #f9fafb);
  border: 1px solid var(--border-light, #f3f4f6);
  color: var(--text, #111827);
  border-bottom-left-radius: 3px;
}

.admin-msg-body p { margin: 0 0 8px; }
.admin-msg-body p:last-child { margin-bottom: 0; }
.admin-msg-body ul, .admin-msg-body ol { margin: 0 0 8px; padding-left: 1.3em; }
.admin-msg-body li { margin-bottom: 3px; }

.admin-msg.user .admin-msg-body a { color: rgba(255,255,255,0.85); }
.admin-msg.assistant .admin-msg-body a { color: var(--brand); }
.admin-msg-body a:hover { text-decoration: underline; }

.admin-msg-body code {
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
}

.admin-msg.user .admin-msg-body code { background: rgba(255,255,255,0.2); }

.admin-msg-body pre {
  margin: 8px 0;
  padding: 10px 12px;
  overflow-x: auto;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}

.admin-msg.user .admin-msg-body pre { background: rgba(255,255,255,0.15); }

/* ── States ── */
.admin-hint {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin: 0 0 14px;
}

.admin-state-row {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
}

.admin-error-row {
  padding: 32px 16px;
  text-align: center;
  color: #b91c1c;
  font-size: 14px;
}

/* ── Badges ── */
.admin-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-right: 6px;
}

.admin-badge.guest {
  background: var(--border-light, #f3f4f6);
  color: var(--text-muted, #6b7280);
}

.admin-badge.active {
  background: var(--brand-xlight, #f0fdfa);
  color: var(--brand, #0f766e);
}

.admin-badge.inactive {
  background: #fef2f2;
  color: #b91c1c;
}

/* ── Modal ── */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.admin-modal-content {
  background: var(--main-bg, #fff);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,0.12));
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.admin-modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.admin-modal-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
}

.admin-modal-close:hover { background: var(--border-light); color: var(--text); }

.admin-modal-body {
  padding: 20px 24px;
}

.admin-form-row {
  margin-bottom: 14px;
}

.admin-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.admin-form-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  color: var(--text, #111827);
  background: var(--main-bg, #fff);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.admin-form-input:focus {
  outline: none;
  border-color: var(--brand, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.admin-form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
}

.admin-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}

.admin-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Bulk upload modal ── */
.admin-bulk-content {
  max-width: 600px;
}

.admin-bulk-hint {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.55;
  padding: 12px;
  background: var(--border-light, #f3f4f6);
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 16px;
}

.admin-bulk-hint code {
  background: var(--main-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.admin-bulk-mode select,
.admin-bulk-csv textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  font-size: 13.5px;
  color: var(--text);
  background: var(--main-bg);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.admin-bulk-mode select:focus,
.admin-bulk-csv textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.admin-bulk-csv textarea {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12.5px;
  resize: vertical;
  min-height: 120px;
}

.admin-bulk-csv input[type="file"] {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-bulk-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13.5px;
  line-height: 1.5;
}

.admin-bulk-result.success {
  background: var(--brand-xlight, #f0fdfa);
  border: 1px solid var(--brand-subtle, #ccfbf1);
  color: var(--brand, #0f766e);
}

.admin-bulk-result.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* ── Sidebar admin link ── */
.sidebar-admin-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand, #0f766e);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-admin-link:hover {
  background: var(--brand-xlight, #f0fdfa);
}

.sidebar-admin-link svg {
  flex-shrink: 0;
}

/* ── Table header meta text ── */
.admin-th-meta {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
  margin-left: 5px;
}

.admin-events-panel {
  margin-bottom: 16px;
}

.admin-events-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-event-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  background: var(--main-bg, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.07));
  padding: 14px 16px;
}

.admin-event-card-value {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text, #111827);
}

.admin-event-card-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

.admin-events-list {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  background: var(--main-bg, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.07));
  overflow: hidden;
}

.admin-event-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}

.admin-event-row:last-child {
  border-bottom: none;
}

.admin-event-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.admin-event-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111827);
}

.admin-event-time {
  font-size: 11.5px;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}

.admin-event-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

/* ── Responsive: stack panes on narrow screens ── */
@media (max-width: 700px) {
  .admin-events-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-detail-panes {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
    height: auto;
  }
}

/* ── Utility ── */
.hidden {
  display: none !important;
}

/* ── Check-in tab ── */
.admin-checkin-section {
  padding: 0 0 20px 0;
}

.admin-checkin-user-selected {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 10px;
}

.admin-checkin-user-selected strong {
  color: var(--text, #111827);
}

.admin-checkin-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn-danger {
  background: #fff;
  border-color: #ef4444;
  color: #ef4444;
}

.admin-btn-danger:hover {
  background: #fef2f2;
}

/* ── User interactions table toolbar (sort + filter chips) ── */
.admin-table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--main-bg, #fff);
}

.admin-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-filter-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border, #e5e7eb);
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.admin-filter-chip:hover {
  background: var(--border-light, #f3f4f6);
  color: var(--text, #111827);
}

.admin-filter-chip.active {
  background: var(--brand-xlight, #f0fdfa);
  color: var(--brand, #0f766e);
  border-color: var(--brand, #0f766e);
}

/* Active sort column header */
.admin-th-sort-active {
  color: var(--brand, #0f766e);
}
