/* ============================================
   RDWC LAB – Admin Panel CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Space+Grotesk:wght@300;400;500;600&display=swap');

:root {
  --bg:        #080e14;
  --bg2:       #0d1720;
  --bg3:       #111f2e;
  --surface:   #0f1e2d;
  --border:    #1a3348;
  --accent:    #00a8e8;
  --accent2:   #0070cc;
  --danger:    #e53e3e;
  --warning:   #f6ad55;
  --success:   #48bb78;
  --text:      #d4e8f0;
  --muted:     #6b8fa8;
  --white:     #ffffff;
  --font:      'Space Grotesk', sans-serif;
  --font-d:    'Orbitron', monospace;
  --radius:    8px;
  --sidebar-w: 240px;
  --topbar-h:  64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

/* ── SIDEBAR ── */
.admin-sidebar {
  width: var(--sidebar-w); background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.3s ease;
}
.admin-sidebar.collapsed { transform: translateX(-100%); }

.sidebar-logo {
  padding: 20px 20px 16px;
  font-family: var(--font-d); font-size: 1.2rem; font-weight: 900;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.logo-rdwc { color: var(--white); }
.logo-lab  { color: var(--accent); }
.admin-badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  background: rgba(0,200,160,0.15); border: 1px solid rgba(0,200,160,0.3);
  color: var(--accent); padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s; cursor: pointer;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(0,200,160,0.12); color: var(--accent); border: 1px solid rgba(0,200,160,0.2); }
.nav-item svg { flex-shrink: 0; }

.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* ── MAIN ── */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; transition: margin 0.3s; }
.admin-main.expanded { margin-left: 0; }

/* ── TOPBAR ── */
.admin-topbar {
  height: var(--topbar-h); background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: var(--radius);
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--text); }
.page-title { font-family: var(--font-d); font-size: 1rem; font-weight: 700; color: var(--white); }

.topbar-right { display: flex; align-items: center; gap: 20px; }

/* ── SHOP TOGGLE ── */
.shop-toggle-wrap { display: flex; align-items: center; gap: 10px; }
.shop-toggle-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.shop-status { font-size: 0.82rem; font-weight: 700; color: var(--success); min-width: 80px; }
.shop-status.offline { color: var(--danger); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: var(--white); border-radius: 50%; transition: 0.3s;
}
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

.admin-user { display: flex; align-items: center; gap: 8px; }
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,200,160,0.2); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-size: 0.8rem; color: var(--accent);
}

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

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.green  { background: rgba(0,200,160,0.12); color: var(--accent); }
.stat-icon.blue   { background: rgba(0,150,255,0.12); color: var(--accent2); }
.stat-icon.orange { background: rgba(246,173,85,0.12); color: var(--warning); }
.stat-icon.red    { background: rgba(229,62,62,0.12); color: var(--danger); }
.stat-num { font-family: var(--font-d); font-size: 1.6rem; font-weight: 700; color: var(--white); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ── SECTION ── */
.admin-section { margin-bottom: 32px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { font-family: var(--font-d); font-size: 0.95rem; color: var(--white); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: var(--font); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #00ffcc; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-outline {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(0,200,160,0.1); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text); }

/* ── TABLE ── */
.admin-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: 12px 16px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: var(--bg3); border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px 16px; font-size: 0.88rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
}
.badge-pdf    { background: rgba(255,165,0,0.15); color: #ffa500; }
.badge-stl    { background: rgba(0,150,255,0.15); color: #0096ff; }
.badge-video  { background: rgba(200,0,100,0.15); color: #ff3080; }
.badge-other  { background: rgba(100,100,100,0.15); color: #aaa; }
.badge-active { background: rgba(0,200,160,0.15); color: var(--accent); }
.badge-inactive { background: rgba(229,62,62,0.15); color: var(--danger); }
.badge-completed { background: rgba(72,187,120,0.15); color: var(--success); }
.badge-pending   { background: rgba(246,173,85,0.15); color: var(--warning); }
.badge-admin  { background: rgba(0,150,255,0.15); color: var(--accent2); }
.badge-user   { background: rgba(100,100,100,0.15); color: #aaa; }

/* ── FORM ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text); font-family: var(--font); font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--bg2); }
.form-actions { display: flex; gap: 12px; margin-top: 20px; justify-content: flex-end; }

/* ── FILE UPLOAD ── */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg2);
}
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: rgba(0,200,160,0.05); }
.file-drop p { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.file-drop svg { color: var(--border); }
.file-name { color: var(--accent); font-size: 0.85rem; margin-top: 8px; font-weight: 600; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; max-width: 560px; width: 100%;
  position: relative; transform: translateY(20px); transition: transform 0.2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close-btn {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.1rem; transition: color 0.2s;
}
.modal-close-btn:hover { color: var(--text); }
.modal-title { font-family: var(--font-d); font-size: 1.1rem; color: var(--white); margin-bottom: 24px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  font-size: 0.88rem; color: var(--text);
  transform: translateX(120%); transition: transform 0.3s;
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: rgba(0,200,160,0.4); }
.toast.error   { border-color: rgba(229,62,62,0.4); }

/* ── SEARCH ── */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap;
}
.search-bar input {
  flex: 1; min-width: 200px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); color: var(--text);
  font-family: var(--font); font-size: 0.88rem; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { margin: 0 auto 16px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ── TOGGLE ROW ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px;
}
.toggle-row-label h4 { font-weight: 600; color: var(--white); margin-bottom: 4px; }
.toggle-row-label p  { font-size: 0.82rem; color: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}
