:root {
  --bg: #07070d;
  --panel: #0e0d15;
  --panel-glass: rgba(14, 13, 21, 0.75);
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(197, 104, 255, 0.25);
  --purple: #c568ff;
  --purple-glow: rgba(197, 104, 255, 0.35);
  --cyan: #38d7ff;
  --cyan-glow: rgba(56, 215, 255, 0.35);
  --text: #f3effa;
  --muted: #a69db2;
  --danger: #ff5277;
  --ok: #34d399;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --button-hover: linear-gradient(135deg, #b866ff 0%, #7376ff 100%);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 10% 15%, rgba(168, 85, 247, 0.15), transparent 40%),
    radial-gradient(circle at 90% 60%, rgba(56, 215, 255, 0.12), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(99, 102, 241, 0.1), transparent 50%);
  z-index: -1;
}

a { color: inherit; text-decoration: none; transition: all 0.25s ease; }

header {
  height: 76px;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(16px, calc((100% - 1320px) / 2));
  background: rgba(7, 7, 13, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  max-width: 100%;
}

.brand {
  font: 800 22px Sora, Inter, sans-serif;
  color: #fff;
  letter-spacing: -0.03em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand span {
  background: linear-gradient(135deg, #c568ff, #38d7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  gap: 16px;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
}

nav a, nav button {
  font-weight: 500;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

nav a:hover {
  color: var(--purple);
  text-shadow: 0 0 12px var(--purple-glow);
}

.nav-admin-btn {
  background: var(--accent-gradient) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 15px var(--purple-glow) !important;
}

.nav-admin-btn:hover {
  background: var(--button-hover) !important;
  text-shadow: none !important;
}

.has-pending-orders {
  position: relative !important;
  background: linear-gradient(135deg, #ff3366, #ff0055) !important;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.6) !important;
  animation: adminPulseGlow 1.5s infinite alternate !important;
}

@keyframes adminPulseGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.95);
    transform: scale(1.03);
  }
}

.admin-badge-pulse {
  background: #ffffff;
  color: #ff0055;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  max-width: 100%;
}

.userbar b {
  background: rgba(56, 215, 255, 0.1);
  border: 1px solid rgba(56, 215, 255, 0.25);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.userbar span {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.button, button {
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  min-height: 44px;
  color: white;
  background: var(--accent-gradient);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px var(--purple-glow);
  touch-action: manipulation;
}

.button:hover, button:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--purple-glow);
}

.button:active, button:active {
  transform: translateY(0);
}

.button.ghost, button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--text);
}

.button.ghost:hover, button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-bright);
}

.button.danger, button.danger {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.35);
}

.container {
  width: min(1320px, calc(100% - 40px));
  margin: 35px auto;
}

.panel {
  background: var(--panel-glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  border-color: var(--line-bright);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

.hero-copy {
  min-height: 410px;
  padding: 55px;
  background: linear-gradient(90deg, #07070d 25%, rgba(7, 7, 13, 0.7)), url('../screen.png') center/cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

h1, h2, h3 {
  font-family: Sora, Inter, sans-serif;
  margin-top: 0;
  letter-spacing: -0.025em;
}

h1 { font-size: 46px; line-height: 1.15; max-width: 680px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }

.accent {
  background: linear-gradient(135deg, #c568ff, #38d7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted { color: var(--muted); }

.tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.tabs button {
  flex: 1;
  background: transparent;
  border-radius: var(--radius-sm);
  border: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
  transition: all 0.25s ease;
}

.tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tabs button.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 15px var(--purple-glow);
}

.tab { display: none; }
.tab.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  background: rgba(9, 9, 14, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  outline: none;
  font-size: 14px;
  transition: all 0.25s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 18px var(--purple-glow);
  background: rgba(14, 13, 21, 0.9);
}

.grid { display: grid; gap: 24px; }
.cards { grid-template-columns: repeat(4, 1fr); }

.card {
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--panel-glass);
  border: 1px solid var(--line);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--line-bright);
  box-shadow: 0 16px 40px rgba(197, 104, 255, 0.18);
}

.card img, .placeholder {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: linear-gradient(135deg, #1c0e2a, #072336);
  display: grid;
  place-items: center;
  font: 800 24px Sora, sans-serif;
  color: rgba(255, 255, 255, 0.4);
}

.card-body { padding: 22px; }
.card-body h3 { margin-bottom: 8px; font-size: 18px; }

.price {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 800;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 50px 0 22px;
}

.auth {
  max-width: 460px;
  margin: 60px auto;
}

.flash {
  width: min(900px, calc(100% - 40px));
  margin: 20px auto;
  padding: 14px 20px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(16, 52, 35, 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.flash.bad {
  border-color: rgba(255, 82, 119, 0.4);
  background: rgba(60, 23, 33, 0.85);
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 76px);
}

.admin-nav {
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: #09090e;
}

.admin-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  margin: 4px 0;
  font-weight: 500;
}

.admin-nav a.active, .admin-nav a:hover {
  background: rgba(197, 104, 255, 0.12);
  color: var(--purple);
}

.admin-main { padding: 32px; min-width: 0; }
.stat-grid { grid-template-columns: repeat(4, 1fr); }
.stat strong { font-size: 30px; color: var(--purple); }

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions a, .actions button { padding: 7px 12px; font-size: 13px; min-height: auto; }

.top-list { display: grid; gap: 10px; }
.top-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  align-self: flex-start;
  flex-shrink: 0;
  height: fit-content;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.08);
}
.badge.completed { color: var(--ok); background: rgba(52, 211, 153, 0.15); }
.badge.pending { color: #fbbf24; background: rgba(251, 191, 36, 0.15); }
.badge.error { color: var(--danger); background: rgba(255, 82, 119, 0.15); }

footer {
  padding: 40px max(24px, calc((100% - 1320px) / 2));
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  margin-top: 70px;
  background: rgba(7, 7, 13, 0.9);
}

@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  header nav { display: none; }
  .hero, .two-col, .admin-layout { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .admin-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav a { white-space: nowrap; }
  h1 { font-size: 34px; }
  .hero-copy { padding: 32px; min-height: 340px; }
}

@media (max-width: 580px) {
  header { gap: 10px; padding: 0 14px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card img, .placeholder { height: 125px; font-size: 15px; }
  .card-body { padding: 14px; }
  .card-body h3 { font-size: 15px; margin-bottom: 4px; }
  .price { font-size: 15px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .container { width: calc(100% - 20px); margin: 16px auto; }
  .hero-copy { min-height: 260px; padding: 20px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 6px; margin: 30px 0 16px; }
  .admin-main { padding: 14px; }
  .panel { padding: 16px; border-radius: var(--radius-md); }
  .userbar b { padding: 5px 10px; font-size: 12px; }
  .userbar span { display: none; }
  .button, button { padding: 10px 14px; font-size: 13px; }
  table { font-size: 13px; }
  th, td { padding: 10px 8px; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
}

