html, body {
  height: 100%;
  margin: 0;
  overflow-y: auto;
}


body::-webkit-scrollbar,
html::-webkit-scrollbar {
  display: none;
}
/* 🔥 PAKSA SEMUA ELEMENT TIDAK BOLEH MELEBAR */
* {
  box-sizing: border-box;
  max-width: 100%;
}
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.list-view {
  display: grid;
  grid-template-columns: 1fr;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f5f5;
  color: #333;
   font-size: 12px;
  line-height: 1.6;
  margin:0;
  padding:0;
}

.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: stretch; /* 🔥 penting */
}

      .app-wrapper {
            width: 100%;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }


/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;

  width: 280px;
  height: 100vh;

  background: linear-gradient(180deg,#1e3a8a 0%,#1e40af 100%);
  color: #fff;

  display: flex;
  flex-direction: column;
  
  overflow: hidden; /* ⭐ tidak ikut scroll */
  z-index: 1000;
}
/* COLLAPSE */
.sidebar.closed{
  width:80px;
}



/* HEADER */
.sidebar-header{
  padding:20px;
  border-bottom:1px solid rgba(255,255,255,.1);
}

/* LOGO */
.logo{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo-icon{
  width:40px;
  height:40px;

  background:rgba(255,255,255,.2);

  border-radius:8px;

  padding:8px;

  flex-shrink:0;
}

.logo-text .company-name,
.logo-text .company-subtitle{
  font-size:14px;
  font-weight:700;
}

/* MENU */
.nav-menu{
  flex:1;

  list-style:none;

  padding:20px 0;
}

.nav-item{
  margin-bottom:4px;
}

.nav-link{
  display:flex;
  align-items:center;

  gap:12px;

  padding:12px 20px;

  color:rgba(255,255,255,.8);

  text-decoration:none;

  font-size:14px;

  transition:.2s ease;
}

.nav-link:hover{
  background:rgba(255,255,255,.1);
  color:#fff;
}

.nav-item.active .nav-link{
  background:rgba(255,255,255,.15);
  color:#fff;

  border-right:3px solid #60a5fa;
}

.nav-icon{
  width:20px;
  height:20px;

  flex-shrink:0;
}

/* FOOTER */
.sidebar-footer {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.tenant-footer {
    margin-top: auto;
    padding: 10px 12px;
}

.tenant-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

.tenant-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tenant-name {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.tenant-sub {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    gap: 6px;
    align-items: center;
}

.tenant-version {
    margin-top: 4px;
    font-size: 10px;
    color: #94a3b8;
}


.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* OVERLAY */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 2000;
}

/* BOTTOM SHEET */
.user-sheet {
    position: fixed;
    bottom: -400px;
    left: 0;
    right: 0;
    background: #111827;
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    transition: 0.3s ease;
    z-index: 2001;
    text-align: center;
}

/* ACTIVE */
.user-sheet.active {
    bottom: 0;
}

/* overlay active */
.sheet-overlay.active {
    display: block;
}

/* HANDLE */
.sheet-handle {
    width: 50px;
    height: 5px;
    background: #374151;
    border-radius: 10px;
    margin: 0 auto 10px;
}

/* AVATAR */
.sheet-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 10px auto;
}

/* BUTTON */
.sheet-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    background: #1f2937;
    color: white;
    cursor: pointer;
}

.sheet-btn.danger {
    background: #dc2626;
}

.footer-text {
    margin-bottom: 2px;
    line-height: 1.3;
}

.footer-version {
    margin-top: 6px;
    font-size: 10px;
    color: #6b7280;
}

.pos-footer-simple {
    margin-top: 30px;
    padding: 12px 0;

    text-align: center;

    font-size: 12px;
    background: linear-gradient(180deg,#1e3a8a 0%,#1e40af 100%);
  color: #fff;
}

/* COLLAPSE */
.sidebar.closed{
  width:80px;
}

/* HIDE TEXT */
.sidebar.closed .logo-text,
.sidebar.closed .company-info,
.sidebar.closed .nav-link span{
  display:none;
}

.sidebar.closed .nav-link{
  justify-content:center;
}

.sidebar.closed .logo{
  justify-content:center;
}


* {
  box-sizing: border-box;
}

.table-view {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

/* 🔥 GRID UTAMA */
.table-header,
.product-row {
  width: 100%;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px 120px;
  align-items: center;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* HEADER */
.table-header {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
/* ROW */
.product-row {
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: 0.2s ease;
  background: #fff;
}

.product-row:hover {
  background: #f8fafc;
}

/* 🔥 FIX ALIGN TEKS (INI PENTING) */
.col-name,
.col-code,
.col-price,
.col-stock {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-price,
.col-stock {
  text-align: right;
  justify-self: end;
}

.col-code {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.col-code .sku {
  font-weight: 600;
  color: #111827;
}

.col-code .barcode {
  font-size: 10px;
  color: #6b7280;
}
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  width: fit-content;
  max-width: 100%;

  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;

  color: #fff;
  background: #3b82f6;

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

  transition: all 0.2s ease;
  white-space: nowrap;
}

.price-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* TOGGLE */
.menu-toggle{
  width:42px;
  height:42px;

  border:none;
  border-radius:10px;

  background:#f3f4f6;

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
}

/* scan button beda sendiri */
.scan-btn {
  background: linear-gradient(135deg, #2f0bfd, #120ef5);
  color: #fff;
  border: none;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
}

/* hover lebih hidup */
.scan-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.35);
}

/* active click effect */
.scan-btn:active {
  transform: scale(0.95);
  box-shadow: 0 5px 12px rgba(16, 185, 129, 0.2);
}

/* glow pulse biar kelihatan “scan ready” */
.scan-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.4);
  z-index: -1;
  opacity: 0;
  transition: 0.3s;
}

.scan-btn:hover::after {
  opacity: 1;
}
.scan-btn i {
  font-size: 16px;
}
.menu-toggle svg{
  width:22px;
  height:22px;
}

.company-info {
  font-size: 12px;
  opacity: 0.8;
}

.company-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.company-subtitle {
  font-weight: 600;
  margin-bottom: 8px;
}

.company-address div {
  margin-bottom: 2px;
}

/* Main Content */
.main-content {
  flex: 1;
   margin-left: 280px;
  transition: .3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 🔥 biar sama tinggi */
}

.sidebar.closed ~ .main-content {
  margin-left: 80px;
}
/* Header */
.header{
  position: sticky;
  top: 0;
  left: 0;

  z-index: 100;

  background: #fff;

  padding: 16px 24px;

  border-bottom: 1px solid #e5e7eb;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin: 0;
}

.header-left {
   position:sticky;
  display: flex;
  align-items: center;
  gap: 16px;
}


.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    position: relative;
    padding-left: 14px;
    letter-spacing: 0.3px;
}

.page-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background: linear-gradient(180deg, #4f46e5, #06b6d4);
    border-radius: 4px;
}

.header-center {
  flex: 1;
  max-width: 400px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
  position: absolute;
  right: 8px;
  background: #6b7280;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.notification-icon {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.notification-text {
  font-size: 14px;
  color: #6b7280;
}

.user-menu {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  gap: 5px;
  background: #f3f4f6;
  border-radius: 8px;

  cursor: pointer;
  max-width: 180px;    /* 🔥 biar tidak melebar */
}

.user-icon {
  width: 28px;
  height: 28px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: #6b7280;
}
.dropdown-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

/* Content Area */
.content-area {
 flex: 1;
 display: grid;
 grid-template-columns: minmax(0, 1fr) 480px;
 gap: 20px;
 padding: 20px;
}
/* Product Section */
.product-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


.section-header{
  background:#fff;
  border-radius:20px;
  padding:18px;
  box-shadow:0 4px 18px rgba(0,0,0,.05);
  margin-bottom:20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

/* ================= TOP ================= */

.top-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  flex-wrap:wrap;
}

.toolbar-left{
  display:flex;
  flex-direction:column;
}

.section-title{
  margin:0;
  font-size:22px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:10px;
}

.section-subtitle{
  color:#888;
  font-size:14px;
  margin-top:4px;
}

/* ================= RIGHT ================= */

.toolbar-right{
  display:flex;
  align-items:center;
  gap:12px;
}

/* ================= SCAN BUTTON ================= */

.scan-btn{
  border:none;
  background:#111827;
  color:#fff;
  padding:12px 18px;
  border-radius:14px;
  font-size:15px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:.2s;
}

.scan-btn:hover{
  transform:translateY(-2px);
}


/* ================= SEARCH ================= */

.search-container{
  position:relative;
  margin-top:18px;
}

.search-input{
  width:100%;
  height:52px;
  border:none;
  background:#f3f4f6;
  border-radius:16px;
  padding:0 18px 0 50px;
  font-size:15px;
  outline:none;
}

.search-icon{
  position:absolute;
  left:18px;
  top:50%;
  transform:translateY(-50%);
  color:#999;
}

/* ================= VIEW ================= */

.view-toggle{
  display:flex;
  background:#f3f4f6;
  padding:4px;
  border-radius:14px;
}

.view-btn{
  border:none;
  width:42px;
  height:42px;
  border-radius:10px;
  background:transparent;
  cursor:pointer;
  font-size:16px;
}

.view-btn.active{
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}

/* ================= SCANNER ================= */

.scanner-wrapper{
  position:relative;
  margin-top:18px;
  border-radius:20px;
  overflow:hidden;
  background:#000;
  display:none;
}

.close-scanner{

  position:absolute;

  top:10px;
  right:10px;

  width:34px;
  height:34px;

  border:none;

  border-radius:50%;

  background:rgba(0,0,0,.7);

  color:#fff;

  font-size:18px;

  cursor:pointer;

  z-index:99999;

}

#video{
  width:100%;
  height:260px;
  object-fit:cover;
   image-rendering:auto;

  filter:
    contrast(1.1)
    brightness(1.05);
}

.scanner-overlay{
  position:absolute;
  inset:0;
  display:flex;
  justify-content:center;
  align-items:center;
  flex-direction:column;
}

.scanner-line{
  width:80%;
  height:2px;
  background:#22c55e;
  box-shadow:0 0 15px #22c55e;
  animation:scanLine 2s linear infinite;
}

.scanner-text{
  position:absolute;
  bottom:18px;
  color:#fff;
  font-size:14px;
  background:rgba(0,0,0,.5);
  padding:6px 12px;
  border-radius:999px;
}

/* ================= ANIMATION ================= */

@keyframes scanLine{

  0%{
    transform:translateY(-80px);
  }

  50%{
    transform:translateY(80px);
  }

  100%{
    transform:translateY(-80px);
  }

}

.view-btn {
  padding: 8px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: #f3f4f6;
}

.view-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

.category-tabs {
  display: flex;
  gap: 8px;

  overflow-x: auto;
  overflow-y: hidden;

  flex-wrap: nowrap;

  width: 100%;

  padding-bottom: 4px;

  -webkit-overflow-scrolling: touch;
}

.category-tab {
  flex: 0 0 auto;
}

.category-tab {
  padding: 8px 16px;
  background: #f3f4f6;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab:hover {
  background: #e5e7eb;
}

.category-tab.active {
  background: #3b82f6;
  color: white;
}


.products-grid {
  display: grid;
  overflow-y: auto;
  height: calc(100vh - 180px);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* 🔥 HIDE SCROLLBAR (Chrome, Edge, Safari) */
.products-grid::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

/* 🔥 HIDE SCROLLBAR (Firefox) */
.products-grid {
  scrollbar-width: none;
}

/* 🔥 HIDE SCROLLBAR (IE/Edge lama) */
.products-grid {
  -ms-overflow-style: none;
}
.product-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.product-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.4;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 8px;
}

.product-stock {
  font-size: 12px;
  color: #6b7280;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;

  width: 100%;
  padding: 6px 0;
  margin-top: 10px;
}

/* BUTTON SUPER SMALL */
.page-btn {
  padding: 4px 8px;
  font-size: 11px;

  border: 1px solid #d1d5db;
  border-radius: 5px;

  background: #fff;
  cursor: pointer;

  line-height: 1;
  transition: 0.15s ease;
}

/* hover */
.page-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

/* active */
.page-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 600;
}

/* disabled */
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* teks halaman (1 / 10) */
.page-btn.active {
  padding: 4px 10px;
  font-size: 11px;
}


/* Cart Section */
.cart-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: fit-content;
}
.discount-input {
  width: 90px;
  min-width: 90px;
  max-width: 90px;

  flex-shrink: 0;

  padding: 6px 10px;

  font-size: 13px;
  font-weight: 600;

  text-align: right;

  border: 1px solid #e5e7eb;
  border-radius: 8px;

  background: #f9fafb;

  outline: none;

  transition: all 0.2s ease;
}

.discount-input:focus {
  outline: none;
  border-color: #16a34a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.discount-input:focus {
  outline: none;
  border-color: #16a34a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.discount-input::-webkit-outer-spin-button,
.discount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cart-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.clear-cart-btn {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-cart-btn:hover {
  background: #fee2e2;
}

.cart-table-container {
  margin-bottom: 20px;
  overflow-x: auto;
}

.cart-table {
  width: 100%;
  table-layout: fixed;
}
.cart-table td:first-child {
  width: 220px; /* bisa kamu kecilkan/lebarkan */
}
.cart-table th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 500;
  color: #6b7280;
  font-size: 12px;
}

.cart-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 8px;

  min-width: 0; /* 🔥 ini KUNCI biar tidak turun */
}

.cart-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 12px;
  color: #111827;

  white-space: normal;   /* 🔥 boleh turun baris */
  word-break: break-word;

  line-height: 1.3;
}

.cart-item-size {
  font-size: 11px;
  color: #6b7280;
}

.cart-item-price {

  font-size: 12px;
  font-weight: 500;
  color: #1f2937;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn{
  width:28px;
  height:28px;

  border:none;
  border-radius:8px;

  background:#f3f4f6;

  font-size:16px;
  font-weight:700;

  cursor:pointer;
}

.qty-input{
  width:34px;
  text-align:center;

  border:1px solid #e5e7eb;
  border-radius:6px;

  font-size:13px;
}

.qty-btn:hover {
  background: #e5e7eb;
}

.mobile-item-subtotal {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 6px 12px;

  font-size: 13px;
  font-weight: 700;
  color: #fff;


  
  background: #2563eb;

  border: 1px solid #e5e7eb;
  border-radius: 999px;

  align-self: center;
  white-space: nowrap;

  box-shadow: 0 2px 6px rgba(0,0,0,0.06);

  transition: all 0.2s ease;
}

.cart-item-subtotal {
  text-align: right;
font-size: 12px;
  font-weight: 500;
 color:#2563eb;

  white-space: nowrap; /* 🔥 tidak turun baris */
  font-variant-numeric: tabular-nums; /* 🔥 angka sejajar rapi */
}

.remove-item-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.remove-item-btn:hover {
  background: #fef2f2;
}

.remove-item-btn svg {
  width: 16px;
  height: 16px;
}



/* ======================================
MODAL
====================================== */

.checkout-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);

  display:none;
  align-items:center;
  justify-content:center;

  z-index:9999;
}

.checkout-modal.active{
  display:flex;
}

/* ======================================
CONTENT
====================================== */

.checkout-modal-content{
  width:100%;
  max-width:500px;

  background:#fff;
  border-radius:24px;

  overflow:hidden;

  box-shadow:0 20px 40px rgba(0,0,0,.2);

  animation:modalShow .2s ease;
}

@keyframes modalShow{
  from{
    transform:translateY(10px);
    opacity:0;
  }
  to{
    transform:translateY(0);
    opacity:1;
  }
}

/* ======================================
HEADER
====================================== */

.checkout-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:18px 22px;

  border-bottom:1px solid #f1f5f9;
}

.checkout-modal-header h2{
  font-size:20px;
  margin:0;

  display:flex;
  align-items:center;
  gap:10px;
}

.close-modal-btn{
  width:38px;
  height:38px;

  border:none;
  background:#f3f4f6;

  border-radius:10px;
  cursor:pointer;
}

/* ======================================
BODY
====================================== */

.checkout-modal-body{
  padding:22px;
}

/* ======================================
INFO
====================================== */

.checkout-info{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.info-row{
  display:flex;
  justify-content:space-between;

  font-size:14px;
}

/* ======================================
TOTAL
====================================== */

.checkout-total-box{
  margin-top:22px;

  background:#f8fafc;
  border-radius:18px;

  padding:20px;
  text-align:center;
}

.checkout-total-label{
  font-size:14px;
  color:#6b7280;
}

.checkout-total-amount{
  font-size:34px;
  font-weight:700;

  margin-top:8px;

  color:#111827;
}

/* ======================================
PAY INPUT
====================================== */

.pay-input-group{
  margin-top:20px;
}

.pay-input-group label{
  display:block;
  margin-bottom:8px;

  font-size:14px;
  font-weight:600;
}

.pay-input-group input{
  width:100%;
  height:52px;

  border:1px solid #d1d5db;
  border-radius:14px;

  padding:0 16px;

  font-size:18px;
  font-weight:600;
}

/* ======================================
CHANGE
====================================== */

.checkout-change-box{
  margin-top:20px;

  display:flex;
  justify-content:space-between;
  align-items:center;

  background:#ecfdf5;

  padding:18px;

  border-radius:16px;

  color:#065f46;
}

.checkout-change-box strong{
  font-size:24px;
}

/* ======================================
BUTTON
====================================== */

.confirm-checkout-btn{
  width:100%;
  height:54px;

  margin-top:24px;

  border:none;
  border-radius:16px;

  background:#2563eb;
  color:#fff;

  font-size:16px;
  font-weight:600;

  cursor:pointer;
}


/* =========================
   CUSTOMER
========================= */

.customer-box{
  margin-top:16px;
}

.customer-box label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:600;
  color:#374151;
}

.customer-select-wrapper{
  position:relative;
}

.customer-select-wrapper i{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#6b7280;
  font-size:14px;
}

.customer-select{
  width:100%;
  height:46px;

  border:1px solid #d1d5db;
  border-radius:12px;

  padding:0 14px 0 42px;

  background:#fff;

  font-size:14px;
  color:#111827;

  outline:none;
  transition:.2s;
}

.customer-select:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 3px rgba(59,130,246,.1);
}

.payment-box{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.payment-box label{
  font-size:13px;
  font-weight:600;
  color:#374151;
}

/* GRID BUTTON */
.payment-options{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:10px;
}

/* BUTTON BASE */
.pay-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 12px;

  border-radius:12px;
  border:1px solid #e5e7eb;

  background:#f9fafb;

  font-size:13px;
  font-weight:600;
  color:#374151;

  cursor:pointer;

  transition:all .2s ease;
  user-select:none;
}

/* ICON */
.pay-btn i{
  font-size:16px;
  color:#6b7280;
  transition:.2s;
}

/* HOVER EFFECT */
.pay-btn:hover{
  background:#eef2ff;
  border-color:#c7d2fe;
  transform:translateY(-2px);
}

/* ACTIVE STATE */
.pay-btn.active{
  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;
  border-color:#3b82f6;

  box-shadow:0 6px 14px rgba(59,130,246,0.25);
}

/* ACTIVE ICON */
.pay-btn.active i{
  color:#fff;
}


.cart-notes {
  margin-bottom: 20px;
}

.cart-notes label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}
.cart-item-count {
  display: flex;
  align-items: center;
  gap: 5px;

  background: #ef4444;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 600;
}
.cart-notes input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.cart-notes input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


.item-discount {
  width: 70px;

  padding: 3px 6px;
  font-size: 12px;

  text-align: right;

  border: 1px solid #e5e7eb;
  border-radius: 6px;

  background: #f9fafb;
}
.item-discount:focus {
  outline: none;
  border-color: #16a34a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.item-discount::-webkit-outer-spin-button,
.item-discount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cart-summary {
  background: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
}

.summary-row .amount {
  font-weight: 600;
  color: #0f172a;
}

.summary-row.total {
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 15px;
}

.summary-row.total .amount {
  font-size: 16px;
  color: #3b82f6;
}

.amount {
  font-weight: 500;
  color: #1f2937;
}

.cart-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  padding: 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

/* secondary */
.action-btn.secondary {
  background: #f1f5f9;
  color: #0f172a;
}

.action-btn.secondary:hover {
  background: #e2e8f0;
}

/* primary checkout */
.action-btn.primary {
  grid-column: span 2;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(34,197,94,0.25);
}

.action-btn.primary:hover {
  transform: translateY(-1px);
}
.mobile-discount {
  margin: 6px 0;
}

.mobile-discount .item-discount {
  width: 70px;

  padding: 4px 6px;
  font-size: 12px;
  font-weight: 600;

  text-align: right;

  border: 1px solid #e5e7eb;
  border-radius: 6px;

  background: #f9fafb;
}
.action-btn.secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.action-btn.secondary:hover {
  background: #e5e7eb;
}

.action-btn.primary {
  background: #3b82f6;
  color: white;
}

.action-btn.primary:hover {
  background: #2563eb;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.checkout-btn {
  flex: 2;
}

.checkout-btn span {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 4px;
}

/* ======================================
   MOBILE CART MODERN UI
====================================== */

.mobile-cart{
  display:none;
  position:fixed;
  inset:0;
  width:100%;
  height:100dvh;

  background:#f4f7fb;

  z-index:2000;
  overflow:hidden;

  flex-direction:column;
}

/* =========================
   HEADER
========================= */
.mobile-cart-header{
  position:sticky;
  top:0;
  z-index:20;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:14px 16px;

  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(14px);

  border-bottom:1px solid #e5e7eb;
}

.pos-title{
  display:flex;
  align-items:center;
  gap:12px;
}

.pos-icon{
  width:44px;
  height:44px;

  border-radius:14px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:linear-gradient(
    135deg,
    #2563eb,
    #2563eb
  );

  color:#fff;
  font-size:18px;

  box-shadow:
    0 10px 20px rgba(34,197,94,0.25);
}

.pos-text h3{
  margin:0;
  font-size:15px;
  font-weight:700;
  color:#0f172a;
}

.pos-text small{
  display:block;
  margin-top:2px;

  font-size:12px;
  color:#64748b;
}

.close-cart{
  width:40px;
  height:40px;

  border:none;
  border-radius:12px;

  background:#f1f5f9;
  color:#0f172a;

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  transition:.25s;
}

.close-cart:hover{
  background:#e2e8f0;
  transform:scale(1.05);
}

/* =========================
   CONTENT
========================= */
.mobile-cart-content{
  flex:1;
  overflow-y:auto;

  padding:16px;
  padding-bottom:240px;

  scrollbar-width:none;
}

.mobile-cart-content::-webkit-scrollbar{
  display:none;
}

/* =========================
   TABS
========================= */
.mobile-cart-tabs{
  display:flex;
  gap:10px;

  overflow-x:auto;
  padding-bottom:6px;
  margin-bottom:16px;

  scrollbar-width:none;
}

.mobile-cart-tabs::-webkit-scrollbar{
  display:none;
}

.cart-tab{
  border:none;
  outline:none;

  padding:10px 16px;
  border-radius:999px;

  background:#e2e8f0;
  color:#334155;

  font-size:13px;
  font-weight:600;

  white-space:nowrap;
  cursor:pointer;

  transition:.25s;
}

.cart-tab:hover{
  transform:translateY(-1px);
}

.cart-tab.active{
  background:linear-gradient(
    135deg,
    #3b82f6,
    #2563eb
  );

  color:#fff;

  box-shadow:
    0 8px 18px rgba(37,99,235,0.28);
}

/* =========================
   ITEM CARD
========================= */
.mobile-cart-items{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.mobile-cart-item{
  display:flex;
  gap:12px;

  padding:12px;

  background:#fff;

  border-radius:18px;
  border:1px solid #edf2f7;

  box-shadow:
    0 8px 24px rgba(15,23,42,0.05);

  transition:.25s ease;
}

.mobile-cart-item:hover{
  transform:translateY(-2px);
}

.mobile-item-image{
  width:72px;
  height:72px;

  object-fit:cover;
  border-radius:14px;

  background:#f8fafc;
}

.mobile-item-info{
  flex:1;
  min-width:0;
}

.mobile-item-name{
  font-size:14px;
  font-weight:700;
  color:#0f172a;

  margin-bottom:4px;

  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.mobile-item-size{
  font-size:12px;
  color:#64748b;

  margin-bottom:10px;
}

.mobile-item-bottom{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.mobile-item-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.mobile-item-price{
  font-size:14px;
  font-weight:700;
  color:#2563eb;
}

/* =========================
   QTY BUTTON
========================= */
.mobile-qty-controls{
  display:flex;
  align-items:center;
  gap:8px;
}

.mobile-qty-btn{
  width:30px;
  height:30px;

  border:none;
  border-radius:10px;

  background:#f1f5f9;
  color:#0f172a;

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  transition:.2s;
}

.mobile-qty-btn:hover{
  background:#dbeafe;
  color:#2563eb;
}

.mobile-qty-value{
  min-width:24px;
  text-align:center;

  font-size:13px;
  font-weight:700;
  color:#0f172a;
}

/* =========================
   STICKY CHECKOUT
========================= */
.mobile-cart-wrapper{
  position:fixed;
  left:0;
  right:0;
  bottom:0;

  z-index:30;

  padding:14px;

  background:
    linear-gradient(
      to top,
      rgba(244,247,251,1),
      rgba(244,247,251,.92),
      transparent
    );
}

/* =========================
   SUMMARY
========================= */
.mobile-cart-summary{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
padding:16px;
  box-sizing:border-box;
  z-index:9999;

  background:#fff;
  border-radius:24px 24px 0 0;

  box-shadow:0 -10px 30px rgba(0,0,0,.15);

  display:flex;
  flex-direction:column;

  transform:translateY(calc(100% - 80px));
  transition:transform .35s ease;

  /* 🔥 PENTING: kasih ruang agar tidak nutup button */
  padding-bottom:90px;
}

/* OPEN FULL */
.mobile-cart-summary.open{
  transform:translateY(0);
}

/* MINIMIZED */
.mobile-cart-summary.minimized{
  transform:translateY(calc(100% - 110px));
}

/* HANDLE AREA BESAR (IMPORTANT) */
.summary-handle{
  width:100%;
  height:40px;

  display:flex;
  justify-content:center;
  align-items:center;

  cursor:pointer;
  touch-action:none;
}

.summary-handle::before{
  content:"";
  width:60px;
  height:5px;

  background:#cbd5e1;
  border-radius:999px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-title {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}

.summary-item span {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}


.clear-btn{
  border:none;

  background:#fef2f2;
  color:#dc2626;

  padding:8px 12px;
  border-radius:10px;

  font-size:12px;
  font-weight:600;

  cursor:pointer;
  transition:.2s;
}

.clear-btn:hover{
  background:#fee2e2;
}

.summary-row{
  display:flex;
  align-items:center;
  justify-content:space-between;

  font-size:14px;
  color:#475569;
}

.summary-row.total{
  margin-top:4px;
  padding-top:14px;

  border-top:1px dashed #cbd5e1;

  font-size:18px;
  font-weight:800;
  color:#0f172a;
}

.summary-row.discount {
  display: grid;
  grid-template-columns: 70px 90px 1fr;
  align-items: center;
  gap: 8px;
}

.summary-row.discount .amount {
  justify-self: end;
  white-space: nowrap;
}



/* =========================
   CHECKOUT BUTTON
========================= */

.mobile-cart-footer{
  position:fixed;
  left:0;
  right:0;
  bottom:0;

  z-index:10000; /* HARUS LEBIH TINGGI DARI SUMMARY */

  padding:12px;

  background:#fff;
}

.mobile-checkout-btn{
  width:100%;

  border:none;
  border-radius:18px;

  padding:16px;

  background:linear-gradient(
    135deg,
    #2563eb,
    #1d4ed8
  );

  color:#fff;

  font-size:15px;
  font-weight:700;

  cursor:pointer;

  box-shadow:
    0 14px 30px rgba(37,99,235,.35);

  transition:.25s;
}

.mobile-checkout-btn:hover{
  transform:translateY(-2px);
}

.mobile-checkout-btn:active{
  transform:scale(.98);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 20px;
  z-index: 1000;
}

.mobile-nav-btn {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.mobile-nav-btn svg {
  width: 20px;
  height: 20px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}


/* Responsive Design */
@media (max-width: 1024px) {
  .content-area {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .cart-section {
    order: -1;
  }
  
  .features-section {
    grid-column: 1;
  }
}


@media (min-width: 769px) {
    .user-sheet,
    .sheet-overlay {
        display: none !important;
    }
}
@media (max-width: 768px) {

  /* =========================
     GLOBAL FIX
  ========================= */
  * {
    box-sizing: border-box;
  }

html, body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-container {
 
  display: flex;
  flex-direction: column;

  }
  
 .pos-footer-simple {
        font-size: 11px;
        padding: 10px 8px;

        /* biar gak “naik turun aneh” di mobile */
        margin-top: 20px;
    }
    .user-sheet {
        display: block;
    }

    .sheet-overlay {
        display: none;
    }

    .sheet-overlay.active {
        display: block;
    }


   .top-toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  .toolbar-right{
    justify-content:space-between;
  }

  .scan-btn{
    flex:1;
    justify-content:center;
  }




   .table-header,
  .product-row {
    grid-template-columns: 90px minmax(0, 1fr) 90px 60px;
    padding: 8px 10px;
  }

  .col-name {
    font-size: 12px;
  }

  .col-price {
    font-size: 11px;
  }

  .col-stock {
    font-size: 11px;
  }

  .col-code {
    font-size: 10px;
  }
  /* =========================
     SIDEBAR
  ========================= */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;

    transform: translateX(-100%);
    transition: .3s ease;
    z-index: 2000;
    
  }
  


  .sidebar.open {
    transform: translateX(0);
  }

  /* =========================
     HEADER (FIXED + SAFE)
  ========================= */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 60px;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;

  }

  .header-left,
  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .header-center {
    flex: 1;
    min-width: 0;
  }
  

  .search-input {
    width: 100%;
    min-width: 0;
  }

  .menu-toggle {
    display: block;
  }

  .page-title {
    font-size: 18px;
  }

  .notification-text,
  .user-info {
    display: none;
  }

  /* =========================
     MAIN CONTENT (INI PENTING)
  ========================= */
 .main-content {
    width: 100%;
    margin: 0;
    padding: 70px 0 85px 0; /* 🔥 OFFSET HEADER FIXED */

  }

  /* =========================
     CONTENT
  ========================= */
  .content-area {
    display: block;
    width: 100%;
    padding: 10px;
    overflow: visible;
  }


  .product-section {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
  }

  /* CATEGORY */
  .category-tabs {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .category-tab {
    display: inline-block !important;
    margin-right: 8px;
  }

  /* PRODUCTS */
  .products-grid {
    height: auto !important;
    overflow: visible !important;
  }
  .product-card {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
  }

  .product-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
  }

  .product-name {
    font-size: 13px;
    line-height: 1.4;
  }

  .product-price {
    font-size: 14px;
  }

  /* CART */
  .cart-section {
    display: none;
  }

  .mobile-cart.open {
    display: flex;
  }

  .mobile-bottom-nav {
    display: block;
  }

  /* FEATURES */
  .features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 16px;
  }

  .feature-icon {
    width: 40px;
    height: 40px;
  }

  .feature-icon svg {
    width: 20px;
    height: 20px;
  }

  .feature-content h3 {
    font-size: 14px;
  }

  .feature-content p {
    font-size: 13px;
  }

  /* PAGINATION */
  .pagination {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .pagination::-webkit-scrollbar {
    display: none;
  }

  .page-btn {
    display: inline-flex;
    min-width: 40px;
    margin-right: 6px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 10px 12px;
  }
  
  .content-area {
    padding: 12px;
  }
  
  .product-section,
  .features-section {
    padding: 16px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  
  .product-card {
    padding: 10px;
  }
  
  .product-image {
    height: 80px;
  }
  
  .product-name {
    font-size: 12px;
  }
  
  .product-price {
    font-size: 13px;
  }
  
  .category-tabs {
    gap: 4px;
  }
  
  .category-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.show {
  display: block;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
