/* ============================================================
   PT BERKAH JAYA AWING — Premium White-Gold Admin Dashboard
   Version 2.0 — Professional & Presentation-Ready
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');


:root {
  
  --gold:           #C9A84C;
  --gold-light:     #D4AF37;
  --gold-pale:      #FDF8EC;
  --gold-soft:      #FFF9E6;
  --gold-border:    rgba(201,168,76,0.25);
  --gold-glow:      rgba(201,168,76,0.12);
  --gold-hover:     #B8922E;

  --sidebar-bg: #F7F3EA;
  --sidebar-hover: #FFFFFF;
  --sidebar-active: #FFF4D6;
  --sidebar-border: #E7E2D8;
  --sidebar-text: #6B7280;
  --sidebar-label: #9CA3AF;


  --bg-main: #F9FAFB;
  --bg-card:        #FFFFFF;
  --bg-topbar:      #FFFFFF;

  --text-main:      #111827;
  --text-body:      #374151;
  --text-soft:      #6B7280;
  --text-muted:     #9CA3AF;

  --border:         #E5E7EB;
  --border-light:   #F3F4F6;

  --green:          #15803D;
  --green-light:    #DCFCE7;
  --red:            #DC2626;
  --red-light:      #FEE2E2;
  --orange:         #C2410C;
  --orange-light:   #FFEDD5;
  --blue:           #1D4ED8;
  --blue-light:     #DBEAFE;

  --sidebar-w:      256px;
  --topbar-h:       60px;

  --radius-xs:      4px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --radius-2xl:     24px;

  --shadow-sm: 0 4px 14px rgba(0,0,0,0.05);
  --shadow:         0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md:      0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-gold:    0 4px 20px rgba(201,168,76,0.18);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  background: var(--bg-main);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app  { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition:transform .25s ease;
  z-index: 200;
  position: relative;
}

.menu-toggle{
  color: var(--gold);
}

.menu-toggle:hover{
  background: var(--gold-soft);
}

.sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(201,168,76,0.3) 20%,
    rgba(201,168,76,0.5) 50%,
    rgba(201,168,76,0.3) 80%,
    transparent 100%
  );
}

/* Logo */

.logo-img{
    width:40px;
    height:40px;
    object-fit:contain;
}

.logo-area {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  position: relative;
}
.logo-box { display: flex; align-items: center; gap: 12px; }

.logo-img-wrap {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1a1d2e, #111827);
  border-radius: var(--radius-md);
  border: 1px solid rgba(201,168,76,0.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.logo-img-wrap img { width: 34px; height: 34px; object-fit: contain; }

.logo-text {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.1px;
}
.logo-text span {
  display: block;
  font-size: 9.5px;
  color: var(--gold);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

/* Nav */
.nav-section {
  padding: 14px 0;
  flex: 1;
  overflow-y: auto;
}
.nav-section::-webkit-scrollbar { width: 2px; }
.nav-section::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }

.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--sidebar-label);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: 14px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
  position: relative;
  margin: 1px 8px;
  border-radius: var(--radius-md);
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; transition: opacity .2s; }
.nav-item:hover{
  color: var(--text-main);
  background: var(--sidebar-hover);
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  color: var(--gold);
  background: var(--sidebar-active);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--gold); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%; transform: translateY(-50%);
  height: 20px; width: 3px;
  background: linear-gradient(to bottom, var(--gold-light), var(--gold));
  border-radius: 0 3px 3px 0;
}

.product-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:16px;
    max-height:420px;
    overflow-y:auto;
    scroll-behavior:smooth;

}

.product-grid::-webkit-scrollbar{
   width:6px;
}

.product-grid::-webkit-scrollbar-thumb{
   background:var(--gold-border);
   border-radius:10px;
}

.product-info h4{
    font-size:14px;
    margin-bottom:4px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.product-info small{
    color:var(--text-muted);
}

.product-price{
    font-size:22px;
    font-weight:700;
    color:var(--gold);
}


.product-meta{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
}

.product-card{
    border:1px solid #ececec;
    border-radius:14px;
    padding:16px;
    cursor:pointer;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    transition:.2s;
    min-height:120px;
}



.product-card:hover{
    border-color:var(--gold);
    transform:translateY(-2px);
    box-shadow:var(--shadow);
}

.product-card.active{
   border:2px solid var(--gold);
   background:#fffdf5;
}

.product-info{
   /* flex:1;
   min-width:0; */
   width:100%;
}

.upload-produk{
  width:100%;
}

.upload-input{
  display:none;
}

.upload-box{
  width:100%;
  min-height:72px;
  padding:14px 16px;
  
  text-align: left;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items: flex-start;
  
  gap:4px;

  border:1.5px dashed var(--gold-border);
  border-radius:12px;

  background:var(--gold-pale);
  color:var(--gold-hover);

  cursor:pointer;
  transition:.2s ease;
}

.upload-box:hover{
  border-color:var(--gold);
  background:var(--gold-soft);
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(201,168,76,.10);
}

.upload-title{
  font-size:13px;
  font-weight:700;
  color:var(--text-main);
}

.upload-info{
  font-size:11.5px;
  color:var(--text-soft);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#uang_bayar{
   font-size:16px;
   font-weight:600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.55);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-hover), var(--gold-light));
  border: 2px solid rgba(201,168,76,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #0F1117;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.user-info {
  flex: 1;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  min-width: 0;
}
.user-info span {
  display: block;
  font-size: 10.5px;
  color: var(--gold);
  font-weight: 400;
  opacity: 0.8;
}

.back-page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9a6a1f;
  font-weight: 600;
  text-decoration: none;
}

.back-page-link:hover {
  color: #6f4b12;
}

.logout-link {
  margin-left: auto;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.logout-link:hover {
  color: #EF4444;
  background: rgba(239,68,68,0.1);
}

.logout-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.logout-modal-overlay.show {
  display: flex;
}

.logout-modal-box {
  width: 360px;
  max-width: calc(100% - 32px);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.logout-modal-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1f2937;
}

.logout-modal-box p {
  margin: 0 0 22px;
  color: #64748b;
  font-size: 14px;
}

.logout-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel,
.btn-logout {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn-cancel {
  background: #f1f5f9;
  color: #334155;
}

.btn-logout {
  background: #b45309;
  color: #fff;
}


/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-body);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.menu-toggle:hover { background: var(--border-light); }

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  visibility:hidden;
  opacity:0;
  z-index: 190;
  transition:.2s;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { 
  display: block;
   opacity:1;
  visibility:visible;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.topbar-left h2 {
  font-size:16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}
.topbar-left p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============================================================
   CONTENT
   ============================================================ */
.content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, .tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7.5px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.1px;
}
.btn:hover, .tb-btn:hover {
  background: var(--bg-main);
  border-color: #D1D5DB;
  color: var(--text-main);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.btn:active, .tb-btn:active { transform: translateY(0); }

.btn.primary{
    height:54px;
    font-size:16px;
}

/* Primary = Gold */
.btn.primary, .tb-btn.primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  letter-spacing: .2px;
  color: #0F1117;
  border: none;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.btn.primary:hover, .tb-btn.primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-hover));
  box-shadow: 0 6px 24px rgba(201,168,76,0.28);
  transform: translateY(-1px);
}

.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
  transition: opacity .4s;
}
.alert-success {
  background: var(--green-light);
  border-color: rgba(21,128,61,0.2);
  color: var(--green);
}
.alert-danger {
  background: var(--red-light);
  border-color: rgba(220,38,38,0.2);
  color: var(--red);
}
.alert-warning {
  background: var(--orange-light);
  border-color: rgba(194,65,12,0.2);
  color: var(--orange);
}
.alert svg { flex-shrink: 0; }
.alert span { flex: 1; }
.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  padding: 0 2px;
  transition: opacity .15s;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
}
.stat-card:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
/* Subtle top accent */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
  border-radius: 0 0 2px 2px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat-sub   { font-size: 11.5px; color: var(--text-muted); }
.stat-income{ font-size: 18px; }
.stock-warning { color: var(--orange); }

.stat-icon {
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; 
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-gold   { background: var(--gold-soft);    border: 1px solid var(--gold-border); }
.icon-green  { background: #F0FDF4;              border: 1px solid rgba(21,128,61,0.15); }
.icon-red    { background: #FFF1F2;              border: 1px solid rgba(220,38,38,0.15); }
.icon-blue   { background: #EFF6FF;              border: 1px solid rgba(29,78,216,0.15); }
.icon-orange { background: #FFF7ED;              border: 1px solid rgba(194,65,12,0.15); }

/* Restock stat icon */
.sc-icon {
  float: right;
  margin-top: -2px;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.sc-val   { font-size: 22px; font-weight: 800; color: var(--text-main); }
.sc-sub   { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

.bg-blue-soft   { background: #EFF6FF; border: 1px solid rgba(29,78,216,0.15); }
.bg-green-soft  { background: #F0FDF4; border: 1px solid rgba(21,128,61,0.15); }
.bg-yellow-soft { background: var(--gold-soft); border: 1px solid var(--gold-border); }
.bg-red-soft    { background: #FFF1F2; border: 1px solid rgba(220,38,38,0.15); }

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.row2{
   display:grid;
   grid-template-columns:1fr 1fr;
   gap:18px;
   margin-bottom:14px;
   align-items:start;
}

.row3{
   display:grid;
   grid-template-columns:2fr 1fr;
   gap:18px;
   margin-top:-6px;
   align-items:start;
}
.col-side{ display: flex; flex-direction: column; gap: 18px; }

.grid-2  { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }


/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all .2s ease;
}

.card:hover{
  box-shadow:var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.1px;
}
.card-link {
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  transition: opacity .15s;
}

.card-link:focus{
  outline: none;
}

.card-link:hover { opacity: 0.75; }
.card-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--gold-soft);
  color: var(--gold-hover);
  border: 1px solid var(--gold-border);
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-count {
  background: var(--bg-main);
  color: var(--text-soft);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.card-body { padding: 18px 20px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-soft);
  background: #FCFBF8;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child { border-radius: 0; }

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td {
  background: linear-gradient(90deg, var(--gold-glow), transparent);
}


.produk-ringkas{
  max-width: 420px;
  line-height: 1.45;
}

.item-count{
  display: block;
  width: fit-content;
  margin-left: 0;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-hover);
  border: 1px solid var(--gold-border);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}


.trx-id  { color: var(--gold); font-weight: 700; font-size: 11.5px; }
.fw-600  { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-gold  { color: var(--gold); }
.text-center { text-align: center; }
.text-normal { color: var(--text-main); }
.font-semibold { font-weight: 600; }

/* Table search */
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-main);
}
.table-search input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text-main);
  background: var(--bg-card);
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.table-search input:focus { border-color: var(--gold); }

.history-card{
   align-self:start;
}

.history-card .table-wrap{
  max-height: 430px;
  overflow-y: auto;
}

.history-table { 
  max-height: 520px; 
  overflow-y: auto; 
  width:100%;
}

.history-table table{
    width:100%;
    table-layout:auto;
}

.history-table td,
.history-table th{
    font-size:11px;
    padding:10px;
}

.history-table thead th{
   position:sticky;
   top:0;
   z-index:2;
}

.form-actions .tb-btn:first-child{
   background:#fff;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 24px;
  font-size: 13px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-success { background: #F0FDF4; color: #15803D; border: 1px solid rgba(21,128,61,0.2); }
.badge-warning { background: #FFF7ED; color: #C2410C; border: 1px solid rgba(194,65,12,0.2); }
.badge-danger  { background: #FFF1F2; color: #DC2626; border: 1px solid rgba(220,38,38,0.2); }
.badge-info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid rgba(29,78,216,0.2); }
.badge-gold    { background: var(--gold-soft); color: var(--gold-hover); border: 1px solid var(--gold-border); }
.badge-normal  { background: #F0FDF4; color: #15803D; border: 1px solid rgba(21,128,61,0.2); }
.badge-menipis { background: #FFF7ED; color: #C2410C; border: 1px solid rgba(194,65,12,0.2); }
.badge-habis   { background: #FFF1F2; color: #DC2626; border: 1px solid rgba(220,38,38,0.2); }

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box { flex: 1; min-width: 180px; position: relative; }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px 0 34px;
  font-size: 12.5px;
  color: var(--text-main);
  background: var(--bg-card);
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
}

.search-box input::placeholder { color: var(--text-muted); }

.filter-select {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-body);
  background: var(--bg-card);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.filter-select:focus { border-color: var(--gold); }

/* ============================================================
   BARCODE TAG
   ============================================================ */
.barcode-tag {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--gold-hover);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-group{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.action-group .act-btn{
  flex-shrink:0;
}

.act-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s ease;
}
.act-btn:hover {
  background: var(--gold-soft);
  color: var(--gold-hover);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.act-del:hover {
  background: var(--red-light);
  border-color: rgba(220,38,38,0.3);
  color: var(--red);
}

/* ============================================================
   CHART & DONUT
   ============================================================ */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 8px 0; }
.bar-wrap   { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar        { width: 100%; border-radius: 5px 5px 0 0; cursor: pointer; transition: opacity .15s; }
.bar:hover  { opacity: 0.75; }
.bar-label  { font-size: 9.5px; color: var(--text-muted); font-weight: 500; }

.donut-wrap   { display: flex; align-items: center; gap: 20px; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.legend-item  { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-body); font-weight: 500; }
.legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-val   { margin-left: auto; font-weight: 700; color: var(--text-main); }

.donut-bg     { fill: none; stroke: var(--border-light); stroke-width: 18; }
.donut-gold   { fill: none; stroke: var(--gold);    stroke-width: 18; stroke-linecap: round; }
.donut-green  { fill: none; stroke: #15803D;        stroke-width: 18; stroke-linecap: round; }
.donut-blue   { fill: none; stroke: #1D4ED8;        stroke-width: 18; stroke-linecap: round; }
.donut-purple { fill: none; stroke: #7C3AED;        stroke-width: 18; stroke-linecap: round; }

.dot-gold   { background: var(--gold); }
.dot-green  { background: #15803D; }
.dot-blue   { background: #1D4ED8; }
.dot-purple { background: #7C3AED; }

/* ============================================================
   TABS
   ============================================================ */
.tabs-wrap {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px;
  margin-bottom: 18px;
  width: fit-content;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 7px 20px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.tab.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #0F1117;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.tab:hover:not(.active) {
  background: var(--bg-main);
  color: var(--text-main);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group   { margin-bottom: 16px; }
.form-label   {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
  text-transform:none;
}
.required { color: var(--red); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
.form-input:focus{
  background:#fffdf8;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.form-select { cursor: pointer; }
.form-textarea { height: auto; padding: 10px 13px; resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

.select-placeholder {
    color: var(--text-main);
    font-weight: 500;
}

.select-placeholder.placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.select-placeholder option {
    color: var(--text-main);
    font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--border-light);
}

.form-actions .btn{
   min-width:90px;
}

.form-actions .primary{
   min-width:170px;
}

#searchBarang{
   margin-bottom:14px;
}

/* Form page */
.form-page-wrap { max-width: 760px; }
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

/* ============================================================
   STOK ITEMS
   ============================================================ */
.stock-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.stock-item:last-child { border-bottom: none; }
.stock-img {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stock-info { flex: 1; min-width: 0; }
.stock-name { font-size: 12.5px; color: var(--text-main); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-sku  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.progress-bar  { height: 4px; background: var(--border-light); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.stock-kritis  { color: var(--red);    font-weight: 700; }
.stock-menipis { color: var(--orange); font-weight: 700; }
.stock-aman    { color: var(--green);  font-weight: 700; }

/* ============================================================
   PREVIEW BOX (POS & Restock)
   ============================================================ */
.barang-preview {
  background: var(--gold-soft);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12.5px;
}
.preview-row + .preview-row { border-top: 1px solid rgba(201,168,76,0.15); }
.preview-label { color: var(--text-soft); font-weight: 500; }
.preview-val   { font-weight: 700; color: var(--text-main); }
.preview-after { color: var(--gold-hover); font-size: 15px; font-weight: 800; }
.preview-total { font-size: 16px; }

/* ============================================================
   STOCK OPNAME
   ============================================================ */
.table-scroll { overflow-x: auto; }
.input-opname { width: 85px; height: 34px; padding: 0 8px; font-size: 12px; }
.selisih-default { color: var(--text-muted); }
.selisih-plus    { color: var(--green); font-weight: 700; }
.selisih-minus   { color: var(--red);   font-weight: 700; }

.opname-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-main);
}
.input-keterangan { max-width: 280px; }



.password-wrap{
  position:relative;
}

.password-wrap .form-input{
  padding-right:45px;
}

.toggle-password{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#9ca3af;
  user-select:none;
}

.toggle-password svg{
  width:18px;
  height:18px;
  display:block;
}

.toggle-password:hover{
  color:var(--gold);
}


.back-login-link{
    display:inline-flex;
    align-items:center;
    gap:8px;

    color:#6b7280;
    text-decoration:none;

    font-size:14px;
    font-weight:600;

    transition:.25s;
}

.back-login-link:hover{
    color:var(--gold);
    transform:translateX(-3px);
}

.back-login-link svg{
    width:16px;
    height:16px;
}


/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

/* For kategori, pelanggan, supplier modals */
div[id="modalBackdrop"],
div[id^="modalBackdrop"] {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.08);
}
.modal-lg { max-width: 680px; }

@keyframes modalIn {
  from { transform: scale(0.96) translateY(-12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);     opacity: 1; }
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  margin: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  animation: modalIn .22s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.modal-close {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.modal-close:hover {
  background: var(--red-light);
  border-color: rgba(220,38,38,0.2);
  color: var(--red);
}

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-card);
}


.tb-btn.outline-gold{
  background:var(--gold-soft);
  color:var(--gold-hover);
  border:1px solid var(--gold-border);
  box-shadow:none;
}

.tb-btn.outline-gold:hover{
  background:var(--gold);
  color:#fff;
  border-color:var(--gold);
}



/* ============================================================
   TABS
   ============================================================ */
/* Already defined above */

/* Supplier & table helpers */
.supplier-count { font-size: 12px; color: var(--text-muted); }
.th-no     { width: 40px; }
.th-action { width: 90px; }
.td-address { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inline-form { display: inline; }
.no-padding  { padding: 0 !important; }
.hidden      { display: none !important; }
.text-warning { color: var(--orange); }
.text-danger  { color: var(--red); }

/* ============================================================
   LOGIN PAGE — Dark & Premium
   ============================================================ */
body.login-page{
    /* background: linear-gradient(135deg,#f8f5ec,#f2ede3); */
    background:
    radial-gradient(circle at top right, rgba(212,175,55,.08), transparent 25%),
    #f8f6ef;
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

.login-card{
    width:460px;
    background:#ffffff;
    border:1px solid rgba(212,175,55,.25);
    border-radius:24px;
    padding:40px;
    box-shadow:
        0 20px 40px rgba(0,0,0,.06),
        0 8px 18px rgba(212,175,55,.08);
}

.login-title{
    font-size:18px;
    margin-bottom:6px;
    color:#111827;
    text-align:center;
    font-weight:700;
}

.login-sub{
    text-align:center;
    color:#6b7280;
    margin-bottom:28px;
}

.login-logo-wrap{
    width:95px;
    height:95px;
    margin:0 auto 28px;
    border-radius:22px;
    border:1px solid rgba(212,175,55,.25);
    background:#fffdf8;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:20px;
    box-shadow:0 15px 35px rgba(212,175,55,.14);
}

.login-logo-img{
    width:65px;
    height:65px;
    object-fit:contain;
}

.login-form .form-input:focus{
    border-color:#d4af37;
    box-shadow:0 0 0 4px rgba(212,175,55,.15);
}

.login-hint{
    margin-top:20px;
    text-align:center;
    color:#9ca3af;
    font-size:13px;
}

/* Login form inputs override */
.login-form .form-label{
    color:#374151;
    font-weight:600;
}

.login-form .form-input{
    background:#ffffff;
    border:1px solid #d1d5db;
    color:#111827;
}

.login-form .form-input::placeholder{
    color:#9ca3af;
}

.login-form .form-input:focus{
    background:#ffffff;
    border-color:#d4af37;
    box-shadow:0 0 0 4px rgba(212,175,55,.15);
}

.login-forgot{
  margin-top:16px;
  text-align:center;
  font-size:12px;
  color:#888;
}

.login-forgot span{
  color:var(--gold);
  font-weight:600;
}

.brand-logo{
    width:52px;
    height:52px;
    border-radius:14px;
    background:#fffdf8;
    border:1px solid rgba(212,175,55,.25);
    padding:8px;
    box-shadow:0 8px 20px rgba(0,0,0,.06);
}

.brand-logo img{
    width:100%;
    height:100%;
    object-fit:contain;
}

/* Login alerts override */
body.login-page .alert-danger {
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.3);
  color: #B91C1C;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.breadcrumb-link:hover { opacity: 0.75; }



/* =========================
   MODAL DELETE MODERN
========================= */

.modal-delete-backdrop{
  display:none;
  position:fixed;
  inset:0;
  z-index:2000;
  background:rgba(17,24,39,.45);
  backdrop-filter:blur(4px);
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal-delete-backdrop.open{
  display:flex;
}

.modal-delete-box{
  width:100%;
  max-width:390px;
  background:#fff;
  border-radius:22px;
  padding:28px;
  text-align:center;
  box-shadow:0 24px 70px rgba(0,0,0,.18);
  animation:deleteModalIn .2s ease;
}

@keyframes deleteModalIn{
  from{
    opacity:0;
    transform:translateY(16px) scale(.96);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

.modal-delete-icon{
  width:54px;
  height:54px;
  border-radius:50%;
  margin:0 auto 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--red-light);
  color:var(--red);
  font-size:26px;
  font-weight:800;
}

.modal-delete-box h3{
  font-size:18px;
  color:var(--text-main);
  margin-bottom:8px;
}

.modal-delete-box p{
  font-size:13px;
  color:var(--text-soft);
  line-height:1.6;
  margin-bottom:22px;
}

.modal-delete-actions{
  display:flex;
  justify-content:center;
  gap:10px;
}

.tb-btn.danger{
  background:var(--red);
  color:#fff;
  border-color:var(--red);
}

.tb-btn.danger:hover{
  background:#b91c1c;
  color:#fff;
}


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
}
.pg-info { font-size: 12px; color: var(--text-muted); }
.pg-btns { display: flex; gap: 6px; }

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px) {
  .grid-pos,
  .grid-2,
  .row2,
  .row3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .stats-grid,
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — MOBILE GLOBAL
   ============================================================ */
@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .menu-toggle {
    display: flex;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .content {
    padding: 14px 16px;
  }

  .topbar {
    padding: 14px 16px;
    height: auto;
    gap: 12px;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .topbar-left h2 {
    font-size: 18px;
  }

  .topbar-left p {
    display: none;
  }

  .topbar-actions {
    width: auto;
  }

  .stats-grid,
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .row2,
  .row3,
  .grid-pos,
  .grid-2,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: center;
  }

  .chart-bars {
    height: 90px;
  }

  .bar-wrap {
    min-width: 42px;
  }

  .card {
    border-radius: 18px;
  }

  .card-body {
    padding: 14px;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .form-actions .tb-btn,
  .form-actions .btn {
    width: auto;
    justify-content: center;
  }
}

/* ============================================================
   RESPONSIVE — SMALL PHONE
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid,
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 14px 12px;
    min-height: 110px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    top: 14px;
    right: 12px;
  }

  .stat-icon svg {
    width: 17px;
    height: 17px;
  }

  .stat-label {
    font-size: 9.5px;
    padding-right: 38px;
  }

  .stat-val {
    font-size: 20px;
    padding-right: 38px;
  }

  .stat-sub {
    font-size: 10px;
  }

  .content {
    padding: 12px;
  }
}


/* FIX DASHBOARD ADMIN */
.row2{
  margin-bottom: 14px;
}

@media (max-width:768px){

  .row2{
    margin-bottom:14px;
  }

  .row3{
    display:grid;
    grid-template-columns:1fr !important;
    gap:14px;
  }

  .row3 .table-wrap{
    overflow-x:auto !important;
  }

  .row3 .table-wrap table{
    min-width:560px;
  }

  .row3 .table-wrap thead{
    display:table-header-group;
  }

  .row3 .table-wrap tr{
    display:table-row;
  }

  .row3 .table-wrap th,
  .row3 .table-wrap td{
    display:table-cell;
    white-space:nowrap;
  }
}

/* =========================
   ADMIN POS LAYOUT
========================= */

.grid-pos{
  display:grid;
  grid-template-columns: minmax(0, 1.75fr) 430px;
  gap:24px;
  align-items:start;
}

.pos-history-wide{
  grid-column: 1 / -1;
  max-height: none;
  overflow: hidden;
}

.pos-history-wide .history-table{
  max-height: 260px;
  overflow-y: auto;
}

.pos-history-wide table{
  min-width: 0;
  width: 100%;
}

.pos-left,
.pos-right{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.pos-right{
  align-self:start;
}

/* Produk khusus halaman POS */
.grid-pos .product-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
  max-height:260px;
  overflow-y:auto;
  padding-right:4px;
  align-content:start;
}

.grid-pos .product-card{
  min-height:86px;
  padding:12px 14px;
  gap:6px;
}

.grid-pos .product-info h4{
  font-size:13px;
  line-height:1.3;
}

.grid-pos .product-info small{
  font-size:11px;
}

.grid-pos .product-price{
  font-size:18px;
  line-height:1.1;
}

.pos-right .card{
  border-radius:16px;
}

.pos-right .card-body{
  padding:18px;
}


.pos-right .history-card{
  max-height:260px;
  overflow:hidden;
}

.pos-right .history-table{
  max-height:200px;
  overflow-y:auto;
}

.pos-right .history-table table{
  min-width:0;
}

.pos-right .history-table th,
.pos-right .history-table td{
  font-size:10.8px;
  padding:9px 10px;
}

/* Tablet */
@media(max-width:1024px){
  .grid-pos{
    grid-template-columns:1fr;
  }

  .pos-right{
    position:static;
  }
}

/* Mobile POS */
@media(max-width:600px){

  .grid-pos{
    gap:14px;
  }

  .grid-pos .card{
    border-radius:16px;
  }

  .grid-pos .card-header{
    padding:14px 16px;
  }

  .grid-pos .card-body{
    padding:14px;
  }

  .grid-pos .product-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
    max-height:none;
    gap:10px;
    padding-right:0;
    overflow:visible;
  }

  .grid-pos .product-card{
    min-height:96px;
    padding:12px;
  }

  .grid-pos .product-info h4{
    font-size:12px;
    max-width:100%;
  }

  .grid-pos .product-info small{
    font-size:10.5px;
  }

  .grid-pos .product-price{
    font-size:17px;
  }

  .pos-right .history-card,
  .pos-right .history-table{
    max-height:none;
  }

  .pos-history-wide{
    grid-column:auto;
    margin-bottom:16px;
  }

  .pos-history-wide .history-table{
    max-height:none;
    overflow-x:hidden;
  }
}

/* =========================
   POS CART
========================= */

.cart-items{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}

.cart-item{
  display:grid;
  grid-template-columns: 1fr auto auto auto;
  gap:10px;
  align-items:center;
  padding:12px;
  border:1px solid var(--border-light);
  border-radius:14px;
  background:#fff;
}

.cart-name{
  font-size:13px;
  font-weight:700;
  color:var(--text-main);
}

.cart-sub{
  font-size:11.5px;
  color:var(--text-muted);
  margin-top:2px;
}

.cart-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.cart-actions button{
  width:26px;
  height:26px;
  border-radius:50%;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-weight:700;
}

.cart-actions span{
  min-width:18px;
  text-align:center;
  font-weight:700;
}

.cart-total{
  font-weight:800;
  color:var(--gold);
  white-space:nowrap;
}

.cart-remove{
  border:none;
  background:transparent;
  color:var(--text-muted);
  font-size:18px;
  cursor:pointer;
}

.cart-remove:hover{
  color:var(--red);
}

@media(max-width:600px){
  .cart-item{
    grid-template-columns:1fr;
    gap:8px;
  }

  .cart-actions,
  .cart-total,
  .cart-remove{
    justify-self:start;
  }
}

@media (max-width: 768px){

  .history-table table{
    min-width: 0;
    width: 100%;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2),
  .history-table th:nth-child(3),
  .history-table td:nth-child(3){
    display: none;
  }

  .history-table th,
  .history-table td{
    font-size: 11px;
    padding: 9px 8px;
  }

  .history-table td:first-child{
    max-width: 120px;
    line-height: 1.3;
  }
}

@media (max-width:768px){

  .row3 .table-wrap{
    overflow-x: auto !important;
  }

  .row3 .table-wrap table{
    min-width: 560px;
  }

  .produk-ringkas{
    max-width: 220px;
    white-space: normal !important;
    line-height: 1.35;
  }

  .item-count{
    margin-left: 0;
    margin-top: 4px;
    display: block;
    width: fit-content;
  }
}

/* =========================
   RESPONSIVE RESTOCK TABLE
========================= */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-responsive table {
  min-width: 900px;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 13px;
  }

  .topbar-actions .btn,
  .topbar-actions .tb-btn{
    min-height:42px;
  }
}

.table-responsive {
    border-radius:12px;
    overflow-x:auto;
}

table th,
table td{
    white-space:nowrap;
    font-size:13px;
    padding:10px;
}


/* =========================
   PEMBELIAN RESPONSIVE FIX
========================= */

.pembelian-toolbar{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) auto 170px auto 170px auto;
  gap:10px;
  align-items:center;
  margin-bottom:16px;
}

.filter-actions{
  display:flex;
  gap:10px;
}

.btn-filter,
.btn-reset{
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:.25s;
  white-space:nowrap;
  padding:0 16px;
}

.btn-filter{
  border:none;
  color:#fff;
  background:linear-gradient(135deg,var(--gold),var(--gold-hover));
  box-shadow:var(--shadow-gold);
}

.btn-filter:hover{
  transform:translateY(-2px);
}

.btn-reset{
  background:#fff;
  color:var(--text-body);
  border:1px solid var(--border);

  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  user-select:none;
}

.btn-reset:hover{
  border-color:var(--gold);
  background:var(--gold-soft);
  color:var(--gold-hover);
}

@media(max-width:768px){

  .topbar{
    flex-direction:column;
    align-items:flex-start;
    height:auto;
  }

  .topbar-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .topbar-actions .btn,
  .topbar-actions .tb-btn{
    width:100%;
    justify-content:center;
    font-size:11.5px;
    padding:8px 10px;
  }

  .stats-grid,
  .stats-row{
    grid-template-columns:repeat(3,1fr);
    gap:8px;
  }

  .stat-card{
    padding:12px 10px;
    min-height:110px;
  }

  .stat-label{
    font-size:8.5px;
    line-height:1.2;
    padding-right:28px;
  }

  .stat-val{
    font-size:18px;
    line-height:1.05;
    padding-right:28px;
  }

  .stat-sub{
    font-size:9px;
    line-height:1.3;
  }

  .stat-icon{
    width:28px;
    height:28px;
    top:12px;
    right:10px;
  }

  .stat-icon svg{
    width:15px;
    height:15px;
  }

  .pembelian-toolbar{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }

  .pembelian-toolbar label{
    font-size:12px;
  }

  .pembelian-toolbar .search-box,
  .pembelian-toolbar input{
    width:100%;
    min-width:0;
  }

  .filter-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .btn-filter,
  .btn-reset{
    width:100%;
    padding:0 12px;
  }

  .table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .table-wrap table{
    min-width:950px;
  }
}


/* =========================
   DATA BARANG RESPONSIVE
========================= */

.barang-toolbar{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) 180px 90px auto;
  gap:10px;
  align-items:center;
}

.btn-cari-barang{
  height:46px;
  min-width:110px;
  padding:0 18px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:13px;
  font-weight:700;

  background:linear-gradient(
    135deg,
    var(--gold),
    var(--gold-hover)
  );
  color:#fff;
  border:none;
  box-shadow:var(--shadow-gold);
}

.btn-cari-kategori{
  height:46px;
  min-width:110px;
  padding:0 18px;
  background:linear-gradient(
    135deg, 
    var(--gold),
    var(--gold-hover));
color:#fff;
border:none;
box-shadow:var(--shadow-gold);
  display:flex;
  align-items:center;
  justify-content:center;

  font-size:13px;
  font-weight:700;
}


@media(max-width:768px){

  .barang-toolbar{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .barang-toolbar .search-box{
    grid-column:1 / -1;
    width:100%;
    min-width:0;
  }

  .barang-toolbar .filter-select{
    width:100%;
    height:42px;
  }

  .barang-toolbar .btn-cari-barang{
    width:100%;
    height:42px;
    background:linear-gradient(135deg,var(--gold),var(--gold-hover));
    color:#fff;
    border:none;
    box-shadow:var(--shadow-gold);
  }

  .barang-toolbar a.tb-btn{
    width:100%;
    height:42px;
    justify-content:center;
  }

  .card .table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .card .table-wrap table{
    min-width:900px;
  }
}

/* =========================
   KATEGORI MOBILE FIX
========================= */

@media(max-width:768px){

  .table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .table-wrap table{
    min-width:700px;
  }

  .btn-cari-kategori{
    width:100%;
    height:42px;
  }
}

/* =========================
   SUPPLIER MOBILE FIX
========================= */

.supplier-toolbar{
    display:grid;
    grid-template-columns:minmax(260px,1fr) auto auto;
    gap:10px;
    align-items:center;
}

.btn-cari-supplier,
.btn-cari-pelanggan,
.btn-cari-kategori{
    height:46px;
    min-width:110px;
    padding:0 18px;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:13px;
    font-weight:700;

    background:linear-gradient(
      135deg,
      var(--gold),
      var(--gold-hover)
    );
    color:#fff;
    border:none;
    box-shadow:var(--shadow-gold);
} 

@media(max-width:768px){

   .supplier-toolbar{
      grid-template-columns:1fr auto;
      gap:10px;
   }

   .supplier-toolbar .search-box{
      grid-column:1 / -1;
      width:100%;
   }

   .supplier-toolbar .btn-cari-supplier,
   .supplier-toolbar .tb-btn{
      height:42px;
      width:100%;
      justify-content:center;
   }

   .supplier-toolbar .tb-btn{
      background:linear-gradient(
         135deg,
         var(--gold),
         var(--gold-hover)
      );

      color:#fff;
      border:none;
      box-shadow:var(--shadow-gold);
   }

   .table-wrap{
      overflow-x:auto;
      -webkit-overflow-scrolling:touch;
   }

   .table-wrap table{
      min-width:850px;
   }
}

/* =========================
   PELANGGAN FINAL FIX
========================= */

.pelanggan-table-wrap table{
  min-width:780px;
}

@media(max-width:768px){
  .pelanggan-toolbar{
    grid-template-columns:1fr;
    gap:10px;
  }
  
  .pelanggan-toolbar .search-box,
  .pelanggan-toolbar .btn-cari-pelanggan{
    width:100%;
  }

  .pelanggan-toolbar .btn-cari-pelanggan{
    height:42px;
    justify-content:center;
     background:linear-gradient(
      135deg,
      var(--gold),
      var(--gold-hover)
    );

    color:#fff;
    border:none;
    box-shadow:var(--shadow-gold);
  }

  .pelanggan-table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

.pelanggan-table-wrap table{
  min-width:780px;
}

  .pelanggan-table-wrap th,
  .pelanggan-table-wrap td{
    white-space:nowrap;
  }

  .pelanggan-table-wrap .action-group{
    min-width:72px;
    display:flex;
    flex-direction:row;
    gap:6px;
    justify-content:center;
  }
}


/* =========================
   PRINT PDF FINAL
========================= */

@media print {

 @page{
    size:A4 landscape;
    margin:10mm;
 }

 html,
 body{
    overflow:visible !important;
    width:auto !important;
    height:auto !important;
    background:#fff !important;
 }

 .sidebar,
 .sidebar-overlay,
 .topbar,
 .toolbar,
 .tabs-wrap,
 .btn,
 .tb-btn,
 .menu-toggle,
 .no-print{
    display:none !important;
 }

 .app,
 .main,
 .content{
    display:block !important;
    width:100% !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
 }

 .card{
    width:100% !important;
    box-shadow:none !important;
    border:1px solid #ddd !important;
 }

 .table-wrap,
 .table-responsive,
 .history-table{
    overflow:visible !important;
    max-height:none !important;
 }

 table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
}
 thead{
    display:table-header-group;
 }

 tr{
    page-break-inside:avoid !important;
 }

body{
    zoom:70%;
}

th,td{
    font-size:9px !important;
    padding:4px 5px !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
}

 .print-title{
    display:block !important;
    text-align:center;
    margin-bottom:12px;
 }

 .stats-row,
 .stats-grid{
    display:none !important;
 }

}