:root{
    --bg-1: #0b0b0c;
    --bg-2: rgba(255,255,255,0.02);
    --panel: rgba(255,255,255,0.03);
    --muted: rgba(255,255,255,0.55);
    --accent: #5aa7ff;
    --accent-2: #376fd6;
    --glass-border: rgba(255,255,255,0.06);
    --unread: #ff6b6b;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(2,6,23,0.6);
    --accent-glow: rgba(90,167,255,0.12);
    --input-bg:#2b2b2b;
    --color-icon:#f0f0f0;
    --bg-color-icon:rgba(255,255,255,0.08);
    --bg-color-icon-hover:#555;
    --color-icon-hover:#fff;
  
  /* Memaksa skema warna dark untuk kontrol form (Chrome/Safari/Firefox) */
  color-scheme: dark;
}

/* ===== Light Theme Overrides ===== */
.theme-light{
  --bg-1: #f5f7fb;
  --bg-2: rgba(0,0,0,0.02);
  --panel: rgb(255, 255, 255);
  --muted: rgba(0,0,0,0.55);
  --accent: #3b82f6;
  --accent-2: #1d4ed8;
  --glass-border: rgba(0,0,0,0.08);
  --accent-glow: rgba(59,130,246,0.12);
  --input-bg:#f3f4f6;
  --color-icon:#111827;
  --bg-color-icon:rgba(102, 102, 102, 0.11);
  --bg-color-icon-hover:rgba(102, 102, 102, 0.354);
  --color-icon-hover:#111827;
  
  color-scheme: light;
}

.theme-light{
  background: linear-gradient(180deg,#f9fafb,#eef2f7);
  color:#111827;
}

.theme-light #content-header{
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
}

/* Input & Placeholder di mode terang */
.theme-light input,
.theme-light select,
.theme-light textarea {
  color: #111827;
  background: var(--input-bg);
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.theme-light input::placeholder,
.theme-light textarea::placeholder {
  color: rgba(0,0,0,0.45);
}

.theme-light input:focus,
.theme-light select:focus,
.theme-light textarea:focus {
  background: var(--input-bg);
  color: #111827;
  border-color: var(--accent);
}

/* Khusus search input di header */
.theme-light #search-input {
  background: var(--input-bg);
  color: #111827;
  border-color: #cbd5e1;
}
.theme-light #search-input::placeholder {
  color: rgba(0,0,0,0.45);
}

/* Placeholder di modal pengaturan kasir */
.theme-light #kasirSettingsModal .form-grid input[type='text']::placeholder {
  color: #666;
}

/* Autofill Chrome/Safari agar tidak jadi putih/kuning */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #e9eef8 !important;
  caret-color: #e9eef8 !important;
  /* Trik box-shadow untuk override background autofill */
  -webkit-box-shadow: 0 0 0px 1000px #111 inset !important;
  box-shadow: 0 0 0px 1000px #111 inset !important;
  transition: background-color 50000s ease-in-out 0s !important;
}

  *{box-sizing:border-box}
  html,body{height:100%; margin:0; font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial; background: linear-gradient(180deg,var(--bg-1), #070708); color:#e9eef8; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;overscroll-behavior: contain;background-color: #000;  
  user-select: none;
  -webkit-user-select: none; /* Chrome, Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE/Edge */}
  body.loading{opacity:0; transform:translateY(6px); transition:opacity 350ms ease, transform 350ms ease;}
  body.ready{opacity:1; transform:none}
  .container{display:flex; height:100vh; width:100vw; padding:28px; gap:24px; align-items:stretch; }
  
  #left-buttons {
      position: fixed;
      left: 20px;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      flex-direction: column;
      gap: 16px;
  }

  .theme-light .left-btn {
      background: var(--bg-color-icon);
      color: var(--color-icon);
      border: 1px solid var(--glass-border);
  }
  
  .theme-light .left-btn:hover {
      background: var(--bg-color-icon-hover);
      color: var(--color-icon-hover);
  }
  
  /* tombol ga bisa di select text */
  .disable_select_text {
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* standar */
  }
  
  .left-btn {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(90,167,255,0.2), rgba(55,111,214,0.3));
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 20px;
      cursor: pointer;
      box-shadow: 0 6px 20px rgba(38,84,160,0.25);
      border: 1px solid rgba(255,255,255,0.05);
      transition: all 0.2s ease;
  }
  
  .left-btn:hover,.left-btn.selected {
      transform: scale(1.12);
      box-shadow: 0 12px 28px rgba(55,111,214,0.35);
      background: linear-gradient(180deg, rgba(90,167,255,0.35), rgba(55,111,214,0.45));
  }
  
  
  
  
  /* Sidebar biar ke kanan */ 
  .sidebar{width:300px; margin-left: 60px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015)); border-radius: var(--radius); padding:14px; display:flex; flex-direction:column; border:1px solid var(--glass-border); backdrop-filter: blur(10px) saturate(120%); box-shadow: var(--shadow); min-height: calc(100vh - 56px);}
  .sidebar-header{display:flex; align-items:center; gap:12px; padding:12px 12px 12px 0; font-weight:600; color: #f3f6fb; font-size:14px; letter-spacing:0.2px; border-bottom: 1px solid rgba(255,255,255,0.02);} 
  .sidebar-sub{font-size:12px; color:var(--muted); margin-top:8px; margin-bottom:8px; padding:0 8px;}
  #client-list,#devices-list{flex:1; overflow:auto; display:flex; flex-direction:column; gap:8px; padding:10px;}
  .hide {
      display: none !important;
  }
  .client-item, .devices-item{
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 180ms cubic-bezier(.2,.9,.3,1), border-color 180ms ease, box-shadow 180ms ease;
    /* background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00)); */
    border: 1px solid transparent;
  }

  .client-item .sender-label{
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.2); /* semi-transparent background */
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 70%; /* agar tidak terlalu panjang */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    backdrop-filter: blur(4px) saturate(120%);
}

.client-item, .devices-item {
  position: relative; /* pastikan agar .sender-label posisinya absolut di dalam item */
}
.client-item:hover .sender-label{
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.8);
}
  
  .client-item:hover, .devices-item:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 0 14px rgba(90,167,255,0.12);
  }
  
  .client-item.selected, .devices-item.selected {
    background: linear-gradient(180deg, rgba(90,167,255,0.14), rgba(55,111,214,0.08));
    border: 1px solid rgba(58,126,220,0.25);
    box-shadow: 0 0 18px rgba(50,90,160,0.18), inset 0 1px 0 rgba(255,255,255,0.03);
    transform: none;
  }
  .client-item .avatar{width:38px; height:38px; border-radius:10px; background: linear-gradient(180deg,#111 30%, rgba(255,255,255,0.02)); display:flex; align-items:center; justify-content:center; font-weight:600; color:var(--muted); font-size:20px; border:1px solid rgba(255,255,255,0.03); flex: 0 0 38px;}
  .client-item .meta{display:flex; flex-direction:column; gap:2px; overflow:hidden;}
  .client-item .meta .title{font-size:13px; font-weight:600; color:#f7fbff; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}
  .client-item .meta .sub{font-size:12px; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}
  .client-item.unread::after{content: ""; width:10px; height:10px; border-radius:50%; background: var(--unread); margin-left: auto; box-shadow: 0 2px 6px rgba(255,107,107,0.12);} 
  .empty-placeholder{ padding:14px; color: #9aa3b2; font-style:italic; font-size:13px; }
  
  /* Chat area */
  #content-area,#devices-area{flex:1; display:flex; flex-direction:column; border-radius: var(--radius); overflow:hidden; background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.02); box-shadow: 0 10px 40px rgba(4,8,18,0.6);} 
  .theme-light #content-area{
    background: linear-gradient(180deg, rgba(245, 245, 245, 0.95), rgba(225, 225, 225, 0.88));
    box-shadow: 0 10px 40px rgba(4,8,18,0.1);
    border: 1px solid rgba(42, 42, 42, 0.398);
  }
  #content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}
.header-left .title {
  font-size: 18px;
  font-weight: 600;
  color: #f0f0f0;
}

.theme-light .header-left .title {
  color: #414141;
}

.header-left .sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.theme-light .header-left .sub {
  color: rgba(0, 0, 0, 0.5);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-actions .btn {
  background: var(--bg-color-icon);
  border: none;
  color:var(--color-icon);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, transform 0.1s;
}

.header-actions .btn:hover {
  background: var(--bg-color-icon-hover); /* sedikit lebih terang */
  color: var(--color-icon-hover);     /* teks lebih kontras */
}

.header-actions .btn i {
  font-size: 14px;
}

/* Form section title: untuk membedakan kelompok input seperti Harga Standart/Member */
.form-section-title {
  display: flex;
  align-items: center;
  margin: 8px 0 10px;
  padding: 8px 12px;
  color: #f7fbff94;
  background: rgba(0, 0, 0, 0.349);
  gap: 8px;
}

.theme-light .form-section-title {
  color: #414141;
}

.form-section-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5aa7ff59;
  box-shadow: 0 0 0 3px rgba(90,167,255,0.25);
}

.theme-light .form-section-title .dot{
  background: #414141;
  box-shadow: none;
}

.theme-light .subsection-title span{
  color: #414141;
}
  
#content{white-space: pre-wrap;word-break: break-word;flex:1; padding:5px; overflow:auto; display:flex; flex-direction:column; gap:14px; 
  /* background:rgb(31, 32, 35); */
  /* background-image: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.008), transparent 10%), radial-gradient(circle at 90% 90%, rgba(255,255,255,0.006), transparent 10%);  */
  scroll-behavior:smooth; position:relative;}
/* Tanpa padding saat mode tabel */
#content.table-content{ padding: 0;}
  
  .chat-message{padding:12px 16px; border-radius: 18px; max-width:66%; line-height:1.35; position:relative; backdrop-filter: blur(4px) saturate(120%); border: 1px solid rgba(255,255,255,0.03); transition: transform 180ms ease, box-shadow 200ms ease, opacity 220ms ease; opacity:0; transform: translateY(6px);}
  .chat-message.show{opacity:1; transform:none;}
  .chat-message.inbox{align-self:flex-start; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); color: #eaf0ff; box-shadow: 0 8px 20px rgba(2,6,23,0.35);} 
  .chat-message.outbox{align-self:flex-end; background: linear-gradient(180deg, rgba(90,167,255,0.18), rgba(55,111,214,0.12)); color: white; border: 1px solid rgba(65,120,210,0.12); box-shadow: 0 12px 30px rgba(38,84,160,0.12);} 
  .chat-message .image-message {
    max-width: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 4px;
  }
  
  .chat-message .image-message img {
    width: 100%;
    display: block;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  
  .chat-message .image-message img:hover {
    transform: scale(1.05);
  }
  .chat-message .meta{display:block; font-size:11px; color:rgba(255,255,255,0.6); margin-top:6px; opacity:0.85;}
  
  /* typing glow */
  .typing-glow{position:relative}
  .typing-glow::after{content:""; position:absolute; right:-8px; bottom:-8px; width:14px; height:14px; border-radius:50%; box-shadow:0 0 18px rgba(90,167,255,0.14); opacity:0; transition:opacity 180ms ease}
  .typing-active.typing-glow::after{opacity:1}
  
  /* subtle entrance */
  .fade-in-up{animation: fadeUp 360ms cubic-bezier(.2,.9,.3,1);} 
  @keyframes fadeUp{ from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }
  
  /* scrollbars */
  #client-list::-webkit-scrollbar, #content::-webkit-scrollbar{width:10px}
  #client-list::-webkit-scrollbar-thumb, #content::-webkit-scrollbar-thumb{ background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)); border-radius:10px; border: 1px solid rgba(255,255,255,0.02);} 
  #client-list::-webkit-scrollbar-track, #content::-webkit-scrollbar-track{ background:transparent;}
  
  @media (max-width:900px){ #sidebar{ width: 220px; } #contenter{ padding:12px; gap:12px; } }
  
  .logout-btn {
    position: fixed;
    top: 5px;
    right: 5px;
    color: rgba(255, 255, 255, 0.463);
    text-decoration: none;
    background: transparent;
    transition: 0.25s ease;
    border: none;
    font-size: 20px;
    cursor: pointer;
  }
  .logout-btn:hover {
    transform: scale(1.2); 
    color: #00eaff;
    text-shadow: 0 0 6px #00eaff, 0 0 12px #00eaff, 0 0 18px #00eaff;
  }
  
  .theme-light .logout-btn {
    color: rgba(0, 0, 0, 0.463);
  }
  
  .claim-btn {
    padding:6px 12px;
    border:none;
    border-radius:10px;
    color:white;
    font-weight:600;
    cursor:pointer;
    margin-left:auto;
    font-size:13px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display:none; /* default disembunyikan */
  }
  .claim-btn.show {
    display:inline-block;
  }
  .claim-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  }
  .claim-btn:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  #floating-popup {
      position: fixed;
      top: 20px;
      right: 20px;
      background: rgba(255, 90, 90, 0.95);
      color: white;
      padding: 12px 20px;
      border-radius: 12px;
      box-shadow: 0 4px 18px rgba(0,0,0,0.3);
      font-weight: 600;
      z-index: 9999;
      opacity: 0;
      transform: translateY(-20px);
      transition: opacity 0.4s ease, transform 0.4s ease;
  }
  #floating-popup.show {
      opacity: 1;
      transform: translateY(0);
  }
  
  .filter-btn {
    width:32px; height:32px; border-radius:50%; display:flex; justify-content:center; align-items:center;
    background: rgba(255,255,255,0.05); color:#cfe8ff; font-size:16px; cursor:pointer; border:1px solid rgba(255,255,255,0.08);
    margin-left:6px; transition: 0.2s ease;
  }
  .filter-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.1); }
  .filter-btn.selected { background: rgba(255,255,255,0.12); transform: scale(1.1); }
  
  /* ✨ APIWA label elegan kiri atas */
  #apiwa-label {
    position: fixed;
    left: 67px;
    top: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: rotate(90deg);
    transform-origin: left top;
    background: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 3px solid #00d0ff;
    padding: 12px 12px;
    border-radius: 0 16px 16px 0;
    color: #e0e0ff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(0, 208, 255, 0.25);
    cursor: default;
    user-select: none;
    opacity: 0.92;
    transition: all 0.3s ease;
  }
  
  /* ✨ Ikon kecil di depan teks */
  #apiwa-label i {
    font-size: 16px;
    color: #00eaff;
    text-shadow: 0 0 6px #00eaff;
    animation: apiwaPulse 2.5s infinite ease-in-out;
  }

  /* Override warna ikon plug dengan spesifitas lebih tinggi */
  #apiwa-label .plug-indicator {
    color: #00eaff; /* kembali neon cyan saat idle */
    text-shadow: 0 0 6px #00eaff;
    animation: apiwaPulse 2.5s infinite ease-in-out;
    transition: color 0.15s ease;
  }
  #apiwa-label .plug-indicator.busy {
    color: rgb(255, 255, 255); 
    text-shadow: 0 0 6px rgb(255, 255, 255);
  }
  
  /* ✨ Hover effect: lebih terang + neon glow */
  #apiwa-label:hover {
    opacity: 1;
    background: rgba(50, 50, 90, 0.75);
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.6), 0 0 10px rgba(0, 200, 255, 0.3);
  }
  #apiwa-label.offline {
    background: rgba(130, 20, 20, 0.6);
    border-left-color: #ffffff;
    color: #ffecec;
    box-shadow: none;
  }
  #apiwa-label.offline .plug-indicator {
    color: #ff6b6b;
    text-shadow: 0 0 6px #ff6b6b;
    animation: none;
  }

  #apiwa-label.established {
    background: rgba(30, 50, 30, 0.6);
    border-left-color: #ffffff;
    color: #ffecec;
    box-shadow: none;
  }
  #apiwa-label.established .plug-indicator {
    color: greenyellow;
    text-shadow: 0 0 6px greenyellow;
    animation: none;
  }
  
  /* ✨ Shine animation di hover */
  #apiwa-label:hover span {
    background: linear-gradient(90deg, #00eaff, #ffffff, #00eaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 2s linear infinite;
  }
  
  /* ✨ Animasi neon ikon */
  @keyframes apiwaPulse {
    0%, 100% { text-shadow: 0 0 6px #00eaff, 0 0 12px #00eaff; }
    50% { text-shadow: 0 0 12px #00ffff, 0 0 20px #00eaff; }
  }
  
  /* ✨ Animasi shine di teks */
  @keyframes shine {
    from { background-position: -100px; }
    to { background-position: 200px; }
  }
  
  /* efek disconnect: ikon dan garis merah kedip-kedip */
  #apiwa-label.disconnect i {
      color: #ff4d4f; /* merah */
      text-shadow: 0 0 6px #ff4d4f, 0 0 12px #ff4d4f;
      animation: blinkIcon 1s infinite;
  }
  
  /* garis kiri (border-left) kedip-kedip */
  #apiwa-label.disconnect {
      border-left-color: #ff4d4f;
      animation: blinkBorder 1s infinite;
  }
  
  /* Animasi kedip */
  @keyframes blinkIcon {
      0%, 50%, 100% { opacity: 1; }
      25%, 75% { opacity: 0; }
  }
  
  @keyframes blinkBorder {
      0%, 50%, 100% { border-left-color: #ff4d4f; }
      25%, 75% { border-left-color: transparent; }
  }
  
  
  .btn-delete {
      padding: 6px 12px;
      background-color: #ff4d4f;
      color: #fff;
      border: none;
      border-radius: 5px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s ease-in-out;
  }
  
  .btn-delete:hover {
      background-color: #ff7875;
      transform: translateY(-1px);
  }

   /* === GRID MODE === */
  /* === GRID MODE === */
  .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.45s cubic-bezier(.2,.9,.3,1);
  }
  .grid-container.rendering{
    opacity: 0;
    pointer-events: none;
  }
  .grid-container.hidden{
    display: none !important;
  }
  .middle-buttons{
    position: fixed;
    left: calc(28px + 60px + 300px + 12px - 63px);
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    z-index: 100;
    pointer-events: auto;
    background: rgba(24, 26, 28, 0.82);
    backdrop-filter: blur(8px);
    padding: 10px 0;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  .theme-light .middle-buttons{
    left: calc(28px + 60px + 300px + 12px - 64px);
    background: rgba(250, 250, 250, 0.92);
    border: 1px solid rgba(42, 42, 42, 0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }
  @media (max-width:768px){
    .middle-buttons{ display:none; }
  }
  .round-btn{
    width:auto;
    height:auto;
    border-radius:0;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.85);
    display:block;
    align-items:center;
    justify-content:center;
    font-size:18px;
    cursor:pointer;
    transition: transform 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: none;
    backdrop-filter: none;
  }
  .theme-light .round-btn{
    color: rgba(17,24,39,0.82);
  }
  .round-btn:hover{
    color: #9cc9ff;
    box-shadow: none;
    background: transparent;
  }
  .round-btn.active{
    color: #60a5fa;
    text-shadow: none;
  }
  .theme-light .round-btn.active, .theme-light .round-btn:hover{
    color:#2563eb;
    text-shadow: none;
  }

  .middle-separator{
    width: 80%;
    height: 1px;
    background: rgba(255,255,255,0.25);
    margin: 6px 0;
  }
  .theme-light .middle-separator{
    background: rgba(0,0,0,0.18);
  }
  .round-btn i{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    padding:13px 20px 13px 20px;
  }
  .round-btn i::before{
    line-height:1;
    display:inline-block;
  }

  .temp-tooltip2{
    /* text-shadow: 0 0 6px #00eaff, 0 0 12px #00eaff, 0 0 18px #00eaff; */
    /* background: linear-gradient(180deg, rgba(29, 46, 65, 1), rgba(17, 29, 53, 1)); */
    background: #000;
    color: #00eaff;
    display: flex;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 14px;
    /* font-weight: bold; */
    transition: opacity 0;
    z-index: 99999;
  }
  .theme-light .temp-tooltip2{
    background: orangered;
    color: #fff;
  }

  .product-card {
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--panel);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    overflow: hidden;
  }

  .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
  }

  .product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
  }

  .product-info {
    padding: 10px;
    text-align: center;
  }
  /* Grid: susun konten kolom dan pusatkan */
  .grid-container .product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .product-info h3 {
    margin: 5px 0;
    font-size: 15px;
  }

  .product-info p {
    margin: 3px 0;
    font-size: 13px;
    color: var(--muted);
  }
  
  .product-card.delete-mode, .product-card.edit-mode{
    cursor: pointer;
    border: 2px dashed #5aa7ff; /* border biru accent */
    box-shadow: 0 0 10px rgba(90,167,255,0.4);
    transition: border 0.15s ease, box-shadow 0.15s ease;
}
  
  .product-card .product-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    z-index: 10;
}

.product-card.delete-mode .product-checkbox {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.product-card.selected {
    border: 2px solid #5aa7ff;
    box-shadow: 0 0 10px rgba(90, 167, 255, 0.5);
    transform: scale(1.03);
}

  /* === LIST MODE === */
  .list-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 16px;
  }

  .list-mode .product-card {
    display: flex;
    align-items: center;
    background: var(--panel);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.2s, transform 0.2s;
    height: 85px;
    justify-content: space-between;
  }

  .list-mode .product-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
  }
  
.product-card.delete-mode,
.product-card.delete-mode:hover,
.product-card.delete-mode:active,
.product-card.delete-mode:focus,
.product-card.edit-mode,
.product-card.edit-mode:active,
.product-card.edit-mode:focus
{
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
}

.product-card.edit-mode:hover{
    border: 2px solid yellow;
}
.theme-light .product-card.edit-mode:hover{
    border: 2px solid orange;
}

.product-card.delete-mode.selected {
    border: 2px solid red;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

#btnHapusEksekusi {
    background-color: #e74c3c;
    color: white;
    border-color: #c0392b;
}

#btnHapusEksekusi:hover {
    background-color: red;
}

/* === TABLE MODE: edit-mode visual === */
.barang-table tbody tr.edit-mode,.barang-table tbody tr.delete-mode { cursor: pointer; }
.barang-table tbody tr.edit-mode td,.barang-table tbody tr.delete-mode td {
  outline: 2px dashed #5aa7ff;
  transition: outline-color 0.15s ease;
}

.barang-table tbody tr.edit-mode:hover td {
  outline-color: yellow;
}
.theme-light .barang-table tbody tr.edit-mode:hover td {
  outline-color: orange;
}

/* === TABLE MODE: delete-mode visual (row-level) === */
.barang-table tbody tr.delete-mode:hover td {
  outline-color: #ff4d4f;
}
.barang-table tbody tr.delete-mode:hover {
  background: #ff4d4f;
}
.barang-table tbody tr.delete-mode.selected {
  background-color: rgb(115, 38, 38) !important;
}

  .list-mode .product-left {
    display: flex;
    /* center vertical di cross-axis */
    align-items: center;
    /* rata kiri di main-axis */
    justify-content: flex-start;
    gap: 2px;
  }

  .list-mode .product-card img {
    width: 65px;
    height: 65px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
  }

  .list-mode .product-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  .list-mode .product-info h3 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
  }

  .list-mode .product-info p {
    margin: 2px 0;
    font-size: 13px;
    color: var(--muted);
  }

  /* === TABLE MODE === */
  .table-mode {
    display: block;              /* override grid */
    padding: 0;                  /* tanpa spasi, gunakan penuh */
    margin: 0;
    overflow-x: auto;            /* aktifkan scroll horizontal untuk banyak kolom */
    -webkit-overflow-scrolling: touch; /* smooth di mobile */
  }

  .table-mode .barang-table {
    width: max-content;          /* biarkan tabel melebar sesuai kolom */
    border-collapse: separate;   /* sticky header lebih konsisten */
    table-layout: auto;          /* kolom mengikuti konten */
    border-spacing: 0;           /* rapat antar sel, tanpa celah */
    background: var(--panel);
    overflow: visible;           /* jangan klip header sticky */
  }

.table-mode .barang-table thead {
  position: sticky;
  top: 0;
  z-index: 3;                    /* pastikan di atas body */
  background: #111;
  backdrop-filter: blur(3px);
}

.table-mode .barang-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.08));
  backdrop-filter: blur(3px);
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;           /* header rapi, tidak terpotong */
}

.theme-light .table-mode .barang-table thead th {
background: linear-gradient(
  180deg,
  rgba(245, 245, 245, 0.95),
  rgba(225, 225, 225, 0.88)
);
backdrop-filter: blur(4px);
box-shadow: 0 1px 4px rgba(0,0,0,0.05);



  color: rgba(44, 44, 44, 0.88);
}

/* Rata-kanan khusus untuk kolom angka agar seragam dengan isi */
.table-mode .barang-table thead th.text-right { text-align: right; }
.table-mode .barang-table tbody td.text-right { text-align: right; }

  .table-mode .barang-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
    word-break: break-word;
    font-size: 13px;
    color: rgba(255,255,255,0.82);
  }

  .theme-light .table-mode .barang-table tbody td {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.82);
  }

  .table-mode .barang-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
  }

  .table-mode .barang-table tbody tr:hover {
    background: rgba(255,255,255,0.10);
  }

  /* Alignment numerik: Stok, Harga Beli, Harga Jual, Harga Partai, Stok Min/Max */
  .table-mode .barang-table tbody td:nth-child(7),
  .table-mode .barang-table tbody td:nth-child(8),
  .table-mode .barang-table tbody td:nth-child(9),
  .table-mode .barang-table tbody td:nth-child(10),
  .table-mode .barang-table tbody td:nth-child(13),
  .table-mode .barang-table tbody td:nth-child(14) {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* Paksa kolom detail satuan selalu rata kiri, override indeks numerik */
  .table-mode .barang-table thead th.satuan-detail-col { text-align: left; }
  .table-mode .barang-table tbody td.satuan-detail-col { text-align: left; }

  /* Kode, Lokasi, Supplier: hindari terlalu panjang */
  .table-mode .barang-table tbody td:nth-child(1),
  .table-mode .barang-table tbody td:nth-child(11),
  .table-mode .barang-table tbody td:nth-child(12) {
    white-space: nowrap;
  }

  /* Warna ikon boolean agar kontras dan enak dilihat */
  .table-mode .barang-table tbody td .fa-check { color: #48cf61; }
  .table-mode .barang-table tbody td .fa-xmark { color: #ff6b6b; }

  /* Warna bintang rating di mode tabel */
  .table-mode .rating-stars { display: inline-flex; gap: 2px; align-items: center; }
  .table-mode .rating-stars .fa-solid.fa-star { color: #f4c542; }
  .table-mode .rating-stars .fa-regular.fa-star { color: rgba(255,255,255,0.40); }
  .theme-light .table-mode .rating-stars .fa-regular.fa-star { color: rgba(0,0,0,0.40); }



  /* Auto width: tidak set lebar kolom agar mengikuti konten */

  @media (max-width: 768px) {
    .table-mode {
      overflow-x: auto;          /* scroll horizontal jika perlu */
      padding: 0;                /* tetap tanpa spasi di mode tabel */
    }
    .table-mode .barang-table {
      min-width: 900px;          /* pastikan kolom tidak terlalu sempit */
    }
  }

  @media (max-width: 480px) {
    .product-card img {
      height: 120px;
    }
    .product-info h3 {
      font-size: 14px;
    }
    .product-info p {
      font-size: 12px;
    }
  }
  
  
/*loading saat load halaman*/
.loading-dots {
  display: none;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10px;
  width: 100%;
  pointer-events: none;
  z-index: 200;
}

.loading-dots span {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: #5aa7ff; /* warna accent */
  border-radius: 50%;
  opacity: 0.3;
  animation: fade 1s infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}
.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
.loading-dots span:nth-child(4) {
  animation-delay: 0.6s;
}

@keyframes fade {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ===== Sticky Nama bersyarat (hanya saat .sticky-nama aktif di mode tabel) ===== */
/* Sembunyikan kolom pertama (Kode) hanya saat sticky aktif */
.table-mode.sticky-nama .barang-table thead tr th:nth-child(1),
.table-mode.sticky-nama .barang-table tbody tr td:nth-child(1) {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important; /* tetap ada di DOM agar nth-child konsisten */
}

/* Tempelkan kolom kedua (Nama Barang) di sisi kiri saat scroll, hanya saat sticky aktif */
.table-mode.sticky-nama .barang-table thead tr th:nth-child(2) {
  position: sticky;
  left: 0 !important;
  z-index: 4; /* di atas body */
  background: #2f2f2f !important;     /* solid, tanpa transparansi */
  backdrop-filter: none !important; /* matikan blur/transparansi */
  background-clip: padding-box;
}
.table-mode.sticky-nama .barang-table tbody tr td:nth-child(2) {
  position: sticky;
  left: 0 !important;
  z-index: 2; /* di bawah header */
  background: #111;                /* solid agar tidak tembus */
  background-clip: padding-box;
  box-shadow: 1px 0 0 rgba(255,255,255,0.06); /* garis pemisah halus */
}


/*Content FIlter*/
.content-filter {
    display: none;           /* horizontal */
    flex-wrap: wrap;         /* pindah baris jika sempit */
    overflow-x: auto;        /* scroll horizontal jika panjang */
    overflow-y: hidden;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    gap: 10px;               /* jarak antar elemen */
    background: rgba(20, 20, 20, 0.95);
    border-radius: 6px;
    transition: all 0.3s ease;
    align-items: center; 
}

.content-filter::-webkit-scrollbar {
    height: 6px;  /* horizontal scrollbar */
}
.content-filter::-webkit-scrollbar-thumb {
    background: rgba(90,167,255,0.4);
    border-radius: 3px;
}
.content-filter::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}

.content-filter.show {
    display: flex;  /* tampilkan */
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center; /* center vertikal */
    gap: 8px;
}

/* label */
.filter-group label {
    margin: 0;
    line-height: 1;
    font-size: 13px;
}

.row.member-row{
  margin: 0;
  padding: 0;
}

.row.member-row div input{
  margin: 0;
}

/* select */
.filter-group select {
    margin: 0;
    padding: 4px 8px;
    height: 28px;       /* fix height */
    line-height: 1;     /* bantu vertical center */
    background: #1f1f1f;
    color: #eee;
    border: 1px solid #555;
    border-radius: 4px;
}

.filter-group button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    background:  rgba(255,255,255,0.08);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-group button:hover {
    background: #555;
}

.btn.active {
  background-color: var(--accent-2);
  color: #fff;
}
.btn.active:hover {
  background-color: var(--accent);
  color: #fff;
}

/* Search container theme selaras dengan header */
.search-container {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05); /* mirip panel sebelumnya */
  border-radius: 8px;
  align-items: center;
  max-width: 400px;
}

/* Input field */
#search-input {
    padding: 5px 10px;
    width: 200px;
    border: 1px solid #555;       /* border default gelap */
    border-radius: 5px;
    background: #0b0b0c;          /* sesuai tema gelap */
    color: #fff;                   /* teks putih */
    transition: all 0.2s ease;
}

input, select, textarea {
  padding: 6px 12px;
  font-family: Menlo, Monaco, 'Courier New', monospace;
  width: 100%;
  background: var(--input-bg);
  border: 1px solid #444;
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
  transition: all 0.2s ease;
  outline: none;
  color: #fff;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  resize: vertical;
}

.content-header{
    display: flex;
  align-items: center; /* vertikal center */
  gap: 8px;
}

#search-container input{
    font-size: 18px;
    width:300px;
}

input:focus, textarea:focus, select:focus {
    border-color: #0078d7;
    background: #252526;
}

#search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

/* Tombol OK */
#search-ok.btn {
  background: #5aa7ff;  /* accent color tema sebelumnya */
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#search-ok.btn:hover {
  background: #376fd6; /* accent-2 color */
}

.kategori{
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  width: 180px;
  position: sticky;
  top: 0;
}
.theme-light .kategori {
  background: rgba(20, 20, 20, 0.04);
}

.kategori-item + .kategori-item { margin-top: 6px; }
.kategori-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-weight: 600;
  color: #cfe8ff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin: 8px;
}
.theme-light .kategori-header {
  color: #111827;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.kategori-side-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cfe8ff;
  cursor: pointer;
}
.theme-light .kategori-side-item {
  color: #111827;
}
.kategori-sublist {
  margin-top: 6px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-light .kategori-sub-btn {
  color: #111827;
}
.kategori-sub-btn {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #cfe8ff;
  font-size: 12px;
  cursor: pointer;
}
.expand-icon {
  color: #9cc9ff;
  font-weight: 600;
  margin-left: 10px;
}
.theme-light .expand-icon {
  color: #111827;
}
.item-count-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  font-size: 12px;
  color: #cfe8ff;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  pointer-events: none;
}
.kategori-side-item.active {
  background: rgba(90,167,255,0.18);
  border-color: rgba(65,120,210,0.25);
  color: #eaf0ff;
  /* box-shadow: 0 0 10px rgba(90,167,255,0.25); */
}
.theme-light .kategori-side-item.active {
  color: #111827;
}
.kategori-sub-btn.active {
  background: rgba(90,167,255,0.12);
  border-color: rgba(65,120,210,0.22);
  color: #eaf0ff;
}
.kategori-sub-btn .kategori-sub-del-icon { display: none; }
.kategori-sub-btn.active .kategori-sub-del-icon { display: inline-block; }
.kategori-master-del-icon, .kategori-sub-del-icon {
  color: #ff6b6b;
}
.kategori-side-item .kategori-master-del-icon { display: none; }
.kategori-side-item.active .kategori-master-del-icon { display: inline-block; }
.kategori-master-del-icon:hover, .kategori-sub-del-icon:hover {
  color: orangered;
}
.theme-light .kategori-sub-btn.active {
  color: #111827;
}

#kategoriList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.utama {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
  height: 100svh;
}

.utama > #content {
  flex: 1;
  min-width: 0;
}

/* Info bar*/
#info-bar {
    display: none;          /* default disembunyikan */
    padding: 8px 15px;
    margin-bottom: 10px;
    background-color: rgba(50, 50, 50, 0.9); /* dark gray semi-transparent */
    color: #fff;            /* teks putih */
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#info-bar button {
    background-color: #e74c3c; /* merah */
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

#info-bar button:hover {
    background-color: #c0392b;
}

/*tambah barang*/
/* Modal backdrop */
.modal {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

/* Modal box */
.modal-content {
  background: #1c1c1c;
  width: 800px;
  border-radius: 12px;
  /* Izinkan konten modal di-scroll agar elemen tidak 'hilang ke atas' */
  overflow-y: auto;
  max-height: 90vh;
  position: relative; /* untuk posisi absolute child seperti listBox */
  display: flex;
  flex-direction: column;
}

.theme-light .modal-content{
  background: #f0f0f0;
}

.stok-cabang-list{
  margin-top:4px; 
  background:#222; 
  border:1px solid #444; 
  border-radius:8px; 
  padding:10px 12px; 
  color:#c7c7c7; 
  font-size:13px; 
  line-height:1.6;
}

.theme-light .stok-cabang-list{
  background: #f0f0f0;
}

.stok-cabang-row{
  display:flex; 
  align-items:center; 
  gap:10px; 
  padding:6px 0; 
  border-top:1px solid #1b1b1e;
}

.theme-light .stok-cabang-row{
  border-top:1px solid #d0d0d0;
}

.theme-light .stok-cabang-kode{
  color: #414141;
}

.form-body{
  padding: 20px;
}

#modalProduk .modal-content, #modalCustomer .modal-content{
  width: 820px;
}

#modalProduk, #modalCustomer {
  z-index: 305;
}

#modalKategori {
  z-index: 306;
}

#modalSupplier {
  z-index: 307;
}

/* Modal Format Serial harus di atas modal produk */
#modalSerialFormat {
  z-index: 306; /* satu tingkat di atas #modalProduk (305) */
}

/* Modal Hapus Semua: harus paling atas dan selalu di tengah */
#modalDeleteAll {
  z-index: 9999;
  align-items: center; /* pastikan tetap center, override responsif */
  justify-content: center;
}
/* Box modal hapus semua tidak fullscreen di mobile */
#modalDeleteAll .modal-content {
  width: 520px;
  max-width: 520px;
  min-height: auto;
  height: auto;
  border-radius: 12px;
  /* Samakan gaya dengan overlay Export/Import Excel */
  background: linear-gradient(180deg, #0b0b0c 0%, #12131a 100%);
  border: 1px solid #00eaff;
  box-shadow: 0 0 12px rgba(0,234,255,0.55), 0 0 24px rgba(0,234,255,0.35), inset 0 0 10px rgba(0,0,0,0.6);
  color: #cfe8ff;
  padding: 14px 18px;
}

/* Indikator koneksi backend (fa-plug) */
.plug-indicator {
  color: #9fb3c8; /* warna normal */
  transition: color 0.15s ease;
}
.plug-indicator.busy {
  color: orangered; /* saat request berjalan */
}

/* Tabs header */
.tab-header {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid #333;
  background: #222;
}

.theme-light .tab-header {
  background: #f0f0f0;
}

.tab-link {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px 14px;
  cursor: pointer;
  color: #f0f0f0;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.theme-light .tab-link {
  color: #414141;
}

.tab-link.active {
  background: #555;
  color: #fff; 
}
.tab-link:hover { 
  background: #555;
  color: #fff; 
}

/* Wrapper untuk isi tab dengan tinggi tetap */
.tab-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 350px;   /* tetap */
  background: #1c1c1c;
  overflow-y: hidden;  /* scroll ada di tiap tab, bukan wrapper */
  /* Hindari perubahan lebar akibat scrollbar muncul/hilang */
  scrollbar-gutter: stable;
  transition: none;
}

.theme-light .tab-content-wrapper {
  background: #f0f0f0;
}

/* Setiap tab-content ditumpuk di atas satu sama lain */
.tab-content {
  position: relative;  /* sebelumnya absolute */
  padding: 20px;
  display: none;
  height: 100%;
  overflow-y: auto;
  /* Stabilkan lebar konten saat scrollbar muncul/hilang */
  scrollbar-gutter: stable;
} 

.tab-content.active {
  display: block;
}

/* Inputan dan label */
label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: #ccc;
}

.theme-light label {
  color: #414141;
}

/* Radio & checkbox should not stretch like text inputs */
input[type="radio"], input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

/* Sort panel tidy styles */
.sort-group #applySort {
  margin-top: 10px;
  padding: 8px 14px;
  background: #5aa7ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.sort-group #applySort:hover { background: #3f8afc; }

.sort-options {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  overflow-x: auto;
  padding-bottom: 20px;
}
.sort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}
.sort-option input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #5aa7ff;
  border-radius: 50%;
  background: transparent;
  position: relative;
}
.sort-option input[type="radio"]:checked {
  background: #5aa7ff;
  box-shadow: inset 0 0 0 4px #1f1f1f;
}
.sort-option span {
  color: #eaeaea;
  font-size: 14px;
}

/* Footer buttons */
.form-footer {
  display: flex;
  justify-content: space-between;  /* kiri-kanan */
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #333;
  background: #222;
}

.theme-light .form-footer {
  background: #f0f0f0;
}

.form-header {
    display: none;
}

.form-row {
  display: flex;
  gap: 10px;  /* jarak antar kolom */
  margin-bottom: 10px;
}


.footer-left {
  font-size: 14px;
  color: #ccc;
}

.footer-right .btn {
  margin-left: 10px;  /* jarak antara Cancel & Simpan */
}
.btn {
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
.btn.cancel {
  background: #444;
  color: #eee;
  margin-right: 10px;
}
.btn.cancel:hover {
  background: #555; /* sedikit lebih terang */
  color: #fff;      /* teks lebih kontras */
}
.btn.save {
  background: #5aa7ff;
  color: #fff;
}
.btn.save:hover {
  background: #3f8afc;
}

.row {
  display: flex;
  gap: 12px; /* jarak antar kolom */
  margin-bottom: 12px;
}

.col-full {
  flex: 1; /* lebar penuh sisa */
}

.col-small {
  width: 150px; /* lebar tetap untuk kode */
}

.col-half {
  flex: 1; /* dua kolom sama lebar */
}

/*custom combobox*/
.input-wrapper {
  position: relative;
  font-size: 16px;
  width: 100%;
  margin-bottom: 12px;
}

.input-wrapper input {
  width: 100%;
  padding-right: 36px;
  box-sizing: border-box;
  margin-bottom: 0;
}

.input-wrapper .icon-btn {
  position: absolute;
  right: 4px;  /* jarak dari sisi kanan */
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-icon);
  cursor: pointer;
}

/* Offset khusus untuk tombol di input kasir agar tidak dempet */
#btnTogglelistgrid.input-btn,
.input-wrapper #btnTogglelistgrid {
  right: 40px; /* geser ke kiri dari tombol tambah barang */
}
.input-wrapper #btnTambahBarang {
  right: 4px; /* tetap di paling kanan */
}

/* Hover: neon lebih terang + glow */
.input-wrapper .icon-btn:hover {
  color: #00eaff;
  text-shadow: 0 0 6px #00eaff, 0 0 12px #00eaff, 0 0 18px #00eaff;
  transform: translateY(-50%) scale(1.2); /* sedikit membesar */
}

.remove-btn-customcombo:hover{
    color: #00eaff;
    text-shadow: 0 0 6px #00eaff, 0 0 12px #00eaff, 0 0 18px #00eaff;
}

/* Active / klik: neon merah + efek klik */
.input-wrapper .icon-btn:active {
  color: #ff6b6b;
  text-shadow: 0 0 6px #ff6b6b, 0 0 12px #ff6b6b, 0 0 18px #ff6b6b;
  transform: translateY(-50%) scale(1.1);
}

.list-box-customcombo {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(30,30,30,0.98);
  border: none; /* top tanpa border */
  /* Box shadow elegan: deep, netral, tanpa glow berlebihan */
  box-shadow:
     0 14px 28px rgba(0, 0, 0, 0.45),
     0 8px 16px rgba(0, 0, 0, 0.35),
     0 1px 0 rgba(255, 255, 255, 0.05) inset;
  /* tampilkan border atas agar terlihat jelas di bawah input */
  margin-top: 2px;
  box-sizing: border-box;
  will-change: top, left, width, opacity, transform;
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 1000; /* di atas form lainnya */
}
/* Animasi hide elegan saat dropdown ditutup */
.list-box-customcombo.hiding {
  animation: comboHideFade 100ms ease-in forwards;
  pointer-events: none;
  box-shadow: none; /* matikan glow saat hide agar tidak ada bayang bergerak */
}
@keyframes comboHideFade {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.list-item-customcombo {
  padding: 8px;
  cursor: pointer;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-item-customcombo:hover {
  background: #2a2a2a;
  /* Subtle hover outline yang kalem */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* Saat navigasi keyboard aktif, matikan efek hover agar tidak dobel highlight */
.list-box-customcombo.keyboard-mode .list-item-customcombo:hover:not(.active) {
  background: transparent;
  box-shadow: none;
}
/* Item aktif saat navigasi keyboard */
.list-item-customcombo.active {
  background: #2f2f2f75;
  /* Fokus elegan tanpa glow berlebihan */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* Enhancements for combo item layout */
.list-item-customcombo .combo-left{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-item-customcombo .combo-price{
  font-weight: 600;
  color: #21c57a; /* hijau lembut untuk harga */
}
.list-item-customcombo .combo-sub{
  font-size: 12px;
  color: #a9a9a9;
}
/* Highlight pencarian di dropdown */
.list-item-customcombo .combo-mark{
  background: #3a3a3a;
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}
.selected-area-customcombo, .option-product-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.option-product-area{
  padding: 10px 0;
}
.selected-box-customcombo, .option-product-content{
  width: 100%;
  background: var(--input-bg);
  padding:5px 10px;
  border-radius:5px;
  display:flex;
  align-items:center;
  border:1px solid #555;
  color: #fff;
}

/* Prefix label (beflabel) di selected-box dibuat lebih redup */
.selected-box-customcombo .pref-label{
  color: var(--muted);
}

.kasir .selected-box-customcombo{
  font-size: 14px;
}

.list-item-customcombo{
  font-size: 14px;
}

.option-product-content{
  padding: 4px 15px 4px 15px;
  border:none;
}

.selected-box-customcombo.padding-kanan{
  padding-right: 35px;
}
/* Susun konten kiri-kanan: teks kiri, toggle ke kanan */
.option-product-content {
  justify-content: space-between;
}
.option-product-content .toggle-wrapper {
  margin-left: auto;
}
.remove-btn-customcombo {
  background: none;
  color: var(--muted);
  border: none;
  font-size: 20px;
  font-weight: bold;
  margin-left: 6px;
  cursor: pointer;
}

/* Tombol trash di item listbox */
.trash-btn-customcombo{
  background: none;
  border: none;
  color: #ff6b6b;
  font-size: 16px;
  cursor: pointer;
  margin-right: 10px;
}

.trash-btn-customcombo:hover{
  color: #ff8a80;
}

/* ===== Light Theme Overrides: Custom Combo ===== */
.theme-light .list-box-customcombo {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
}
.theme-light .list-item-customcombo { color: #111827; }
.theme-light .list-item-customcombo:hover {
  background: rgba(0,0,0,0.06);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.theme-light .list-item-customcombo.active {
  background: rgba(59,130,246,0.12);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.26);
}
.theme-light .list-item-customcombo .combo-price { color: #16a34a; }
.theme-light .list-item-customcombo .combo-sub { color: #6b7280; }
.theme-light .list-item-customcombo .combo-mark {
  background: rgba(0,0,0,0.10);
  color: #111827;
}
.theme-light .selected-box-customcombo,
.theme-light .option-product-content{
  background: var(--input-bg);
  border-color: #cbd5e1;
  color: #111827;
}
.theme-light .remove-btn-customcombo { color: rgba(0,0,0,0.55); }
.theme-light .trash-btn-customcombo { color: #ef4444; }
.theme-light .trash-btn-customcombo:hover { color: #f87171; }

/* === Dropdown Barang: Grid Mode === */
.list-box-customcombo.grid-mode {
  /* tampil sebagai grid mirip kartu produk */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: minmax(86px, auto);
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}
.list-box-customcombo.grid-mode.keyboard-mode .list-item-customcombo:hover:not(.active) {
  background: transparent;
  box-shadow: none;
}
.list-box-customcombo.grid-mode .list-item-customcombo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  padding: 10px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.list-box-customcombo.grid-mode .list-item-customcombo:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 5px 15px rgba(0,0,0,0.6);
}
.list-box-customcombo.grid-mode .list-item-customcombo.active {
  outline: 2px dashed #5aa7ff;
  box-shadow: 0 0 10px rgba(90,167,255,0.4);
}
.list-box-customcombo.grid-mode .combo-price {
  align-self: flex-end;
}

/* Thumbnail untuk barang pada grid-mode */
.list-box-customcombo .combo-thumb { display: none; }
.list-box-customcombo.grid-mode .combo-thumb { display: block; width: 100%; }
.list-box-customcombo.grid-mode .combo-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--input-bg);
  margin-bottom: 6px;
}

.theme-light .list-box-customcombo.grid-mode {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
}
.theme-light .list-box-customcombo.grid-mode .list-item-customcombo {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.theme-light .list-box-customcombo.grid-mode .list-item-customcombo:hover {
  background: rgba(0,0,0,0.06);
  box-shadow: 0 5px 15px rgba(0,0,0,0.18);
}

/* ===== Rating Stars ===== */
.rating-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 2px;
  margin-top: 4px;
  line-height: 1;
}
.rating-stars .fa-star {
  font-size: 14px;
}
.rating-stars .fa-solid.fa-star {
  color: #f5b301;
}
.rating-stars .fa-regular.fa-star {
  color: #cbd5e1;
}

/* Override untuk list mode: bintang rata kiri */
.list-mode .rating-stars {
  justify-content: flex-start;
}

/* ===== iOS-style toggle for Open Price ===== */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ios-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 26px;
}
.ios-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ios-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #3c3c3c;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: background 180ms ease, box-shadow 180ms ease;
}
.ios-slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 180ms ease;
}
.ios-switch input:checked + .ios-slider {
  background: #34C759; /* iOS green */
}
.ios-switch input:checked + .ios-slider::before {
  transform: translateX(22px);
}

  
  
/* ===== Harga Bertingkat (Tab 4) ===== */
.tier-table {
  margin-top: 8px;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  overflow: visible;
  /* Standar tinggi kontrol di baris tier */
  --tier-input-height: 36px;
}
.tier-header, .tier-row {
  display: grid;
  gap: 8px;
  align-items: center;
}
#tierBody .tier-row, 
#tierBody2 .tier-row, 
#tierBody3 .tier-row, 
#tierBody4 .tier-row { align-items: start; }
.tier-header {
  background: #1f2430;
  color: #cfd8dc;
  padding: 10px 12px;
}
#tierBody .tier-row,
#tierBody2 .tier-row,
#tierBody3 .tier-row,
#tierBody4 .tier-row { padding: 10px 12px; border-top: 1px solid #2b2f3a; }
.tier-table #tierBody .tier-row > *,
.tier-table #tierBody2 .tier-row > *,
.tier-table #tierBody3 .tier-row > *,
.tier-table #tierBody4 .tier-row > * { align-self: start; } 
.tier-actions { padding: 10px 12px; border-top: 1px solid #2b2f3a; display:flex; justify-content:flex-end; }
.tier-row input[type="number"], .tier-row input[type="text"], .tier-row select { width: 100%; }
.tier-periode { display: flex; align-items: center; }
.theme-light .tier-periode .icon-btn { background: #aeaeae; color: #fff; border: 1px solid #838181; }
.theme-light .tier-periode .icon-btn:hover { background: #999797; }
.tier-periode .dash { margin: 0 8px; opacity: 0.7; }
/* Label keterangan baris kedua membentang seluruh kolom */
.tier-row .tier-note { grid-column: 1 / -1; margin-top: 6px; color: #cfd8dc; font-size: 13px; }
.tier-row .tier-note .note-title { font-weight: 600; margin-bottom: 6px; color: #e0e6eb; }
.theme-light .tier-row .tier-note .note-title { color: #000; }
.tier-row .tier-note .tier-note-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.tier-row .tier-note .note-field { display: flex; align-items: center; gap: 8px; position: relative; }
.tier-row .tier-note .note-field label { color: #9fb3c8; min-width: 70px; }
.theme-light .tier-row .tier-note .note-field label { color: #000; }
.tier-row .tier-note .note-field input[type="text"] { height: 30px; padding: 4px 8px; border-radius: 6px; border: 1px solid #3a4150; background: #1e232c; color: #e6eef5; }
.theme-light .tier-row .tier-note .note-field input[type="text"] { background: #fff; color: #111827; border-color: #d1d5db; }
.theme-light .tier-row .tier-note .note-field input[type="text"]::placeholder { color: #9ca3af; }
.tier-row .tier-note .note-results { position: absolute; top: 34px; left: 78px; min-width: 260px; max-height: 220px; overflow: auto; background: #202633; border: 1px solid #3a4150; border-radius: 6px; box-shadow: 0 6px 14px rgba(0,0,0,0.35); z-index: 100000; }
/* Pastikan kontainer input jadi stacking context di atas footer */
.tier-row .tier-note .note-field { position: relative; z-index: 100001; }
.tier-row .tier-note .note-result-item { padding: 6px 10px; cursor: pointer; color: #e6eef5; }
.tier-row .tier-note .note-result-item:hover { background: #2a3140; }
.tier-row .tier-note .hidden { display: none !important; }
/* Popover kalender untuk memilih periode mulai-sampai */
.tier-periode { position: relative; display: flex; align-items: stretch; gap: 6px; }
/* Hapus tombol kalender: gunakan input tanggal sebagai trigger popover */
.tier-periode .range-display input[type="date"] { cursor: pointer; }
.tier-periode .range-display { cursor: pointer; }
/* Pastikan semua konten di dalam range-display ber-cursor pointer */
.tier-periode .range-display * { cursor: pointer; }
/* Ikon calendar picker (Chrome/Safari) juga pointer */
.tier-periode .range-display input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
.tier-periode .range-popover {
  position: fixed; /* tampil di atas header modal dan mengikuti viewport */
  left: 0; /* akan di-set via JS saat dibuka */
  top: 0;  /* akan di-set via JS saat dibuka */
  z-index: 10000000; /* pastikan di atas header/modal lainnya */
  background: #1c1c1c;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  padding: 12px;
  width: 280px;
}
.tier-periode .range-popover.hidden { display: none; }
.tier-periode .range-popover.visible { display: block; }
.range-popover input[type="date"] { cursor: pointer; }
.range-popover input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
.range-popover .range-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.range-popover .range-row label {
  color: #cfd8dc;
  font-size: 13px;
}
.range-popover .range-actions { text-align: right; }
.range-popover .btnSetRange {
  padding: 6px 10px;
  background: #5aa7ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.range-popover .btnCloseRange {
  padding: 6px 10px;
  background: transparent;
  color: #cfd8dc;
  border: 1px solid #3a4150;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
}
.range-popover .btnCloseRange:hover { background: #2a3140; }

/* Samakan tinggi input tanggal dan tombol kalender di baris tier */
.tier-row input[type="date"]{
  margin-bottom: 0;
  height: var(--tier-input-height);
  font-size: 14px;
}
.tier-row .tier-pilihan, 
.tier-row .tier-operator {
  height: var(--tier-input-height);
  margin-bottom: 0;
  font-size: 14px;
  padding-right: 5px;
}
.tier-row .tier-jum1,
.tier-row .tier-jum2,
.tier-row .tier-nilai{
  height: var(--tier-input-height);
  margin-top: 0;
  margin-bottom: 0;
  font-size: 14px;
}
.tier-row .btnDelTier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px; /* vertikal diatur oleh height untuk menyamai input */
  border: 1px solid #2b2f3a;
  background: #222;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
  height: var(--tier-input-height);
}
.tier-row .tier-periode input
{ margin-top: 0; margin-bottom: 0; }

@media (max-width: 900px) {
  /* grid-template-columns dipindah ke templates/barang.html */
}

#previewGbrBarang{
  border: 2px solid #7a7a7a6f;
  border-radius: 10px;
}
#previewGbrBarang:hover{
  border: 2px solid #5aa7ff;
  border-radius: 10px;
  background-color: #0076d725;
}
/* Style untuk gambar kedua agar konsisten */
#previewGbrBarang2{
  border: 2px solid #7a7a7a6f;
  border-radius: 10px;
}
#previewGbrBarang2:hover{
  border: 2px solid #5aa7ff;
  border-radius: 10px;
  background-color: #0076d725;
}

/* Popup submenu untuk tombol Other */
.other-menu-popup {
  position: fixed;
  z-index: 9999;
  min-width: 280px;
  /* background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015)); */
  background: var(--bg-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(120%);
  transform: scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.other-menu-popup.show {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.other-menu-grid {
  display: flex;
  flex-direction: column; /* tata ke bawah */
  gap: 8px;
}
.other-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease, box-shadow 160ms ease;
  width: 100%; /* penuh lebar untuk list vertikal */
}
.theme-light .other-menu-item {
  background: rgba(0,0,0,0.06);
  color: #000;
  border: 1px solid rgba(0,0,0,0.05);
}
.other-menu-item i {
  font-size: 14px;
  color: var(--accent);
}
.other-menu-item:hover {
  background: rgba(255,255,255,0.10);
  /* transform: translateY(-1px); */
  box-shadow: 0 8px 24px rgba(4,8,18,0.35);
}
.other-menu-item.active {
  background: rgba(255,255,255,0.14);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,234,255,0.18) inset, 0 8px 24px rgba(4,8,18,0.35);
}
.theme-light .other-menu-item.active {
  background: rgba(0,0,0,0.08);
  border-color: var(--accent);
  color: #000;
}
.other-menu-popup::after {
  content: "";
  position: absolute;
  top: -7px;
  right: 22px;
  width: 14px;
  height: 14px;
  /* background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015)); */
  background: var(--bg-1);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  transform: rotate(45deg);
}
@media (max-width: 768px) {
  .other-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .other-menu-popup { min-width: 240px; }
}
/* Batch tab tweaks */
.batch-panel{background:#1f2024;border:1px solid #2f3136;border-radius:10px;padding:12px}
.theme-light .batch-panel{box-shadow: none;}
.batch-panel .row label{color:#c7c7c7}
.theme-light .batch-panel .row label{color:#000}
.batch-list{background:#1b1c20;border-radius:8px}
.batch-list div{padding:6px 4px}
.batch-input-no{padding: 7px;}
/* .batch-input-no,.batch-input-qty{background:#202226;border:1px solid #34363c;color:#e0e0e0;border-radius:6px;padding:8px} */
.batch-desc{color:#bdbdbda5; font-size: 14px;margin-bottom:10px;}
.theme-light .batch-desc{color:#000}
/* ===== Elegan NB (Batch & Serial) ===== */
.nb-panel { border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 12px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015)); box-shadow: var(--shadow); backdrop-filter: blur(8px) saturate(120%); transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.nb-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.theme-light .nb-title { color: #000; }
.nb-title strong { color: #f3f6fb; }
.theme-light .nb-title strong { color: #000; }
.nb-title .stok { color: var(--muted);}

.nb-list { margin-top: 0; }
.nb-list-header { display: grid; grid-template-columns: 2fr 1fr 36px; color: #aeb9c6; padding: 8px 10px; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)); font-size: 12px; letter-spacing: 0.2px; }
.nb-list-header.serial { grid-template-columns: 1.6fr 1fr 1fr 1.2fr 1fr 36px; }
.nb-hcell { margin-top: 2px; }
.theme-light .nb-hcell { color: #000; }
.nb-hcell--right { text-align: right; }
.nb-hcell--center { text-align: center; }
.nb-list-body { display: grid; grid-template-columns: 2fr 1fr 36px; grid-auto-rows: minmax(28px, auto); gap: 8px; padding: 8px 10px; }
.nb-list-body.serial { grid-template-columns: 1.6fr 1fr 1fr 1.2fr 1fr 36px; }
.nb-cell { margin-top: 2px; color: #bdbdbd; font-size: 14px;}
.theme-light .nb-cell { color: #000; }
.nb-cell--right { text-align: right;}
.nb-cell--action { display: flex; justify-content: center; align-items: center; align-self: center; }
.theme-light .nb-cell--action { color: #000; }
.nb-empty { grid-column: 1 / -1; color: var(--muted); font-style: italic; font-size: 13px; }

.nb-input-row { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0; }
.nb-input-col { display: flex; flex-direction: column; }
.theme-light .nb-input-col label { color: #000; }
.nb-input-col.w-2 { flex: 2; }
.nb-input-col.w-1 { flex: 1; }
.nb-input-col.w-actions { flex: 0; }
.nb-hidden-label { visibility: hidden; }
/* Serial input row: place action buttons side-by-side */
.nb-input-row--serial .nb-input-col.w-actions { flex-direction: row; align-items: center; gap: 8px; margin-top: 24px; }
.nb-input-row--serial .nb-input-col.w-actions .nb-hidden-label { display: none; }
/* Align items to top; offset actions to match input top (label height) */
.nb-input-row--serial { align-items: flex-start; }
/* .nb-input-col input[type="text"] { height: 30px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); color: #e6eef5; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.nb-input-col input[type="text"]::placeholder { color: rgba(233, 238, 248, 0.45); }
.nb-input-col input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); background: rgba(255,255,255,0.06); } */

/* Icon button khusus di NB list agar tidak bentrok dengan .input-wrapper */
.nb-list .icon-btn { width: 24px; height: 24px; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); color: #cfd8dc; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease; }
.nb-list .icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--unread); border-color: rgba(255,255,255,0.12); }
.nb-list .icon-btn:active { transform: scale(0.96); }
.nb-list .icon-btn:focus { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }

/* Responsif: rapikan input & grid di layar kecil */
@media (max-width: 640px) {
  .nb-input-row { flex-direction: column; gap: 8px; }
  .nb-input-col.w-actions { align-self: flex-end; }
  .nb-list-header { grid-template-columns: 1.6fr 0.8fr 32px; }
  .nb-list-body { grid-template-columns: 1.6fr 0.8fr 32px; }
}

/* Aksesibilitas: kurangi motion jika user prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .nb-panel, .nb-list .icon-btn, .nb-input-col input[type="text"] { transition: none; }
}
  /* ===== Light Theme: Master List clarity ===== */
  .theme-light .sidebar{
    background: rgba(203, 203, 203, 0.674);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  }
  .theme-light .sidebar-header{ color:#111827; border-bottom-color: rgba(0,0,0,0.06); }
  .theme-light .sidebar-sub{ color: rgba(0,0,0,0.55); }

  .theme-light .client-item, .theme-light .devices-item{
    /* background: rgb(232, 232, 232); */
    border: 1px solid none;
    /* box-shadow: 0 2px 16px rgba(0,0,0,0.08); */
  }
  .theme-light .client-item:hover, .theme-light .devices-item:hover{
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  }
  .theme-light .client-item.selected, .theme-light .devices-item.selected{
    background: #eaf2ff;
    border-color: #93c5fd;
    box-shadow: 0 8px 22px rgba(29,78,216,0.12);
  }

  .theme-light .client-item .meta .title{ color:#111827; }
  .theme-light .client-item .meta .sub{ color:#6b7280; }
  .theme-light .client-item .avatar{
    background: transparent;
    border: 1px solid transparent;
    color: #111827;
  }
  .theme-light .client-item .avatar i{ color:#111827; }
  .theme-light .client-item .sender-label{ background: rgba(0,0,0,0.06); color:#374151; }
  .theme-light .client-item:hover .sender-label{ background: rgba(0,0,0,0.08); color:#111827; }
