/* Shared Admin UI Styles
 * Common patterns used across all admin pages
 */

/* ===== CONTAINERS ===== */
.admin-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--admin-secondary, #f8fafc);
  min-height: 100vh;
}

/* ===== TABLES ===== */
.admin-table-container {
  background: var(--bg-primary, #ffffff);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  margin-bottom: 2rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: var(--bg-muted, #f1f5f9);
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-primary, #1f2937);
}

.admin-table tbody tr:hover {
  background: var(--bg-muted, #f1f5f9);
  cursor: pointer;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge.partner,
.badge-partner {
  background: #dbeafe;
  color: #1e40af;
}

.badge.promoter,
.badge-promoter {
  background: #fef3c7;
  color: #92400e;
}

.badge.admin,
.badge-admin {
  background: #f3e8ff;
  color: #7c3aed;
}

.badge.postpaid,
.badge-postpaid {
  background: #dcfce7;
  color: #166534;
}

.badge.regular,
.badge-regular {
  background: #f1f5f9;
  color: #475569;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  text-transform: uppercase;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.processed,
.status-badge.approved {
  background: #dcfce7;
  color: #166534;
}

.status-badge.rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== PAGINATION ===== */
.admin-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-primary, #ffffff);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.admin-pagination .pagination-info {
  color: var(--text-muted, #9ca3af);
  font-size: 0.875rem;
  font-weight: 500;
}

.admin-pagination .pagination-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-pagination .pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary, #1f2937);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.admin-pagination .pagination-btn:hover {
  background: var(--primary, #4361ee);
  color: white;
  border-color: var(--primary, #4361ee);
  transform: translateY(-1px);
}

.admin-pagination .current-page {
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--primary, #4361ee);
  background: rgba(67, 97, 238, 0.1);
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
}

/* ===== TAB NAVIGATION ===== */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  text-decoration: none;
  color: var(--text-secondary, #6b7280);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.admin-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%,;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.1), transparent);
  transition: left 0.6s;
}

.admin-tab:hover::before {
  left: 100%;
}

.admin-tab:hover {
  color: var(--text-primary, #1f2937);
  border-color: var(--primary, #4361ee);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.admin-tab.active {
  background: var(--primary, #4361ee);
  color: white;
  border-color: var(--primary, #4361ee);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.admin-tab .tab-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.admin-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.3);
}

.admin-tab:not(.active) .tab-count {
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-primary, #1f2937);
}

/* ===== EMPTY STATES ===== */
.admin-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-primary, #ffffff);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.admin-empty-state-icon {
  margin-bottom: 1.5rem;
  opacity: 0.5;
  color: var(--text-muted, #9ca3af);
}

.admin-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.5rem;
}

.admin-empty-state p {
  color: var(--text-secondary, #6b7280);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* ===== FILTER SECTIONS ===== */
.admin-filter-section {
  margin-bottom: 2rem;
}

.admin-filter-card {
  background: var(--bg-primary, #ffffff);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.admin-filter-bar {
  display: flex;
  align-items: end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.admin-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 140px;
  flex: 1;
}

.admin-filter-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-filter-group input,
.admin-filter-group select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #1f2937);
  transition: all 0.2s ease;
}

.admin-filter-group input:focus,
.admin-filter-group select:focus {
  outline: none;
  border-color: var(--primary, #4361ee);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ===== SECTION CARDS ===== */
.admin-section {
  background: var(--bg-primary, #ffffff);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  margin-bottom: 2rem;
  overflow: hidden;
}

.admin-section-header {
  background: var(--bg-muted, #f1f5f9);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.admin-section-header h3 {
  margin: 0;
  color: var(--primary, #4361ee);
  font-size: 1.4rem;
  font-weight: 600;
}

.admin-section-content {
  padding: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-page {
    padding: 1rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  .admin-pagination {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

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

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

  .admin-filter-bar {
    flex-direction: column;
  }

  .admin-filter-group {
    min-width: unset;
    width: 100%;
  }

  .admin-section-header,
  .admin-section-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .admin-page {
    padding: 0.5rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .admin-section-header,
  .admin-section-content {
    padding: 1rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.admin-filter-auto {
  flex: 0 0 auto;
}

.admin-filter-wide {
  flex: 2;
}

.form-error {
  color: #991b1b;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.section-description {
  margin: 0.5rem 0 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.selection-controls {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.selection-count {
  font-weight: 600;
  color: #4361ee;
}

.table-checkbox-column {
  width: 50px;
}

.checkbox-label {
  cursor: pointer;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.warning-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fef3c7;
  border-radius: 8px;
  border: 1px solid #fbbf24;
}

.warning-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #92400e;
}

.warning-label-text {
  font-weight: 500;
}

.error-box {
  margin-top: 1rem;
  padding: 1rem;
  background: #fee2e2;
  border-radius: 8px;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.info-list {
  line-height: 1.8;
  color: #6b7280;
}

.inline-code {
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: #4361ee;
}

.danger-button {
  background: #ef4444;
  border-color: #ef4444;
}

.filter-spacing {
  margin-top: 2rem;
}
