/* POS app mock — matches KROWA dashboard visual language */

.pos-window { background: #0E1322; }
.pos-body {
  display: grid;
  grid-template-columns: 232px 1fr 320px;
  min-height: 580px;
  background: #FAFBFC;
  position: relative;
}

/* ───────────────────────── Sidebar ───────────────────────── */

.pos-side {
  background: #0E1322;
  color: #8B91A8;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
}

.pos-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.pos-side-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--blue-600);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  position: relative;
  letter-spacing: -0.04em;
}
.pos-side-mark i {
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #EF4444;
  box-shadow: 0 0 0 1.5px #0E1322;
}
.pos-side-name {
  color: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pos-side-sub {
  color: var(--blue-400);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.pos-side-section {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4D5573;
  padding: 18px 10px 6px;
  font-weight: 600;
}

.pos-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #B8BED4;
  font-weight: 500;
  font-size: 13px;
  cursor: default;
}
.pos-side-item:hover {
  background: rgba(255,255,255,.03);
  color: white;
}
.pos-side-item.is-active {
  background: var(--blue-600);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(32,80,229,.5);
}
.pos-side-ic {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.85;
}
.pos-side-item.is-active .pos-side-ic { opacity: 1; }
.pos-side-label { flex: 1; }
.pos-side-k {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255,255,255,.06);
  color: #6B7390;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.pos-side-item.is-active .pos-side-k {
  background: rgba(255,255,255,.16);
  color: rgba(255,255,255,.85);
}

.pos-side-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.pos-side-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--blue-600);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.pos-side-user-text { min-width: 0; }
.pos-side-uname {
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-side-role { color: #6B7390; font-size: 10.5px; margin-top: 1px; }

/* ───────────────────────── Main ───────────────────────── */

.pos-main {
  background: #FAFBFC;
  padding: 22px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pos-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.pos-header-crumb {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 2px;
}
.pos-header-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.pos-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pos-search {
  display: flex; align-items: center; gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12.5px;
  height: 38px;
  min-width: 240px;
}
.pos-search svg { color: var(--muted-2); }
.pos-search .kw-kbd { margin-left: auto; }
.pos-time {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pos-time-dot {
  width: 6px; height: 6px;
  background: #EF4444;
  border-radius: 999px;
  display: inline-block;
}

.pos-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pos-cat {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
  cursor: pointer;
  font-family: inherit;
}
.pos-cat:hover { border-color: var(--ink-3); color: var(--ink); }
.pos-cat.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* Product grid */

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
  align-content: start;
}
.pos-product {
  background: white;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
  min-width: 0;
}
.pos-product:disabled { cursor: default; }
.pos-product:not(:disabled):hover {
  border-color: var(--blue-400);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -14px rgba(32,80,229,.4);
}
.pos-product.is-flashing {
  animation: kwFlash .55s ease;
  border-color: #16A34A;
}
@keyframes kwFlash {
  0% { background: white; }
  30% { background: #DCFCE7; }
  100% { background: white; }
}
.pos-product-img {
  height: 62px;
  background: linear-gradient(135deg, #F2F4F8, #E7EBF2);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  position: relative;
  overflow: hidden;
}
.pos-product-emoji {
  font-size: 26px;
  filter: saturate(.9);
}
.pos-product-badge {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 9.5px;
  background: #FEF3C7;
  color: #B45309;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.pos-product-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.pos-product-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.pos-product-price {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.pos-product-stock { color: var(--muted); }
.pos-product-plus {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--blue-600);
  color: white;
  font-size: 16px;
  font-weight: 500;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.pos-product:not(:disabled):hover .pos-product-plus {
  opacity: 1;
  transform: translateY(0);
}

/* ───────────────────────── Cart ───────────────────────── */

.pos-cart {
  background: white;
  border-left: 1px solid var(--line);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.pos-cart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
}
.pos-cart-title { font-weight: 600; font-size: 15px; }
.pos-cart-time { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pos-cart-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.pos-cart-clear:hover { color: #EF4444; background: #FEF2F2; }

.pos-cart-items {
  display: flex; flex-direction: column; gap: 0;
  flex: 1;
  min-height: 130px;
  overflow: auto;
  scrollbar-width: thin;
  margin: 0 -8px;
  padding: 0 8px;
}
.pos-cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}
.pos-cart-row-main { min-width: 0; }
.pos-cart-name {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-cart-line {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.pos-cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 999px;
  height: 26px;
  padding: 2px;
}
.pos-cart-qty-ctrl button {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: none;
  background: white;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.pos-cart-qty-ctrl button:hover { background: var(--blue-600); color: white; }
.pos-cart-qty-ctrl span {
  min-width: 22px; text-align: center;
  font-size: 12px; font-weight: 600;
  font-family: var(--font-mono);
}
.pos-cart-qty-static {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--blue-600);
  font-size: 12px;
  width: 28px;
  text-align: center;
}

.pos-cart-sum {
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pos-cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  flex: 1;
}
.pos-cart-empty-icon {
  font-size: 28px;
  opacity: .5;
  margin-bottom: 4px;
}
.pos-cart-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}
.pos-cart-empty small { font-size: 11.5px; }

/* Totals */
.pos-cart-totals {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.pos-cart-trow {
  display: flex; justify-content: space-between;
  font-size: 12.5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.pos-cart-trow.muted { color: var(--muted); }
.pos-cart-trow.total {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--ink);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-2);
}

.pos-pay-btn {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  background: var(--blue-600);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 18px -8px rgba(32,80,229,.7);
  position: relative;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.pos-pay-btn:not(.is-disabled):hover { background: var(--blue-700); transform: translateY(-1px); }
.pos-pay-btn.is-disabled {
  background: var(--surface-3);
  color: var(--muted-2);
  cursor: not-allowed;
  box-shadow: none;
}
.pos-pay-kbd {
  position: absolute; right: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255,255,255,.18);
  padding: 3px 7px;
  border-radius: 4px;
}
.pos-pay-btn.is-disabled .pos-pay-kbd { background: rgba(0,0,0,.04); color: var(--muted-2); }

.pos-cart-methods {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.pos-pay-method {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: default;
}
.pos-pay-method.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.pos-cart-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
}
.pos-status-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--muted-2);
  position: relative;
}
.pos-status-dot.is-on { background: #16A34A; }
.pos-status-dot.is-on::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: #16A34A;
  opacity: 0.25;
  animation: kwPulse 1.6s ease-out infinite;
}
@keyframes kwPulse {
  from { transform: scale(0.5); opacity: 0.4; }
  to { transform: scale(1.4); opacity: 0; }
}

/* ───────────────────────── Success overlay ───────────────────────── */

.pos-success {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 5;
  animation: kwFadeIn .2s ease;
}
@keyframes kwFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pos-success-card {
  background: white;
  border-radius: 18px;
  padding: 28px 32px;
  text-align: center;
  min-width: 280px;
  box-shadow: 0 30px 60px -20px rgba(11,14,26,.4);
  animation: kwSuccessPop .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes kwSuccessPop {
  from { opacity: 0; transform: scale(.86) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.pos-success-check {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: #16A34A;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 20px -6px rgba(22,163,74,.5);
  animation: kwCheckBounce .5s .1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes kwCheckBounce {
  from { transform: scale(.5); }
  to { transform: scale(1); }
}
.pos-success-h {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.pos-success-amount {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 14px;
  font-family: var(--font-sans);
}
.pos-success-cae {
  display: flex; gap: 6px; align-items: baseline; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.pos-success-cae strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
}
.pos-success-tag {
  display: inline-block;
  font-size: 11px;
  background: var(--blue-50);
  color: var(--blue-700);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 900px) {
  .pos-body { grid-template-columns: 64px 1fr 280px; }
  .pos-side-label, .pos-side-section, .pos-side-brand-text, .pos-side-user-text, .pos-side-k {
    display: none;
  }
  .pos-side-brand { justify-content: center; padding: 4px 0 18px; }
  .pos-side-user { justify-content: center; padding: 12px 0 0; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .pos-body { grid-template-columns: 1fr; }
  .pos-side { display: none; }
  .pos-cart { border-left: none; border-top: 1px solid var(--line); }
}
