:root {
  --ink: #151821;
  --muted: #777d8c;
  --line: #e8e9ed;
  --soft: #f5f6f8;
  --orange: #ff6b35;
  --orange-dark: #e95622;
  --green: #16a36a;
  --sidebar: #11141b;
  --white: #fff;
  --shadow: 0 12px 34px rgba(20, 24, 35, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef0f3; font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 20px; color: #a5a9b4; background: var(--sidebar); display: flex; flex-direction: column; z-index: 5; }
.brand { padding: 0 10px 33px; color: white; text-decoration: none; display: flex; align-items: center; gap: 11px; font: 800 20px Manrope, sans-serif; letter-spacing: -.7px; }
.brand > span:last-child span { color: var(--orange); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); }
.brand-mark svg { width: 21px; fill: white; stroke: none; }
.main-nav { display: grid; gap: 7px; }
.nav-item { position: relative; width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 10px; color: inherit; background: transparent; display: flex; gap: 14px; align-items: center; font-weight: 600; }
.nav-item svg { width: 20px; }
.nav-item:hover { color: #fff; background: #1b1f28; }
.nav-item.active { color: white; background: #272a32; }
.nav-item.active::before { content: ""; position: absolute; left: -18px; width: 4px; height: 25px; border-radius: 0 4px 4px 0; background: var(--orange); }
.sidebar-bottom { margin-top: auto; }
.cashier { margin-top: 18px; padding: 17px 4px 0; border-top: 1px solid #292c35; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.cashier .avatar { position: relative; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; background: #3b4050; font-size: 12px; font-weight: 700; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #29c77d; border: 2px solid var(--sidebar); }
.cashier strong, .cashier small { display: block; white-space: nowrap; }
.cashier strong { color: #f7f7f8; font-size: 12px; }
.cashier small { margin-top: 2px; color: #747985; font-size: 10px; }
.cashier button { border: 0; color: #767b87; background: transparent; }

.workspace { min-width: 0; background: #f7f7f8; }
.topbar { height: 102px; padding: 21px 30px 18px 34px; border-bottom: 1px solid var(--line); background: white; display: flex; justify-content: space-between; align-items: center; }
.eyebrow { margin: 0 0 4px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 800 26px Manrope, sans-serif; letter-spacing: -.8px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.status-pill { height: 36px; padding: 0 13px; border-radius: 8px; color: #168458; background: #eaf8f2; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: #20af73; box-shadow: 0 0 0 3px #ccecdf; }
.icon-button { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; color: #6b7180; background: white; display: grid; place-items: center; }
.icon-button svg { width: 18px; }
.notification > span { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); border: 1px solid white; }

.selling-area { height: calc(100vh - 102px); display: grid; grid-template-columns: minmax(530px, 1fr) 390px; overflow: hidden; }
.catalog { min-width: 0; padding: 26px 30px 32px 34px; overflow-y: auto; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-box { height: 48px; padding: 0 13px; border: 1px solid #dedfe4; border-radius: 11px; color: #858b98; background: white; display: flex; align-items: center; gap: 11px; box-shadow: 0 2px 6px rgba(20,20,30,.02); }
.search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,.12); }
.search-box svg { width: 19px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); font-size: 13px; }
kbd { padding: 3px 6px; border: 1px solid #dddfe4; border-radius: 5px; color: #999eaa; background: #f5f6f8; font: 600 10px "DM Sans"; box-shadow: 0 1px 0 #ddd; }
.scan-button { height: 48px; padding: 0 17px; border: 1px solid #dedfe4; border-radius: 11px; color: #3d4350; background: white; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.scan-button:hover { border-color: #c8cbd1; background: #fafafa; }
.categories { margin: 22px 0 25px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.category { padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; color: #6e7481; background: white; white-space: nowrap; font-size: 11px; font-weight: 700; }
.category span { margin-left: 5px; color: #a7acb5; }
.category.active { color: white; border-color: var(--ink); background: var(--ink); }
.category.active span { color: #b9bcc4; }
.section-heading, .section-heading > div { display: flex; justify-content: space-between; align-items: center; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 { margin: 0; font: 800 16px Manrope; }
.section-heading > div span { margin-left: 9px; color: #a1a5af; font-size: 11px; }
.sort-button { border: 0; color: #6c7280; background: transparent; font-size: 11px; font-weight: 600; }
.sort-button svg { width: 14px; vertical-align: middle; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 13px; }
.product-card { position: relative; padding: 0; overflow: hidden; border: 1px solid #e8e9ed; border-radius: 13px; text-align: left; background: white; transition: .2s ease; box-shadow: 0 3px 10px rgba(20,24,35,.025); }
.product-card:hover { transform: translateY(-3px); border-color: #ffb79e; box-shadow: var(--shadow); }
.product-card:active { transform: translateY(-1px) scale(.99); }
.product-visual { position: relative; height: 118px; display: grid; place-items: center; background: var(--product-bg); overflow: hidden; }
.product-visual::after { content: ""; width: 87px; height: 87px; border-radius: 50%; background: rgba(255,255,255,.48); position: absolute; }
.product-icon { z-index: 1; font-size: 53px; filter: drop-shadow(0 7px 6px rgba(30,30,40,.14)); transform: rotate(-4deg); }
.stock-tag { position: absolute; top: 9px; left: 9px; z-index: 2; padding: 4px 7px; border-radius: 5px; color: #177a55; background: rgba(235,250,244,.92); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.stock-tag.low { color: #bf6a19; background: #fff3df; }
.product-info { padding: 12px 12px 13px; }
.product-category { color: #9b9fab; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.product-info h3 { min-height: 32px; margin: 4px 0 7px; font-size: 12px; line-height: 1.35; }
.product-info strong { color: var(--orange); font: 800 14px Manrope; }
.product-info strong small { color: #9ca1ab; font: 500 9px "DM Sans"; }
.empty-state { padding: 60px 0; text-align: center; color: var(--muted); display: none; }
.empty-state span { font-size: 42px; }.empty-state h3 { margin: 10px 0 5px; }.empty-state p { font-size: 13px; }

.cart-panel { min-width: 0; padding: 24px 24px 17px; border-left: 1px solid var(--line); background: white; display: flex; flex-direction: column; overflow: hidden; box-shadow: -8px 0 30px rgba(25,28,40,.025); }
.cart-header { display: flex; align-items: center; justify-content: space-between; }
.cart-header > div { display: flex; align-items: center; gap: 10px; }
.cart-header h2 { margin: 0; font: 800 17px Manrope; }
.order-number { padding: 4px 7px; border-radius: 5px; color: #8e939f; background: var(--soft); font-size: 9px; font-weight: 700; }
.clear-button { border: 0; color: #b0b3bb; background: transparent; font-size: 11px; font-weight: 600; }
.clear-button:hover { color: #dc4a40; }
.customer-selector { width: 100%; margin: 18px 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: #767c89; background: #fafafb; display: grid; grid-template-columns: 36px 1fr 18px; align-items: center; text-align: left; }
.customer-icon { width: 34px; height: 34px; border-radius: 9px; color: #747a87; background: #eff0f2; display: grid; place-items: center; }
.customer-icon svg { width: 17px; }
.customer-selector small, .customer-selector strong { display: block; }
.customer-selector small { color: #a4a8b1; font-size: 9px; }
.customer-selector strong { margin-top: 2px; color: #363b46; font-size: 11px; }
.customer-selector > svg { width: 14px; }
.cart-items { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.cart-item { padding: 12px 0; border-bottom: 1px solid #f0f0f2; display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; animation: itemIn .22s ease; }
@keyframes itemIn { from { opacity: 0; transform: translateX(10px); } }
.cart-thumb { width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; background: var(--product-bg); font-size: 25px; }
.item-data { min-width: 0; }
.item-data h3 { overflow: hidden; margin: 0 0 5px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.item-data > span { color: #8e939e; font-size: 9px; }
.quantity { margin-top: 7px; display: flex; align-items: center; gap: 8px; }
.quantity button { width: 21px; height: 21px; padding: 0; border: 1px solid #e1e3e7; border-radius: 5px; color: #777d89; background: white; font-size: 13px; }
.quantity span { min-width: 12px; text-align: center; font-size: 10px; font-weight: 700; }
.item-price { align-self: start; padding-top: 3px; text-align: right; }
.item-price strong { display: block; font: 800 11px Manrope; }
.remove-item { margin-top: 10px; padding: 0; border: 0; color: #bbbfc6; background: transparent; font-size: 9px; }
.remove-item:hover { color: #d94c43; }
.cart-empty { flex: 1; display: grid; place-content: center; text-align: center; color: #aaadb5; }
.cart-empty div { font-size: 34px; filter: grayscale(1); opacity: .55; }
.cart-empty h3 { margin: 10px 0 4px; color: #676d78; font-size: 13px; }
.cart-empty p { font-size: 10px; }
.summary { padding-top: 14px; border-top: 1px solid var(--line); }
.summary > div:not(.total-row):not(.quick-actions) { margin-bottom: 9px; color: #858a96; display: flex; align-items: center; font-size: 10px; }
.summary > div > strong { margin-left: auto; color: #474c57; }
.summary > div > button { margin-left: 7px; padding: 0; border: 0; color: var(--orange); background: transparent; font-size: 9px; font-weight: 700; }
.total-row { margin-top: 13px; padding-top: 13px; border-top: 1px dashed #dfe1e5; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.total-row strong { font: 800 22px Manrope; }
.total-row strong small { color: #8e939e; font: 600 9px "DM Sans"; }
.pay-button { width: 100%; height: 50px; margin-top: 15px; padding: 0 17px; border: 0; border-radius: 10px; color: white; background: var(--orange); display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; box-shadow: 0 8px 18px rgba(255,107,53,.22); }
.pay-button:hover { background: var(--orange-dark); }
.pay-button:disabled { cursor: not-allowed; color: #a3a7af; background: #e8e9ec; box-shadow: none; }
.pay-button svg { width: 15px; vertical-align: middle; }
.quick-actions { margin-top: 12px; display: flex; justify-content: center; gap: 15px; }
.quick-actions button { border: 0; color: #9a9ea8; background: transparent; font-size: 8px; }
.quick-actions kbd { margin-right: 3px; font-size: 7px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; padding: 20px; visibility: hidden; opacity: 0; background: rgba(11,13,18,.68); backdrop-filter: blur(5px); display: grid; place-items: center; transition: .2s; }
.modal-backdrop.open { visibility: visible; opacity: 1; }
.modal { position: relative; width: min(390px, 100%); padding: 33px; border-radius: 20px; text-align: center; background: white; transform: scale(.96); transition: .2s; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.open .modal { transform: scale(1); }
.modal-close { position: absolute; right: 15px; top: 12px; border: 0; color: #9ea2ab; background: transparent; font-size: 23px; }
.success-icon { width: 65px; height: 65px; margin: 0 auto 18px; border-radius: 50%; color: var(--green); background: #e9f8f2; display: grid; place-items: center; }
.success-icon svg { width: 30px; stroke-width: 2.5; }
.modal h2 { margin-bottom: 8px; font: 800 24px Manrope; }
.modal > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.6; }
.receipt-total { margin: 23px 0 7px; padding: 17px; border-radius: 11px; background: var(--soft); display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.receipt-total strong { font: 800 17px Manrope; }
.modal .pay-button { justify-content: center; }
.print-button { margin-top: 13px; border: 0; color: #757b87; background: transparent; font-size: 11px; font-weight: 700; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 30; padding: 12px 17px; border-radius: 10px; color: white; background: #22262f; display: flex; align-items: center; gap: 9px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast span { width: 20px; height: 20px; border-radius: 50%; color: #1f6; background: rgba(70,255,150,.1); display: grid; place-items: center; }
.toast p { margin: 0; font-size: 11px; font-weight: 600; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding-inline: 12px; }
  .brand { padding-inline: 8px; }
  .brand > span:last-child, .nav-item span, .cashier > div:not(.avatar), .cashier > button { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -12px; }
  .cashier { display: flex; justify-content: center; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 850px) {
  .selling-area { height: auto; grid-template-columns: 1fr; overflow: visible; }
  .catalog { overflow: visible; }
  .cart-panel { min-height: 520px; border-left: 0; border-top: 1px solid var(--line); }
  .workspace { overflow: hidden; }
}
@media (max-width: 600px) {
  .app-shell { display: block; padding-bottom: 65px; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 65px; padding: 7px 12px; flex-direction: row; }
  .brand, .sidebar-bottom { display: none; }
  .main-nav { width: 100%; display: flex; justify-content: space-around; }
  .nav-item { width: 60px; height: 50px; flex-direction: column; gap: 2px; font-size: 9px; }
  .nav-item span { display: block; }
  .nav-item.active::before { inset: auto auto -7px; width: 25px; height: 3px; border-radius: 4px 4px 0 0; }
  .topbar { height: 82px; padding: 15px 18px; }
  .topbar h1 { font-size: 21px; }
  .status-pill, #fullscreenBtn { display: none; }
  .selling-area { display: block; }
  .catalog, .cart-panel { padding: 20px 17px; }
  .search-row { grid-template-columns: 1fr 48px; }
  .scan-button { padding: 0; justify-content: center; }
  .scan-button { font-size: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-visual { height: 110px; }
}
@media print {
  .app-shell, .modal-close, .modal .pay-button, .print-button { display: none !important; }
  .modal-backdrop { position: static; visibility: visible; opacity: 1; background: white; }
  .modal { box-shadow: none; }
}
