:root {
  --red: #e50914; --red-dark: #a3060f; --red-glow: rgba(229,9,20,.35);
  --bg: #0a0a0a; --surface: #141414; --card: #1b1b1b; --border: #2b2b2b;
  --text: #f2f2f2; --muted: #9a9a9a;
  --green: #2ecc71; --yellow: #f1c40f; --blue: #3498db;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

nav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 5%; background: rgba(20,20,20,.95); backdrop-filter: blur(8px); border-bottom: 2px solid var(--red); }
.logo { font-size: 22px; font-weight: 800; color: var(--red); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo span { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--red); color: #fff; border: 0;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; transition: .25s; }
.btn:hover { background: var(--red-dark); box-shadow: 0 0 18px var(--red-glow); }
.btn.outline { background: transparent; border: 1.5px solid var(--red); color: var(--red); }
.btn.outline:hover { background: var(--red); color: #fff; }
.btn.ghost { background: var(--card); border: 1px solid var(--border); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.green { background: #1e8449; } .btn.green:hover { background: #27ae60; box-shadow: 0 0 14px rgba(46,204,113,.3); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.hero { text-align: center; padding: 70px 20px 50px; background: radial-gradient(ellipse at top, #250104 0%, var(--bg) 65%); }
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero p { color: var(--muted); margin: 14px auto 26px; max-width: 560px; font-size: 16px; }

.categories { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 10px 4%; }
.cat-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--card); color: var(--muted);
  border: 1px solid var(--border); padding: 9px 18px; border-radius: 24px; cursor: pointer; font-size: 14px; transition: .25s; }
.cat-btn:hover, .cat-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 22px; padding: 30px 5% 50px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: .3s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); border-color: var(--red); box-shadow: 0 12px 32px var(--red-glow); }
.card-icon { height: 110px; display: flex; align-items: center; justify-content: center; color: var(--red);
  background: linear-gradient(135deg, #1d0407, #120203); }
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.tag { align-self: flex-start; background: rgba(229,9,20,.12); color: var(--red); font-size: 12px; padding: 4px 12px; border-radius: 12px; }
.card-body h3 { margin: 10px 0 6px; font-size: 17px; }
.card-body p { color: var(--muted); font-size: 13.5px; flex: 1; margin-bottom: 14px; line-height: 1.5; }
.card-foot { display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--red); font-size: 21px; font-weight: 800; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 300;
  align-items: center; justify-content: center; padding: 16px; }
.modal.show { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--red); border-radius: 14px; padding: 28px;
  width: 100%; max-width: 430px; max-height: 90vh; overflow-y: auto; position: relative;
  animation: pop .22s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box h2 { color: var(--red); margin-bottom: 18px; display: flex; align-items: center; gap: 9px; font-size: 21px; }
.close { position: absolute; top: 14px; right: 16px; cursor: pointer; color: var(--muted); background: none; border: 0; }
.close:hover { color: var(--red); }

input, textarea, select { width: 100%; padding: 12px 14px; margin-bottom: 13px; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(229,9,20,.15); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: 11px; font-size: 15px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--red); border-bottom-color: var(--red); }

.badge { padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.pending   { background: rgba(241,196,15,.15); color: var(--yellow); }
.badge.paid      { background: rgba(52,152,219,.15); color: var(--blue); }
.badge.delivered { background: rgba(46,204,113,.15); color: var(--green); }
.badge.rejected  { background: rgba(229,9,20,.15); color: var(--red); }

.pay-box { background: var(--card); border: 1px dashed var(--red); border-radius: 10px; padding: 16px; margin-bottom: 16px; white-space: pre-line; font-size: 14px; }
.ticket-id { text-align: center; background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 14px;
  font-size: 15px; letter-spacing: 1px; border: 1px solid var(--border); }
.ticket-id b { color: var(--red); }

.admin-wrap { display: none; min-height: calc(100vh - 60px); }
.sidebar { width: 225px; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 0; flex-shrink: 0; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 13px 22px; color: var(--muted); font-size: 14.5px; cursor: pointer; border-left: 3px solid transparent; transition: .2s; }
.sidebar a:hover, .sidebar a.active { color: var(--red); background: rgba(229,9,20,.08); border-left-color: var(--red); }
.admin-main { flex: 1; padding: 28px; min-width: 0; }
.admin-main h1 { font-size: 24px; margin-bottom: 22px; }
.panel { display: none; } .panel.active { display: block; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 10px; padding: 20px; }
.stat h2 { font-size: 28px; color: var(--red); }
.stat p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; min-width: 620px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #1d0407; color: var(--red); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(229,9,20,.04); }

.order-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.order-item small { color: var(--muted); display: block; margin-top: 3px; }

.msg { padding: 11px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 13px; display: none; }
.msg.err { display: block; background: rgba(229,9,20,.12); color: #ff6b74; border: 1px solid rgba(229,9,20,.4); }
.msg.ok  { display: block; background: rgba(46,204,113,.1); color: var(--green); border: 1px solid rgba(46,204,113,.35); }

footer { text-align: center; padding: 24px; color: var(--muted); font-size: 13.5px; background: var(--surface); border-top: 2px solid var(--red); }

.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== V2 ADDITIONS ========== */
.toolbar { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 14px 5% 0; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; padding: 9px 16px; width: min(420px, 100%); color: var(--muted); }
.search input { background: none; border: 0; margin: 0; padding: 0; }
.search input:focus { box-shadow: none; }
.toolbar select { width: auto; margin: 0; border-radius: 24px; padding: 9px 14px; }

.stars { color: #f1c40f; display: inline-flex; gap: 1px; align-items: center; }
.stars .off { color: #4a4a4a; }
.rate-stars svg { cursor: pointer; transition: .15s; }
.rate-stars svg:hover { transform: scale(1.2); }
.rating-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: 6px 0 4px; cursor: pointer; }

.card-img { height: 135px; width: 100%; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.stock-badge { font-size: 11px; padding: 3px 10px; border-radius: 10px; background: rgba(46,204,113,.13); color: var(--green); font-weight: 700; }
.stock-badge.out { background: rgba(229,9,20,.13); color: var(--red); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--red); cursor: pointer; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--card); color: var(--red); }
.avatar-big { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid var(--red); display: block; margin: 0 auto 12px; }

.promo-row { display: flex; gap: 8px; margin-bottom: 13px; }
.promo-row input { margin: 0; }
.divider { border-top: 1px solid var(--border); margin: 18px 0; }
.link { color: var(--red); cursor: pointer; font-size: 13px; }
.link:hover { text-decoration: underline; }
.review-comment { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 9px; font-size: 13.5px; }
.review-comment small { color: var(--muted); display: block; margin-top: 5px; }

.hamburger { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 240; }
.backdrop.show { display: block; }

@media (max-width: 768px) {
  .hamburger { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: -280px; height: 100vh; width: 260px; z-index: 250;
    transition: left .3s ease; display: block; overflow-y: auto; padding: 70px 0 20px;
    border-right: 1px solid var(--border); border-bottom: 0; }
  .sidebar.open { left: 0; box-shadow: 8px 0 40px rgba(0,0,0,.7); }
  .sidebar a { border-left: 3px solid transparent; border-bottom: 0; white-space: normal; padding: 15px 24px; font-size: 15px; }
  .sidebar a.active { border-left-color: var(--red); border-bottom-color: transparent; background: rgba(229,9,20,.08); }
}

/* ===== MOBILE REDESIGN ===== */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  nav { padding: 10px 4%; }
  .logo { font-size: 18px; gap: 6px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 6px 10px; font-size: 12px; min-height: 36px; }
  .nav-actions .btn.small { padding: 5px 9px; font-size: 11px; }
  .avatar { width: 30px; height: 30px; }

  .hero { padding: 32px 16px 28px; }
  .hero h1 { font-size: clamp(22px, 6vw, 32px); }
  .hero p { font-size: 14px; margin: 10px auto 18px; max-width: 100%; }
  .hero .btn { font-size: 13px; padding: 9px 16px; }

  .toolbar { flex-direction: column; gap: 8px; padding: 12px 4% 0; align-items: stretch; }
  .search { width: 100%; padding: 8px 14px; }
  .toolbar select { width: 100%; padding: 10px 14px; font-size: 13px; }

  .categories { padding: 8px 4%; gap: 8px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .categories::-webkit-scrollbar { display: none; }
  .cat-btn { flex-shrink: 0; padding: 7px 15px; font-size: 13px; }

  .grid { grid-template-columns: 1fr; gap: 14px; padding: 16px 4% 36px; }

  .card { flex-direction: row; align-items: stretch; border-radius: 12px; }
  .card:hover { transform: none; box-shadow: none; }
  .card-icon { height: auto; width: 90px; min-height: 90px; flex-shrink: 0; border-radius: 12px 0 0 12px; }
  .card-img { height: 100%; width: 90px; min-height: 90px; object-fit: cover; border-bottom: 0; border-radius: 12px 0 0 12px; }
  .card-body { padding: 12px; }
  .card-body h3 { font-size: 14px; margin: 5px 0 3px; }
  .card-body p { font-size: 12.5px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tag { font-size: 10px; padding: 3px 10px; }
  .price { font-size: 16px; }
  .card-foot .btn.small { padding: 6px 10px; font-size: 11px; }
  .stock-badge { font-size: 10px; padding: 2px 8px; }
  .rating-line { font-size: 11px; gap: 4px; margin: 3px 0 2px; }

  .modal { padding: 10px; align-items: flex-end; }
  .modal-box { padding: 20px; border-radius: 14px 14px 0 0; max-width: 100%; max-height: 92vh; }
  .modal-box h2 { font-size: 18px; margin-bottom: 14px; }

  input, textarea, select { padding: 11px 12px; font-size: 15px; margin-bottom: 10px; }
  .btn { padding: 11px 16px; font-size: 14px; min-height: 44px; }
  .btn.small { padding: 7px 11px; font-size: 12px; min-height: 34px; }
  .tabs button { padding: 10px; font-size: 14px; }

  .order-item { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .order-item strong { font-size: 13px; }
  .order-item small { font-size: 11px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat h2 { font-size: 22px; }
  .stat p { font-size: 12px; }

  .admin-main { padding: 14px; }
  .admin-main h1 { font-size: 20px; margin-bottom: 14px; }

  .table-wrap { border-radius: 8px; }
  table { font-size: 12px; min-width: 560px; }
  th, td { padding: 9px 10px; }

  .pay-box { font-size: 13px; padding: 12px; }
  .ticket-id { font-size: 13px; padding: 10px; }
  .hint { font-size: 12px; }
  .msg { font-size: 12.5px; padding: 9px 12px; }

  .avatar-big { width: 72px; height: 72px; }
  .promo-row { flex-direction: column; gap: 6px; }
  .promo-row input { margin: 0; }
  .promo-row .btn { width: 100%; }

  .review-comment { font-size: 12.5px; padding: 10px; }

  .tabs { margin-bottom: 14px; }
  footer { padding: 18px; font-size: 12px; }

  .close { top: 10px; right: 12px; padding: 6px; }
}

@media (max-width: 400px) {
  .card-icon { width: 72px; min-height: 72px; }
  .card-img { width: 72px; min-height: 72px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: 13px; }
  .hero { padding: 24px 12px 20px; }
  .hero h1 { font-size: 20px; }
  .stats { grid-template-columns: 1fr; }
}
