/* SMM Admin Panel CSS (Stage 2) */
:root {
  --bg-primary: #080610;
  --bg-secondary: #0c0a1a;
  --card-bg: rgba(20, 17, 38, 0.6);
  --card-border: rgba(255, 255, 255, 0.05);
  
  --text-primary: #f1eff7;
  --text-muted: #9590b2;
  --text-accent: #a78bfa;
  
  --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 15px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Outfit', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.smm-admin-theme {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.admin-bg-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(150px);
  top: -150px;
  right: -250px;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================
   1. Login Panel Style
   ========================================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.4s ease;
}

.login-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background-color: rgba(255, 255, 255, 0.06);
}

.form-static-text {
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.btn-login {
  width: 100%;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* ==========================================
   2. Main Dashboard Layout
   ========================================== */
.admin-dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar Menu */
.admin-sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--card-border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  font-size: 1.4rem;
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 48px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.menu-item:hover, .menu-item.active {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
}

.btn-view-client {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-view-client:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Main Content area */
.admin-content {
  padding: 40px;
  overflow-y: auto;
}

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

.admin-content-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
}

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

.profile-avatar {
  background: var(--accent-gradient);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.profile-name {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Sections management */
.cms-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.cms-section.active {
  display: block;
}

/* Card Admin Component */
.card-admin {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.card-admin h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Form layouts */
.form-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.btn-admin-primary {
  background: var(--primary-gradient);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-admin-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-admin-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 24px;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-admin-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Connection Test UI */
.test-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.test-result {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Sync Header bar services */
.services-header-row, .orders-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-sync-api {
  background: var(--accent-gradient);
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
  transition: all 0.3s ease;
}

.btn-sync-api:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}

.services-filters {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.services-filters input, .services-filters select {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  outline: none;
}

.services-filters input:focus, .services-filters select:focus {
  border-color: var(--text-accent);
}

/* Admin Data Table component */
.table-container {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

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

.admin-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

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

.btn-table-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-accent);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background-color: var(--text-accent);
  color: var(--bg-primary);
}

.empty-table {
  text-align: center !important;
  color: var(--text-muted) !important;
  padding: 30px !important;
  font-style: italic;
}

/* Status toggler */
.badge-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.toggle-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

.toggle-inactive {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Stats panel dashboard */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stats-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stats-card-icon {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.04);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-card-info h4 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stats-card-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stats-profit {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(20, 17, 38, 0.6) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.stats-profit h4 {
  color: var(--success);
}

/* ==========================================
   3. Service Modal Style
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.btn-modal-close:hover {
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

/* Checkbox Toggle */
.checkbox-group {
  margin: 16px 0 0 0;
}

.checkbox-container {
  display: block;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--primary-gradient);
  border-color: transparent;
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.checkbox-container .checkmark::after {
  left: 6px;
  top: 2.5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--text-accent);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  display: flex;
  align-items: center;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
  transform: translateY(0);
}

/* Spinners */
.sync-spinner, .refresh-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Charts Wrapper */
.chart-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

@media (max-width: 992px) {
  .admin-dashboard {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    height: auto;
    position: static;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-charts-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .form-row {
    display: flex;
    flex-direction: column;
  }
}

.btn-refresh {
  background: var(--accent-gradient);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
  transition: all 0.3s ease;
}

.btn-refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}
