:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --red-dim: rgba(230, 57, 70, 0.15);
  --black: #0a0a0a;
  --black-2: #111111;
  --black-3: #1a1a1a;
  --black-4: #222222;
  --black-5: #2d2d2d;
  --white: #ffffff;
  --white-dim: rgba(255,255,255,0.7);
  --white-faint: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --border-red: rgba(230,57,70,0.3);
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-red: 0 4px 24px rgba(230,57,70,0.25);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.18s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font);
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white-faint);
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--red);
}

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

.btn-outline:hover {
  background: var(--red-dim);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 13px 30px;
  font-size: 16px;
}

.btn-danger {
  background: rgba(220,38,38,0.15);
  color: #ff4d4d;
  border: 1px solid rgba(220,38,38,0.3);
}

.btn-danger:hover {
  background: rgba(220,38,38,0.25);
}

.input {
  width: 100%;
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition);
}

.input:focus {
  border-color: var(--red);
  background: var(--black-4);
}

.input::placeholder {
  color: rgba(255,255,255,0.3);
}

.select {
  width: 100%;
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}

.select:focus {
  border-color: var(--red);
}

.select option {
  background: var(--black-3);
}

.card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--border-red);
}

.badge-green {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.2);
}

.badge-yellow {
  background: rgba(234,179,8,0.1);
  color: #eab308;
  border: 1px solid rgba(234,179,8,0.2);
}

.badge-gray {
  background: var(--white-faint);
  color: var(--white-dim);
  border: 1px solid var(--border);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: var(--white-faint);
  border: none;
  color: var(--white-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--red-dim);
  color: var(--red);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--white-dim);
  margin-bottom: 6px;
}

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

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

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

.toast {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  border-color: rgba(34,197,94,0.3);
  color: #22c55e;
}

.toast.error {
  border-color: var(--border-red);
  color: var(--red);
}

.toast.info {
  border-color: var(--border);
  color: var(--white);
}

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.text-red { color: var(--red); }
.text-dim { color: var(--white-dim); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-logo .blaze { color: var(--red); }
.nav-logo .cart { color: var(--white); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--white-dim);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--white);
  background: var(--white-faint);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--black-2);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--white-dim);
  transition: var(--transition);
}

.mobile-menu a:hover {
  color: var(--white);
  background: var(--white-faint);
}

@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .modal { padding: 20px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: unset; }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--white-faint);
}

tbody td {
  padding: 12px 14px;
  color: var(--white);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--white-dim);
}

.empty-state svg {
  margin: 0 auto 14px;
  opacity: 0.3;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--black-5);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--white-dim);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--red);
  border-color: var(--red);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateY(-50%) translateX(18px);
  background: var(--white);
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover {
  color: var(--white);
}

.tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.stat-card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--white-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--white-dim);
  margin-top: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.progress-bar {
  height: 6px;
  background: var(--black-5);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.notification-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white-dim);
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 38px;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--red);
  background: var(--red-dim);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--white-dim);
  font-size: 14px;
  pointer-events: none;
}

.upload-placeholder svg {
  opacity: 0.5;
}

.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  object-fit: contain;
  display: block;
}

.upload-area-banner .upload-preview {
  max-height: 140px;
  width: 100%;
  object-fit: cover;
}
