/* Admin Panel Styles */

:root {
  --admin-panel-width: 420px;
  --admin-toggle-width: 36px;
  --admin-accent: #ff6b6b;
  --admin-accent2: #ff9f43;
  --admin-bg: rgba(10, 10, 18, 0.96);
  --admin-border: rgba(255, 107, 107, 0.15);
  --admin-glow: rgba(255, 107, 107, 0.25);
}

/* ---------------------------------------------------------------------------
   Admin Toggle Button (positioned above DNA button)
--------------------------------------------------------------------------- */

.admin-toggle-btn {
  position: fixed;
  right: 0;
  top: calc(50% - 60px);
  transform: translateY(-50%);
  z-index: 52;
  width: var(--admin-toggle-width);
  height: 88px;
  background: linear-gradient(180deg,
    rgba(255, 107, 107, 0.12) 0%,
    rgba(255, 159, 67, 0.12) 100%);
  border: 1px solid var(--admin-border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--admin-accent);
  transition: all 0.3s ease;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

.admin-toggle-btn #admin-toggle-text {
  writing-mode: vertical-rl;
}

.admin-toggle-btn.visible {
  display: flex;
}

.admin-toggle-btn:hover {
  background: linear-gradient(180deg,
    rgba(255, 107, 107, 0.22) 0%,
    rgba(255, 159, 67, 0.22) 100%);
  box-shadow: 0 0 14px var(--admin-glow);
  width: 42px;
}

body.admin-panel-open .admin-toggle-btn {
  right: var(--admin-panel-width);
}

/* ---------------------------------------------------------------------------
   Admin Panel Sidebar
--------------------------------------------------------------------------- */

.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 28px;
  width: var(--admin-panel-width);
  background: var(--admin-bg);
  border-left: 1px solid var(--admin-border);
  backdrop-filter: blur(16px);
  z-index: 55;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.admin-panel.open {
  transform: translateX(0);
}

/* ---------------------------------------------------------------------------
   Header & Tabs
--------------------------------------------------------------------------- */

.admin-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.admin-panel-header h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--admin-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-panel-header h3::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--admin-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--admin-accent);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.admin-tab.active {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 159, 67, 0.15));
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--admin-accent);
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.15);
}

/* ---------------------------------------------------------------------------
   Tab Content
--------------------------------------------------------------------------- */

.admin-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* ---------------------------------------------------------------------------
   Stats Grid
--------------------------------------------------------------------------- */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.admin-stat-card .stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.admin-stat-card .stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.admin-stat-card.online .stat-value {
  color: #6abf69;
}

.admin-stat-card.positive .stat-value {
  color: #6abf69;
}

.admin-stat-card.negative .stat-value {
  color: #e06c75;
}

/* ---------------------------------------------------------------------------
   Sections
--------------------------------------------------------------------------- */

.admin-section {
  margin-bottom: 20px;
}

.admin-section h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------------------------------------------------------------------------
   User List
--------------------------------------------------------------------------- */

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.admin-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 12px;
}

.admin-user-item .user-email {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-item .user-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.admin-user-item .user-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
}

.admin-user-item .user-status.active {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.admin-user-item .user-status.online {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.admin-user-item .user-status.trialing {
  background: rgba(97, 175, 239, 0.2);
  color: #61afef;
}

/* ---------------------------------------------------------------------------
   Financial Split
--------------------------------------------------------------------------- */

.admin-financial-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.financial-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.financial-column h5 {
  margin: 0 0 8px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.financial-value {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.financial-value.positive {
  color: #6abf69;
}

.financial-value.negative {
  color: #e06c75;
}

.financial-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.admin-profit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(106, 191, 105, 0.1), rgba(106, 191, 105, 0.05));
  border: 1px solid rgba(106, 191, 105, 0.2);
  border-radius: 8px;
  margin-bottom: 20px;
}

.admin-profit-row span:first-child {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.profit-value {
  font-size: 18px;
  font-weight: 700;
  color: #6abf69;
}

/* ---------------------------------------------------------------------------
   Transaction List
--------------------------------------------------------------------------- */

.admin-tx-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.admin-tx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 11px;
}

.admin-tx-item .tx-type {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.admin-tx-item .tx-type.purchase {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.admin-tx-item .tx-type.usage {
  background: rgba(224, 108, 117, 0.2);
  color: #e06c75;
}

.admin-tx-item .tx-desc {
  flex: 1;
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tx-item .tx-amount {
  font-weight: 600;
}

.admin-tx-item .tx-amount.positive {
  color: #6abf69;
}

.admin-tx-item .tx-amount.negative {
  color: #e06c75;
}

/* ---------------------------------------------------------------------------
   Job List
--------------------------------------------------------------------------- */

.admin-job-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 70vh;
  overflow-y: auto;
}

.admin-job-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 11px;
}

.admin-job-item .job-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-job-item .job-status.pending {
  background: #e5c07b;
}

.admin-job-item .job-status.in_progress {
  background: #61afef;
  animation: pulse 1.5s infinite;
}

.admin-job-item .job-status.completed {
  background: #6abf69;
}

.admin-job-item .job-status.failed {
  background: #e06c75;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.admin-job-item .job-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
}

.admin-job-item .job-user {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-job-item .job-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.admin-job-item .job-cost {
  color: #e5c07b;
  font-weight: 600;
  font-size: 10px;
}

.admin-job-item .job-status.awaiting_funds {
  background: #c678dd;
  animation: pulse 2s infinite;
}

.admin-job-item.awaiting {
  background: rgba(198, 120, 221, 0.1);
  border: 1px solid rgba(198, 120, 221, 0.3);
}

.job-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.job-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-btn.pass {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.job-btn.pass:hover {
  background: rgba(106, 191, 105, 0.4);
}

.job-btn.cancel {
  background: rgba(224, 108, 117, 0.2);
  color: #e06c75;
}

.job-btn.cancel:hover {
  background: rgba(224, 108, 117, 0.4);
}

.job-btn.retry {
  background: rgba(229, 192, 123, 0.2);
  color: #e5c07b;
}

.job-btn.retry:hover {
  background: rgba(229, 192, 123, 0.4);
}

.job-btn.details {
  background: rgba(97, 175, 239, 0.2);
  color: #61afef;
}

.job-btn.details:hover {
  background: rgba(97, 175, 239, 0.4);
}

.admin-stat-card.awaiting .stat-value {
  color: #c678dd;
}

/* ---------------------------------------------------------------------------
   Job Details Modal
--------------------------------------------------------------------------- */

.job-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.job-details-content {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.job-details-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.job-details-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.job-details-close:hover {
  color: #fff;
}

.job-details-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.job-details-section:last-child {
  border-bottom: none;
}

.job-details-section h5 {
  margin: 0 0 12px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.job-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.detail-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.detail-value {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.job-config-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.config-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.job-apis-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-api-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border-left: 3px solid #61afef;
}

.api-service {
  font-size: 12px;
  font-weight: 600;
  color: #61afef;
}

.api-model {
  font-size: 11px;
  color: #fff;
}

.api-purpose {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.job-details-section.error {
  background: rgba(224, 108, 117, 0.1);
}

.job-details-section.error h5 {
  color: #e06c75;
}

.job-details-section.error pre {
  margin: 0;
  font-size: 11px;
  color: #e06c75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------------------------------------------
   Withdrawal Modal
--------------------------------------------------------------------------- */

.admin-withdrawal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 16px;
}

.admin-withdrawal-form label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-withdrawal-form input,
.admin-withdrawal-form select,
.admin-withdrawal-form textarea {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}

.admin-withdrawal-form input:focus,
.admin-withdrawal-form select:focus,
.admin-withdrawal-form textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
}

/* ---------------------------------------------------------------------------
   Balance List
--------------------------------------------------------------------------- */

.admin-balance-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
}

.admin-balance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 12px;
}

.admin-balance-item .balance-email {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-balance-item .balance-amount {
  font-weight: 600;
  color: #6abf69;
}

/* ---------------------------------------------------------------------------
   Withdrawal List
--------------------------------------------------------------------------- */

.admin-withdrawal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 10px;
}

.admin-withdrawal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 11px;
}

.admin-withdrawal-item .withdrawal-dest {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(97, 175, 239, 0.2);
  color: #61afef;
}

.admin-withdrawal-item .withdrawal-amount {
  flex: 1;
  font-weight: 600;
  color: #6abf69;
}

.admin-withdrawal-item .withdrawal-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

/* ---------------------------------------------------------------------------
   Empty State
--------------------------------------------------------------------------- */

.admin-empty-state {
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* ---------------------------------------------------------------------------
   Mobile Responsive
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Notification Badge
--------------------------------------------------------------------------- */

.admin-notif-badge {
  position: absolute;
  top: 8px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e06c75;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: horizontal-tb;
  letter-spacing: 0;
  box-shadow: 0 0 8px rgba(224, 108, 117, 0.6);
  animation: badge-pulse 2s infinite;
}

.admin-notif-badge.hidden,
.admin-alerts-count.hidden {
  display: none;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.admin-alerts-count {
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  background: #e06c75;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------------------
   Alerts Tab Content
--------------------------------------------------------------------------- */

.admin-alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-alerts-header h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.admin-alerts-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.alert-filter {
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.alert-filter:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.alert-filter.active {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--admin-accent);
}

.admin-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.admin-notification-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.admin-notification-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-notification-item.unread {
  background: rgba(255, 107, 107, 0.06);
  border-color: rgba(255, 107, 107, 0.15);
}

.admin-notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--admin-accent);
  border-radius: 3px 0 0 3px;
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notification-icon.purchase {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.notification-icon.signup {
  background: rgba(97, 175, 239, 0.2);
  color: #61afef;
}

.notification-icon.alert {
  background: rgba(224, 108, 117, 0.2);
  color: #e06c75;
}

.notification-icon.job {
  background: rgba(229, 192, 123, 0.2);
  color: #e5c07b;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-meta {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.notification-meta .user {
  color: rgba(255, 255, 255, 0.6);
}

.notification-meta .amount {
  color: #6abf69;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Charts Grid
--------------------------------------------------------------------------- */

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-section-header h4 {
  margin: 0;
}

.admin-period-select {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.admin-period-select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-chart-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
}

.admin-chart-card.full-width {
  grid-column: 1 / -1;
}

.admin-chart-card h5 {
  margin: 0 0 10px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.admin-chart-card canvas {
  height: 120px !important;
  width: 100% !important;
}

.admin-chart-card.full-width canvas {
  height: 150px !important;
}

/* ---------------------------------------------------------------------------
   Affiliates List
--------------------------------------------------------------------------- */

.admin-affiliates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.admin-affiliate-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.affiliate-info {
  flex: 1;
  min-width: 0;
}

.affiliate-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.affiliate-email {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.affiliate-code {
  font-size: 11px;
  color: #61afef;
  font-family: monospace;
  background: rgba(97, 175, 239, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.affiliate-stats {
  display: flex;
  gap: 16px;
  text-align: center;
}

.affiliate-stat {
  display: flex;
  flex-direction: column;
}

.affiliate-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #6abf69;
}

.affiliate-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.affiliate-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
}

.affiliate-status.active {
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
}

.affiliate-status.paused {
  background: rgba(229, 192, 123, 0.2);
  color: #e5c07b;
}

.affiliate-status.terminated {
  background: rgba(224, 108, 117, 0.2);
  color: #e06c75;
}

/* ---------------------------------------------------------------------------
   Commissions List
--------------------------------------------------------------------------- */

.admin-commissions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.admin-commission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 11px;
}

.commission-affiliate {
  color: #61afef;
  font-weight: 500;
  flex: 1;
}

.commission-amount {
  color: #6abf69;
  font-weight: 600;
}

.commission-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.commission-pay-btn {
  padding: 4px 10px;
  background: rgba(106, 191, 105, 0.2);
  color: #6abf69;
  border: none;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.commission-pay-btn:hover {
  background: rgba(106, 191, 105, 0.4);
}

/* ---------------------------------------------------------------------------
   Mobile Responsive
--------------------------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --admin-panel-width: 100%;
  }

  .admin-toggle-btn {
    top: auto;
    bottom: 100px;
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 22px 0 0 22px;
    writing-mode: horizontal-tb;
    font-size: 8px;
    letter-spacing: 1px;
  }

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

  .admin-financial-split {
    grid-template-columns: 1fr;
  }

  .admin-charts-grid {
    grid-template-columns: 1fr;
  }

  .admin-affiliate-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .affiliate-stats {
    width: 100%;
    justify-content: space-around;
  }
}

/* ---------------------------------------------------------------------------
   Messages Tab (Admin Conversations)
--------------------------------------------------------------------------- */

.admin-conversations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 500px;
  overflow-y: auto;
}

.admin-conversation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-conversation-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-conversation-item.has-unread {
  background: rgba(255, 107, 107, 0.06);
  border-color: rgba(255, 107, 107, 0.15);
}

.admin-conversation-item.has-unread::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--admin-accent);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--admin-accent);
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-email {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.conv-preview {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.conv-meta {
  text-align: right;
  flex-shrink: 0;
}

.conv-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.conv-unread-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e06c75;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.admin-conversation-detail.hidden {
  display: none;
}

.conversation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.conversation-user-email {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.admin-conversation-detail .help-messages {
  max-height: 60vh;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-conversation-detail .help-input-area {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  padding: 10px;
  display: flex;
  gap: 8px;
}

.admin-conversation-detail .help-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-family: inherit;
  resize: none;
}

.admin-conversation-detail .help-input:focus {
  outline: none;
  border-color: var(--admin-accent);
}

.admin-conversation-detail .btn-primary {
  width: auto;
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 6px;
}

/* Admin Announcements List */
.admin-announcements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.admin-announcement-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
