/* ==========================================================================
   ANUMIXTOOLS - ADMIN DASHBOARD & ANALYTICS STYLESHEET
   Brand Palette: Black (#111111), Gold (#D4A72C), Cream (#FAF7F0), Gray (#374151)
   ========================================================================== */

:root {
  --admin-bg: #0c0d0e;
  --admin-surface: #141518;
  --admin-surface-subtle: #1c1e22;
  --admin-card-border: rgba(255, 255, 255, 0.08);
  --admin-card-border-hover: rgba(212, 167, 44, 0.4);

  --gold: #D4A72C;
  --gold-light: #E8C968;
  --gold-glow: rgba(212, 167, 44, 0.18);
  --gold-border: rgba(212, 167, 44, 0.35);

  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-blue: #3B82F6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) var(--admin-bg);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--admin-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 167, 44, 0.35);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Gold Selection Highlight */
::selection {
  background: rgba(212, 167, 44, 0.35);
  color: #FFFFFF;
}

body {
  font-family: var(--font-body);
  background-color: var(--admin-bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Accessible Focus Rings */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   1. AUTHENTICATION / LOGIN SCREEN
   ========================================================================== */
.admin-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(212, 167, 44, 0.08) 0%, transparent 60%),
              var(--admin-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(212, 167, 44, 0.08);
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.auth-header {
  margin-bottom: 1.75rem;
}

.auth-logo-img {
  height: 48px;
  width: auto;
  margin-bottom: 1rem;
}

.auth-badge {
  display: inline-block;
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

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

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  background: #24272e;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .form-input {
  padding-right: 2.75rem;
}

.pwd-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: var(--transition);
}

.pwd-toggle:hover {
  opacity: 1;
  color: var(--gold);
}

.btn-primary-gold {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, var(--gold) 0%, #b88a1c 100%);
  color: #111111;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 18px rgba(212, 167, 44, 0.28);
  margin-top: 0.5rem;
}

.btn-primary-gold:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 8px 24px rgba(212, 167, 44, 0.45);
}

.btn-primary-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  text-align: left;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.auth-footer {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.75rem;
  transition: var(--transition);
}

.back-link:hover {
  text-decoration: underline;
  color: var(--gold-light);
}


/* ==========================================================================
   2. DASHBOARD MAIN INTERFACE
   ========================================================================== */
.admin-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.dash-navbar {
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-card-border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.dash-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dash-brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.dash-title-badge {
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-user-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-card-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.btn-secondary {
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-card-border);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: rgba(212, 167, 44, 0.1);
  color: var(--gold-light);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
}

/* Main Body */
.dash-main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-heading {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.dash-subheading {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dash-date-badge {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gold);
  font-family: monospace;
}

/* Overview Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--admin-card-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card-featured {
  border-color: var(--gold-border);
  background: linear-gradient(145deg, var(--admin-surface) 0%, rgba(212, 167, 44, 0.05) 100%);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-icon {
  font-size: 1.2rem;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.metric-tool-name {
  font-size: 1.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-trend {
  font-size: 0.78rem;
  font-weight: 600;
}

.text-gold { color: var(--gold); }
.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }

/* Charts Layout */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.chart-panel-large {
  grid-column: 1 / -1;
}

@media (min-width: 1024px) {
  .chart-panel-large {
    grid-column: span 2;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.panel-badge {
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-card-border);
  color: var(--gold);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}

.doughnut-wrap {
  height: 220px;
}

/* Tables */
.table-section {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.dash-table th {
  background: var(--admin-surface-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.dash-table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.dash-table th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.dash-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

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

.table-loading {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem !important;
  font-style: italic;
}

.tool-badge {
  display: inline-block;
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
}

.category-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.session-code {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--admin-surface-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

/* Details Breakdown Row */
.details-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--admin-surface-subtle);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.breakdown-label {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breakdown-count {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--gold);
}

/* Footer */
.dash-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--admin-card-border);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* FastForex API Sync Banner */
.api-sync-banner {
  background: var(--admin-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.api-sync-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.api-sync-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--gold);
}

.api-sync-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.api-sync-title {
  font-size: 0.92rem;
  color: var(--text-main);
}

.api-sync-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.curr-live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseLiveDot 2s infinite;
}

@keyframes pulseLiveDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

