/* ========================================================
   TrailTrack Stories — Admin Panel Styles
   ======================================================== */

.admin-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
}

.admin-header {
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border, #334155);
  padding-bottom: 0;
}

.admin-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.admin-tab:hover {
  color: var(--text-primary, #f1f5f9);
  background: rgba(255,255,255,0.03);
}

.admin-tab.active {
  color: var(--accent-green, #059669);
  border-bottom-color: var(--accent-green, #059669);
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--surface, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-green, #059669);
}

.admin-stat-card-warn:hover {
  border-color: var(--error, #dc2626);
}

.admin-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.admin-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.admin-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
}

/* Sections */
.admin-section {
  margin-bottom: 32px;
}

.admin-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary, #f1f5f9);
}

/* Tables */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table thead {
  background: rgba(255,255,255,0.03);
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border, #334155);
}

.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

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

.admin-row-banned {
  opacity: 0.6;
  background: rgba(220,38,38,0.05);
}

/* User cell */
.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-name {
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
}

/* Badges */
.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary, #94a3b8);
}

.admin-badge-admin {
  background: rgba(5,150,105,0.2);
  color: var(--accent-green-light, #10b981);
}

.admin-badge-banned {
  background: rgba(220,38,38,0.2);
  color: #f87171;
}

/* Actions */
.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

/* Links */
.admin-link {
  color: var(--accent-green-light, #10b981);
  text-decoration: none;
}

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

/* States */
.admin-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #94a3b8);
}

.admin-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #94a3b8);
}

.admin-error {
  text-align: center;
  padding: 40px;
  color: #f87171;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-panel {
    padding: 12px 8px;
  }

  .admin-header h1 {
    font-size: 1.2rem;
  }

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

  .admin-stat-card {
    padding: 12px;
  }

  .admin-stat-value {
    font-size: 1.4rem;
  }

  .admin-actions {
    flex-direction: column;
  }

  /* Tabs scroll horizontally */
  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .admin-tab {
    min-height: 44px;
    padding: 10px 14px;
    flex-shrink: 0;
  }

  /* Tables scroll horizontally */
  .admin-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .admin-table {
    min-width: 600px;
  }

  /* Toolbar stacks */
  .admin-toolbar {
    flex-wrap: wrap;
  }

  .admin-toolbar input,
  .admin-toolbar select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-stat-value {
    font-size: 1.2rem;
  }

  .admin-stat-icon {
    font-size: 1.2rem;
  }
}
