/* SulitSee — application shell */
.sidebar { background: #fff; border-right: 1px solid #EEF2F6; }
.side-label { padding: 0 .85rem; margin: .4rem 0 .5rem; font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #94A3B8; }
.side-link { position: relative; display: flex; align-items: center; gap: .8rem; height: 2.85rem; padding: 0 .85rem; border-radius: 14px; font-size: .92rem; font-weight: 700; color: #475569; transition: background .2s, color .2s; }
.side-link svg { width: 1.2rem; height: 1.2rem; color: #94A3B8; transition: color .2s; }
.side-link:hover { background: #F8FAFC; color: var(--navy); }
.side-link.is-active { background: #F0FDF4; color: var(--green-700); }
.side-link.is-active svg { color: var(--green-600); }
.side-link.is-active::before { content: ""; position: absolute; left: -1rem; top: .65rem; bottom: .65rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--green-600); }
.side-count { margin-left: auto; min-width: 1.5rem; height: 1.4rem; padding: 0 .45rem; border-radius: 99px; background: #F1F5F9; color: #475569; font-size: .72rem; display: grid; place-items: center; }
.side-link.is-active .side-count { background: #DCFCE7; color: var(--green-700); }
.side-scan { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; height: 3.3rem; padding: 0 .65rem; border-radius: 16px; font-weight: 800; font-size: .92rem; color: #fff; background: linear-gradient(135deg, #22C55E, #16A34A 55%, #15803D); box-shadow: 0 12px 24px -12px rgba(22,163,74,.8); transition: transform .25s var(--ease), box-shadow .25s; }
.side-scan:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(22,163,74,.9); }
.side-scan.is-active { box-shadow: 0 0 0 3px #BBF7D0, 0 12px 24px -12px rgba(22,163,74,.8); }

.topbar { background: var(--g-bar); backdrop-filter: var(--g-bar-filter); -webkit-backdrop-filter: var(--g-bar-filter); border-bottom: 1px solid rgba(226,232,240,.7); }
.top-search { align-items: center; gap: .6rem; height: 2.75rem; flex: 1 1 18rem; min-width: 9rem; max-width: 26rem; padding: 0 .9rem; border-radius: 14px; background: #fff; border: 1px solid #E2E8F0; transition: border-color .2s, box-shadow .2s; }
.top-search:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.top-search input { flex: 1; min-width: 0; background: transparent; outline: none; font-size: .9rem; font-weight: 500; }
.top-search kbd { font-size: .7rem; font-weight: 700; color: #64748B; border: 1px solid #E2E8F0; border-radius: 6px; padding: .1rem .4rem; }
.icon-btn { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 13px; color: #334155; transition: background .2s; }
.icon-btn:hover { background: #EEF2F6; }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }
.avatar { display: grid; place-items: center; flex: none; border-radius: 13px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #22C55E, #84CC16 70%, #FACC15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* View transitions */
.view-enter { animation: fade-up .5s var(--ease) both; }
.view-enter > * { animation: fade-up .55s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .04s; } .view-enter > *:nth-child(3) { animation-delay: .08s; }
.view-enter > *:nth-child(4) { animation-delay: .12s; } .view-enter > *:nth-child(5) { animation-delay: .16s; } .view-enter > *:nth-child(n+6) { animation-delay: .2s; }

/* Page header */
.page-title { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.1; }
.page-sub { margin-top: .35rem; color: #64748B; font-weight: 500; }
.sec-title { font-size: 1.15rem; font-weight: 900; letter-spacing: -.02em; }
.sec-sub { font-size: .82rem; color: #64748B; font-weight: 500; }
.link-more { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 800; color: var(--green-700); }
.link-more:hover { color: var(--green-600); }
.link-more svg { width: 1rem; height: 1rem; transition: transform .2s; }
.link-more:hover svg { transform: translateX(2px); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: .4rem; height: 2.4rem; padding: 0 1rem; border-radius: 99px; border: 1px solid #E2E8F0; background: #fff; font-size: .85rem; font-weight: 700; color: #475569; white-space: nowrap; transition: all .2s var(--ease); }
.pill:hover { border-color: #CBD5E1; color: var(--navy); }
.pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill svg { width: 1rem; height: 1rem; }

/* Quick actions */
.qa { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 8.5rem; padding: 1.15rem; border-radius: 24px; background: #fff; border: 1px solid #E8EDF3; text-align: left; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.qa:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -20px rgba(15,23,42,.25); }
.qa-ic { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 15px; }
.qa-ic svg { width: 1.3rem; height: 1.3rem; }
.qa.is-primary { color: #fff; border: 0; background: radial-gradient(120% 120% at 0% 100%, rgba(250,204,21,.55), transparent 50%), linear-gradient(135deg, #22C55E, #16A34A 50%, #14532D); box-shadow: 0 20px 36px -18px rgba(22,163,74,.9); }
.qa.is-primary .qa-ic { background: rgba(255,255,255,.2); }
.qa.is-primary::after { content: ""; position: absolute; right: -1.5rem; top: -1.5rem; width: 6rem; height: 6rem; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.35); animation: spin 18s linear infinite; }

/* Product card */
.pcard { position: relative; display: flex; flex-direction: column; padding: .9rem; border-radius: 24px; background: #fff; border: 1px solid #E8EDF3; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; cursor: pointer; }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -22px rgba(15,23,42,.28); border-color: #D9E2EC; }
.fav-btn { position: absolute; right: .7rem; top: .7rem; z-index: 2; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: rgba(255,255,255,.9); color: #94A3B8; box-shadow: 0 2px 8px rgba(15,23,42,.08); transition: transform .3s var(--spring), color .2s; }
.fav-btn svg { width: 1.05rem; height: 1.05rem; }
.fav-btn:hover { transform: scale(1.1); color: #E11D48; }
.fav-btn.is-on { color: #E11D48; }
.fav-btn.is-on svg { fill: currentColor; animation: pop .4s var(--spring); }
.add-btn { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 13px; background: var(--navy); color: #fff; transition: transform .25s var(--ease), background .2s; flex: none; }
.add-btn:hover { background: var(--green-600); transform: scale(1.06); }
.add-btn svg { width: 1.1rem; height: 1.1rem; }
.add-btn.is-added { background: var(--green-600); }

/* List rows */
.lrow { display: flex; align-items: center; gap: .85rem; padding: .7rem .75rem; border-radius: 18px; transition: background .2s; }
.lrow:hover { background: #F8FAFC; }
.lrow .lcheck { cursor: pointer; }
.qty { display: inline-flex; align-items: center; height: 2rem; border-radius: 10px; border: 1px solid #E2E8F0; background: #fff; }
.qty button { width: 1.9rem; height: 100%; display: grid; place-items: center; color: #475569; }
.qty button:hover { color: var(--green-700); }
.qty button svg { width: .85rem; height: .85rem; }
.qty span { min-width: 1.4rem; text-align: center; font-size: .82rem; font-weight: 800; }

/* Scanner */
.scanner { position: relative; overflow: hidden; border-radius: 32px; background: radial-gradient(70% 60% at 50% 35%, #22324F, #0B1222 70%); color: #fff; }
.viewfinder { position: relative; margin: 0 auto; width: min(100%, 22rem); aspect-ratio: 3 / 4; }
.shutter { position: relative; display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.4); transition: transform .2s var(--ease); }
.shutter::after { content: ""; width: 3.9rem; height: 3.9rem; border-radius: 50%; background: linear-gradient(145deg, #A3E635, #22C55E 50%, #15803D); box-shadow: 0 10px 24px -6px rgba(34,197,94,.8); }
.shutter:active { transform: scale(.92); }
.shutter svg { position: absolute; z-index: 1; width: 1.6rem; height: 1.6rem; color: #fff; }
.scan-step { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; font-weight: 700; color: rgba(255,255,255,.45); transition: color .3s; }
.scan-step .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); flex: none; }
.scan-step.is-active { color: #fff; }
.scan-step.is-active .dot { border-color: var(--sun); border-top-color: transparent; animation: spin .8s linear infinite; }
.scan-step.is-done { color: #fff; }
.scan-step.is-done .dot { border-color: var(--green-500); background: var(--green-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center/70% no-repeat; animation: pop .35s var(--spring); }
.ocr-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: center; padding: .75rem; border-radius: 16px; border: 1.5px solid #EEF2F6; background: #fff; transition: border-color .2s; }
.ocr-row:focus-within { border-color: #86EFAC; }
.ocr-row.is-flag { border-color: #FDE047; background: #FEFCE8; }
.ocr-in { width: 100%; min-width: 0; background: transparent; outline: none; font-weight: 700; font-size: .9rem; border-radius: 8px; padding: .2rem .35rem; margin-left: -.35rem; }
.ocr-in:focus { background: #F0FDF4; }
.ocr-price { width: 6rem; text-align: right; font-weight: 900; }
.barcode-laser { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #EF4444; box-shadow: 0 0 12px 3px rgba(239,68,68,.7); animation: laser 1.6s ease-in-out infinite; }
@keyframes laser { 0%, 100% { transform: translateY(-40px); } 50% { transform: translateY(40px); } }

/* Seg control */
.seg { display: inline-flex; padding: .3rem; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.seg button { padding: .5rem 1rem; border-radius: 10px; font-size: .85rem; font-weight: 700; color: rgba(255,255,255,.6); transition: all .25s; }
.seg button.is-active { background: #fff; color: var(--navy); }
.seg.light { background: #F1F5F9; border-color: transparent; }
.seg.light button { color: #64748B; }
.seg.light button.is-active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(15,23,42,.08); }

/* Receipt card */
.rcard { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 22px; background: #fff; border: 1px solid #E8EDF3; text-align: left; width: 100%; transition: transform .3s var(--ease), box-shadow .3s; }
.rcard:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -22px rgba(15,23,42,.3); }
.store-badge { display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; border-radius: 15px; font-weight: 900; font-size: .95rem; color: #fff; }

/* Setting rows */
.set-row { display: flex; align-items: center; gap: .9rem; padding: .95rem 1.1rem; }
.set-row + .set-row { border-top: 1px solid #F1F5F9; }
.set-ic { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; flex: none; }
.set-ic svg { width: 1.15rem; height: 1.15rem; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3.5rem 1.5rem; border-radius: 28px; background: #fff; border: 1.5px dashed #D9E2EC; }
.empty-art { position: relative; display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: 30px; background: linear-gradient(145deg, #F0FDF4, #FEFCE8); }
.empty-art svg { width: 2.6rem; height: 2.6rem; color: var(--green-600); }
.empty-art::after { content: ""; position: absolute; inset: -10px; border-radius: 36px; border: 1.5px dashed #BBF7D0; animation: spin 24s linear infinite; }

/* Notification */
.notif { display: flex; gap: .85rem; padding: .9rem 1.25rem; transition: background .2s; }
.notif:hover { background: #F8FAFC; }
.notif.unread { background: #F0FDF4; }

@media (max-width: 1023px) {
  .toast-stack { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}

/* Grid children may shrink below their content width (prevents horizontal overflow on phones) */
#view .grid > * { min-width: 0; }

/* Product cards on small phones: a little tighter so two fit comfortably */
@media (max-width: 379px) {
  .pcard { padding: .7rem; border-radius: 20px; }
  .pcard .fav-btn { right: .55rem; top: .55rem; width: 2rem; height: 2rem; }
}
