/* ==========================================================================
   Trackr — Admin & Partner Modern SaaS Dashboard Stylesheet
   ========================================================================== */

:root {
  --admin-bg: #05070d;
  --admin-surface: #0b0f19;
  --admin-surface-card: #0f1523;
  --admin-surface-hover: #161e31;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(56, 189, 248, 0.45);
  --admin-text: #f8fafc;
  --admin-muted: #94a3b8;
  --admin-accent: #38bdf8;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
}

body {
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 24px 0 60px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-box {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-box:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}

/* Card Panels */
.card-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

/* Form Inputs & Fields */
.form-input {
  background: #080c15 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9px !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--admin-accent) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
  background: #0b111e !important;
}

.form-input::placeholder {
  color: #526077;
}

.form-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  display: block;
  margin-bottom: 6px;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.data-table th {
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.2);
}

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

/* Badges */
.plan-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.plan-badge.lifetime, .plan-badge.early-bird {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.plan-badge.monthly {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Modern Toast Notification */
#admin-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 18px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.admin-toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}
.admin-toast.success .toast-icon { color: #34d399; }

.admin-toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}
.admin-toast.error .toast-icon { color: #f87171; }

.admin-toast.info {
  border-color: rgba(56, 189, 248, 0.4);
}
.admin-toast.info .toast-icon { color: #38bdf8; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* In-App Confirmation Modal */
#admin-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal-box {
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
}

/* Threshold Progress Bar */
.payout-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.payout-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.4s ease;
}
