:root{
  --bg-1:#f7f1e7;
  --bg-2:#efe4d1;
  --glass:rgba(255,255,255,.42);
  --glass-strong:rgba(255,255,255,.58);
  --glass-border:rgba(255,255,255,.52);
  --text:#171717;
  --muted:#777;
  --accent:#f7a514;
  --accent-2:#ffbc2e;
  --shadow:0 20px 50px rgba(0,0,0,.10);
  --shadow-soft:0 10px 25px rgba(0,0,0,.06);
  --radius-xl:30px;
  --radius-lg:24px;
  --radius-md:18px;
}

*{
  box-sizing:border-box;
}

html,body{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.58), transparent 28%),
    radial-gradient(circle at top right, rgba(255,255,255,.22), transparent 26%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

body{
  min-height:100vh;
}

.scanShell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding:16px 16px 0;
}

.scanGlass{
  flex:1;
  display:flex;
  flex-direction:column;
  background:var(--glass);
  border:1px solid var(--glass-border);
  border-radius:32px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  overflow:hidden;
  padding:22px 32px 20px;
}

.screen{
  display:none;
  flex:1;
  min-height:0;
}

.screen.active{
  display:flex;
  flex-direction:column;
}

.homeTop{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding-top:0;
}

.logoWrap{
  width:350px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:6px;
}

.companyLogo{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  filter:drop-shadow(0 8px 14px rgba(0,0,0,.08));
}

.mainTitle{
  margin:14px 0 12px;
  text-align:center;
  font-size:56px;
  font-weight:900;
  letter-spacing:.2px;
  line-height:1.05;
}

.liveDateTime{
  font-size:22px;
  font-weight:700;
  color:var(--muted);
  margin-bottom:10px;
}

.modeGrid{
  flex:1;
  width:100%;
  max-width:760px;
  max-height: 400px;
  margin:24px auto 8px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:38px;
  align-items:center;
}

.modeCard{
  min-height:280px;
  border:none;
  border-radius:32px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.02)),
    linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    0 18px 36px rgba(247,165,20,.22);
  color:#111;
  font-size:50px;
  font-weight:900;
  letter-spacing:.4px;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.modeCard{
  min-height:280px;
  border:none;
  border-radius:32px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.02)),
    linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    0 18px 36px rgba(247,165,20,.22);
  color:#111;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.modeCard::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top left, rgba(255,255,255,.22), transparent 42%);
  pointer-events:none;
}

.modeCard:hover{
  transform:translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 22px 40px rgba(247,165,20,.28);
  filter:saturate(1.03);
}

.modeCard:active{
  transform:scale(.985);
}

.modeCardInner{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
}

.modeIconWrap{
  width:90px;
  height:90px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:24px;
  background:rgba(255,255,255,.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35);
}

.modeIcon{
  width:52px;
  height:52px;
}

.modeIconStroke{
  fill:none;
  stroke:#111;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.modeText{
  font-size:48px;
  font-weight:900;
  letter-spacing:.4px;
  line-height:1;
}

.modeCard::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top left, rgba(255,255,255,.22), transparent 42%);
  pointer-events:none;
}

.modeCard:hover{
  transform:translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 22px 40px rgba(247,165,20,.28);
  filter:saturate(1.03);
}

.modeCard:active{
  transform:scale(.985);
}

.modeCard span{
  position:relative;
  z-index:1;
}

.scanHeader{
  position:relative;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  margin-bottom:14px;
  min-height:60px;
}

.backBtn{
  height:54px;
  padding:0 18px;
  border:none;
  border-radius:16px;
  background:var(--glass-strong);
  border:1px solid var(--glass-border);
  box-shadow:var(--shadow-soft);
  font-size:18px;
  font-weight:800;
  cursor:pointer;
  position:absolute;
  left:0;
  top:0;
}

.scanHeaderCenter{
  text-align:center;
}

.scanHeaderSpacer{
  width:140px;
}

.scanModeTitle{
  font-size:34px;
  font-weight:900;
  letter-spacing:.3px;
}

.liveDateTimeMini{
  margin-top:6px;
  color:var(--muted);
  font-size:16px;
  font-weight:700;
}

.scanCardGlass{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  padding:20px;
  background:rgba(255,255,255,.36);
  border:1px solid rgba(255,255,255,.50);
  border-radius:26px;
  box-shadow:0 16px 36px rgba(0,0,0,.07);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.scanInputRow{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

#scanInput{
  flex:1;
  min-width:320px;
  height:58px;
  border-radius:18px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.80);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.4);
  padding:0 18px;
  font-size:20px;
  outline:none;
}

#scanInput:focus{
  border-color:rgba(247,165,20,.75);
  box-shadow:0 0 0 4px rgba(247,165,20,.12);
}

.primaryBtn,
.ghostBtn,
.confirmBtn{
  height:58px;
  min-width:120px;
  border:none;
  border-radius:18px;
  font-size:18px;
  font-weight:800;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}

.primaryBtn,
.confirmBtn{
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0)),
    linear-gradient(180deg, var(--accent-2), var(--accent));
  color:#111;
  box-shadow:0 14px 28px rgba(247,165,20,.22);
}

.ghostBtn{
  background:rgba(255,255,255,.75);
  color:#111;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 10px 20px rgba(0,0,0,.05);
}

.primaryBtn:hover,
.ghostBtn:hover,
.confirmBtn:hover,
.backBtn:hover{
  transform:translateY(-1px);
}

.scanMessage{
  min-height:26px;
  margin-bottom:10px;
  font-size:15px;
  font-weight:800;
}

.basketArea{
  flex:1;
  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:18px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 10px 24px rgba(0,0,0,.05);
}

.basketTable{
  width:100%;
  border-collapse:collapse;
  font-size:15px;
}

.basketTable thead{
  background:rgba(245,245,245,.92);
}

.basketTable th,
.basketTable td{
  padding:13px 15px;
  text-align:left;
  white-space:nowrap;
  border-bottom:1px solid rgba(0,0,0,.07);
}

.basketTable th{
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.35px;
}

.tableMiniBtn{
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(0,0,0,.08);
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.scanFooterActions{
  display:flex;
  justify-content:flex-end;
  margin-top:16px;
}

.confirmBtn{
  min-width:200px;
}

.scanFooter{
  margin-top:12px;
  border-radius:24px 24px 0 0;
  background:linear-gradient(180deg, rgba(255,188,46,.94), rgba(247,165,20,.96));
  color:#111;
  text-align:center;
  padding:12px 18px;
  font-size:14px;
  font-weight:800;
  box-shadow:0 -8px 20px rgba(247,165,20,.14);
}

.pinModal{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
}

.pinModal.hidden{
  display:none;
}

.pinModalBackdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.pinModalCard{
  position:relative;
  z-index:1;
  width:min(420px, calc(100vw - 32px));
  background:rgba(255,255,255,.88);
  border:1px solid rgba(255,255,255,.72);
  border-radius:24px;
  box-shadow:0 24px 60px rgba(0,0,0,.18);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  padding:24px;
}

.pinModalTitle{
  font-size:28px;
  font-weight:900;
  text-align:center;
  margin-bottom:8px;
}

.pinModalSubtext{
  font-size:16px;
  font-weight:700;
  color:var(--muted);
  text-align:center;
  margin-bottom:18px;
}

.pinInput{
  width:100%;
  height:64px;
  border-radius:18px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.92);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.4);
  text-align:center;
  font-size:32px;
  font-weight:900;
  letter-spacing:8px;
  outline:none;
  padding:0 16px;
}

.pinInput:focus{
  border-color:rgba(247,165,20,.75);
  box-shadow:0 0 0 4px rgba(247,165,20,.12);
}

.pinError{
  min-height:22px;
  margin-top:10px;
  color:#c81e1e;
  font-size:14px;
  font-weight:800;
  text-align:center;
}

.pinModalActions{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-top:18px;
}

.invoiceToast{
  position:fixed;
  top:22px;
  right:22px;
  min-width:280px;
  max-width:420px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  color:#1f2937;
  border:1px solid rgba(255,255,255,.75);
  border-left:6px solid #f59e0b;
  border-radius:16px;
  box-shadow:0 18px 45px rgba(0,0,0,.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;
}

.cameraWrap{
  margin-bottom:14px;
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.60);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 10px 24px rgba(0,0,0,.05);
}

.cameraWrap.hidden{
  display:none;
}

.cameraTopBar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}

.cameraLabel{
  font-size:16px;
  font-weight:800;
}

.qrReader{
  width:100%;
  max-width:520px;
  margin:0 auto;
  overflow:hidden;
  border-radius:16px;
}

.iconBtn{
  width:58px;
  height:58px;
  border:none;
  border-radius:18px;
  background:rgba(255,255,255,.75);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 10px 20px rgba(0,0,0,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.iconBtn:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(0,0,0,.08);
}

.iconBtn svg{
  width:35px;
  height:35px;
}

.iconStroke{
  fill:none;
  stroke:#111;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media (max-width: 1100px){
  .mainTitle{
    font-size:44px;
  }

  .modeGrid{
    max-width:680px;
    gap:24px;
  }

  .modeCard{
    min-height:230px;
    font-size:40px;
  }
}