/* ── Admin-specific styles ──────────────────────────────────────── */

/* Live indicator */
.admin-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.28);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.28); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

/* Refresh button spinner state */
.admin-refresh-btn.loading svg {
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero stat strip ─────────────────────────────────────────────── */
.admin-hero {
  align-items: start !important;
  padding-bottom: 36px;
}

.admin-stat-strip {
  display: grid;
  gap: 12px;
  align-self: start;
}

.admin-stat-card {
  padding: 18px 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  display: grid;
  gap: 4px;
}

.admin-stat-card span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-stat-card strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.admin-stat-card.ink {
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
}
.admin-stat-card.ink span  { color: rgba(255,255,255,.6); }
.admin-stat-card.ink strong { color: #fff; }

.admin-stat-card.accent-yellow { box-shadow: 4px 4px 0 var(--yellow); }
.admin-stat-card.accent-coral  { box-shadow: 4px 4px 0 var(--coral); }

/* ── Tab nav ─────────────────────────────────────────────────────── */
.admin-section {
  margin-top: 48px !important;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.admin-tab {
  padding: 10px 18px;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
  position: relative;
  bottom: -1px;
}

.admin-tab:hover { color: var(--ink); background: rgba(158,230,207,.18); }

.admin-tab.active {
  color: var(--ink);
  background: var(--surface-strong);
  border-color: var(--line);
  border-bottom-color: var(--surface-strong);
}

/* ── Panel content ───────────────────────────────────────────────── */
.admin-panel-content { display: none; }
.admin-panel-content.active { display: block; }

/* ── Chart cards ─────────────────────────────────────────────────── */
.admin-charts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.admin-chart-card {
  padding: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 45px rgba(23, 21, 18, 0.08);
}

.admin-chart-card.full-width {
  margin-bottom: 18px;
}

.admin-chart-card h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

/* Bar chart */
.admin-bar-list { display: grid; gap: 10px; }

.admin-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.admin-bar-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-bar-track {
  height: 8px;
  background: rgba(23,21,18,.08);
  border-radius: 4px;
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 4px;
  transition: width 600ms cubic-bezier(.22,1,.36,1);
}

.admin-bar-fill.cat-music    { background: var(--violet); }
.admin-bar-fill.cat-festival { background: var(--mint); filter: saturate(1.4); }
.admin-bar-fill.cat-comedy   { background: var(--yellow); }
.admin-bar-fill.cat-theatre  { background: var(--coral); }

.admin-bar-value {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

/* Donut */
.admin-donut-wrap {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-donut-wrap canvas { max-height: 160px; }

/* Legend */
.admin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.admin-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.admin-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.admin-table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-table-header h3 { margin: 0; }

.admin-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

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

.admin-table thead tr {
  background: var(--bg);
}

.admin-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

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

.admin-table tbody tr:hover td {
  background: rgba(158, 230, 207, 0.14);
}

/* Mono ID */
.admin-id {
  font-family: "SF Mono", "Fira Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  background: rgba(23,21,18,.06);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Badges */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
}

.admin-badge.reserved,
.admin-badge.selected,
.admin-badge.active {
  background: rgba(158, 230, 207, 0.4);
  border-color: rgba(15, 110, 86, 0.25);
  color: #0F6E56;
}

.admin-badge.pending_review {
  background: rgba(244, 200, 75, 0.35);
  border-color: rgba(185, 117, 23, 0.3);
  color: #854F0B;
}

.admin-badge.approved {
  background: rgba(43, 120, 255, 0.12);
  border-color: rgba(43, 120, 255, 0.3);
  color: var(--blue);
}

.admin-badge.rejected {
  background: rgba(255, 111, 97, 0.15);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

/* Category badges */
.admin-cat {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.admin-cat.music    { background: rgba(124,92,255,.12); color: var(--violet); }
.admin-cat.festival { background: rgba(158,230,207,.45); color: #0F6E56; }
.admin-cat.comedy   { background: rgba(244,200,75,.35); color: #854F0B; }
.admin-cat.theatre  { background: rgba(255,111,97,.15); color: #c0392b; }

/* Action buttons */
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms, color 160ms, box-shadow 160ms;
  font-size: 14px;
}
.admin-action-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.admin-action-btn.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 2px 2px 0 #dc2626;
}
.admin-action-btn.approve:hover {
  background: #0F6E56;
  border-color: #0F6E56;
  box-shadow: 2px 2px 0 #0F6E56;
}

/* Resale select */
.admin-status-select {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

/* Inventory bar inside events table */
.admin-inv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-inv-track {
  flex: 1;
  max-width: 100px;
  height: 6px;
  background: rgba(23,21,18,.08);
  border-radius: 3px;
  overflow: hidden;
}
.admin-inv-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--mint);
  filter: saturate(1.3);
  transition: width 500ms ease;
}

/* Empty state */
.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.admin-empty strong {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--ink);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .admin-charts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .admin-charts-row {
    grid-template-columns: 1fr;
  }
  .admin-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
