/* =============================================
   NEXOS TRADING - Admin Panel Dark Mode 2025
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-base:       #080c14;
  --bg-primary:    #0d1117;
  --bg-secondary:  #111827;
  --bg-card:       #161d2e;
  --bg-card-hover: #1c2540;
  --bg-input:      #0d1117;
  --bg-sidebar:    #0a0e1a;

  --accent-cyan:    #00d4ff;
  --accent-cyan-dim: rgba(0, 212, 255, 0.12);
  --accent-green:   #00ff9d;
  --accent-green-dim: rgba(0, 255, 157, 0.12);
  --accent-red:     #ff4d6d;
  --accent-red-dim: rgba(255, 77, 109, 0.12);
  --accent-yellow:  #ffd60a;
  --accent-yellow-dim: rgba(255, 214, 10, 0.12);
  --accent-purple:  #9d4edd;
  --accent-purple-dim: rgba(157, 78, 221, 0.12);

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #4a5568;

  --border:        rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 212, 255, 0.25);

  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);

  --sidebar-w: 260px;
  --topbar-h:  64px;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ─── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.4); }

/* ─── LAYOUT ─────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(0,212,255,0.3);
}

.sidebar-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-brand .brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.15);
}

.nav-item.active .nav-icon { color: var(--accent-cyan); }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.admin-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.admin-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.admin-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  display: flex; align-items: center; gap: 6px;
  color: var(--accent-red);
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 0;
  transition: opacity var(--transition);
}
.logout-btn:hover { opacity: 0.7; color: var(--accent-red); }

/* ─── MAIN CONTENT ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOPBAR ─────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-time {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* ─── PAGE CONTENT ───────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ─── STATS GRID ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.cyan::after  { background: linear-gradient(90deg, var(--accent-cyan), transparent); }
.stat-card.green::after { background: linear-gradient(90deg, var(--accent-green), transparent); }
.stat-card.red::after   { background: linear-gradient(90deg, var(--accent-red), transparent); }
.stat-card.purple::after{ background: linear-gradient(90deg, var(--accent-purple), transparent); }

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.cyan   { background: var(--accent-cyan-dim);   color: var(--accent-cyan); }
.stat-icon.green  { background: var(--accent-green-dim);  color: var(--accent-green); }
.stat-icon.red    { background: var(--accent-red-dim);    color: var(--accent-red); }
.stat-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }

.stat-info { flex: 1; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-delta.up   { color: var(--accent-green); }
.stat-delta.down { color: var(--accent-red); }

/* ─── CARDS ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 22px; }

/* ─── TABLE ──────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg-secondary);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,0.02); }

.td-name { color: var(--text-primary); font-weight: 500; }

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
}
.btn-primary:hover {
  background: #00b8d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,212,255,0.3);
  color: #000;
  opacity: 1;
}

.btn-success {
  background: var(--accent-green);
  color: #000;
}
.btn-success:hover {
  background: #00d982;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,255,157,0.3);
  color: #000;
  opacity: 1;
}

.btn-danger {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(255,77,109,0.2);
}
.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
  opacity: 1;
}

.btn-ghost {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  opacity: 1;
}

.btn-warning {
  background: var(--accent-yellow-dim);
  color: var(--accent-yellow);
  border: 1px solid rgba(255,214,10,0.2);
}
.btn-warning:hover {
  background: var(--accent-yellow);
  color: #000;
  opacity: 1;
}

/* ─── BADGES / STATUS ────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-cyan    { background: var(--accent-cyan-dim);    color: var(--accent-cyan); }
.badge-green   { background: var(--accent-green-dim);   color: var(--accent-green); }
.badge-red     { background: var(--accent-red-dim);     color: var(--accent-red); }
.badge-yellow  { background: var(--accent-yellow-dim);  color: var(--accent-yellow); }
.badge-purple  { background: var(--accent-purple-dim);  color: var(--accent-purple); }
.badge-muted   { background: rgba(255,255,255,0.05);    color: var(--text-muted); }

/* ─── FORMS ──────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-secondary); }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ─── ALERT / FLASH ──────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.alert-success {
  background: var(--accent-green-dim);
  border: 1px solid rgba(0,255,157,0.2);
  color: var(--accent-green);
}

.alert-danger {
  background: var(--accent-red-dim);
  border: 1px solid rgba(255,77,109,0.2);
  color: var(--accent-red);
}

.alert-info {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent-cyan);
}

/* ─── SEARCH BAR ─────────────────────────────── */
.search-bar {
  position: relative;
}

.search-bar input {
  padding-left: 36px;
  width: 260px;
}

.search-bar .search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ─── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 90%;
  transform: scale(0.96);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-text {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ─── GRID UTIL ──────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mt-4   { margin-top: 16px; }
.mb-4   { margin-bottom: 16px; }
.flex   { display: flex; }
.items-center { align-items: center; }
.gap-3  { gap: 12px; }
.gap-2  { gap: 8px; }
.ml-auto { margin-left: auto; }
.text-right { text-align: right; }

/* ─── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,255,157,0.05) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 0 30px rgba(0,212,255,0.25);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── DASHBOARD CHARTS PLACEHOLDER ──────────── */
.chart-placeholder {
  height: 200px;
  background: repeating-linear-gradient(
    to right,
    var(--bg-secondary) 0px,
    var(--bg-secondary) 1px,
    transparent 1px,
    transparent 40px
  ),
  repeating-linear-gradient(
    to bottom,
    var(--bg-secondary) 0px,
    var(--bg-secondary) 1px,
    transparent 1px,
    transparent 40px
  );
  border-radius: var(--radius-sm);
  display: flex; align-items: flex-end;
  padding: 16px;
  gap: 10px;
  overflow: hidden;
}

/* ─── PRODUCT IMAGE ──────────────────────────── */
.product-img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.product-img-placeholder {
  width: 44px; height: 44px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border);
}

/* ─── RESPONSIVE ─────────────────────────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .form-row { grid-template-columns: 1fr; }
  .grid-2   { grid-template-columns: 1fr; }
  .grid-3   { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .search-bar input { width: 180px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { padding: 28px 20px; }
}
