:root{
  --text:#2f241d;
  --title:#4b2400;
  --muted:rgba(75,36,0,.75);
  --line:rgba(255,255,255,.42);
  --line-strong:rgba(255,255,255,.52);
  --glass:rgba(255,248,240,.58);
  --glass-soft:rgba(255,255,255,.32);
  --white-soft:rgba(255,255,255,.38);
  --shadow:0 20px 60px rgba(120,56,8,.18);
  --shadow-soft:0 10px 24px rgba(120,56,8,.10);
  --orange-1:#ffb222;
  --orange-2:#ff9137;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  min-height:100%;
  font-family:"Inter","Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(255,165,0,.22) 0%, rgba(255,165,0,0) 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(255,165,0,.14) 0%, rgba(255,165,0,0) 55%),
    linear-gradient(180deg, rgba(255,165,0,.14) 0%, rgba(255,165,0,.06) 55%, rgba(255,255,255,0) 100%);
}

body{
  min-height:100vh;
  position:relative;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.35), transparent 45%),
    radial-gradient(circle at bottom right, rgba(255,255,255,.15), transparent 65%),
    linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.02));
  pointer-events:none;
}

.scanShell{
  position:relative;
  z-index:1;
  min-height:100vh;
  padding:28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.scanGlass{
  width:100%;
  max-width:1024px;
  border-radius:30px;
  padding:28px;
  background:var(--glass);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.38);
  box-shadow:
    0 20px 60px rgba(120,56,8,.18),
    inset 0 1px 0 rgba(255,255,255,.35);
}

.screen{
  display:none;
  width:100%;
}

.screen.active{
  display:block;
}

.homeTop{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:8px;
  margin-bottom:24px;
}

.logoWrap{
  width:300px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.companyLogo{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

.mainTitle{
  margin:0;
  font-size:56px;
  font-weight:900;
  line-height:1.05;
  letter-spacing:.2px;
  color:#4b2400;
}

.liveDateTime{
  margin-top:4px;
  font-size:15px;
  font-weight:700;
  color:var(--muted);
}

.modeGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  max-width:620px;
  margin:28px auto 0;
}

.modeCard{
  min-height:120px;
  border:none;
  border-radius:24px;
  padding:20px;
  cursor:pointer;
  background:linear-gradient(180deg, rgba(255,255,255,.52), rgba(255,255,255,.22));
  box-shadow:
    0 10px 30px rgba(152,78,14,.18),
    inset 0 1px 0 rgba(255,255,255,.35);
  border:1px solid rgba(255,255,255,.45);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.modeCard:hover{
  transform:translateY(-2px);
  box-shadow:
    0 16px 32px rgba(152,78,14,.22),
    inset 0 1px 0 rgba(255,255,255,.4);
  border-color:rgba(255,255,255,.65);
}

.modeCard:active{
  transform:scale(.985);
}

.modeCardInner{
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.modeIconWrap{
  width:60px;
  height:60px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.38);
  border:1px solid rgba(255,255,255,.42);
  box-shadow:0 8px 18px rgba(120,56,8,.08);
}

.modeIcon{
  width:34px;
  height:34px;
}

.modeIconStroke{
  fill:none;
  stroke:var(--title);
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.modeText{
  font-size:24px;
  font-weight:800;
  color:var(--title);
  line-height:1;
}

.homeBottomActions{
  display:flex;
  justify-content:center;
  margin-top:28px;
}

.homeBackBtn{
  min-width:120px;
  padding:14px 20px;
  border:none;
  border-radius:18px;
  cursor:pointer;
  font-size:15px;
  font-weight:700;
  color:#7a430c;
  background:rgba(255,255,255,.32);
  border:1px solid rgba(255,255,255,.42);
  box-shadow:0 8px 24px rgba(120,56,8,.10);
  transition:transform .16s ease, box-shadow .16s ease;
}

.homeBackBtn:hover{
  transform:translateY(-1px);
}

.homeBackBtn:active{
  transform:scale(.985);
}

.scanHeader{
  display:flex;
  align-items:center;
  gap:18px;
  margin-bottom:24px;
}

.backBtn{
  min-width:110px;
  padding:12px 18px;
  border:none;
  border-radius:18px;
  cursor:pointer;
  font-size:15px;
  font-weight:700;
  background:rgba(255,255,255,.35);
  color:#5a2f05;
  border:1px solid rgba(255,255,255,.45);
  box-shadow:0 8px 20px rgba(120,56,8,.10);
  transition:transform .16s ease, box-shadow .16s ease;
}

.backBtn:hover{
  transform:translateY(-1px);
}

.scanHeaderCenter{
  text-align:left;
}

.scanModeTitle{
  margin:0;
  font-size:32px;
  font-weight:800;
  color:var(--title);
  letter-spacing:.2px;
}

.liveDateTimeMini{
  margin-top:4px;
  color:var(--muted);
  font-size:15px;
  font-weight:700;
}

.scanHeaderSpacer{
  display:none;
}

.scanCardGlass{
  display:flex;
  flex-direction:column;
  padding:0;
  background:none;
  border:none;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

.scanInputRow{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

#scanInput{
  flex:1;
  min-width:280px;
  min-height:52px;
  border-radius:18px;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.42);
  background:rgba(255,255,255,.38);
  color:var(--title);
  font-size:15px;
  outline:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25);
}

#scanInput:focus{
  border-color:rgba(255,144,24,.85);
  box-shadow:
    0 0 0 3px rgba(255,145,0,.14),
    inset 0 1px 0 rgba(255,255,255,.3);
}

.primaryBtn,
.ghostBtn,
.confirmBtn,
.iconBtn,
.tableMiniBtn{
  border:none;
  border-radius:18px;
  cursor:pointer;
  font-weight:700;
  transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.primaryBtn,
.confirmBtn{
  min-width:140px;
  padding:14px 22px;
  font-size:15px;
  color:#fff;
  background:linear-gradient(180deg, var(--orange-1), var(--orange-2));
  box-shadow:0 10px 24px rgba(173,77,7,.28);
}

.ghostBtn{
  min-width:120px;
  padding:14px 20px;
  font-size:15px;
  color:#7a430c;
  background:rgba(255,255,255,.32);
  border:1px solid rgba(255,255,255,.42);
  box-shadow:0 8px 24px rgba(120,56,8,.10);
}

.iconBtn{
  width:52px;
  height:52px;
  min-width:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.32);
  border:1px solid rgba(255,255,255,.42);
  box-shadow:0 8px 24px rgba(120,56,8,.10);
}

.iconBtn:hover,
.primaryBtn:hover,
.ghostBtn:hover,
.confirmBtn:hover,
.tableMiniBtn:hover{
  transform:translateY(-1px);
}

.iconBtn svg{
  width:24px;
  height:24px;
}

.iconStroke{
  fill:none;
  stroke:var(--title);
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.scanMessage{
  min-height:24px;
  margin-bottom:12px;
  font-size:14px;
  font-weight:700;
}

.cameraWrap{
  margin-bottom:18px;
  padding:18px;
  border-radius:22px;
  background:rgba(255,255,255,.32);
  border:1px solid rgba(255,255,255,.38);
  box-shadow:0 8px 24px rgba(120,56,8,.08);
}

.cameraWrap.hidden{
  display:none;
}

.cameraTopBar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.cameraLabel{
  font-size:16px;
  font-weight:700;
  color:var(--title);
}

.qrReader{
  width:100%;
  max-width:520px;
  margin:0 auto;
  overflow:hidden;
  border-radius:18px;
}

.basketArea{
  min-height:0;
  overflow:auto;
}

.basketEmpty{
  padding:18px;
  color:var(--muted);
  font-size:16px;
  font-weight:700;
}

.basketMeta{
  margin:8px 0 10px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.basketBox{
  overflow:auto;
  border-radius:22px;
  background:rgba(255,255,255,.26);
  border:1px solid rgba(255,255,255,.38);
}

.basketTable{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}

.basketTable th,
.basketTable td{
  padding:14px 16px;
  text-align:left;
  font-size:14px;
  border-bottom:1px solid rgba(255,255,255,.24);
}

.basketTable th{
  background:rgba(255,255,255,.2);
  color:#5c3007;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.3px;
}

.basketTable td{
  color:#472100;
  background:rgba(255,255,255,.08);
}

.tableMiniBtn{
  min-width:96px;
  padding:10px 14px;
  font-size:13px;
  color:#7a430c;
  background:rgba(255,255,255,.32);
  border:1px solid rgba(255,255,255,.42);
  box-shadow:0 8px 18px rgba(120,56,8,.08);
}

.scanFooterActions{
  display:flex;
  justify-content:flex-end;
  margin-top:26px;
}

.scanFooter{
  margin-top:18px;
  padding:6px 0 0;
  background:none;
  color:rgba(75,36,0,.72);
  text-align:center;
  font-size:13px;
  font-weight:700;
  box-shadow:none;
  border-radius:0;
}

.pinModal{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.pinModal.hidden{
  display:none;
}

.pinModalBackdrop{
  position:absolute;
  inset:0;
  background:rgba(55,28,5,.32);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.pinModalCard{
  position:relative;
  z-index:1;
  width:100%;
  max-width:460px;
  border-radius:28px;
  padding:26px;
  background:rgba(255,248,240,.92);
  border:1px solid rgba(255,255,255,.44);
  box-shadow:
    0 20px 50px rgba(120,56,8,.2),
    inset 0 1px 0 rgba(255,255,255,.3);
  text-align:center;
}

.pinModalTitle{
  margin:0 0 8px;
  font-size:28px;
  font-weight:800;
  color:var(--title);
}

.pinModalSubtext{
  margin:0 0 18px;
  color:var(--muted);
  font-size:15px;
  font-weight:700;
}

.pinInput{
  width:100%;
  min-height:52px;
  border-radius:18px;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.42);
  background:rgba(255,255,255,.38);
  color:var(--title);
  text-align:center;
  font-size:22px;
  font-weight:800;
  letter-spacing:8px;
  outline:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25);
}

.pinInput:focus{
  border-color:rgba(255,144,24,.85);
  box-shadow:
    0 0 0 3px rgba(255,145,0,.14),
    inset 0 1px 0 rgba(255,255,255,.3);
}

.pinError{
  min-height:22px;
  margin-top:10px;
  color:#b42318;
  font-size:14px;
  font-weight:700;
  text-align:center;
}

.pinModalActions{
  display:flex;
  gap:14px;
  justify-content:center;
  margin-top:22px;
}

.invoiceToast{
  position:fixed;
  top:22px;
  right:22px;
  min-width:280px;
  max-width:420px;
  background:rgba(255,248,240,.94);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  color:#4b2400;
  border:1px solid rgba(255,255,255,.75);
  border-left:6px solid #f59e0b;
  border-radius:16px;
  box-shadow:0 18px 45px rgba(120,56,8,.14);
  padding:14px 16px;
  z-index:9999;
  font-size:14px;
  font-weight:800;
  line-height:1.5;
  opacity:1;
  transform:translateY(0);
  transition:opacity .22s ease, transform .22s ease;
}

.invoiceToast.hidden{
  opacity:0;
  pointer-events:none;
  transform:translateY(-10px);
}

.invoiceToast.success{
  border-left-color:#16a34a;
}

.invoiceToast.warning{
  border-left-color:#f59e0b;
}

.invoiceToast.error{
  border-left-color:#dc2626;
}

@media (max-width: 900px){
  .scanShell{
    padding:18px;
    justify-content:flex-start;
  }

  .scanGlass{
    padding:20px;
    border-radius:24px;
  }

  .mainTitle{
    font-size:42px;
  }

  .modeGrid{
    grid-template-columns:1fr;
  }

  .scanHeader{
    flex-wrap:wrap;
    gap:12px;
  }

  .scanHeaderCenter{
    width:100%;
  }

  .scanInputRow{
    flex-direction:column;
  }

  #scanInput,
  .primaryBtn,
  .ghostBtn,
  .confirmBtn{
    width:100%;
  }

  .iconBtn{
    width:100%;
    height:52px;
  }

  .scanFooterActions{
    justify-content:stretch;
  }
}