:root {
  --primary: #FF0000;
  --primary-dark: #cc0000;
  --navy: #050810;
  --navy-light: #0f1623;
  --navy-card: #0a0f1a;
  --border: rgba(255,255,255,0.08);
  --text-muted: rgba(255,255,255,0.5);
  --font-display: 'Anton', sans-serif;
  --font-body: 'Oswald', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--navy);
  color: #fff;
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.9; }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 16px; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 14px 32px; border: none; cursor: pointer;
  transition: all 0.3s; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: white; color: black; }
.btn-secondary { background: transparent; color: white; border: 1px solid var(--border); clip-path: none; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input-field {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  color: white; width: 100%; padding: 12px 16px;
  font-family: var(--font-mono); font-size: 14px; transition: 0.3s; outline: none;
}
.input-field:focus { border-color: var(--primary); background: rgba(255,255,255,0.05); }
.input-field::placeholder { color: rgba(255,255,255,0.2); }
.input-label {
  display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: #888; margin-bottom: 4px; text-transform: uppercase;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
select.input-field option { background: var(--navy-light); color: white; }

textarea.input-field { resize: vertical; min-height: 100px; font-family: var(--font-mono); }

.card {
  background: var(--navy-card); border: 1px solid var(--border);
  padding: 24px; transition: border-color 0.3s;
}
.card:hover { border-color: rgba(255,255,255,0.15); }

.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.05em; padding: 4px 10px; text-transform: uppercase;
}
.badge-pending { background: rgba(234,179,8,0.15); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.badge-processing { background: rgba(59,130,246,0.15); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.badge-shipped { background: rgba(168,85,247,0.15); color: #a855f7; border: 1px solid rgba(168,85,247,0.3); }
.badge-delivered { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.badge-cancelled { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.badge-admin { background: rgba(255,0,0,0.15); color: var(--primary); border: 1px solid rgba(255,0,0,0.3); }
.badge-customer { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.badge-active { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.badge-inactive { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

.nav-auth {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50;
  background: rgba(5,8,16,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 16px 24px;
}
.nav-auth-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-family: var(--font-display); font-size: 24px; font-style: italic; letter-spacing: -0.03em; }
.nav-brand span { color: var(--primary); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-family: var(--font-display); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--text-muted); transition: color 0.3s;
}
.nav-link:hover { color: var(--primary); }
.nav-user {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; color: white;
}

.mobile-menu-toggle {
  display: none; background: none; border: none; color: white; cursor: pointer;
}
.mobile-menu-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(5,8,16,0.98);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px;
  transform: translateY(-100%); transition: transform 0.4s ease;
}
.mobile-menu-overlay.open { transform: translateY(0); }
.mobile-close-btn {
  position: absolute; top: 24px; right: 24px; background: none; border: none;
  color: white; font-size: 24px; cursor: pointer;
}

.page-content { padding-top: 80px; min-height: 100vh; }

.auth-page {
  display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 65px);
  padding: 20px; padding-top: 80px;
}
.auth-card {
  background: var(--navy-light); border: 1px solid var(--border);
  width: 100%; max-width: 440px; padding: 48px; position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.sidebar-layout { display: flex; min-height: calc(100vh - 65px); margin-top: 65px; }
.sidebar {
  width: 260px; background: var(--navy-light); border-right: 1px solid var(--border);
  padding: 24px 0; position: fixed; top: 65px; bottom: 0; overflow-y: auto;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  font-family: var(--font-body); font-size: 14px; color: var(--text-muted);
  transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: white; background: rgba(255,255,255,0.03); }
.sidebar-link.active { color: var(--primary); border-left-color: var(--primary); background: rgba(255,0,0,0.05); }
.sidebar-icon { width: 18px; height: 18px; opacity: 0.6; }
.main-content { flex: 1; margin-left: 260px; padding: 32px; }

.stat-card {
  background: var(--navy-card); border: 1px solid var(--border); padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-value { font-family: var(--font-display); font-size: 36px; letter-spacing: -0.02em; }
.stat-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); padding: 12px 16px;
  text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 14px; white-space: nowrap;
}
tr:hover td { background: rgba(255,255,255,0.02); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--navy-light); border: 1px solid var(--border);
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; padding: 32px;
}

.toast-container { position: fixed; top: 80px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-card); border: 1px solid var(--border); padding: 14px 20px;
  font-family: var(--font-mono); font-size: 13px; display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.3s ease; min-width: 280px; max-width: 90vw;
}
.toast-success { border-left: 3px solid #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid #3b82f6; }

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

.stock-low { color: #eab308; font-weight: 600; }
.stock-out { color: #ef4444; font-weight: 600; }
.stock-ok { color: #22c55e; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 20px; opacity: 0.3; }
.empty-state p { font-family: var(--font-mono); font-size: 14px; }

.site-footer {
  padding: 64px 16px 32px; border-top: 1px solid var(--border); background: var(--navy-light);
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid var(--border);
}
.footer-brand { font-size: 32px; font-family: var(--font-display); font-style: italic; margin-bottom: 16px; }
.footer-desc { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); line-height: 1.8; max-width: 300px; }
.footer-col-title {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--primary); margin-bottom: 20px;
}
.footer-link {
  display: block; font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); margin-bottom: 12px; transition: color 0.3s;
}
.footer-link:hover { color: white; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; flex-wrap: wrap; gap: 16px;
}
.footer-copy { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-muted); }
.footer-socials { display: flex; gap: 16px; }
.footer-social {
  width: 36px; height: 36px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.3s;
}
.footer-social:hover { border-color: var(--primary); color: var(--primary); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-4 { gap: 16px; }
.text-red { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}
@keyframes pulse { 0% { opacity: 0.7; } 100% { opacity: 1; } }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── MOBILE BOTTOM NAV (dashboard + admin) ─────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
  background: rgba(10,15,26,0.98); border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.mobile-bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: flex-end;
  max-width: 500px; margin: 0 auto;
}
.mbn-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 6px 12px; border-radius: 8px; transition: all 0.2s; flex: 1;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.05em;
  text-transform: uppercase; min-width: 0;
}
.mbn-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.mbn-btn.active { color: var(--primary); }
.mbn-btn.active svg { stroke: var(--primary); }
.mbn-badge {
  position: absolute; top: 4px; right: 8px;
  background: var(--primary); color: white; font-size: 9px;
  border-radius: 99px; padding: 1px 5px; font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px 16px 80px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none !important; }
  .mobile-menu-toggle { display: block; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .toast { min-width: unset; }
  .mobile-bottom-nav { display: block; }
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td, th { white-space: nowrap; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .hide-mobile { display: none; }
  .main-content { padding: 12px 12px 80px; }
}

/* Live status pulse */
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; margin-right: 5px;
  animation: livePulse 2s ease-in-out infinite;
}
.live-dot.syncing { background: #f59e0b; }
