:root{
  --bg0:#0b0712;
  --bg1:#120a1f;
  --card:#141024cc;
  --card2:#110c20cc;
  --stroke:#ffffff14;
  --stroke2:#ffffff0c;
  --text:#e7e4ff;
  --muted:#bcb3ffb3;

  --accent:#c35cff;
  --accent2:#ff6bd6;
  --money:#2ef6c8;

  --radius:18px;
  --shadow: 0 18px 40px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 25% 10%, rgba(195,92,255,.35), transparent 60%),
    radial-gradient(1200px 600px at 75% 20%, rgba(255,107,214,.22), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

/* Loader */
/* === Loader spinner === */
.loader{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px);
  z-index:9999;
  transition: opacity .4s ease, visibility .4s ease;
}
.loader.hide{
  opacity:0;
  visibility:hidden;
}

.loader-card{
  min-width:260px;
  padding:24px 22px;
  border-radius:18px;
  background: linear-gradient(180deg, rgba(30,18,52,.9), rgba(12,8,20,.9));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  gap:16px;
}

/* Spinner */
.spinner{
  width:38px;
  height:38px;
  border-radius:50%;
  border:4px solid rgba(195,92,255,.25);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

.loader-texts{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.loader-title{
  font-weight:900;
  letter-spacing:.3px;
}

.loader-sub{
  font-size:13px;
  color:var(--muted);
}


/* Layout */
.app{
  display:grid;
  grid-template-columns: 290px 1fr;
  min-height:100vh;
}

.sidebar{
  position:sticky; top:0;
  height:100vh;
  padding:18px;
  background: linear-gradient(180deg, rgba(14,10,26,.75), rgba(10,7,18,.75));
  border-right:1px solid var(--stroke2);
  backdrop-filter: blur(12px);
}

.brand{
  display:flex; gap:12px; align-items:center;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.03);
}
.brand-logo{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  font-weight:900;
  background: linear-gradient(135deg, rgba(195,92,255,.9), rgba(46,246,200,.55));
}
.brand-title{ font-weight:900; letter-spacing:.5px; }
.brand-sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.nav{ margin-top:16px; display:flex; flex-direction:column; gap:10px; }
.nav-item{
  color:var(--text);
  text-decoration:none;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background: transparent;
  opacity:.9;
}
.nav-item:hover{
  border-color: var(--stroke);
  background: rgba(255,255,255,.03);
}
.nav-item.active{
  border-color: rgba(195,92,255,.25);
  background: linear-gradient(90deg, rgba(195,92,255,.14), rgba(255,107,214,.06));
}
.sidebar-bottom{
  position:absolute; left:18px; right:18px; bottom:18px;
  display:flex; flex-direction:column; gap:10px;
}
.nav-item.back{
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.03);
}
.copyright{ color:rgba(255,255,255,.35); font-size:12px; padding-left:6px; }

.main{
  padding:24px;
  min-height: 100vh;
}

.topbar{
  display:flex; justify-content:space-between; gap:14px;
  padding:18px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(25,16,45,.75), rgba(12,8,20,.75));
  box-shadow: var(--shadow);
}
.topbar h1{ margin:0; font-size:28px; letter-spacing:.2px; }
.topbar p{ margin:6px 0 0; color:var(--muted); }

.topbar-actions{ display:flex; gap:10px; align-items:flex-start; }

.btn{
  appearance:none;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:700;
  text-decoration:none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(195,92,255,.35); }
.btn:active{ transform: translateY(0); }
.btn-ghost{ background: rgba(255,255,255,.03); }
.btn-wide{ width:100%; }

.content{
  margin-top:14px;
  display:grid;
  grid-template-columns: minmax(0,1fr) 340px;
  gap:14px;
  align-items:start;
}

/* Cards */
.card{
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(22,14,38,.70), rgba(10,7,18,.70));
  box-shadow: var(--shadow);
  overflow:hidden;
  min-width:0;
}
.card-head{
  padding:14px 16px;
  border-bottom:1px solid var(--stroke2);
  display:flex; justify-content:space-between; gap:10px; align-items:center;
}
.card-title{ font-weight:900; letter-spacing:.3px; }
.card-hint{ color:var(--muted); font-size:12px; }

/* Items grid inside card: 2 oszlop, mint a képen */
.items-grid{
  padding:8px 10px 14px;
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap:10px;
}

.items-col{
  border:1px solid var(--stroke2);
  border-radius:14px;
  overflow:hidden;
  background: rgba(255,255,255,.02);
  min-width:0;
}

.items-head{
  padding:10px 12px;
  display:grid;
  grid-template-columns: 1fr 120px 120px 86px;
  gap:10px;
  color:rgba(255,255,255,.55);
  font-size:12px;
  letter-spacing:.6px;
  text-transform:uppercase;
  border-bottom:1px solid var(--stroke2);
}

.items-list{ display:flex; flex-direction:column; }

.item-row{
  padding:10px 12px;
  display:grid;
  grid-template-columns: 1fr 120px 120px 86px;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--stroke2);
}
.item-row:last-child{ border-bottom:none; }

.item{
  display:flex; align-items:center; gap:10px;
  min-width:0;
}
.icon{
  width:28px; height:28px;
  border-radius:10px;
  display:grid; place-items:center;
  border:1px solid rgba(195, 92, 255, 0);
  background: linear-gradient(135deg, rgba(195,92,255,.18), rgba(255,107,214,.06));
  box-shadow: 0 0 14px rgba(195,92,255,.20);
  flex:0 0 auto;
  font-size:14px;
}
.meta{ min-width:0; }
.name{
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.desc{ color:rgba(255,255,255,.55); font-size:12px; margin-top:2px; }

.right{ text-align:right; }
.price{
  font-weight:900;
  color: var(--money);
}
.weight{ color:rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }

.qty{
  width:72px;
  height:34px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  color:var(--text);
  text-align:center;
  font-weight:900;
  outline:none;
}

/* Summary */
.summary{ padding-bottom:12px; }
.sum-box{
  margin:12px 14px 0;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.02);
}
.sum-label{ color:rgba(255,255,255,.55); font-size:12px; letter-spacing:.4px; }
.sum-value{ margin-top:6px; font-weight:900; font-size:22px; }
.sum-value.accent{ color:var(--money); }

.sum-actions{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  padding:14px;
}

/* Footer */
.footer{
  margin-top: auto;
  padding: 16px 0;
  text-align: center;
  color: rgba(255,255,255,.45);
  font-size: 12px;
}


/* Responsive */
@media (max-width: 1100px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{ position:relative; height:auto; }
  .sidebar-bottom{ position:relative; left:auto; right:auto; bottom:auto; margin-top:14px; }
  .content{ grid-template-columns: 1fr; }
}
@media (max-width: 900px){
  .items-grid{ grid-template-columns: 1fr; }
}

.percent-input{
  width:100%;
  height:42px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  color:var(--text);
  text-align:center;
  font-weight:900;
  font-size:16px;
  outline:none;
}

.icon img{
  width:18px;
  height:18px;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
}

.icon img{ width: 30px; height: 30px;}
