
:root{
  --bg:#0b1220;
  --card:#101a33;
  --muted:#93a4c7;
  --text:#eaf0ff;
  --brand:#2dd4bf;
  --brand2:#60a5fa;
  --danger:#fb7185;
  --ok:#34d399;
  --warn:#fbbf24;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 26px;
  --border: 1px solid rgba(255,255,255,.08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  background: radial-gradient(1100px 600px at 15% 10%, rgba(96,165,250,.35), transparent 60%),
              radial-gradient(900px 520px at 80% 15%, rgba(45,212,191,.30), transparent 60%),
              radial-gradient(900px 700px at 40% 100%, rgba(251,113,133,.18), transparent 60%),
              var(--bg);
  color:var(--text);
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none}
button, input, select, textarea{font:inherit}
.container{max-width:1100px; margin:0 auto; padding:18px}
.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.6);
  border-bottom: var(--border);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:12px 18px;
}
.brand{
  display:flex; align-items:center; gap:10px;
}
.logo{
  width:40px; height:40px; border-radius:14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 30px rgba(96,165,250,.25);
  position:relative;
}
.logo:after{
  content:""; position:absolute; inset:9px;
  border-radius:12px;
  background: rgba(11,18,32,.45);
  border: 1px solid rgba(255,255,255,.14);
}
.brand h1{font-size:16px; margin:0; line-height:1.1}
.brand small{display:block; color:var(--muted); font-size:12px; margin-top:2px}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border: var(--border);
  background: rgba(16,26,51,.6);
  color: var(--muted);
}
.pill b{color:var(--text)}
.pills{display:flex; gap:10px; flex-wrap:wrap}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: rgba(16,26,51,.72);
  border: var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}
.card-header{
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-bottom: var(--border);
}
.card-header h2{margin:0; font-size:14px; letter-spacing:.2px}
.card-body{padding:14px 16px}

.btn{
  cursor:pointer;
  border: var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  transition: transform .06s ease, background .2s ease, border .2s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#07101e;
  font-weight:700;
}
.btn.danger{
  border:none;
  background: linear-gradient(135deg, var(--danger), #fb923c);
  color:#1a0a0e;
  font-weight:700;
}
.btn.ghost{background: transparent}
.btn.small{padding:8px 10px; border-radius:12px; font-size:13px}
.btn.block{width:100%}

.row{display:flex; gap:10px; flex-wrap:wrap}
.field{display:flex; flex-direction:column; gap:7px; margin-bottom:12px}
.label{color:var(--muted); font-size:12px}
.input, .select, .textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(11,18,32,.45);
  color:var(--text);
  outline:none;
}
.textarea{min-height:84px; resize:vertical}
.hr{height:1px; background: rgba(255,255,255,.08); margin:12px 0}

.tag{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius: 999px;
  border: var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size:12px;
}
.tag.ok{background: rgba(52,211,153,.12); color:#bff7e4; border-color: rgba(52,211,153,.24)}
.tag.warn{background: rgba(251,191,36,.12); color:#ffe8a6; border-color: rgba(251,191,36,.24)}
.tag.bad{background: rgba(251,113,133,.12); color:#ffd1d8; border-color: rgba(251,113,133,.24)}

.products{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
}
@media (max-width: 980px){
  .products{grid-template-columns: repeat(3, 1fr)}
}
@media (max-width: 520px){
  .products{grid-template-columns: repeat(2, 1fr)}
}
.product{
  border: var(--border);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  overflow:hidden;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border .2s ease;
  position:relative;
}
.product:hover{transform: translateY(-1px); background: rgba(255,255,255,.06)}
.product img{
  width:100%; height:110px; object-fit:cover; display:block;
  background: rgba(0,0,0,.25);
}
.product .pbody{padding:10px 10px 12px}
.product .name{font-weight:700; font-size:13px; line-height:1.2; margin-bottom:6px}
.product .meta{display:flex; align-items:center; justify-content:space-between; gap:8px}
.price{font-weight:800}
.muted{color:var(--muted)}
.badge{
  position:absolute; top:10px; right:10px;
  background: rgba(11,18,32,.7);
  border: var(--border);
  border-radius: 999px;
  padding:6px 9px;
  font-size:12px;
  color: var(--muted);
}

.cart-fab{
  position:fixed; right:16px; bottom:16px; z-index:30;
  width:58px; height:58px; border-radius: 20px;
  border:none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#07101e;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
}
.cart-count{
  position:absolute; top:-6px; right:-6px;
  min-width:22px; height:22px; padding:0 6px;
  display:flex; align-items:center; justify-content:center;
  border-radius:999px;
  background: rgba(251,113,133,.95);
  color:#19060b;
  font-weight:900;
  border: 1px solid rgba(255,255,255,.18);
  font-size:12px;
}

.modal{
  position:fixed; inset:0; z-index:40;
  display:none;
  align-items:flex-end;
  background: rgba(0,0,0,.55);
}
.modal.show{display:flex}
.sheet{
  width:100%;
  max-width: 980px;
  margin:0 auto;
  border-radius: 26px 26px 0 0;
  background: rgba(16,26,51,.86);
  border: var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.sheet-header{
  padding:12px 14px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border-bottom: var(--border);
}
.sheet-header .grab{
  width:44px; height:5px; border-radius:999px;
  background: rgba(255,255,255,.22);
  margin:0 auto;
}
.sheet-body{padding:14px}
.cart-items{display:flex; flex-direction:column; gap:10px; max-height: 44vh; overflow:auto}
.cart-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px;
  border-radius: 16px;
  border: var(--border);
  background: rgba(255,255,255,.04);
}
.cart-item .left{min-width:0}
.cart-item .title{font-weight:800; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.cart-item .sub{color:var(--muted); font-size:12px}
.qty{
  display:flex; align-items:center; gap:8px;
}
.qty button{
  width:34px; height:34px; border-radius: 12px;
}
.kpi{
  display:grid; grid-template-columns: repeat(3,1fr); gap:10px;
}
@media (max-width: 520px){
  .kpi{grid-template-columns:1fr}
}
.kpi .box{
  padding:12px; border-radius: 18px;
  border: var(--border);
  background: rgba(255,255,255,.04);
}
.kpi .box .val{font-size:18px; font-weight:900}
.kpi .box .lbl{color:var(--muted); font-size:12px; margin-top:4px}

.tabs{
  display:flex; gap:8px; flex-wrap:wrap;
}
.tab{
  padding:9px 12px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(255,255,255,.04);
  cursor:pointer;
  color: var(--muted);
  user-select:none;
}
.tab.active{
  background: rgba(45,212,191,.14);
  border-color: rgba(45,212,191,.25);
  color:#d9fff6;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th{
  text-align:left;
  color: var(--muted);
  font-size:12px;
  padding:0 10px;
}
.table td{
  padding:12px 10px;
  background: rgba(255,255,255,.04);
  border-top: var(--border);
  border-bottom: var(--border);
}
.table tr td:first-child{border-left: var(--border); border-radius: 16px 0 0 16px}
.table tr td:last-child{border-right: var(--border); border-radius: 0 16px 16px 0}

.status-line{
  display:flex; align-items:center; gap:10px;
}
.dotline{display:flex; align-items:center; gap:10px}
.dot{
  width:12px; height:12px; border-radius:999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  position:relative;
}
.dot.active{
  background: rgba(45,212,191,.95);
  border-color: rgba(45,212,191,.45);
  box-shadow: 0 0 0 6px rgba(45,212,191,.15);
}
.dot.active:after{
  content:""; position:absolute; inset:-10px;
  border-radius:999px;
  border: 2px solid rgba(96,165,250,.24);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse{
  0%{transform: scale(.55); opacity:.55}
  50%{transform: scale(1); opacity:.8}
  100%{transform: scale(.55); opacity:.55}
}

.toast{
  position:fixed; left:50%; bottom:88px; transform: translateX(-50%);
  background: rgba(16,26,51,.88);
  border: var(--border);
  border-radius: 999px;
  padding:10px 14px;
  display:none;
  box-shadow: var(--shadow);
  z-index:50;
}
.toast.show{display:block}

.star{
  font-size:22px; cursor:pointer; color: rgba(255,255,255,.22);
}
.star.on{color: rgba(251,191,36,.95)}

.nozoom{
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}
