/* ==========================================================================
   Admin Section - Listener Analytics & User Tracking
   ========================================================================== */
.admin-nav-btn {
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.25), rgba(255, 209, 102, 0.3));
  border: 1px solid rgba(255, 209, 102, 0.5);
  color: #ffd166;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 15px rgba(255, 209, 102, 0.2);
  transition: all 0.2s ease;
}

.admin-nav-btn:hover {
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.4), rgba(255, 209, 102, 0.5));
  border-color: #ffd166;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.4);
  transform: translateY(-1px);
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.admin-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-panel {
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 42, 109, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255, 42, 109, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-overlay.active .admin-panel {
  transform: translateY(0);
}

.admin-panel-header {
  padding: 24px 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 9, 23, 0.85);
}

.admin-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-title-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.admin-title-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.admin-title-text h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.admin-title-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.admin-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-panel-body {
  padding: 24px 30px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Overview Stat Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  flex-shrink: 0;
}

#admin-card-tracks {
  grid-column: span 2;
}

.admin-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.18s ease,
              box-shadow 0.18s ease,
              background-color 0.18s ease;
}

.admin-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(225, 29, 72, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 14px rgba(225, 29, 72, 0.18);
}

.admin-metric-card:focus-visible {
  outline: 2px solid var(--accent-crimson);
  outline-offset: 2px;
}

.admin-metric-card.active-tab-card {
  border-color: var(--accent-crimson);
  background: linear-gradient(145deg, rgba(225, 29, 72, 0.14), var(--bg-card) 60%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 18px rgba(225, 29, 72, 0.3);
}

.admin-metric-card.active-tab-card::after {
  height: 4px;
  background: var(--accent-gradient);
  opacity: 1;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.7);
}

.admin-metric-card.active-tab-card .admin-metric-label {
  color: #fff;
}

.admin-metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.7;
}

.admin-metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.admin-metric-val {
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.admin-metric-sub {
  font-size: 0.8rem;
  color: var(--accent-crimson);
}

/* Real-Time Pulse Indicator & Active Card */
.live-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
  animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
  0% { transform: scale(0.95); opacity: 0.6; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.95); opacity: 0.6; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

#admin-card-active.is-active {
  border-color: rgba(74, 222, 128, 0.45);
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.12);
}

#admin-card-active.is-active::after {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  opacity: 1;
}

#admin-card-active.is-active .admin-metric-val {
  color: #4ade80;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

#admin-card-active.active-tab-card {
  border-color: #22c55e;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.14), var(--bg-card) 60%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 18px rgba(34, 197, 94, 0.28);
}

#admin-card-active.active-tab-card::after {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  opacity: 1;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
}

/* Tabs */
.admin-nav-tabs {
  display: flex;
  /* Wrap instead of scrolling horizontally: the scrollbar was hidden, so any
     tab that did not fit was unreachable by mouse, and the tab labels were
     clipped at every viewport width. Wrapping keeps all five visible, and
     dropping overflow also restores the automatic minimum height that the
     90vh flex column was using to crush the strip. */
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  flex-shrink: 0;
}

.admin-tab {
  flex-shrink: 0;
  /* Never let a single label be wider than the strip: at very narrow widths the
     button shrinks and its text wraps instead of pushing the row sideways. */
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
  background: rgba(255, 42, 109, 0.15);
  border-color: rgba(255, 42, 109, 0.4);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 42, 109, 0.2);
}

/* Controls row (search, refresh) */
.admin-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.admin-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.admin-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 38px;
  font-size: 0.88rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.admin-search-input:focus {
  border-color: var(--accent-crimson);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px rgba(255, 42, 109, 0.2);
}

.admin-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  fill: var(--text-muted);
}

.admin-refresh-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.admin-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Data Table */
/* Data Table & Scrollable Views */
.admin-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.admin-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 520px;
  position: relative;
  -webkit-overflow-scrolling: touch;
  /* Scroll containers lose their automatic minimum size, so this would
     otherwise collapse to a few pixels on short viewports. */
  flex-shrink: 0;
}

.admin-table-wrapper::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.admin-table-wrapper::-webkit-scrollbar-track {
  background: rgba(14, 6, 18, 0.7);
  border-radius: 4px;
}

.admin-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 42, 109, 0.35);
  border-radius: 4px;
}

.admin-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 42, 109, 0.65);
}

.admin-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: #15081d;
  padding: 13px 18px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.admin-table th.sortable:hover,
.admin-table th.sortable:focus-visible {
  color: #fff;
  background: #200d2b;
  outline: none;
}

.admin-table th.sortable .sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  vertical-align: middle;
}

.admin-table th.sortable .sort-icon svg {
  display: block;
}

.admin-table th.sortable .sort-asc,
.admin-table th.sortable .sort-desc {
  opacity: 0.28;
  transition: opacity 0.15s ease, fill 0.15s ease;
}

.admin-table th.sortable:hover .sort-asc,
.admin-table th.sortable:hover .sort-desc {
  opacity: 0.6;
}

.admin-table th.sortable.active {
  color: #ff4d8d;
}

.admin-table th.sortable.active.asc .sort-asc {
  opacity: 1;
  fill: #ff2a6d;
}

.admin-table th.sortable.active.asc .sort-desc {
  opacity: 0.12;
}

.admin-table th.sortable.active.desc .sort-desc {
  opacity: 1;
  fill: #ff2a6d;
}

.admin-table th.sortable.active.desc .sort-asc {
  opacity: 0.12;
}

/* Pagination Bar */
.admin-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(18, 8, 24, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.admin-pagination-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-pagination-info strong {
  color: #fff;
  font-weight: 600;
}

.admin-per-page-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-per-page-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  padding: 5px 10px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.admin-per-page-select:focus,
.admin-per-page-select:hover {
  border-color: var(--accent-crimson);
}

.admin-per-page-select option {
  background: #1a0b22;
  color: #fff;
}

.admin-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-page-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.admin-page-btn:hover:not(:disabled) {
  background: rgba(255, 42, 109, 0.15);
  border-color: rgba(255, 42, 109, 0.4);
  color: #fff;
}

.admin-page-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 42, 109, 0.4);
}

.admin-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.admin-page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  font-size: 0.85rem;
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 42, 109, 0.04);
}

.admin-user-cell {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  font-weight: 600;
  color: #fff;
}

.admin-user-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
}

.status-badge.verified {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-badge.unverified {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-badge.expired {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.guest {
  background: rgba(157, 78, 221, 0.12);
  color: #c084fc;
  border: 1px solid rgba(157, 78, 221, 0.3);
}

.duration-pill {
  font-weight: 600;
  color: #ffd166;
  font-variant-numeric: tabular-nums;
}

.btn-inspect-user {
  background: rgba(255, 42, 109, 0.12);
  border: 1px solid rgba(255, 42, 109, 0.3);
  color: var(--accent-crimson);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-inspect-user:hover {
  background: var(--accent-crimson);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-crimson-glow);
}

.admin-user-actions {
  white-space: nowrap;
}

.btn-delete-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.btn-delete-user:hover {
  border-color: #f43f5e;
  background: #f43f5e;
  color: #fff;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

.btn-delete-user svg {
  fill: currentColor;
}

/* User Inspector Detail Modal */
.user-drilldown-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.user-drilldown-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.user-drilldown-card {
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  background: #130a18;
  border: 1px solid rgba(255, 42, 109, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.9), 0 0 30px rgba(255,42,109,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drilldown-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drilldown-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* IP Tracking & Intelligence Elements */
.ip-link-badge {
  background: rgba(255, 42, 109, 0.1);
  border: 1px solid rgba(255, 42, 109, 0.25);
  color: #ff6594;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ip-link-badge:hover {
  background: var(--accent-crimson);
  color: #fff;
  border-color: var(--accent-crimson);
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.4);
}

.ip-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ip-info-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.ip-info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-crimson);
  opacity: 0.8;
}

.ip-info-box-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.ip-info-box-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.ip-info-box-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.ip-info-box-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.raw-ua-wrapper {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.raw-ua-wrapper:hover {
  white-space: normal;
  word-break: break-all;
  color: #ddd;
}

/* ==========================================================================
   Admin Recording Upload Styles
   ========================================================================== */
.admin-upload-action-btn {
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.25), rgba(255, 77, 141, 0.15)) !important;
  border-color: rgba(255, 42, 109, 0.45) !important;
  color: #ff4d8d !important;
}

.admin-upload-action-btn:hover {
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.4), rgba(255, 77, 141, 0.25)) !important;
  color: #fff !important;
  border-color: #ff2a6d !important;
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.3);
}

.admin-upload-container {
  padding: 8px 4px 20px;
}

.admin-upload-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.admin-upload-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.admin-upload-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.admin-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 860px) {
  .admin-upload-grid {
    grid-template-columns: 1fr;
  }
}

.admin-upload-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.required-star {
  color: #ff2a6d;
}

.admin-form-row {
  display: flex;
  gap: 16px;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  background: rgba(18, 8, 24, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 14px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: #ff2a6d;
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.25);
}

.admin-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.admin-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.admin-tier-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-tier-option input[type="radio"] {
  display: none;
}

.admin-tier-box {
  display: block;
  padding: 12px 14px;
  background: rgba(18, 8, 24, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.admin-tier-option input[type="radio"]:checked + .admin-tier-box {
  border-color: #ff2a6d;
  background: rgba(255, 42, 109, 0.1);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.2);
}

.admin-tier-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.admin-tier-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Audio Drop Zone */
.admin-file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.admin-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: rgba(18, 8, 24, 0.6);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.admin-dropzone:hover,
.admin-dropzone.dragover {
  border-color: #ff2a6d;
  background: rgba(255, 42, 109, 0.08);
  box-shadow: 0 0 16px rgba(255, 42, 109, 0.15);
}

.admin-dropzone-icon {
  width: 36px;
  height: 36px;
  fill: #ff2a6d;
  margin-bottom: 8px;
  opacity: 0.85;
}

.admin-dropzone-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.admin-dropzone-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.admin-dropzone-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 42, 109, 0.12);
  border: 1px solid rgba(255, 42, 109, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
}

.admin-dropzone-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-dropzone-filesize {
  font-size: 0.76rem;
  color: #ff4d8d;
}

.admin-btn-remove-file {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.admin-btn-remove-file:hover {
  color: #fff;
}

/* Cover Grid */
.admin-cover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.admin-cover-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-cover-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

.admin-cover-item.selected {
  border-color: #ff2a6d;
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.5);
}

.admin-cover-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-cover-item .cover-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 6px;
  font-size: 0.68rem;
  color: #fff;
  text-align: center;
  backdrop-filter: blur(2px);
}

/* Upload Footer & Progress */
.admin-upload-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-upload-progress-wrapper {
  background: rgba(18, 8, 24, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.admin-upload-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-upload-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.admin-upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff2a6d, #9d4edd);
  border-radius: 4px;
  transition: width 0.15s ease;
}

.admin-upload-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.admin-upload-status {
  font-size: 0.86rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  flex: 1;
}

.admin-upload-status.success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.admin-upload-status.error {
  background: rgba(255, 42, 109, 0.15);
  border: 1px solid rgba(255, 42, 109, 0.4);
  color: #ff4d8d;
}

.admin-submit-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff2a6d, #d81b60);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 28px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 15px rgba(255, 42, 109, 0.4);
}

.admin-submit-upload-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 42, 109, 0.55);
}

.admin-submit-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.custom-track-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 42, 109, 0.18);
  border: 1px solid rgba(255, 42, 109, 0.4);
  color: #ff2a6d;
}

.featured-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 183, 3, 0.18);
  border: 1px solid rgba(255, 183, 3, 0.45);
  color: #ffb703;
}

.admin-btn-featured-track {
  background: rgba(255, 183, 3, 0.12);
  border: 1px solid rgba(255, 183, 3, 0.35);
  color: #ffb703;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}

.admin-btn-featured-track:hover {
  background: rgba(255, 183, 3, 0.28);
  border-color: #ffb703;
  color: #fff;
  transform: translateY(-1px);
}

.admin-btn-featured-track.active {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.35), rgba(255, 42, 109, 0.25));
  border-color: #ffb703;
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 183, 3, 0.3);
}

.admin-btn-delete-track {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.admin-btn-delete-track:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
  transform: scale(1.05);
}

/* Section Header Bar for Artists & Categories */
.admin-section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}

.admin-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.admin-section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.admin-action-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(255, 42, 109, 0.3);
}

.admin-action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 42, 109, 0.45);
}

.admin-btn-edit-track {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #00f0ff;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}

.admin-btn-edit-track:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  color: #fff;
  transform: translateY(-1px);
}

.track-title-link {
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.track-title-link:hover,
.track-title-link:focus-visible {
  color: #ffd166;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.track-title-link .track-inspect-hint {
  opacity: 0;
  transform: translateX(-3px);
  transition: all 0.18s ease;
  color: #ffd166;
}

.track-title-link:hover .track-inspect-hint {
  opacity: 0.85;
  transform: translateX(0);
}

.admin-btn-track-listeners {
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  color: #ffd166;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}

.admin-btn-track-listeners:hover {
  background: rgba(255, 209, 102, 0.25);
  border-color: #ffd166;
  color: #fff;
  transform: translateY(-1px);
}

.sort-tag-badge {
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: #ffd166;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-btn-upload-new-img {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 42, 109, 0.5);
  color: #ff2a6d;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn-upload-new-img:hover {
  background: rgba(255, 42, 109, 0.15);
  border-color: #ff2a6d;
  color: #fff;
}

/* Sub-modals for Editing Recordings, Artists, Categories */
.admin-submodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100010;
  background: rgba(5, 5, 10, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.admin-submodal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 42, 109, 0.2);
  overflow: hidden;
}

.admin-submodal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.admin-submodal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.admin-submodal-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-submodal-form {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-submodal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-submodal-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-submodal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-artist-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-artist-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 42, 109, 0.4);
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.25);
  flex-shrink: 0;
}

.admin-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #fff;
}

/* ===========================================================================
   Responsive overrides — everything from here down runs AFTER every base rule
   in this file, so a declaration here wins any equal-specificity tie and no
   override can be silently shadowed.
   =========================================================================== */
@media (max-width: 860px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .admin-modal-overlay,
  .user-drilldown-modal,
  .ip-drilldown-modal {
    padding: 8px 6px;
  }

  .admin-panel,
  .user-drilldown-card,
  .ip-drilldown-card {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .admin-panel-header,
  .drilldown-header {
    padding: 14px 16px;
  }

  .admin-title-text h2 {
    font-size: 1.25rem;
  }

  .admin-title-text p {
    font-size: 0.76rem;
  }

  .admin-panel-body,
  .drilldown-body {
    padding: 14px 12px;
    gap: 16px;
  }

  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .admin-metric-card {
    padding: 12px 14px;
    gap: 4px;
  }

  .admin-metric-label {
    font-size: 0.68rem;
  }

  .admin-metric-val {
    font-size: 1.45rem;
  }

  .admin-metric-sub {
    font-size: 0.72rem;
  }

  .admin-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-search-wrapper {
    max-width: 100%;
  }

  .admin-refresh-btn {
    justify-content: center;
    width: 100%;
    padding: 9px 14px;
  }

  .admin-pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .admin-pagination-left {
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .admin-pagination-controls {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .ip-intelligence-grid {
    grid-template-columns: 1fr;
  }
}

