:root {
  --bg-dark: #070a10;
  --bg-card: #0e1320;
  --bg-card-hover: #131a2c;
  --gold-primary: #f5b041;
  --gold-hover: #f39c12;
  --gold-glow: rgba(245, 176, 65, 0.25);
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --green: #00e676;
  --amber: #f59e0b;
  --red: #ef4444;
  --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-family);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */
.admin-header {
  background: rgba(14, 19, 32, 0.95);
  border-bottom: 1px solid rgba(245, 176, 65, 0.2);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.admin-header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bull-logo-svg {
  width: 100%;
  height: 100%;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--gold-primary);
  font-weight: 600;
}

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

.system-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseBeacon 1.5s infinite;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Main */
.admin-main {
  flex: 1;
  padding: 30px 0 60px 0;
}

/* Stats Cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  border-color: rgba(245, 176, 65, 0.3);
  transform: translateY(-2px);
}

.stat-pending-alert {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(14, 19, 32, 0.95), rgba(245, 158, 11, 0.08));
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-orders { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.icon-pending { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.icon-approved { background: rgba(0, 230, 118, 0.12); color: var(--green); }
.icon-revenue { background: rgba(245, 176, 65, 0.15); color: var(--gold-primary); }

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

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin: 2px 0;
}

.stat-trend {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.stat-trend.pending-text {
  color: var(--amber);
  font-weight: 600;
}

.highlight-amber { color: var(--amber) !important; }
.highlight-green { color: var(--green) !important; }
.highlight-gold { color: var(--gold-primary) !important; }

/* Panel Card */
.admin-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-title-wrap h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 4px;
}

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

.panel-actions-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-search-input {
  background: rgba(8, 11, 17, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text-white);
  font-size: 0.85rem;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(245, 176, 65, 0.25);
}

/* Filter Tabs */
.admin-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
}

.admin-tab-btn.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #080b11;
}

.admin-tab-btn.filter-pending.active {
  background: var(--amber);
  border-color: var(--amber);
  color: #080b11;
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

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

.admin-orders-table th {
  background: rgba(8, 11, 17, 0.6);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

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

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

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

/* Badges */
.badge-order-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(245, 176, 65, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(245, 176, 65, 0.25);
  font-size: 0.78rem;
}

.trader-cell {
  display: flex;
  flex-direction: column;
}

.trader-name {
  font-weight: 700;
  color: var(--text-white);
}

.trader-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-product {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-product.prod-funded {
  background: rgba(245, 176, 65, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(245, 176, 65, 0.3);
}

.badge-product.prod-indicator {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-product.prod-bot {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-method {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-white);
}

.tid-cell-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tid-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-tid {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold-primary);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy-tid:hover {
  background: var(--gold-primary);
  color: #080b11;
}

.amount-usd {
  font-weight: 800;
  color: var(--text-white);
}

.amount-pkr {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Status Badges */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border-radius: 99px;
  text-transform: uppercase;
}

.status-tag.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-tag.status-approved {
  background: rgba(0, 230, 118, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.status-tag.status-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Action Buttons */
.action-buttons-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-table-approve {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-table-approve:hover {
  background: var(--green);
  color: #080b11;
}

.btn-table-reject {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-table-reject:hover {
  background: var(--red);
  color: #ffffff;
}

.btn-table-delete {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  font-size: 0.75rem;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-table-delete:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Buttons Common */
.btn {
  font-family: var(--font-family);
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 0.95rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-white);
}

.btn-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-success {
  background: var(--green);
  border: none;
  color: #080b11;
}

.btn-success:hover {
  background: #00c853;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.4);
}

.btn-danger {
  background: var(--red);
  border: none;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #0e1320;
  border: 1px solid rgba(245, 176, 65, 0.3);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-header {
  padding: 24px 24px 16px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.success-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 230, 118, 0.15);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.reject-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 2px;
}

.modal-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px 24px 24px 24px;
}

.approve-summary-box {
  background: rgba(8, 11, 17, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.82rem;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sum-row:last-child {
  border-bottom: none;
}

.sum-label {
  color: var(--text-muted);
}

.sum-val {
  color: var(--text-white);
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
}

.field-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.flex-1 {
  flex: 1;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background: rgba(8, 11, 17, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-primary);
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0e1320;
  border: 1px solid var(--gold-primary);
  color: var(--text-white);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.86rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

@media (max-width: 768px) {
  .admin-header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    align-items: center;
  }

  .admin-greeting {
    width: 100%;
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  .admin-header-actions .btn {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .admin-main {
    padding: 16px 12px 40px;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .panel-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .panel-actions-wrap {
    width: 100%;
  }

  .search-box-wrap {
    width: 100%;
  }

  .admin-search-input {
    width: 100%;
    font-size: 16px !important;
  }

  .admin-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    width: 100%;
    gap: 6px;
  }

  .admin-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.76rem;
    padding: 6px 10px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 8px;
  }

  .admin-orders-table {
    min-width: 720px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    padding: 16px;
    border-radius: 14px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 1.1rem;
  }

  .brand-sub {
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .form-input, select, textarea {
    font-size: 16px !important;
  }
}

