:root{
  --bg0: #05060e;
  --bg1: #0a0f1f;

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.64);

  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.09);
  --stroke: rgba(255,255,255,.12);
  --stroke2: rgba(255,255,255,.18);

  --shadow: 0 30px 120px rgba(0,0,0,.55);
  --shadow2: 0 14px 46px rgba(0,0,0,.42);

  --radius: 22px;

  --p1: #7c5cff;
  --p2: #00c8ff;
  --p3: #ff3d57;

  --tg-bg: var(--tg-theme-bg-color, var(--bg1));
  --tg-text: var(--tg-theme-text-color, var(--text));
  --tg-hint: var(--tg-theme-hint-color, var(--muted));
  --tg-button: var(--tg-theme-button-color, var(--p1));
  --tg-button-text: var(--tg-theme-button-text-color, #fff);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color: var(--tg-text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

.bg{position:fixed; inset:0; pointer-events:none; z-index:-1}
.orb{
  position:absolute;
  width:720px; height:720px;
  border-radius:999px;
  filter: blur(34px);
  opacity:.38;
  transform: translate3d(0,0,0);
  animation: float 10s ease-in-out infinite;
}
.orb1{left:-240px; top:-220px; background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.95), transparent 55%)}
.orb2{right:-260px; top:140px; background: radial-gradient(circle at 35% 35%, rgba(0,200,255,.78), transparent 58%); animation-duration: 12s}
@keyframes float{0%,100%{transform: translateY(0)}50%{transform: translateY(18px)}}

.gridFx{
  position:absolute; inset:0;
  background:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity:.12;
  mask-image: radial-gradient(circle at 50% 20%, black 30%, transparent 70%);
}

.scanline{
  position:absolute; inset:-20% 0;
  background: linear-gradient(transparent, rgba(255,255,255,.05), transparent);
  opacity:.06;
  animation: scan 7.5s linear infinite;
}
@keyframes scan{0%{transform: translateY(-30%)}100%{transform: translateY(30%)}}

#app{min-height:100%; display:flex; flex-direction:column}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(8,10,18,.58);
  backdrop-filter: blur(16px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:44px; height:44px;
  border-radius: 18px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(0,200,255,.70));
  box-shadow: var(--shadow2);
  position:relative;
  overflow:hidden;
}
.logoGlow{
  position:absolute; inset:-18px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.45), transparent 52%);
  transform: rotate(18deg);
}
.logoMark{position:relative; font-weight:950; letter-spacing:.2px}
.titles .title{font-weight:950; letter-spacing:.2px}
.titles .subtitle{margin-top:2px; font-size:12px; color: var(--tg-hint)}

.actions{display:flex; gap:10px; align-items:center}
.iconBtn{
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--tg-text);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.iconBtn:hover{transform: translateY(-1px); background: rgba(255,255,255,.10); border-color: var(--stroke2)}
.iconBtn:active{transform: translateY(0px)}

/* Layout */
.container{width:min(980px, 100%); margin:0 auto; padding:16px; flex:1}
.grid{display:grid; grid-template-columns: repeat(12, 1fr); gap:12px}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

h2{margin:0 0 10px; font-size:20px}
h3{margin:0 0 8px; font-size:16px}
.muted{color: var(--tg-hint); margin:0}
.small{font-size:12px}

/* Buttons */
.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
button{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--tg-text);
  border-radius: 16px;
  padding:11px 14px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
button:hover{transform: translateY(-1px); background: rgba(255,255,255,.10); border-color: var(--stroke2)}
button:active{transform: translateY(0px)}
button.primary{
  background: linear-gradient(135deg, var(--tg-button), rgba(0,200,255,.60));
  border-color: transparent;
  color: var(--tg-button-text);
  box-shadow: 0 18px 60px rgba(124,92,255,.16);
}
button.danger{
  background: rgba(255,61,87,.14);
  border-color: rgba(255,61,87,.32);
}
button.ok{
  background: rgba(61,255,155,.14);
  border-color: rgba(61,255,155,.35);
}
button.ghost{background: transparent}

/* Product cards */
.card{
  grid-column: span 12;
  display:flex; gap:14px;
  align-items:stretch;
  padding:14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
  position:relative;
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(circle at 20% 0%, rgba(124,92,255,.20), transparent 55%),
              radial-gradient(circle at 90% 100%, rgba(0,200,255,.15), transparent 45%);
  pointer-events:none;
}
@media (min-width: 720px){ .card{grid-column: span 6} }

.thumb{
  width:132px; min-width:132px; height:100px;
  border-radius: 20px;
  overflow:hidden;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  position:relative;
  z-index:1;
}
.thumb img{width:100%; height:100%; object-fit:cover}
.cardBody{flex:1; min-width:0; position:relative; z-index:1}
.priceRow{display:flex; align-items:baseline; gap:10px; margin-top:10px}
.price{font-size:18px; font-weight:950}
.badge{
  font-size:12px;
  padding:4px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.07);
}

/* Form fields */
.field{display:flex; flex-direction:column; gap:6px; margin-top:12px}
input, select, textarea{
  width:100%;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  color: var(--tg-text);
  border-radius: 16px;
  padding:11px 12px;
  outline:none;
}
textarea{min-height:120px; resize:vertical}
label{font-size:12px; color: var(--tg-hint)}

/* Bottom bar */
.bottombar{
  position:sticky; bottom:0; z-index:20;
  display:flex; gap:8px;
  padding:10px 12px;
  border-top: 1px solid var(--stroke);
  background: rgba(8,10,18,.70);
  backdrop-filter: blur(16px);
}
.nav{
  flex:1;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  padding:10px 10px;
  border-radius: 18px;
}
.nav.active{
  background: rgba(255,255,255,.08);
  border:1px solid var(--stroke);
}
.navIcon{display:grid; place-items:center; opacity:.95}

/* misc */
.hr{height:1px; background: var(--stroke); margin:14px 0}
.hidden{display:none !important}

/* Toast */
.toast{
  position:fixed;
  left:50%;
  transform: translateX(-50%);
  bottom:84px;
  width:min(720px, calc(100% - 24px));
  padding:12px 14px;
  border-radius: 18px;
  border:1px solid var(--stroke);
  background: rgba(18,22,34,.92);
  box-shadow: var(--shadow2);
  z-index:50;
}
