/* Theme picker */
.theme-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;margin-top:8px;}
.theme-option{display:flex;align-items:center;gap:8px;border:1.5px solid var(--line);border-radius:13px;padding:7px 9px;cursor:pointer;background:var(--card);font-size:11.5px;font-weight:700;color:var(--ink-soft);}
.theme-option.active{border-color:var(--primary);background:var(--primary-tint);color:var(--primary-dark);}
.theme-swatch{
  width:30px;height:30px;border-radius:9px;cursor:pointer;flex:0 0 auto;
  border:2px solid var(--line); display:flex;align-items:center;justify-content:center;
  transition:transform .12s, border-color .12s;
}
.theme-swatch.active{border-color:var(--primary);}
.theme-swatch svg{width:15px;height:15px;color:#fff;opacity:0;}
.theme-swatch.active svg{opacity:1;}
.theme-grid.colors-only{grid-template-columns:repeat(auto-fit,44px);justify-content:center;gap:10px;margin:0;width:100%;max-width:100%;}
.theme-grid.colors-only .theme-option{width:44px;height:44px;padding:5px;justify-content:center;border-radius:13px;}
.theme-grid.colors-only .theme-swatch{width:30px;height:30px;}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:stretch;}
.settings-grid>.card{margin:0;height:100%;}
.settings-wide{grid-column:1/-1;}
.channel-add-grid{display:grid;grid-template-columns:170px minmax(0,1fr) auto;gap:8px;margin-top:12px;align-items:stretch;}
.channel-add-grid select,.channel-add-grid input{width:100%;min-width:0;border:1.5px solid var(--line);background:var(--card);border-radius:12px;padding:10px 13px;font:inherit;color:var(--ink);}
.platform-choice{display:flex;align-items:center;gap:8px;min-width:0;}
.platform-choice img{width:30px;height:30px;border-radius:9px;object-fit:cover;flex:0 0 auto;border:1px solid var(--line-soft);}
.channel-picker-auto{display:grid;grid-template-columns:minmax(145px,.75fr) minmax(0,1.25fr);gap:8px;width:100%;min-width:0;}
.channel-picker-platform{display:flex;align-items:center;gap:7px;min-width:0;}
.channel-picker-platform img{width:32px;height:32px;border-radius:9px;object-fit:cover;flex:0 0 auto;border:1px solid var(--line-soft);display:none;}
.channel-picker-auto select{width:100%!important;min-width:0!important;min-height:46px;border:1.5px solid var(--line);background:var(--card);border-radius:12px;padding:10px 12px;font:inherit;color:var(--ink);}
@media (max-width:520px){.channel-picker-auto{grid-template-columns:1fr;}.channel-picker-platform img{width:28px;height:28px;}}
@media (max-width:620px){.channel-add-grid{grid-template-columns:1fr;}.channel-add-grid .btn{width:100%;}}


/* APK viewport fix: phone + tablet portrait always use a fixed visible viewport. */
@media (max-width:767px){
  body{padding:0;align-items:stretch;justify-content:stretch;}
  .device{width:100%;max-width:none;height:var(--app-height);min-height:0;max-height:var(--app-height);border-radius:0;border:none;box-shadow:none;}
  .topbar{padding-top:calc(18px + env(safe-area-inset-top));flex:0 0 auto;}
  .content{min-height:0;width:100%;max-width:720px;margin:0 auto;}
  .overlay{position:absolute;inset:0;}
  #onboarding .sheet{max-height:calc(var(--app-height) - 24px)!important;overflow-y:auto;margin:auto 12px!important;}
}
@media (min-width:421px) and (max-width:767px){
  .topbar{padding-left:28px;padding-right:28px;}
  .content{padding-left:24px;padding-right:24px;}
  .sheet{padding-left:24px;padding-right:24px;}
}
.settings-grid,.settings-grid>*,.card,.btn-row,.channel-add-grid,.platform-choice{min-width:0;max-width:100%;}
@media (max-width:620px){
  .settings-grid{grid-template-columns:minmax(0,1fr);}
  .settings-wide{grid-column:auto;}
  .settings-grid .btn-row{flex-wrap:wrap;}
  .settings-grid .btn-row>.btn{min-width:min(150px,100%);}
  .settings-grid [style*="display:flex"] input{min-width:0;}
}

@media (max-width:420px){
  body{padding:0;}
  .device{border-radius:0; min-height:var(--app-height); max-width:100%; border:none;}
  .settings-grid{grid-template-columns:1fr;}
  .settings-wide{grid-column:auto;}
  .theme-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .theme-grid.colors-only{grid-template-columns:repeat(auto-fit,44px);}
  .date-field-grid,.date-field-grid.date-grid-with-action{grid-template-columns:minmax(0,1fr)!important;}
  .date-field-grid.date-grid-with-action>:last-child{width:100%;}
}
@media (max-width:560px){
  .sheet .date-field-grid,.sheet .date-field-grid.date-grid-with-action{grid-template-columns:minmax(0,1fr)!important;}
  .sheet .date-field-grid.date-grid-with-action>:last-child{width:100%;}
  .audit-filter-grid{grid-template-columns:minmax(0,1fr);}
}

/* ======================================================
   TABLET / PC LAYOUT (Poco Pad C1 & perangkat layar lebar)
   Menambahkan sidebar navigasi + area konten lebar, tanpa
   mengubah struktur HTML maupun logika JavaScript.
   ====================================================== */
@media (min-width:768px){
  body{align-items:center; padding:28px 20px;}
  .device{
    max-width:1220px;
    width:100%;
    height:calc(var(--app-height) - 56px);
    min-height:560px;
    max-height:900px;
    border-radius:26px;
    display:grid;
    grid-template-columns:236px 1fr;
    grid-template-rows:auto 1fr;
    grid-template-areas:
      "nav top"
      "nav content";
    overflow:hidden;
    transition:grid-template-columns .22s ease;
  }
  .device.sidebar-collapsed{grid-template-columns:76px 1fr;}

  /* Sidebar navigasi (menggantikan bottom bar) */
  .navbar{
    grid-area:nav;
    position:relative;
    inset:auto;
    height:100%;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    align-content:flex-start;
    gap:8px;
    padding:26px 14px calc(20px + env(safe-area-inset-bottom));
    background:var(--card);
    backdrop-filter:none;
    border-top:none;
    border-right:1px solid var(--line);
  }
  .navbar::before{
    content:'';
    display:block;
    width:58px;
    height:58px;
    margin:0 0 12px 8px;
    flex:0 0 58px;
    background-image:var(--app-brand-logo);
    background-repeat:no-repeat;
    background-position:center;
    background-size:contain;
  }
  .sidebar-toggle{
    display:grid;place-items:center;position:absolute;right:12px;top:29px;width:30px;height:30px;
    border:1.5px solid var(--line);border-radius:10px;background:linear-gradient(145deg,#fff,var(--paper));color:var(--ink-soft);
    cursor:pointer;font-size:19px;line-height:1;z-index:2;transition:transform .2s,background .2s;
    box-shadow:inset 1px 1px 0 rgba(255,255,255,.9),0 4px 9px rgba(22,48,38,.13);
  }
  .sidebar-toggle:hover{background:var(--primary-tint);color:var(--primary);}
  .device.sidebar-collapsed .sidebar-toggle{right:23px;transform:rotate(180deg);}
  .device.sidebar-collapsed .navbar::before{visibility:hidden;height:50px;padding:0;}
  .device.sidebar-collapsed .navbar{padding-left:10px;padding-right:10px;}
  .device.sidebar-collapsed .navbtn{flex:0 0 auto;width:100%;justify-content:center;padding:10px 8px;gap:0;}
  .device.sidebar-collapsed .navbtn span{display:none;}
  .device.sidebar-collapsed .navbtn svg{width:42px;height:42px;}
  .device.sidebar-collapsed .navbtn.active{background:transparent;}
  .navbtn{
    flex:0 0 auto;
    width:100%;
    flex-direction:row;
    justify-content:flex-start;
    align-items:center;
    gap:12px;
    padding:12px 13px;
    border-radius:13px;
    font-weight:600;
  }
  .navbtn:hover{background:var(--paper);}
  .navbtn.active{background:var(--primary-tint); color:var(--primary-dark);}
  .navbtn{--nav-accent:var(--primary);--nav-soft:var(--primary-tint);}
  .navbtn[data-tab="dashboard"]{--nav-accent:#0f8f7d;--nav-soft:#d9f5ef;}
  .navbtn[data-tab="kas"]{--nav-accent:#2474b5;--nav-soft:#e0effb;}
  .navbtn[data-tab="gudang"]{--nav-accent:#7654b5;--nav-soft:#eee7fb;}
  .navbtn[data-tab="barcode"]{--nav-accent:#a05a2c;--nav-soft:#f8eadf;}
  .navbtn[data-tab="laporan"]{--nav-accent:#cf416a;--nav-soft:#fde5ec;}
  .navbtn[data-tab="lainnya"]{--nav-accent:#5d6770;--nav-soft:#e9edf0;}
  .navbtn svg{
    width:40px;height:40px;padding:9px;border-radius:13px;color:var(--nav-accent);
    background:var(--nav-soft);border:1px solid var(--line);
    box-shadow:inset 1px 1px 0 rgba(255,255,255,.95),0 5px 10px rgba(24,42,58,.13);
    background:linear-gradient(145deg,#fff 3%,var(--nav-soft) 56%,color-mix(in srgb,var(--nav-accent) 24%,var(--nav-soft)));
    border:1px solid color-mix(in srgb,var(--nav-accent) 25%,#fff);
    box-shadow:inset 1px 1px 0 rgba(255,255,255,.95),inset -2px -2px 5px color-mix(in srgb,var(--nav-accent) 13%,transparent),0 5px 10px color-mix(in srgb,var(--nav-accent) 19%,transparent);
    transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
    overflow:visible;
  }
  .navbtn:hover svg{transform:translateY(-2px);filter:saturate(1.08);}
  .navbtn.active svg{
    color:#fff;
    background:linear-gradient(145deg,color-mix(in srgb,var(--nav-accent) 72%,#fff),var(--nav-accent) 58%,color-mix(in srgb,var(--nav-accent) 72%,#000));
    border-color:color-mix(in srgb,var(--nav-accent) 72%,#fff);
    box-shadow:inset 1px 1px 0 rgba(255,255,255,.55),inset -3px -3px 7px rgba(0,0,0,.16),0 7px 14px color-mix(in srgb,var(--nav-accent) 34%,transparent);
    transform:translateY(-1px);
  }
  .navbtn span{font-size:13.5px;}

  /* Header atas konten */
  .topbar{
    grid-area:top;
    justify-content:space-between;
    align-items:center;
    padding:22px 32px 16px;
    border-bottom:1px solid var(--line-soft);
    gap:0;
  }
  .topbar .greet, .topbar .store, .topbar .date{text-align:left;}

  /* Area konten utama */
  .content{
    grid-area:content;
    padding:24px 32px 60px;
    max-width:820px;
    width:100%;
    margin:0 auto;
  }

  /* FAB mengikuti sudut kanan-bawah area konten, bukan seluruh device */
  .fab{right:40px; bottom:40px;}

  /* Sheet & onboarding tampil sebagai modal di tengah layar, bukan bottom sheet */
  .overlay{align-items:center; justify-content:center; padding:24px;}
  .sheet{
    max-width:560px;
    width:100%;
    max-height:86vh;
    border-radius:22px;
    padding:10px 22px 22px;
    transform:translateY(12px) scale(.98);
    box-shadow:0 28px 70px rgba(5,12,9,.28);
  }
  .sheet.modal-wide{max-width:720px;}
  .sheet.modal-compact{max-width:440px;}
  .overlay.show .sheet{transform:translateY(0) scale(1);}
}

/* APK keyboard fix: --app-height sudah berisi tinggi layar yang benar-benar terlihat. */
body.keyboard-open .fab{display:none!important;}
body.keyboard-open .navbar{display:none!important;}
@media (min-width:768px){
  body.keyboard-open{padding:0;align-items:stretch;}
  body.keyboard-open .device{display:flex;flex-direction:column;width:100%;max-width:none;height:var(--app-height);min-height:0;max-height:var(--app-height);border-radius:0;border:none;}
  body.keyboard-open .topbar{display:none!important;}
  body.keyboard-open .content{flex:1;min-height:0;max-width:none;padding:0;}
  body.keyboard-open .overlay .sheet{max-width:720px;}
}
body.keyboard-open .overlay{
  align-items:flex-start!important;
  justify-content:center!important;
  padding:calc(8px + env(safe-area-inset-top)) 8px 8px!important;
}
body.keyboard-open .overlay .sheet{
  width:100%!important;
  margin:0!important;
  max-height:calc(var(--app-height) - 16px - env(safe-area-inset-top))!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch!important;
  scroll-padding-top:64px;
  scroll-padding-bottom:32px;
}
body.keyboard-open .content{padding-bottom:18px;}

@media (min-width:1180px){
  .device{max-width:1320px;}
  .content{max-width:900px;}
}

/* ======================================================
   Ellinhijab-Produksi: adaptasi struktur nav dan tab.
   ====================================================== */
.nav-items{display:flex;flex:1;width:100%;min-width:0;}
.navbar::before{background-image:var(--app-brand-logo);}
.theme-option .check{font-size:15px;color:#fff;opacity:0;font-weight:900;line-height:1;}
.theme-option.active .check{opacity:1;}
@media (min-width:768px){
  .nav-items{display:flex;flex-direction:column;gap:8px;flex:0 0 auto;width:100%;}
  .navbtn[data-tab="dashboard"]{--nav-accent:#0f8f7d;--nav-soft:#d9f5ef;}
  .navbtn[data-tab="production"]{--nav-accent:#2474b5;--nav-soft:#e0effb;}
  .navbtn[data-tab="reject"]{--nav-accent:#cf416a;--nav-soft:#fde5ec;}
  .navbtn[data-tab="stock"]{--nav-accent:#7654b5;--nav-soft:#eee7fb;}
  .navbtn[data-tab="wages"]{--nav-accent:#a77a12;--nav-soft:#f5ebcb;}
  .navbtn[data-tab="finance"]{--nav-accent:#15735c;--nav-soft:#ddf2ea;}
  .navbtn[data-tab="master"]{--nav-accent:#a05a2c;--nav-soft:#f8eadf;}
  .navbtn[data-tab="history"]{--nav-accent:#4154b3;--nav-soft:#e1e6fa;}
  .navbtn[data-tab="settings"]{--nav-accent:#5d6770;--nav-soft:#e9edf0;}
}

/* Produksi > Cutting: responsif mengikuti lebar device tanpa scroll horizontal. */
.production-cutting-card{width:100%;max-width:100%;overflow:hidden;}
.production-cutting-card .table-wrap{width:100%;max-width:100%;overflow:hidden;}
.production-cutting-card .pager-row{width:100%;min-width:0;gap:12px;}
.production-cutting-card .pager-row span{flex:1;min-width:0;}
.production-cutting-table{
  width:100%;
  min-width:0!important;
  table-layout:fixed;
}
.production-cutting-table th,
.production-cutting-table td{
  min-width:0;
  padding:9px 5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.production-cutting-table th{
  padding-top:8px;
  padding-bottom:8px;
  font-size:9px;
  line-height:1.15;
}
.production-cutting-table th:nth-child(2),
.production-cutting-table td:nth-child(2){white-space:normal;line-height:1.2;}
/* Total Potongan wajib selalu terbaca penuh; header boleh turun dua baris. */
.production-cutting-table th:nth-child(4),
.production-cutting-table th:nth-child(5){white-space:normal;overflow:visible;text-overflow:clip;}
.production-cutting-table td:nth-child(4){white-space:nowrap;overflow:visible;text-overflow:clip;}
/* Tombol Detail dibuat compact agar kolom Aksi tidak memakan ruang. */
.production-cutting-table td:nth-child(9){overflow:visible;}
.production-cutting-table td:nth-child(9) .btn{
  min-height:30px;
  padding:6px 8px;
  border-radius:9px;
  font-size:11px;
  line-height:1;
  white-space:nowrap;
}

.cutting-route-actions{display:flex;gap:8px;flex-wrap:wrap;}
.cutting-route-actions .btn{flex:1 1 160px;min-width:0;}

.production-cutting-topbar{display:flex;align-items:stretch;justify-content:space-between;gap:12px;margin:0 0 12px;}
.cutting-pending-box{display:flex;align-items:center;justify-content:space-between;gap:18px;min-width:190px;padding:11px 14px;border:1px solid var(--line,#ddd);border-radius:14px;background:var(--card,#fff);color:inherit;font:inherit;cursor:pointer;}
.cutting-pending-box span{font-size:12px;font-weight:700;}
.cutting-pending-box b{display:grid;place-items:center;min-width:28px;height:28px;padding:0 7px;border-radius:999px;background:rgba(36,116,181,.12);font-size:12px;}
.production-cutting-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.cutting-filter-summary{margin:-2px 0 12px;padding:8px 10px;border:1px dashed var(--line,#ddd);border-radius:10px;font-size:10px;line-height:1.4;opacity:.8;}
.cutting-reject-note{margin-top:4px;font-weight:700;}
.cutting-worker-actions{flex-wrap:wrap;justify-content:flex-end;}
@media (max-width:640px){
  .production-cutting-topbar{align-items:stretch;flex-direction:column;}
  .cutting-pending-box{width:100%;min-width:0;}
  .production-cutting-actions{display:grid;grid-template-columns:1fr 1fr;}
  .production-cutting-actions .btn{width:100%;}
}

/* Desktop lebar: semua kolom tampil. */
@media (min-width:1100px){
  .production-cutting-table th:nth-child(1),.production-cutting-table td:nth-child(1){width:5%;}
  .production-cutting-table th:nth-child(2),.production-cutting-table td:nth-child(2){width:20%;}
  .production-cutting-table th:nth-child(3),.production-cutting-table td:nth-child(3){width:11%;}
  .production-cutting-table th:nth-child(4),.production-cutting-table td:nth-child(4){width:14%;}
  .production-cutting-table th:nth-child(5),.production-cutting-table td:nth-child(5){width:14%;}
  .production-cutting-table th:nth-child(6),.production-cutting-table td:nth-child(6){width:8%;}
  .production-cutting-table th:nth-child(7),.production-cutting-table td:nth-child(7){width:8%;}
  .production-cutting-table th:nth-child(8),.production-cutting-table td:nth-child(8){width:12%;}
  .production-cutting-table th:nth-child(9),.production-cutting-table td:nth-child(9){width:8%;}
}

/* Desktop/tablet sedang: nomor disembunyikan, informasi produksi utama tetap tampil. */
@media (min-width:901px) and (max-width:1099px){
  .production-cutting-table th:nth-child(1),.production-cutting-table td:nth-child(1){display:none;}
  .production-cutting-table th:nth-child(2),.production-cutting-table td:nth-child(2){width:22%;}
  .production-cutting-table th:nth-child(3),.production-cutting-table td:nth-child(3){width:11%;}
  .production-cutting-table th:nth-child(4),.production-cutting-table td:nth-child(4){width:14%;}
  .production-cutting-table th:nth-child(5),.production-cutting-table td:nth-child(5){width:14%;}
  .production-cutting-table th:nth-child(6),.production-cutting-table td:nth-child(6){width:8%;}
  .production-cutting-table th:nth-child(7),.production-cutting-table td:nth-child(7){width:9%;}
  .production-cutting-table th:nth-child(8),.production-cutting-table td:nth-child(8){width:13%;}
  .production-cutting-table th:nth-child(9),.production-cutting-table td:nth-child(9){width:9%;}
}

/* Tablet sempit: No dan Tahap pindah ke Detail, kolom utama tetap tampil. */
@media (min-width:768px) and (max-width:900px){
  .production-cutting-table th,.production-cutting-table td{padding-left:4px;padding-right:4px;font-size:11px;}
  .production-cutting-table th{font-size:8.5px;}
  .production-cutting-table th:nth-child(1),.production-cutting-table td:nth-child(1),
  .production-cutting-table th:nth-child(7),.production-cutting-table td:nth-child(7){display:none;}
  .production-cutting-table th:nth-child(2),.production-cutting-table td:nth-child(2){width:22%;}
  .production-cutting-table th:nth-child(3),.production-cutting-table td:nth-child(3){width:12%;}
  .production-cutting-table th:nth-child(4),.production-cutting-table td:nth-child(4){width:16%;}
  .production-cutting-table th:nth-child(5),.production-cutting-table td:nth-child(5){width:16%;}
  .production-cutting-table th:nth-child(6),.production-cutting-table td:nth-child(6){width:9%;}
  .production-cutting-table th:nth-child(8),.production-cutting-table td:nth-child(8){width:15%;}
  .production-cutting-table th:nth-child(9),.production-cutting-table td:nth-child(9){width:10%;}
}

/* Mobile/tablet portrait: tanpa scroll horizontal; Total Potongan selalu tampil penuh. */
@media (max-width:767px){
  .production-cutting-table th,.production-cutting-table td{padding:8px 4px;font-size:10.5px;}
  .production-cutting-table th{font-size:8px;letter-spacing:.03em;}
  .production-cutting-table th:nth-child(1),.production-cutting-table td:nth-child(1),
  .production-cutting-table th:nth-child(7),.production-cutting-table td:nth-child(7){display:none;}
  .production-cutting-table th:nth-child(2),.production-cutting-table td:nth-child(2){width:22%;}
  .production-cutting-table th:nth-child(3),.production-cutting-table td:nth-child(3){width:12%;}
  .production-cutting-table th:nth-child(4),.production-cutting-table td:nth-child(4){width:16%;}
  .production-cutting-table th:nth-child(5),.production-cutting-table td:nth-child(5){width:16%;}
  .production-cutting-table th:nth-child(6),.production-cutting-table td:nth-child(6){width:9%;}
  .production-cutting-table th:nth-child(8),.production-cutting-table td:nth-child(8){width:15%;}
  .production-cutting-table th:nth-child(9),.production-cutting-table td:nth-child(9){width:10%;}
  .production-cutting-table td:nth-child(9) .btn{min-height:26px;padding:4px 5px;font-size:9.5px;border-radius:8px;}
  .production-cutting-table .badge{padding:4px 6px;font-size:8px;}
}

/* Phone kecil: padatkan tipografi, tetapi Produk/Petugas/Total/Sudah/Sisa/Status/Aksi tetap ada. */
@media (max-width:420px){
  .production-cutting-table th,.production-cutting-table td{padding:7px 2px;font-size:9.5px;}
  .production-cutting-table th{font-size:7.5px;letter-spacing:.015em;}
  .production-cutting-table th:nth-child(2),.production-cutting-table td:nth-child(2){width:22%;}
  .production-cutting-table th:nth-child(3),.production-cutting-table td:nth-child(3){width:12%;}
  .production-cutting-table th:nth-child(4),.production-cutting-table td:nth-child(4){width:16%;}
  .production-cutting-table th:nth-child(5),.production-cutting-table td:nth-child(5){width:16%;}
  .production-cutting-table th:nth-child(6),.production-cutting-table td:nth-child(6){width:9%;}
  .production-cutting-table th:nth-child(8),.production-cutting-table td:nth-child(8){width:15%;}
  .production-cutting-table th:nth-child(9),.production-cutting-table td:nth-child(9){width:10%;}
  .production-cutting-table td:nth-child(9) .btn{min-height:24px;padding:3px 4px;font-size:8.5px;}
  .production-cutting-table .badge{padding:3px 4px;font-size:7.5px;}
}

/* Produksi: Jahit, Lubang, Kancing, QC, dan Finishing mengikuti pola tabel Cutting. */
.production-table-card{width:100%;max-width:100%;overflow:hidden;}
.production-table-card .table-wrap{width:100%;max-width:100%;overflow:hidden;}
.production-table-card .pager-row{width:100%;min-width:0;gap:12px;}
.production-table-card .pager-row span{flex:1;min-width:0;}
.production-data-table{
  width:100%;
  min-width:0!important;
  table-layout:fixed;
}
.production-data-table th,
.production-data-table td{
  min-width:0;
  padding:9px 5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.production-data-table th{
  padding-top:8px;
  padding-bottom:8px;
  font-size:9px;
  line-height:1.15;
  white-space:normal;
  text-overflow:clip;
}
.production-data-table td b{font-weight:800;}
.production-data-table td:last-child{overflow:visible;}
.production-data-table td:last-child .btn{
  min-height:30px;
  padding:6px 8px;
  border-radius:9px;
  font-size:11px;
  line-height:1;
  white-space:nowrap;
}
.production-data-table .badge{white-space:nowrap;}
.production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3),
.production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3),
.production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){white-space:normal;line-height:1.2;}

@media (min-width:1100px){
  .production-perk-table th:nth-child(1),.production-perk-table td:nth-child(1){width:5%;}
  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){width:15%;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:22%;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:13%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:13%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:9%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:13%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:10%;}

  .production-qc-table th:nth-child(1),.production-qc-table td:nth-child(1){width:5%;}
  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){width:12%;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:24%;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:11%;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:10%;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:9%;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:17%;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:12%;}

  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){width:6%;}
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:14%;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:25%;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:15%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:15%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:15%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:10%;}
}

@media (min-width:768px) and (max-width:1099px){
  .production-data-table th:nth-child(1),.production-data-table td:nth-child(1){display:none;}
  .production-data-table th,.production-data-table td{padding-left:4px;padding-right:4px;font-size:11px;}
  .production-data-table th{font-size:8.5px;}

  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){width:16%;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:23%;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:14%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:14%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:10%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:13%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:10%;}

  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){width:13%;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:25%;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:12%;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:10%;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:9%;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:19%;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:12%;}

  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:15%;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:28%;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:17%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:17%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:13%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:10%;}
}

@media (max-width:767px){
  .production-data-table th,.production-data-table td{padding:8px 3px;font-size:10px;}
  .production-data-table th{font-size:7.8px;letter-spacing:.025em;}
  .production-data-table th:nth-child(1),.production-data-table td:nth-child(1){display:none;}
  .production-data-table td:last-child .btn{min-height:26px;padding:4px 5px;font-size:9.5px;border-radius:8px;}
  .production-data-table .badge{padding:4px 5px;font-size:8px;}

  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){display:none;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:26%;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:17%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:17%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:11%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:17%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:12%;}

  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){display:none;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:28%;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:14%;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:12%;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:11%;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:21%;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:14%;}

  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){display:none;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:31%;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:20%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:20%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:17%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:12%;}
}

@media (max-width:420px){
  .production-data-table th,.production-data-table td{padding:7px 2px;font-size:9.2px;}
  .production-data-table th{font-size:7.2px;letter-spacing:.01em;}
  .production-data-table td:last-child .btn{min-height:24px;padding:3px 4px;font-size:8.5px;}
  .production-data-table .badge{padding:3px 4px;font-size:7.3px;}
}

/* Jahit dan Lubang mengikuti pola UI Cutting: tools terpisah, filter/laporan, detail ringkas. */
.production-perk-topbar{display:flex;align-items:stretch;justify-content:space-between;gap:12px;margin:0 0 12px;}
.perk-pending-box{display:flex;align-items:center;justify-content:space-between;gap:18px;min-width:190px;padding:11px 14px;border:1px solid var(--line,#ddd);border-radius:14px;background:var(--card,#fff);color:inherit;font:inherit;cursor:pointer;}
.perk-pending-box span{font-size:12px;font-weight:700;}
.perk-pending-box b{display:grid;place-items:center;min-width:28px;height:28px;padding:0 7px;border-radius:999px;background:rgba(36,116,181,.12);font-size:12px;}
.production-perk-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.perk-filter-summary{margin:-2px 0 12px;padding:8px 10px;border:1px dashed var(--line,#ddd);border-radius:10px;font-size:10px;line-height:1.4;opacity:.8;}
.perk-reject-note{margin-top:4px;font-weight:700;}
.perk-detail-summary{margin-bottom:10px;}
.perk-deposit-list{display:grid;gap:8px;}
.perk-deposit-card{margin:0;}
.perk-qc-sent{margin:0 0 10px;padding:9px 11px;border:1px solid var(--line,#ddd);border-radius:10px;font-size:11px;font-weight:700;}
.perk-detail-actions{flex-wrap:wrap;}
@media (max-width:640px){
  .production-perk-topbar{align-items:stretch;flex-direction:column;}
  .perk-pending-box{width:100%;min-width:0;}
  .production-perk-actions{display:grid;grid-template-columns:1fr 1fr;}
  .production-perk-actions .btn{width:100%;}
  .perk-detail-actions .btn{flex:1 1 140px;}
}

/* Tabel proses produksi tetap contained tanpa horizontal slide. */
@media (min-width:1100px){
  .production-perk-table th:nth-child(1),.production-perk-table td:nth-child(1){width:5%;display:table-cell;}
  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){width:13%;display:table-cell;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:20%;display:table-cell;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:10%;display:table-cell;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:12%;display:table-cell;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:12%;display:table-cell;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:8%;display:table-cell;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:12%;display:table-cell;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:8%;display:table-cell;}
}
@media (min-width:768px) and (max-width:1099px){
  .production-perk-table th:nth-child(1),.production-perk-table td:nth-child(1){display:none;}
  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){width:14%;display:table-cell;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:23%;display:table-cell;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:10%;display:table-cell;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:13%;display:table-cell;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:13%;display:table-cell;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:9%;display:table-cell;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:11%;display:table-cell;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:7%;display:table-cell;}
}
@media (max-width:767px){
  .production-perk-table th:nth-child(1),.production-perk-table td:nth-child(1),
  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){display:none;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:27%;display:table-cell;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:10%;display:table-cell;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:15%;display:table-cell;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:15%;display:table-cell;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:10%;display:table-cell;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:13%;display:table-cell;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:10%;display:table-cell;}
}
@media (max-width:420px){
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){display:none;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:30%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:17%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:17%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:11%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:15%;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:10%;}
}

/* QC & Finishing mengikuti pola tools produksi. */
.production-qc-topbar,.production-finishing-topbar{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:0 0 12px;}
.production-qc-actions,.production-finishing-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.qc-filter-summary,.finishing-filter-summary{margin:-2px 0 12px;padding:8px 10px;border:1px dashed var(--line,#ddd);border-radius:10px;font-size:10px;line-height:1.4;opacity:.8;}
.production-detail-summary{position:relative;margin-bottom:10px;}
.production-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px;}
.production-detail-grid>div{min-width:0;padding:8px 9px;border:1px solid var(--line,#ddd);border-radius:10px;}
.production-detail-grid span{display:block;font-size:9px;opacity:.7;margin-bottom:3px;}
.production-detail-grid b{display:block;font-size:12px;line-height:1.25;overflow-wrap:anywhere;}
.production-detail-grid .production-detail-wide{grid-column:1/-1;}
.production-detail-status{margin-top:10px;}
.production-detail-note{margin:0;}
.stock-warehouse-note{margin:-6px 0 10px;}
.production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){white-space:normal;line-height:1.15;}

/* QC tetap 8 kolom dan contained. */
@media (min-width:1100px){
  .production-qc-table th:nth-child(1),.production-qc-table td:nth-child(1){width:5%;display:table-cell;}
  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){width:11%;display:table-cell;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:24%;display:table-cell;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:11%;display:table-cell;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:10%;display:table-cell;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:9%;display:table-cell;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:18%;display:table-cell;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:12%;display:table-cell;}

  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){width:5%;display:table-cell;}
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:10%;display:table-cell;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:22%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:17%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:10%;display:table-cell;}
}
@media (min-width:768px) and (max-width:1099px){
  .production-qc-table th:nth-child(1),.production-qc-table td:nth-child(1),
  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){display:none;}
  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){width:12%;display:table-cell;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:27%;display:table-cell;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:12%;display:table-cell;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:10%;display:table-cell;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:9%;display:table-cell;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:18%;display:table-cell;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:10%;display:table-cell;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:24%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:13%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:13%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:18%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:10%;display:table-cell;}
}
@media (max-width:767px){
  .production-qc-topbar,.production-finishing-topbar{align-items:stretch;}
  .production-qc-actions,.production-finishing-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;}
  .production-qc-actions .btn,.production-finishing-actions .btn{width:100%;}
  .production-qc-table th:nth-child(1),.production-qc-table td:nth-child(1),
  .production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){display:none;}
  .production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:29%;display:table-cell;}
  .production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:14%;display:table-cell;}
  .production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:12%;display:table-cell;}
  .production-qc-table th:nth-child(6),.production-qc-table td:nth-child(6){width:10%;display:table-cell;}
  .production-qc-table th:nth-child(7),.production-qc-table td:nth-child(7){width:21%;display:table-cell;}
  .production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:14%;display:table-cell;}
  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1),
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){display:none;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:28%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:14%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:14%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:19%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:15%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:10%;display:table-cell;}
}
@media (max-width:420px){
  .production-detail-grid{grid-template-columns:1fr;}
  .production-detail-grid .production-detail-wide{grid-column:auto;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){display:none;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:31%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:16%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:23%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:18%;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:12%;}
}

/* Produksi: rapikan kolom proses & Finishing agar tidak terpotong. */
.production-perk-table td:nth-child(2),
.production-finishing-table td:nth-child(6){
  white-space:normal;
  overflow-wrap:anywhere;
  text-overflow:clip;
  line-height:1.15;
}
.production-perk-table td:nth-child(8) .badge,
.production-finishing-table td:nth-child(7) .badge{
  max-width:100%;
  white-space:normal;
  text-align:center;
  line-height:1.1;
}
.production-perk-table td:last-child,
.production-finishing-table td:last-child{
  overflow:hidden;
  text-overflow:clip;
}
.production-perk-table td:last-child .btn,
.production-finishing-table td:last-child .btn{
  width:100%;
  max-width:100%;
  min-width:0;
  padding-left:5px;
  padding-right:5px;
}

@media (min-width:768px) and (max-width:1099px){
  .production-perk-table th:nth-child(2),.production-perk-table td:nth-child(2){width:14%;}
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:21%;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:9%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:12%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:12%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:8%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:13%;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:11%;}

  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:10%;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:21%;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:13%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:13%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:18%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:13%;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:12%;}
}

@media (max-width:767px){
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:24%;}
  .production-perk-table th:nth-child(4),.production-perk-table td:nth-child(4){width:9%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:14%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:14%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:9%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:16%;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:14%;}

  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:25%;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:13%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:13%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:20%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:15%;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:14%;}
}

@media (max-width:420px){
  .production-perk-table th:nth-child(3),.production-perk-table td:nth-child(3){width:27%;}
  .production-perk-table th:nth-child(5),.production-perk-table td:nth-child(5){width:15%;}
  .production-perk-table th:nth-child(6),.production-perk-table td:nth-child(6){width:15%;}
  .production-perk-table th:nth-child(7),.production-perk-table td:nth-child(7){width:10%;}
  .production-perk-table th:nth-child(8),.production-perk-table td:nth-child(8){width:18%;}
  .production-perk-table th:nth-child(9),.production-perk-table td:nth-child(9){width:15%;}

  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:27%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:15%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:22%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:18%;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:18%;}
}

/* Stok: dua gudang dipisah sebagai tab, pola UI mengikuti Cutting/Produksi. */
.stock-page{width:100%;min-width:0;}
.stock-warehouse-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  width:100%;
  margin:0 0 18px;
}
.stock-warehouse-tab{
  min-width:0;
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  color:var(--ink);
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease;
}
.stock-warehouse-tab:hover{border-color:color-mix(in srgb,var(--primary) 38%,var(--line));background:var(--primary-tint);}
.stock-warehouse-tab.active{
  border-color:var(--primary);
  background:var(--primary);
  color:#fff;
  box-shadow:0 5px 12px color-mix(in srgb,var(--primary) 20%,transparent);
}
.stock-active-label{margin-bottom:10px;}
.stock-cutting-topbar{
  min-width:0;
  margin:0 0 10px;
}
.stock-cutting-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
  min-width:0;
  width:100%;
}
.stock-cutting-actions>.btn,
.stock-search-inline{
  width:100%;
  min-width:0;
  min-height:42px;
  height:100%;
}
.stock-cutting-actions>.btn{
  justify-content:center;
  white-space:normal;
  line-height:1.15;
  text-align:center;
}
.stock-search-inline{
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 11px;
  border:1.5px solid var(--line);
  border-radius:11px;
  background:var(--card);
  color:var(--slate);
}
.stock-search-inline:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 9%,transparent);}
.stock-search-inline svg{width:14px;height:14px;flex:0 0 14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;}
.stock-search-inline input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:11px;}
.stock-search-inline input::placeholder{color:var(--slate);opacity:.8;}
.stock-total-row{width:100%;margin:0 0 12px;}
.stock-total-box{
  width:100%;
  min-width:0;
  cursor:default;
  padding:10px 13px;
}
.stock-total-box span{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;}
.stock-total-box small{max-width:100%;font-size:8.5px;font-weight:600;color:var(--slate);line-height:1.2;white-space:normal;}
.stock-total-box b{flex:0 0 auto;}
.stock-filter-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:-2px 0 12px;
}
.stock-filter-summary span{min-width:0;overflow-wrap:anywhere;}
.stock-filter-summary .btn{flex:0 0 auto;}
.stock-legacy-note{margin:0 0 12px;padding:9px 11px;}
.stock-legacy-note .help-p{margin:0;}
.stock-section-label{margin-top:17px;}
.stock-table-card{width:100%;max-width:100%;overflow:hidden;}
.stock-table-wrap{width:100%;max-width:100%;overflow:hidden;}
.stock-table{width:100%;min-width:0!important;table-layout:fixed;}
.stock-table th,.stock-table td{min-width:0;padding:9px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;}
.stock-table th{padding-top:8px;padding-bottom:8px;font-size:9px;line-height:1.15;white-space:normal;text-overflow:clip;}
.stock-table td b{font-weight:800;}
.stock-product-cell{white-space:normal!important;line-height:1.2;text-align:left;}
.stock-reference-cell{white-space:normal!important;line-height:1.2;}
.stock-action-cell{overflow:visible!important;text-overflow:clip!important;}
.stock-action-cell .btn{min-height:30px;max-width:100%;padding:6px 8px;border-radius:9px;font-size:10px;line-height:1;white-space:normal;}
.stock-current-table .stock-action-cell .btn{width:100%;}
.stock-current-table .stock-product-cell .small{display:block;margin-top:3px;color:var(--slate);font-size:9px;font-weight:650;line-height:1.2;}
.stock-current-table th:nth-child(1),.stock-current-table td:nth-child(1){display:table-cell!important;}
.stock-current-table .stock-product-link b{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.25;}
.stock-empty-cell{padding:18px 10px!important;white-space:normal!important;}
.stock-empty-cell .empty{padding:0;}
.stock-pager{width:100%;min-width:0;gap:12px;}
.stock-pager span{flex:1;min-width:0;text-align:center;}
.stock-current-table th:nth-child(1),.stock-current-table td:nth-child(1){width:55%;text-align:left;}
.stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:17%;text-align:center;}
.stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:28%;text-align:center;}
.stock-movement-table th:nth-child(1),.stock-movement-table td:nth-child(1){width:15%;}
.stock-movement-table th:nth-child(2),.stock-movement-table td:nth-child(2){width:27%;text-align:left;}
.stock-movement-table th:nth-child(3),.stock-movement-table td:nth-child(3){width:13%;}
.stock-movement-table th:nth-child(4),.stock-movement-table td:nth-child(4){width:12%;}
.stock-movement-table th:nth-child(5),.stock-movement-table td:nth-child(5){width:21%;}
.stock-movement-table th:nth-child(6),.stock-movement-table td:nth-child(6){width:12%;}

@media (max-width:900px){
  .stock-cutting-actions{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:640px){
  .stock-warehouse-tabs{margin-bottom:14px;}
  .stock-warehouse-tab{min-height:38px;padding:8px 9px;font-size:10.5px;}
  .stock-cutting-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  .stock-cutting-actions>.btn,.stock-search-inline{min-height:40px;}
  .stock-filter-summary{align-items:stretch;}
  .stock-table th,.stock-table td{padding:8px 3px;font-size:10px;}
  .stock-table th{font-size:7.8px;letter-spacing:.025em;}
  .stock-action-cell .btn{min-height:26px;padding:4px 5px;font-size:9px;}
  .delivery-preview-actions{display:grid;grid-template-columns:1fr 1fr;}
  .delivery-preview-actions .btn{width:100%;}
  .stock-current-table th:nth-child(1),.stock-current-table td:nth-child(1){width:52%;}
  .stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:18%;}
  .stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:30%;}
  .stock-movement-table th:nth-child(5),.stock-movement-table td:nth-child(5){display:none;}
  .stock-movement-table th:nth-child(1),.stock-movement-table td:nth-child(1){width:20%;}
  .stock-movement-table th:nth-child(2),.stock-movement-table td:nth-child(2){width:36%;}
  .stock-movement-table th:nth-child(3),.stock-movement-table td:nth-child(3){width:16%;}
  .stock-movement-table th:nth-child(4),.stock-movement-table td:nth-child(4){width:13%;}
  .stock-movement-table th:nth-child(6),.stock-movement-table td:nth-child(6){width:15%;}
}
@media (max-width:420px){
  .stock-warehouse-tabs{gap:6px;}
  .stock-warehouse-tab{padding:7px 6px;font-size:9.5px;}
  .stock-current-table th:nth-child(1),.stock-current-table td:nth-child(1){width:50%;}
  .stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:18%;}
  .stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:32%;}
  .stock-movement-table th:nth-child(1),.stock-movement-table td:nth-child(1){width:21%;}
  .stock-movement-table th:nth-child(2),.stock-movement-table td:nth-child(2){width:38%;}
  .stock-movement-table th:nth-child(3),.stock-movement-table td:nth-child(3){width:16%;}
  .stock-movement-table th:nth-child(4),.stock-movement-table td:nth-child(4){width:11%;}
  .stock-movement-table th:nth-child(6),.stock-movement-table td:nth-child(6){width:14%;}
}

/* Master > Pelanggan: tetap satu pola dengan tabel Produksi. */
.master-tabs{margin:0 0 18px;}
.master-tabs button{flex:1;}
.master-customer-card{width:100%;max-width:100%;overflow:hidden;}
.master-customer-table{width:100%;min-width:0!important;table-layout:fixed;}
.master-customer-table th,.master-customer-table td{min-width:0;padding:9px 6px;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;}
.master-customer-table th{font-size:9px;line-height:1.15;white-space:normal;}
.master-customer-table td:first-child,.master-customer-table td:nth-child(3){white-space:normal;line-height:1.2;}
.master-customer-table th:nth-child(1),.master-customer-table td:nth-child(1){width:24%;}
.master-customer-table th:nth-child(2),.master-customer-table td:nth-child(2){width:21%;}
.master-customer-table th:nth-child(3),.master-customer-table td:nth-child(3){width:30%;}
.master-customer-table th:nth-child(4),.master-customer-table td:nth-child(4){width:14%;}
.master-customer-table th:nth-child(5),.master-customer-table td:nth-child(5){width:11%;overflow:visible;}
.master-wa-link{display:inline-flex;align-items:center;max-width:100%;color:var(--primary-dark);font-weight:800;text-decoration:none;white-space:nowrap;}
.master-wa-link:hover{text-decoration:underline;}
.master-customer-table td:last-child .btn{min-height:30px;padding:6px 8px;border-radius:9px;font-size:10px;white-space:nowrap;}
.delivery-preview-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);}
.delivery-preview-meta>div{min-width:0;display:flex;flex-direction:column;gap:2px;}
.delivery-preview-meta span{font-size:10px;color:var(--slate);}
.delivery-pdf-preview{height:min(54vh,520px);min-height:320px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;}
.delivery-pdf-preview iframe{display:block;width:100%;height:100%;border:0;background:#fff;}
.delivery-preview-actions{display:flex;flex-wrap:wrap;gap:8px;}
.delivery-preview-actions .btn{flex:1 1 120px;min-width:0;}
.delivery-preview-meta b{font-size:12px;line-height:1.25;}
@media (max-width:640px){
  .master-customer-table th,.master-customer-table td{padding:8px 3px;font-size:9.5px;}
  .master-customer-table th{font-size:7.8px;}
  .master-customer-table th:nth-child(3),.master-customer-table td:nth-child(3){display:none;}
  .master-customer-table th:nth-child(1),.master-customer-table td:nth-child(1){width:31%;}
  .master-customer-table th:nth-child(2),.master-customer-table td:nth-child(2){width:30%;}
  .master-customer-table th:nth-child(4),.master-customer-table td:nth-child(4){width:22%;}
  .master-customer-table th:nth-child(5),.master-customer-table td:nth-child(5){width:17%;}
  .master-wa-link{font-size:9px;}
  .delivery-pdf-preview{height:48vh;min-height:280px;}
}


/* ======================================================
   Keuangan: responsive mengikuti pola compact aplikasi
   dan pola search/filter Gudang Ellinhijab.
   ====================================================== */
.finance-page{width:100%;max-width:100%;min-width:0;overflow-x:hidden;container-type:inline-size;}
.finance-page>*{max-width:100%;min-width:0;}

/* Tipografi Keuangan: skala konsisten supaya tidak ada body tabel 14px bersebelahan dengan header 7-8px. */
.finance-page{font-size:12px;line-height:1.4;}
.finance-page .btn{font-size:12px;line-height:1.2;}
.finance-page .card-title{font-size:12.5px;line-height:1.3;}
.finance-page .pager-row span{font-size:10.5px;line-height:1.3;}

/* Tab Keuangan: ukuran/font konsisten, teks selalu terbaca, dan responsif terhadap lebar konten. */
.finance-tabs{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:8px;
  width:100%;
  max-width:100%;
  margin:0 0 14px;
  overflow:visible;
  align-items:stretch;
}
.finance-tabs button{
  width:100%;
  min-width:0;
  min-height:42px;
  height:auto;
  padding:7px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:normal;
  word-break:normal;
  font-size:12px;
  font-weight:700;
  line-height:1.15;
  text-align:center;
}

.finance-period{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;max-width:100%;}
.finance-period .btn{flex:1 1 108px;min-width:0;padding:8px 12px;white-space:normal;font-size:12px;line-height:1.2;}
.finance-period .btn.active{background:var(--primary);border-color:var(--primary);color:#fff;}

.finance-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px;width:100%;}
.finance-summary-card{min-width:0;max-width:100%;display:flex;flex-direction:column;justify-content:center;min-height:96px;}
.finance-summary-card .lbl,.finance-summary-card .val,.finance-summary-card .mini{text-align:center;}
.finance-summary-grid>.finance-summary-card:only-child{grid-column:1/-1;width:min(100%,460px);justify-self:center;}
.finance-summary-grid>.finance-summary-card:last-child:nth-child(odd):not(:only-child){grid-column:1/-1;width:calc(50% - 5px);justify-self:center;}
.finance-summary-card .val{font-size:18px;overflow-wrap:anywhere;}

/* Search/filter mengikuti pola Gudang: field rounded + icon + kontrol setinggi sama. */
.finance-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:8px;
  align-items:stretch;
  width:100%;
  max-width:100%;
  margin-bottom:10px;
}
.finance-search{position:relative;display:block;min-width:0;margin:0;}
.finance-search svg{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  width:16px;
  height:16px;
  color:var(--slate);
  pointer-events:none;
  z-index:1;
}
.finance-search input{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  height:44px;
  border:1.5px solid var(--line);
  background:var(--card);
  border-radius:12px;
  padding:10px 13px 10px 38px;
  font:inherit;
  font-size:13.5px;
  color:var(--ink);
  transition:border-color .15s,box-shadow .15s,background .15s;
}
.finance-search input:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-tint);
  background:var(--paper);
}
.finance-search input::placeholder{color:var(--slate);opacity:.9;}
.finance-toolbar-btn{min-height:44px;height:44px;padding:9px 14px;white-space:nowrap;font-size:12px;line-height:1.2;}
.finance-filter-summary{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  width:fit-content;
  max-width:100%;
  margin:-1px 0 11px;
  padding:6px 9px;
  border:1px solid var(--line-soft);
  border-radius:10px;
  background:var(--card);
  color:var(--slate);
  font-size:10.5px;
  line-height:1.35;
}
.finance-filter-summary span{font-weight:700;color:var(--primary-dark);}
.finance-filter-summary b{font-weight:650;color:var(--ink-soft);overflow-wrap:anywhere;}

/* Filter sheet mengikuti grid/filter panel pada sample Gudang. */
.finance-filter-panel{
  margin:10px 0 0;
  padding:12px;
  border:1.5px solid var(--line);
  border-radius:15px;
  background:var(--card);
}
.finance-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:end;}
.finance-filter-grid .field{margin:0;min-width:0;}
.finance-filter-grid select{min-height:46px;height:46px;background:var(--paper);}
.finance-filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px;}
.finance-filter-actions .btn{width:100%;min-width:0;font-size:12px;line-height:1.2;}

.finance-table-card{width:100%;max-width:100%;padding:0;overflow:hidden;}
.finance-table-card .table-wrap{width:100%;max-width:100%;min-width:0;overflow:hidden;}
.finance-table{width:100%;max-width:100%;min-width:0!important;table-layout:fixed;}
.finance-table th,.finance-table td{min-width:0;padding:10px 8px;white-space:normal;overflow-wrap:break-word;word-break:normal;vertical-align:middle;text-align:center;}
.finance-table td{font-size:11.5px;line-height:1.35;font-weight:500;}
.finance-table th{font-size:9.5px;line-height:1.2;font-weight:800;letter-spacing:.015em;}
.finance-table tbody tr{min-height:52px;}
.finance-table td b,.finance-table td strong{font-size:inherit;line-height:inherit;overflow-wrap:break-word;word-break:normal;}
.finance-table .small{margin-top:3px;font-size:9.5px;line-height:1.3;font-weight:500;color:var(--slate);}
.finance-table .badge{font-size:9.5px;line-height:1.1;padding:4px 7px;}
.finance-invoice-table th:nth-child(1),.finance-invoice-table td:nth-child(1){width:12%;}
.finance-invoice-table th:nth-child(2),.finance-invoice-table td:nth-child(2){width:9%;}
.finance-invoice-table th:nth-child(3),.finance-invoice-table td:nth-child(3){width:8%;}
.finance-invoice-table th:nth-child(4),.finance-invoice-table td:nth-child(4){width:12%;}
.finance-invoice-table th:nth-child(5),.finance-invoice-table td:nth-child(5){width:15%;}
.finance-invoice-table th:nth-child(6),.finance-invoice-table td:nth-child(6){width:10%;}
.finance-invoice-table th:nth-child(7),.finance-invoice-table td:nth-child(7){width:8%;}
.finance-invoice-table th:nth-child(8),.finance-invoice-table td:nth-child(8){width:9%;}
.finance-invoice-table th:nth-child(9),.finance-invoice-table td:nth-child(9){width:8%;}
.finance-invoice-table th:nth-child(10),.finance-invoice-table td:nth-child(10){width:9%;}
.finance-debt-table th:nth-child(1),.finance-debt-table td:nth-child(1){width:16%;}
.finance-debt-table th:nth-child(2),.finance-debt-table td:nth-child(2){width:14%;}
.finance-debt-table th:nth-child(3),.finance-debt-table td:nth-child(3){width:31%;}
.finance-debt-table th:nth-child(4),.finance-debt-table td:nth-child(4){width:11%;}
.finance-debt-table th:nth-child(5),.finance-debt-table td:nth-child(5){width:17%;}
.finance-debt-table th:nth-child(6),.finance-debt-table td:nth-child(6){width:11%;}
.finance-debt-table td:nth-child(3){font-size:inherit;line-height:inherit;}
.finance-expense-table th:nth-child(1),.finance-expense-table td:nth-child(1){width:16%;}
.finance-expense-table th:nth-child(2),.finance-expense-table td:nth-child(2){width:16%;}
.finance-expense-table th:nth-child(3),.finance-expense-table td:nth-child(3){width:16%;}
.finance-expense-table th:nth-child(4),.finance-expense-table td:nth-child(4){width:32%;}
.finance-expense-table th:nth-child(5),.finance-expense-table td:nth-child(5){width:20%;}
.finance-table .nowrap{white-space:nowrap;}
.finance-row-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;align-items:center;}
.finance-row-actions .btn{min-height:30px;padding:6px 8px;font-size:10.5px;line-height:1.1;}
.finance-source-card{padding:12px 14px;margin-bottom:10px;}
.finance-source-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.finance-source-main{min-width:0;}
.finance-source-main b{display:block;font-size:12.5px;line-height:1.3;}
.finance-source-main span{display:block;font-size:10.5px;line-height:1.35;color:var(--slate);margin-top:3px;}
.finance-source-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto;}
.finance-note{font-size:11px;color:var(--slate);line-height:1.5;overflow-wrap:anywhere;}
.finance-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;}
.finance-payment-list .row{align-items:flex-start;}
.finance-report-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.finance-report-controls .field:first-child{grid-column:1/-1;}
.finance-empty-metric{font-size:22px;font-weight:700;color:var(--slate);}

/* Keuangan: pola transaksi/pembayaran mengikuti sample Gudang Ellin. */
.finance-invoice-items{display:grid;gap:8px;margin-bottom:12px;}
.finance-invoice-item-row{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(150px,190px);gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--card);cursor:pointer;}
.finance-invoice-item-row>input[type="checkbox"]{width:18px;height:18px;margin:0;accent-color:var(--primary);}
.finance-invoice-item-info{min-width:0;}
.finance-invoice-item-info b{display:block;font-size:12px;line-height:1.3;overflow-wrap:anywhere;}
.finance-invoice-item-info small{display:block;margin-top:3px;font-size:10px;line-height:1.35;color:var(--slate);}
.finance-invoice-price-field{display:block;min-width:0;}
.finance-invoice-price-field small{display:block;margin-bottom:4px;font-size:10px;line-height:1.25;font-weight:700;color:var(--slate);}
.finance-invoice-price-field input{width:100%;height:38px;min-width:0;}
.finance-payment-panel{padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--card);margin:10px 0 12px;}
.finance-payment-panel .field{margin-top:0;margin-bottom:10px;}
.finance-payment-panel [hidden]{display:none!important;}
.finance-payment-preview{padding:9px 11px;border:1px solid var(--line-soft);border-radius:10px;background:var(--paper);font-size:10.5px;font-weight:700;line-height:1.4;color:var(--ink-soft);}
.finance-optional{font-weight:500;color:var(--slate);}
.finance-invoice-total-card{margin-top:10px;}
.finance-detail-items{width:100%;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--card);margin-bottom:12px;}
.finance-detail-items table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px;line-height:1.35;}
.finance-detail-items th,.finance-detail-items td{padding:8px 7px;border-bottom:1px solid var(--line-soft);text-align:left;overflow-wrap:anywhere;}
.finance-detail-items th{font-size:9.5px;line-height:1.2;color:var(--slate);text-transform:uppercase;}
.finance-detail-items th:nth-child(n+2),.finance-detail-items td:nth-child(n+2){text-align:right;}
.finance-detail-items tr:last-child td{border-bottom:0;}
.finance-party-invoices{padding:4px 10px;}
.finance-party-invoice-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;padding:10px 4px;border:0;border-bottom:1px solid var(--line-soft);background:transparent;color:var(--ink);text-align:left;cursor:pointer;}
.finance-party-invoice-row:last-child{border-bottom:0;}
.finance-party-invoice-row span{min-width:0;}
.finance-party-invoice-row b,.finance-party-invoice-row small{display:block;}
.finance-party-invoice-row small{margin-top:3px;color:var(--slate);font-size:10px;line-height:1.35;overflow-wrap:anywhere;}
.finance-party-invoice-row strong{flex:0 0 auto;font-size:11.5px;line-height:1.3;}
.finance-receivable-table th:nth-child(1),.finance-receivable-table td:nth-child(1){width:16%;}
.finance-receivable-table th:nth-child(2),.finance-receivable-table td:nth-child(2){width:11%;}
.finance-receivable-table th:nth-child(3),.finance-receivable-table td:nth-child(3){width:9%;}
.finance-receivable-table th:nth-child(4),.finance-receivable-table td:nth-child(4){width:12%;}
.finance-receivable-table th:nth-child(5),.finance-receivable-table td:nth-child(5){width:11%;}
.finance-receivable-table th:nth-child(6),.finance-receivable-table td:nth-child(6){width:12%;}
.finance-receivable-table th:nth-child(7),.finance-receivable-table td:nth-child(7){width:11%;}
.finance-receivable-table th:nth-child(8),.finance-receivable-table td:nth-child(8){width:9%;}
.finance-receivable-table th:nth-child(9),.finance-receivable-table td:nth-child(9){width:9%;}

/* Tablet / area konten sedang: 4 + 3 tab, baris kedua dipusatkan. */
@media (max-width:760px){
  .finance-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));}
  .finance-toolbar .finance-search{grid-column:1/-1;}
  .finance-toolbar-btn{width:100%;}
  .finance-summary-grid{grid-template-columns:1fr 1fr;}
  .finance-detail-grid{grid-template-columns:1fr;}
  .finance-report-controls{grid-template-columns:1fr;}
  .finance-report-controls .field:first-child{grid-column:auto;}
  .finance-filter-grid{grid-template-columns:1fr;}
  .finance-invoice-item-row{grid-template-columns:auto minmax(0,1fr);}
  .finance-invoice-price-field{grid-column:2;}
  .finance-table th,.finance-table td{padding:7px 4px;}
  .finance-table td{font-size:10.5px;line-height:1.35;}
  .finance-table th{font-size:9px;line-height:1.2;}
  .finance-table .small{font-size:9px;}
  .finance-invoice-table th:nth-child(2),.finance-invoice-table td:nth-child(2),
  .finance-invoice-table th:nth-child(3),.finance-invoice-table td:nth-child(3),
  .finance-invoice-table th:nth-child(7),.finance-invoice-table td:nth-child(7){display:none;}
  .finance-invoice-table th:nth-child(1),.finance-invoice-table td:nth-child(1){width:18%;}
  .finance-invoice-table th:nth-child(4),.finance-invoice-table td:nth-child(4){width:16%;}
  .finance-invoice-table th:nth-child(5),.finance-invoice-table td:nth-child(5){width:20%;}
  .finance-invoice-table th:nth-child(6),.finance-invoice-table td:nth-child(6){width:14%;}
  .finance-invoice-table th:nth-child(8),.finance-invoice-table td:nth-child(8){width:12%;}
  .finance-invoice-table th:nth-child(9),.finance-invoice-table td:nth-child(9){width:11%;}
  .finance-invoice-table th:nth-child(10),.finance-invoice-table td:nth-child(10){width:9%;}
  .finance-row-actions{gap:4px;}
  .finance-row-actions .btn{padding:5px 6px;font-size:10px;line-height:1.1;min-height:28px;}
}

/* Mobile table: ubah baris Keuangan menjadi card agar tidak tumpang tindih. */
@media (max-width:620px){
  .finance-table-card{background:transparent;border:0;box-shadow:none;overflow:visible;}
  .finance-table-card .table-wrap{overflow:visible;}
  .finance-responsive-table{display:block;table-layout:auto;background:transparent;}
  .finance-responsive-table thead{display:none;}
  .finance-responsive-table tbody{display:grid;gap:10px;width:100%;padding:0;}
  .finance-responsive-table tbody tr{display:block;width:100%;border:1px solid var(--line);border-radius:14px;background:var(--card);overflow:hidden;}
  .finance-invoice-table.finance-responsive-table td,
  .finance-receivable-table.finance-responsive-table td,
  .finance-debt-table.finance-responsive-table td,
  .finance-expense-table.finance-responsive-table td{
    display:grid!important;
    grid-template-columns:minmax(92px,.8fr) minmax(0,1.2fr);
    gap:12px;
    align-items:center;
    width:100%!important;
    min-width:0;
    padding:9px 12px;
    border:0;
    border-bottom:1px solid var(--line-soft);
    text-align:right;
    font-size:11px;
    line-height:1.35;
    font-weight:500;
    white-space:normal!important;
  }
  .finance-responsive-table tbody tr td:last-child{border-bottom:0;}
  .finance-responsive-table td::before{content:attr(data-label);font-size:9.5px;line-height:1.2;font-weight:800;color:var(--slate);text-align:left;text-transform:uppercase;letter-spacing:.025em;}
  .finance-responsive-table td[colspan]{display:block!important;text-align:center;padding:18px 12px;}
  .finance-responsive-table td[colspan]::before{display:none;}
  .finance-responsive-table .finance-row-actions{justify-content:flex-end;}
  .finance-responsive-table .badge{justify-self:end;}
}

/* Phone: 2 kolom konsisten, tab terakhir tetap di tengah. */
@media (max-width:520px){
  .finance-period .btn{flex:1 1 calc(50% - 4px);font-size:12px;}
  .finance-summary-grid{grid-template-columns:1fr;}
  .finance-summary-grid>.finance-summary-card:only-child,.finance-summary-grid>.finance-summary-card:last-child:nth-child(odd):not(:only-child){grid-column:auto;width:100%;}
  .finance-source-head{flex-direction:column;}
  .finance-source-actions{width:100%;}
  .finance-source-actions .btn{width:100%;}
  .finance-filter-panel{padding:10px;}
  .finance-search input{font-size:13px;}
  .finance-invoice-item-row{grid-template-columns:auto minmax(0,1fr);padding:9px;}
  .finance-invoice-price-field{grid-column:1/-1;padding-left:28px;}
  .finance-party-invoice-row{align-items:flex-start;}
}

/* Responsiveness tab mengikuti lebar area Keuangan, bukan lebar browser/sidebar. */
@container (max-width:980px){
  .finance-tabs{grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;}
  .finance-tabs button{grid-column:span 2;}
  .finance-tabs button:nth-child(5){grid-column:2 / span 2;}
  .finance-tabs button:nth-child(6){grid-column:4 / span 2;}
  .finance-tabs button:nth-child(7){grid-column:6 / span 2;}
}
@container (max-width:560px){
  .finance-tabs{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;}
  .finance-tabs button{grid-column:span 2;min-height:42px;padding:6px 7px;font-size:12px;}
  .finance-tabs button:nth-child(5),
  .finance-tabs button:nth-child(6){grid-column:span 2;}
  .finance-tabs button:nth-child(7){grid-column:2 / span 2;}
}

@media (max-width:380px){
  .finance-toolbar{grid-template-columns:1fr;}
  .finance-toolbar .finance-search{grid-column:auto;}
  .finance-filter-actions{grid-template-columns:1fr;}
  .finance-period .btn{flex-basis:100%;}
}

/* ======================================================
   Keuangan: HPP manual, Pengeluaran manual, dan Void.
   Menjaga pola compact/responsive yang sudah dipakai.
   ====================================================== */
.finance-invoice-item-row{
  grid-template-columns:auto minmax(0,1fr) minmax(132px,170px) minmax(132px,170px);
}
.finance-hpp-missing{font-size:10px;font-weight:700;color:var(--slate);}
.finance-row-void{opacity:.68;}
.finance-row-void td{text-decoration:none;}
.finance-void-banner,.finance-void-warning{
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid color-mix(in srgb,#b42318 24%,var(--line));
  border-radius:12px;
  background:color-mix(in srgb,#b42318 7%,var(--card));
  color:var(--ink);
  font-size:11px;
  line-height:1.45;
}
.finance-void-banner{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.finance-void-banner b{font-size:13px;color:#b42318;letter-spacing:.06em;}
.finance-detail-actions{flex-wrap:wrap;}
.finance-detail-actions .btn{flex:1 1 120px;min-width:0;}
.finance-hpp-edit-list{display:grid;gap:9px;margin:10px 0 12px;}
.finance-hpp-edit-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(140px,180px);
  gap:10px;
  align-items:end;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
}
.finance-hpp-edit-row>div:first-child{min-width:0;align-self:center;}
.finance-hpp-edit-row b,.finance-hpp-edit-row small{display:block;}
.finance-hpp-edit-row b{font-size:11.5px;line-height:1.3;overflow-wrap:anywhere;}
.finance-hpp-edit-row small{margin-top:3px;font-size:10px;line-height:1.35;color:var(--slate);}
.finance-hpp-edit-row .field{margin:0;}
.finance-expense-toolbar{grid-template-columns:minmax(0,1fr) auto;align-items:center;}
.finance-expense-toolbar .finance-note{padding:0 2px;}
.finance-expense-table th:nth-child(1),.finance-expense-table td:nth-child(1){width:13%;}
.finance-expense-table th:nth-child(2),.finance-expense-table td:nth-child(2){width:17%;}
.finance-expense-table th:nth-child(3),.finance-expense-table td:nth-child(3){width:27%;}
.finance-expense-table th:nth-child(4),.finance-expense-table td:nth-child(4){width:12%;}
.finance-expense-table th:nth-child(5),.finance-expense-table td:nth-child(5){width:15%;}
.finance-expense-table th:nth-child(6),.finance-expense-table td:nth-child(6){width:16%;}
.finance-profit-table th:nth-child(1),.finance-profit-table td:nth-child(1){width:13%;}
.finance-profit-table th:nth-child(2),.finance-profit-table td:nth-child(2){width:15%;}
.finance-profit-table th:nth-child(3),.finance-profit-table td:nth-child(3){width:20%;}
.finance-profit-table th:nth-child(4),.finance-profit-table td:nth-child(4){width:14%;}
.finance-profit-table th:nth-child(5),.finance-profit-table td:nth-child(5){width:14%;}
.finance-profit-table th:nth-child(6),.finance-profit-table td:nth-child(6){width:14%;}
.finance-profit-table th:nth-child(7),.finance-profit-table td:nth-child(7){width:10%;}

@media (max-width:760px){
  .finance-invoice-item-row{grid-template-columns:auto minmax(0,1fr) minmax(118px,150px);}
  .finance-invoice-price-field:last-child{grid-column:3;}
  .finance-expense-toolbar{grid-template-columns:1fr;}
  .finance-expense-toolbar .finance-toolbar-btn{width:100%;}
}

@media (max-width:620px){
  .finance-profit-table.finance-responsive-table td{
    display:grid!important;
    grid-template-columns:minmax(92px,.8fr) minmax(0,1.2fr);
    gap:12px;
    align-items:center;
    width:100%!important;
    min-width:0;
    padding:9px 12px;
    border:0;
    border-bottom:1px solid var(--line-soft);
    text-align:right;
    font-size:11px;
    line-height:1.35;
    font-weight:500;
    white-space:normal!important;
  }
  .finance-hpp-edit-row{grid-template-columns:1fr;}
}

@media (max-width:520px){
  .finance-invoice-item-row{grid-template-columns:auto minmax(0,1fr);}
  .finance-invoice-price-field:last-child{grid-column:1/-1;padding-left:28px;}
}


/* Upah/Gaji: list utama ringkas; informasi audit lengkap dibuka lewat Detail. */
.wage-list-card{
  padding:4px 16px;
  text-align:left;
  overflow:hidden;
}
.wage-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  min-width:0;
  padding:12px 2px;
  border-bottom:1px solid var(--line-soft);
  text-align:left;
}
.wage-row:last-of-type{border-bottom:0;}
.wage-main{min-width:0;}
.wage-person{
  color:var(--ink);
  font-size:13px;
  font-weight:800;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.wage-person.is-missing{
  color:var(--slate);
  font-size:11.5px;
  font-weight:700;
}
.wage-meta{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  margin-top:4px;
  color:var(--slate);
  font-size:10px;
  line-height:1.25;
}
.wage-division{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  min-height:19px;
  padding:3px 7px;
  border-radius:999px;
  background:var(--primary-tint);
  color:var(--primary-dark);
  font-size:9px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
}
.wage-product{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:600;
}
.wage-detail{
  margin-top:4px;
  color:var(--slate);
  font-size:10px;
  font-weight:600;
  line-height:1.25;
}
.wage-side{
  display:grid;
  grid-template-columns:auto auto;
  align-items:center;
  gap:10px;
  min-width:0;
}
.wage-total{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:4px;
  min-width:92px;
  text-align:right;
}
.wage-total strong{
  color:var(--ink);
  font-family:'Space Grotesk',sans-serif;
  font-size:13.5px;
  font-weight:800;
  line-height:1.15;
  white-space:nowrap;
}
.wage-total .badge{
  margin:0;
  font-size:8.5px;
  line-height:1;
  white-space:nowrap;
}
.wage-row-actions{display:flex;align-items:center;gap:6px;}
.wage-row-actions .btn{min-height:30px;padding:5px 8px;font-size:9.5px;white-space:nowrap;}
.wage-pay-btn{min-width:54px;}
.wage-pager{margin-top:4px;}
.wage-detail-card .diffline{align-items:flex-start;gap:14px;}
.wage-detail-card .diffline span{flex:0 0 42%;}
.wage-detail-card .diffline b{text-align:right;overflow-wrap:anywhere;}

@media (max-width:620px){
  .wage-list-card{padding:4px 12px;}
  .wage-row{gap:10px;padding:11px 0;}
  .wage-side{grid-template-columns:auto;gap:6px;justify-items:end;}
  .wage-row-actions{gap:5px;}
  .wage-row-actions .btn{min-height:28px;padding:4px 7px;font-size:9px;}
  .wage-total{min-width:82px;}
  .wage-total strong{font-size:12.5px;}
}

@media (max-width:420px){
  .wage-row{grid-template-columns:minmax(0,1fr) 88px;align-items:start;gap:8px;}
  .wage-person{font-size:12.5px;}
  .wage-meta{gap:5px;font-size:9.5px;}
  .wage-division{font-size:8.5px;padding:3px 6px;}
  .wage-detail{font-size:9.5px;}
  .wage-side{width:88px;}
  .wage-total{min-width:0;width:100%;}
  .wage-total strong{font-size:12px;}
  .wage-row-actions{width:100%;justify-content:flex-end;flex-wrap:wrap;}
  .wage-row-actions .btn{flex:1 1 auto;min-width:0;padding-left:5px;padding-right:5px;}
  .wage-detail-card .diffline{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr);gap:10px;}
  .wage-detail-card .diffline span{flex:none;}
}


/* Upah/Gaji: pencarian, filter audit, tanggal jelas, laporan dan slip. */
.wage-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:0 0 10px;
  min-width:0;
}
.wage-search{position:relative;display:block;flex:1 1 280px;min-width:180px;}
.wage-search svg{position:absolute;left:12px;top:50%;width:16px;height:16px;transform:translateY(-50%);color:var(--slate);pointer-events:none;}
.wage-search input{width:100%;min-width:0;min-height:38px;padding:8px 12px 8px 36px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:11.5px;outline:none;}
.wage-search input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent);}
.wage-tool-btn{min-height:38px;padding:7px 11px;font-size:10.5px;white-space:nowrap;}
.wage-filter-summary{margin:-2px 0 10px;padding:8px 10px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:10px;line-height:1.4;overflow-wrap:anywhere;}
.wage-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.wage-filter-wide{grid-column:1/-1;}
.wage-dates{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin-top:6px;color:var(--slate);font-size:9.5px;line-height:1.35;}
.wage-dates b{color:var(--ink-soft);font-size:inherit;font-weight:800;}

@media (max-width:900px){
  .wage-search{flex-basis:100%;}
  .wage-tool-btn{flex:1 1 120px;}
}
@media (max-width:620px){
  .wage-toolbar{display:grid;grid-template-columns:1fr 1fr;}
  .wage-search{grid-column:1/-1;min-width:0;}
  .wage-toolbar .wage-tool-btn{min-width:0;width:100%;}
  .wage-filter-grid{grid-template-columns:1fr;}
  .wage-filter-wide{grid-column:auto;}
  .wage-dates{display:grid;gap:3px;margin-top:7px;}
}
@media (max-width:420px){
  .wage-toolbar{grid-template-columns:1fr 1fr;gap:7px;}
  .wage-tool-btn{font-size:9.5px;padding-left:6px;padding-right:6px;}
  .wage-search input{font-size:10.5px;}
  .wage-dates{font-size:9px;}
}

/* Finishing -> Stok: hasil Finishing menunggu alokasi gudang berdasarkan Master Produk. */
.production-finishing-table td:nth-child(7){white-space:normal;line-height:1.15;}
.production-finishing-table td:nth-child(7) .badge{max-width:100%;white-space:normal;text-align:center;line-height:1.1;}
.production-finishing-table td:nth-child(9){overflow:hidden;text-overflow:clip;}
.production-finishing-table td:nth-child(9) .btn{width:100%;max-width:100%;min-width:0;padding-left:5px;padding-right:5px;}
@media (min-width:1100px){
  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){width:5%;display:table-cell;}
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:9%;display:table-cell;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:20%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:11%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:9%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:15%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:11%;display:table-cell;}
  .production-finishing-table th:nth-child(9),.production-finishing-table td:nth-child(9){width:8%;display:table-cell;}
}
@media (min-width:768px) and (max-width:1099px){
  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){display:none;}
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:9%;display:table-cell;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:22%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:11%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:9%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:16%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(9),.production-finishing-table td:nth-child(9){width:9%;display:table-cell;}
}
@media (max-width:767px){
  .production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1),
  .production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){display:none;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:27%;display:table-cell;}
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:13%;display:table-cell;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:10%;display:table-cell;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:18%;display:table-cell;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:12%;display:table-cell;}
  .production-finishing-table th:nth-child(9),.production-finishing-table td:nth-child(9){width:8%;display:table-cell;}
}
@media (max-width:420px){
  .production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){display:none;}
  .production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:31%;}
  .production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:16%;}
  .production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:12%;}
  .production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:22%;}
  .production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:12%;}
  .production-finishing-table th:nth-child(9),.production-finishing-table td:nth-child(9){width:7%;}
}

.stock-allocation-card{margin-bottom:18px;}
.stock-allocation-note{padding:10px 12px;border-bottom:1px solid var(--line-soft);font-size:10px;line-height:1.4;color:var(--slate);}
.stock-allocation-table th:nth-child(1),.stock-allocation-table td:nth-child(1){width:14%;}
.stock-allocation-table th:nth-child(2),.stock-allocation-table td:nth-child(2){width:31%;text-align:left;}
.stock-allocation-table th:nth-child(3),.stock-allocation-table td:nth-child(3){width:10%;text-align:center;}
.stock-allocation-table th:nth-child(4),.stock-allocation-table td:nth-child(4){width:23%;text-align:center;white-space:normal;}
.stock-allocation-table th:nth-child(5),.stock-allocation-table td:nth-child(5){width:22%;text-align:center;}
.stock-allocation-table td:nth-child(4) .badge{max-width:100%;white-space:normal;text-align:center;line-height:1.1;}
@media (max-width:640px){
  .stock-allocation-note{font-size:9.5px;}
  .stock-allocation-table th:nth-child(1),.stock-allocation-table td:nth-child(1){display:none;}
  .stock-allocation-table th:nth-child(2),.stock-allocation-table td:nth-child(2){width:35%;}
  .stock-allocation-table th:nth-child(3),.stock-allocation-table td:nth-child(3){width:12%;}
  .stock-allocation-table th:nth-child(4),.stock-allocation-table td:nth-child(4){width:25%;}
  .stock-allocation-table th:nth-child(5),.stock-allocation-table td:nth-child(5){width:28%;}
}
@media (max-width:420px){
  .stock-allocation-table th:nth-child(2),.stock-allocation-table td:nth-child(2){width:35%;}
  .stock-allocation-table th:nth-child(3),.stock-allocation-table td:nth-child(3){width:13%;}
  .stock-allocation-table th:nth-child(4),.stock-allocation-table td:nth-child(4){width:24%;}
  .stock-allocation-table th:nth-child(5),.stock-allocation-table td:nth-child(5){width:28%;}
  .stock-allocation-table .stock-action-cell .btn{font-size:8.5px;padding:4px;}
}


/* Stok batch: saldo produk tunggal + riwayat per produk + satu pengiriman multi-model. */
.stock-balance-note{padding:9px 11px;border-bottom:1px solid var(--line-soft);font-size:10px;line-height:1.4;color:var(--slate);}
.stock-product-link{display:flex;width:100%;min-width:0;flex-direction:column;align-items:flex-start;gap:3px;padding:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit;}
.stock-product-link b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.stock-product-link span{font-size:9px;font-weight:650;color:var(--slate);}
.stock-product-link:hover b{text-decoration:underline;}
.stock-product-history-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px;}
.stock-product-history-summary>div{display:flex;min-width:0;flex-direction:column;gap:3px;padding:8px 9px;border:1px solid var(--line-soft);border-radius:10px;background:var(--paper);}
.stock-product-history-summary span{font-size:9px;color:var(--slate);}
.stock-product-history-summary b{min-width:0;font-size:11px;overflow-wrap:anywhere;}
.stock-product-history-card{overflow:hidden;}
.stock-history-table{width:100%;min-width:0!important;table-layout:fixed;}
.stock-history-table th,.stock-history-table td{padding:8px 5px;min-width:0;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;}
.stock-history-table th:nth-child(1),.stock-history-table td:nth-child(1){width:18%;}
.stock-history-table th:nth-child(2),.stock-history-table td:nth-child(2){width:16%;}
.stock-history-table th:nth-child(3),.stock-history-table td:nth-child(3){width:14%;}
.stock-history-table th:nth-child(4),.stock-history-table td:nth-child(4){width:34%;white-space:normal;}
.stock-history-table th:nth-child(5),.stock-history-table td:nth-child(5){width:18%;}
.stock-batch-recipient{margin-bottom:10px;}
.stock-batch-items-card{padding:0;overflow:hidden;}
.stock-batch-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border-bottom:1px solid var(--line-soft);}
.stock-batch-head>div{display:flex;min-width:0;flex-direction:column;gap:2px;}
.stock-batch-head b{font-size:12px;}
.stock-batch-head small{font-size:9.5px;color:var(--slate);line-height:1.3;}
.stock-batch-list{display:grid;max-height:42vh;overflow-y:auto;}
.stock-batch-row{display:grid;grid-template-columns:minmax(150px,1.2fr) minmax(0,2fr);gap:10px;padding:10px 12px;border-bottom:1px solid var(--line-soft);}
.stock-batch-row:last-child{border-bottom:0;}
.stock-batch-check{display:flex;align-items:flex-start;gap:8px;min-width:0;cursor:pointer;}
.stock-batch-check input{margin-top:2px;flex:0 0 auto;}
.stock-batch-check span{display:flex;min-width:0;flex-direction:column;gap:3px;}
.stock-batch-check b{font-size:11px;line-height:1.25;overflow-wrap:anywhere;}
.stock-batch-check small{font-size:9px;color:var(--slate);line-height:1.3;}
.stock-batch-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
.stock-batch-fields .field{margin:0;}
.stock-batch-fields .field label{font-size:8.5px;}
.stock-batch-fields input{min-width:0;}
.stock-batch-billable{grid-column:1/-1;min-height:0;font-size:9px;font-weight:700;color:var(--slate);}
.stock-batch-payment{margin-top:10px;}
.stock-batch-total-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:8px;}
.stock-batch-total-grid>div{display:flex;min-width:0;flex-direction:column;gap:3px;padding:8px 9px;border:1px solid var(--line-soft);border-radius:10px;background:var(--paper);}
.stock-batch-total-grid span{font-size:8.5px;color:var(--slate);}
.stock-batch-total-grid b{font-size:11px;overflow-wrap:anywhere;}
.delivery-preview-meta small{max-width:100%;font-size:9px;color:var(--slate);line-height:1.3;overflow-wrap:anywhere;}
@media (min-width:901px){
  .stock-cutting-actions{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:640px){
  .stock-balance-note{font-size:9.5px;}
  .stock-product-history-summary{grid-template-columns:1fr 1fr;}
  .stock-batch-row{grid-template-columns:1fr;gap:8px;padding:10px;}
  .stock-batch-fields{grid-template-columns:repeat(3,minmax(0,1fr));}
  .stock-batch-billable{grid-column:auto;}
  .stock-batch-total-grid{grid-template-columns:1fr 1fr;}
  .stock-history-table th:nth-child(4),.stock-history-table td:nth-child(4){display:none;}
  .stock-history-table th:nth-child(1),.stock-history-table td:nth-child(1){width:24%;}
  .stock-history-table th:nth-child(2),.stock-history-table td:nth-child(2){width:20%;}
  .stock-history-table th:nth-child(3),.stock-history-table td:nth-child(3){width:20%;}
  .stock-history-table th:nth-child(5),.stock-history-table td:nth-child(5){width:36%;}
}
@media (max-width:420px){
  .stock-product-history-summary{grid-template-columns:1fr;}
  .stock-batch-head{align-items:flex-start;}
  .stock-batch-fields{grid-template-columns:1fr;}
  .stock-batch-total-grid{grid-template-columns:1fr;}
  .stock-batch-list{max-height:48vh;}
}

/* Reject: mengikuti pola Produksi/Stok — toolbar ringkas, tabel responsif, detail dipindah ke sheet. */
.reject-screen,.reject-division-screen{display:grid;gap:10px;min-width:0;}
.reject-panel,.reject-division-panel{width:100%;max-width:100%;overflow:hidden;padding:12px 14px;}
.reject-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px;min-width:0;}
.reject-search-wrap{position:relative;display:block;flex:1 1 300px;min-width:180px;}
.reject-search-wrap svg{position:absolute;left:12px;top:50%;width:16px;height:16px;transform:translateY(-50%);fill:none;stroke:var(--slate);stroke-width:1.8;pointer-events:none;}
.reject-search-wrap input{box-sizing:border-box;width:100%;min-width:0;min-height:38px;padding:8px 12px 8px 36px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:11.5px;outline:none;}
.reject-search-wrap input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent);}
.reject-tool-btn{min-height:38px;padding:7px 11px;font-size:10.5px;white-space:nowrap;}
.reject-tool-btn[disabled]{opacity:.42;cursor:default;}
.reject-filter-note{margin:-2px 0 10px;padding:8px 10px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:10px;line-height:1.4;overflow-wrap:anywhere;}
.reject-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.reject-table-wrap{width:100%;max-width:100%;overflow:hidden;}
.reject-table,.reject-division-table{width:100%;min-width:0!important;table-layout:fixed;}
.reject-table th,.reject-table td,.reject-division-table th,.reject-division-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reject-table td:nth-child(2),.reject-division-table td:nth-child(2){white-space:normal;line-height:1.18;}
.reject-table .badge,.reject-division-table .badge{max-width:100%;white-space:normal;text-align:center;line-height:1.1;}
.reject-spk-number{overflow-wrap:anywhere;word-break:break-word;}
.reject-mobile-meta{display:none;margin-top:3px;color:var(--slate);font-size:8.5px;font-weight:600;line-height:1.25;}
.reject-detail-btn,.reject-repair-btn{width:100%;max-width:100%;min-width:0;padding-left:5px!important;padding-right:5px!important;}
.reject-pager,.reject-pending-pager{width:100%;min-width:0;gap:12px;margin-top:10px;}
.reject-pager span,.reject-pending-pager span{flex:1;min-width:0;}

.reject-pending{padding:11px 13px;overflow:hidden;}
.reject-pending-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:7px;}
.reject-pending-title{font-size:12px;font-weight:800;line-height:1.2;}
.reject-pending-sub{margin-top:3px;color:var(--slate);font-size:10px;line-height:1.35;}
.reject-pending-count{display:grid;place-items:center;flex:0 0 auto;min-width:28px;height:28px;padding:0 7px;border-radius:999px;background:var(--amber-tint);color:var(--amber);font-size:11px;font-weight:800;}
.reject-pending-list{display:grid;}
.reject-pending-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;border-top:1px solid var(--line-soft);}
.reject-pending-row:first-child{border-top:0;}
.reject-pending-mark{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:var(--coral-tint);color:var(--coral);font-size:13px;font-weight:900;}
.reject-pending-body{min-width:0;}
.reject-pending-body b,.reject-pending-body span,.reject-pending-body small{display:block;min-width:0;overflow-wrap:anywhere;}
.reject-pending-body b{font-size:11.5px;line-height:1.25;}
.reject-pending-body span{margin-top:2px;color:var(--ink-soft);font-size:10px;font-weight:700;line-height:1.3;}
.reject-pending-body small{margin-top:2px;color:var(--slate);font-size:9.5px;line-height:1.3;}
.reject-pending-action{min-width:82px;white-space:nowrap;}

.reject-empty{min-height:92px;display:flex;align-items:center;justify-content:center;gap:10px;text-align:left;border:1px dashed var(--line);border-radius:12px;padding:14px;}
.reject-empty-icon{font-size:20px;color:var(--slate);}
.reject-empty b{display:block;font-size:12px;margin-bottom:2px;}
.reject-empty span{display:block;color:var(--slate);font-size:10px;line-height:1.45;}
.reject-detail-card .diffline{align-items:flex-start;}
.reject-detail-card .diffline b{max-width:62%;text-align:right;overflow-wrap:anywhere;white-space:normal;}
.reject-division-embedded{margin-top:10px;}

@media (min-width:1100px){
  .reject-table th:nth-child(1),.reject-table td:nth-child(1){width:15%;}
  .reject-table th:nth-child(2),.reject-table td:nth-child(2){width:23%;}
  .reject-table th:nth-child(3),.reject-table td:nth-child(3){width:13%;}
  .reject-table th:nth-child(4),.reject-table td:nth-child(4){width:8%;}
  .reject-table th:nth-child(5),.reject-table td:nth-child(5){width:9%;}
  .reject-table th:nth-child(6),.reject-table td:nth-child(6){width:12%;}
  .reject-table th:nth-child(7),.reject-table td:nth-child(7){width:13%;}
  .reject-table th:nth-child(8),.reject-table td:nth-child(8){width:7%;}
  .reject-division-table th:nth-child(1),.reject-division-table td:nth-child(1){width:17%;}
  .reject-division-table th:nth-child(2),.reject-division-table td:nth-child(2){width:27%;}
  .reject-division-table th:nth-child(3),.reject-division-table td:nth-child(3){width:9%;}
  .reject-division-table th:nth-child(4),.reject-division-table td:nth-child(4){width:10%;}
  .reject-division-table th:nth-child(5),.reject-division-table td:nth-child(5){width:14%;}
  .reject-division-table th:nth-child(6),.reject-division-table td:nth-child(6){width:13%;}
  .reject-division-table th:nth-child(7),.reject-division-table td:nth-child(7){width:10%;}
}
@media (min-width:768px) and (max-width:1099px){
  .reject-table th:nth-child(1),.reject-table td:nth-child(1){width:16%;display:table-cell;}
  .reject-table th:nth-child(2),.reject-table td:nth-child(2){width:25%;display:table-cell;}
  .reject-table th:nth-child(3),.reject-table td:nth-child(3){width:13%;display:table-cell;}
  .reject-table th:nth-child(4),.reject-table td:nth-child(4){width:8%;display:table-cell;}
  .reject-table th:nth-child(5),.reject-table td:nth-child(5){width:9%;display:table-cell;}
  .reject-table th:nth-child(6),.reject-table td:nth-child(6){width:12%;display:table-cell;}
  .reject-table th:nth-child(7),.reject-table td:nth-child(7){width:11%;display:table-cell;}
  .reject-table th:nth-child(8),.reject-table td:nth-child(8){width:6%;display:table-cell;}
  .reject-division-table th:nth-child(1),.reject-division-table td:nth-child(1){width:18%;display:table-cell;}
  .reject-division-table th:nth-child(2),.reject-division-table td:nth-child(2){width:29%;display:table-cell;}
  .reject-division-table th:nth-child(3),.reject-division-table td:nth-child(3){width:9%;display:table-cell;}
  .reject-division-table th:nth-child(4),.reject-division-table td:nth-child(4){width:10%;display:table-cell;}
  .reject-division-table th:nth-child(5),.reject-division-table td:nth-child(5){width:14%;display:table-cell;}
  .reject-division-table th:nth-child(6),.reject-division-table td:nth-child(6){width:12%;display:table-cell;}
  .reject-division-table th:nth-child(7),.reject-division-table td:nth-child(7){width:8%;display:table-cell;}
}
@media (max-width:767px){
  .reject-panel,.reject-division-panel{padding:10px;}
  .reject-search-wrap{flex-basis:100%;min-width:0;}
  .reject-tool-btn{flex:1 1 120px;}
  .reject-table th:nth-child(3),.reject-table td:nth-child(3),
  .reject-table th:nth-child(4),.reject-table td:nth-child(4),
  .reject-table th:nth-child(5),.reject-table td:nth-child(5),
  .reject-table th:nth-child(6),.reject-table td:nth-child(6){display:none;}
  .reject-table th:nth-child(1),.reject-table td:nth-child(1){width:22%;display:table-cell;}
  .reject-table th:nth-child(2),.reject-table td:nth-child(2){width:43%;display:table-cell;}
  .reject-table th:nth-child(7),.reject-table td:nth-child(7){width:22%;display:table-cell;}
  .reject-table th:nth-child(8),.reject-table td:nth-child(8){width:13%;display:table-cell;}
  .reject-division-table th:nth-child(3),.reject-division-table td:nth-child(3),
  .reject-division-table th:nth-child(4),.reject-division-table td:nth-child(4),
  .reject-division-table th:nth-child(5),.reject-division-table td:nth-child(5){display:none;}
  .reject-division-table th:nth-child(1),.reject-division-table td:nth-child(1){width:23%;display:table-cell;}
  .reject-division-table th:nth-child(2),.reject-division-table td:nth-child(2){width:41%;display:table-cell;}
  .reject-division-table th:nth-child(6),.reject-division-table td:nth-child(6){width:22%;display:table-cell;}
  .reject-division-table th:nth-child(7),.reject-division-table td:nth-child(7){width:14%;display:table-cell;}
  .reject-mobile-meta{display:block;}
  .reject-pending-row{grid-template-columns:28px minmax(0,1fr);}
  .reject-pending-action{grid-column:2;width:100%;min-width:0;margin-top:-2px;}
  .reject-filter-grid{grid-template-columns:1fr;}
  .reject-detail-card .diffline{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr);gap:10px;}
  .reject-detail-card .diffline b{max-width:none;}
}
@media (max-width:420px){
  .reject-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
  .reject-search-wrap{grid-column:1/-1;}
  .reject-tool-btn{width:100%;min-width:0;font-size:9.5px;padding-left:6px;padding-right:6px;}
  .reject-search-wrap input{font-size:10.5px;}
  .reject-table th:nth-child(1),.reject-table td:nth-child(1){width:24%;}
  .reject-table th:nth-child(2),.reject-table td:nth-child(2){width:41%;}
  .reject-table th:nth-child(7),.reject-table td:nth-child(7){width:23%;}
  .reject-table th:nth-child(8),.reject-table td:nth-child(8){width:12%;}
  .reject-division-table th:nth-child(1),.reject-division-table td:nth-child(1){width:24%;}
  .reject-division-table th:nth-child(2),.reject-division-table td:nth-child(2){width:39%;}
  .reject-division-table th:nth-child(6),.reject-division-table td:nth-child(6){width:23%;}
  .reject-division-table th:nth-child(7),.reject-division-table td:nth-child(7){width:14%;}
  .reject-pending{padding:10px;}
  .reject-pending-body b{font-size:10.5px;}
  .reject-pending-body span,.reject-pending-body small{font-size:9px;}
  .reject-pending-action{font-size:9.5px;}
  .reject-empty{min-height:82px;padding:12px;}
}

/* Master: tabel compact, filter/search, tarif 3 divisi, responsive tanpa kolom hilang. */
.master-tabs{margin-bottom:12px;}
.master-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px;min-width:0;}
.master-search{position:relative;display:block;flex:1 1 320px;min-width:200px;}
.master-search svg{position:absolute;left:12px;top:50%;width:16px;height:16px;transform:translateY(-50%);fill:none;stroke:var(--slate);stroke-width:1.8;pointer-events:none;}
.master-search input{box-sizing:border-box;width:100%;min-width:0;min-height:38px;padding:8px 12px 8px 36px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:11.5px;outline:none;}
.master-search input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent);}
.master-tool-btn{min-height:38px;padding:7px 12px;font-size:10.5px;white-space:nowrap;}
.master-filter-summary{margin:-2px 0 10px;padding:8px 10px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:10px;line-height:1.35;overflow-wrap:anywhere;}
.master-product-card,.master-customer-card{width:100%;max-width:100%;overflow:hidden;padding:0;}
.master-table-wrap{width:100%;max-width:100%;overflow:hidden;}
.master-product-table,.master-customer-table{width:100%;min-width:0!important;table-layout:fixed;}
.master-product-table th,.master-product-table td,.master-customer-table th,.master-customer-table td{min-width:0;padding:9px 6px;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;}
.master-product-table th,.master-customer-table th{font-size:8.5px;line-height:1.15;white-space:normal;}
.master-product-table td,.master-customer-table td{font-size:10px;line-height:1.25;}
.master-product-table td:first-child,.master-product-table td:nth-child(5),.master-customer-table td:first-child,.master-customer-table td:nth-child(3){white-space:normal;overflow-wrap:anywhere;}
.master-product-table .badge,.master-customer-table .badge{max-width:100%;white-space:normal;text-align:center;line-height:1.1;}
/* Master Produk tidak boleh ikut rule responsive generik yang menyembunyikan kolom pertama. */
.master-product-table th:nth-child(1),.master-product-table td:nth-child(1){display:table-cell!important;width:28%;}
.master-product-table th:nth-child(2),.master-product-table td:nth-child(2){width:14%;}
.master-product-table th:nth-child(3),.master-product-table td:nth-child(3){width:17%;}
.master-product-table th:nth-child(4),.master-product-table td:nth-child(4){width:14%;}
.master-product-table th:nth-child(5),.master-product-table td:nth-child(5){width:18%;}
.master-product-table th:nth-child(6),.master-product-table td:nth-child(6){width:9%;overflow:visible;}
.master-customer-table th:nth-child(1),.master-customer-table td:nth-child(1){width:24%;}
.master-customer-table th:nth-child(2),.master-customer-table td:nth-child(2){width:21%;}
.master-customer-table th:nth-child(3),.master-customer-table td:nth-child(3){width:30%;}
.master-customer-table th:nth-child(4),.master-customer-table td:nth-child(4){width:14%;}
.master-customer-table th:nth-child(5),.master-customer-table td:nth-child(5){width:11%;overflow:visible;}
.master-product-table td:last-child .btn,.master-customer-table td:last-child .btn{width:100%;min-width:0;min-height:30px;padding:6px 6px;border-radius:9px;font-size:9.5px;white-space:nowrap;}
.master-product-name .small{margin-top:3px;font-size:8.5px;color:var(--slate);}
.master-pager{padding:10px 12px;margin:0;border-top:1px solid var(--line-soft);}
.master-pager span{flex:1;min-width:0;text-align:center;}
.master-rate-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.master-rate-grid .field{margin:0;}

@media (max-width:767px){
  .master-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
  .master-search{grid-column:1/-1;min-width:0;}
  .master-tool-btn{width:100%;min-width:0;}
  .master-table-wrap{overflow:visible;}
  .master-product-table,.master-customer-table,.master-product-table tbody,.master-customer-table tbody{display:block;width:100%;}
  .master-product-table thead,.master-customer-table thead{display:none;}
  .master-product-table tr,.master-customer-table tr{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:0;border-bottom:1px solid var(--line-soft);padding:7px 9px;box-sizing:border-box;}
  .master-product-table tr:last-child,.master-customer-table tr:last-child{border-bottom:0;}
  .master-product-table td,.master-customer-table td,
  .master-product-table td:nth-child(n),.master-customer-table td:nth-child(n){display:flex!important;width:auto!important;min-width:0;align-items:flex-start;justify-content:space-between;gap:8px;padding:6px 5px;border:0!important;white-space:normal!important;overflow:visible;text-overflow:clip;box-sizing:border-box;}
  .master-product-table td:nth-child(1){display:block!important;}
  .master-product-table td::before,.master-customer-table td::before{content:attr(data-label);flex:0 0 auto;max-width:48%;font-size:8px;font-weight:800;color:var(--slate);text-transform:uppercase;letter-spacing:.02em;}
  .master-product-table td>*:not(.small),.master-customer-table td>*:not(.small){min-width:0;text-align:right;overflow-wrap:anywhere;}
  .master-product-table td.master-product-name,.master-customer-table td:first-child{grid-column:1/-1;display:block!important;padding-top:8px;}
  .master-product-table td.master-product-name::before,.master-customer-table td:first-child::before{display:block;margin-bottom:3px;max-width:none;}
  .master-product-table td.master-product-name>*{text-align:left!important;}
  .master-product-table td:last-child,.master-customer-table td:last-child{grid-column:1/-1;display:block!important;padding-bottom:8px;}
  .master-product-table td:last-child::before,.master-customer-table td:last-child::before{display:none;}
  .master-product-table td:last-child .btn,.master-customer-table td:last-child .btn{width:100%;}
  .master-product-table td[colspan],.master-customer-table td[colspan]{grid-column:1/-1!important;display:block!important;}
  .master-product-table td[colspan]::before,.master-customer-table td[colspan]::before{display:none;}
  .master-rate-grid{grid-template-columns:1fr;}
}
@media (max-width:420px){
  .master-product-table tr,.master-customer-table tr{grid-template-columns:1fr;padding:7px 8px;}
  .master-product-table td,.master-customer-table td,.master-product-table td.master-product-name,.master-customer-table td:first-child,.master-product-table td:last-child,.master-customer-table td:last-child{grid-column:1/-1;}
  .master-pager{gap:6px;padding:9px 8px;}
  .master-pager .btn{font-size:9px;padding-left:6px;padding-right:6px;}
  .master-pager span{font-size:8.5px;}
}

/* Riwayat: 3 kolom ringkas. Detail lengkap dibuka dari baris. */
.history-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px;min-width:0;}
.history-search{position:relative;display:block;flex:1 1 360px;min-width:220px;}
.history-search svg{position:absolute;left:12px;top:50%;width:16px;height:16px;transform:translateY(-50%);fill:none;stroke:var(--slate);stroke-width:1.8;pointer-events:none;}
.history-search input{box-sizing:border-box;width:100%;min-width:0;min-height:38px;padding:8px 12px 8px 36px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:11.5px;outline:none;}
.history-search input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent);}
.history-tool-btn{min-height:38px;padding:7px 12px;font-size:10.5px;white-space:nowrap;}
.history-filter-summary{margin:-2px 0 10px;padding:8px 10px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:10px;line-height:1.35;overflow-wrap:anywhere;}
.history-card{width:100%;max-width:100%;overflow:hidden;padding:0;}
.history-table-wrap{width:100%;max-width:100%;overflow:hidden;}
.history-table{width:100%;min-width:0!important;table-layout:fixed;}
.history-table th,.history-table td{display:table-cell!important;min-width:0;padding:10px 9px;vertical-align:middle;box-sizing:border-box;}
.history-table th{font-size:8.5px;line-height:1.15;white-space:normal;}
.history-table td{font-size:10.5px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;}
.history-table th:nth-child(1),.history-table td:nth-child(1){width:22%;}
.history-table th:nth-child(2),.history-table td:nth-child(2){width:23%;}
.history-table th:nth-child(3),.history-table td:nth-child(3){width:55%;}
.history-table .small{margin-top:3px;font-size:8.5px;color:var(--slate);font-weight:500;}
.history-time b,.history-user b,.history-action b{display:block;min-width:0;}
.history-row{cursor:pointer;transition:background .14s ease;}
.history-row:hover{background:color-mix(in srgb,var(--primary) 5%,transparent);}
.history-row:focus{outline:2px solid color-mix(in srgb,var(--primary) 45%,transparent);outline-offset:-2px;}
.history-pager{padding:10px 12px;margin:0;border-top:1px solid var(--line-soft);}
.history-pager span{flex:1;min-width:0;text-align:center;}
.history-detail-card .diffline{align-items:flex-start;gap:16px;}
.history-detail-card .diffline b{max-width:68%;text-align:right;overflow-wrap:anywhere;}
.history-detail-wide{flex-direction:column;gap:4px!important;}
.history-detail-wide b{max-width:100%!important;text-align:left!important;}

@media (max-width:767px){
  .history-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
  .history-search{grid-column:1/-1;min-width:0;}
  .history-tool-btn{width:100%;min-width:0;}
  .history-table th,.history-table td{padding:9px 7px;}
  .history-table th:nth-child(1),.history-table td:nth-child(1){width:24%;}
  .history-table th:nth-child(2),.history-table td:nth-child(2){width:24%;}
  .history-table th:nth-child(3),.history-table td:nth-child(3){width:52%;}
}
@media (max-width:420px){
  .history-table th,.history-table td{padding:8px 5px;font-size:9.5px;}
  .history-table th{font-size:7.5px;}
  .history-table .small{font-size:8px;}
  .history-table th:nth-child(1),.history-table td:nth-child(1){width:28%;}
  .history-table th:nth-child(2),.history-table td:nth-child(2){width:27%;}
  .history-table th:nth-child(3),.history-table td:nth-child(3){width:45%;}
  .history-pager{gap:6px;padding:9px 8px;}
  .history-pager .btn{font-size:9px;padding-left:6px;padding-right:6px;}
  .history-pager span{font-size:8.5px;}
}

/* Pengaturan client-ready + multi akun divisi */
.settings-client-grid{align-items:start;}
.settings-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;min-width:0;}
.settings-card-head>.ttl,.settings-card-head>div{min-width:0;}
.settings-card-head .help-p{margin:4px 0 0;text-align:left;}
.settings-display-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(210px,.8fr);gap:18px;align-items:end;}
.settings-mini-label{font-size:10px;font-weight:800;color:var(--ink-soft);margin-bottom:8px;}
.settings-density{margin:0;}
.settings-account-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.settings-account-grid>div{border:1px solid var(--line-soft);border-radius:11px;padding:10px 12px;min-width:0;}
.settings-account-grid span{display:block;font-size:9.5px;color:var(--slate);margin-bottom:3px;}
.settings-account-grid b{display:block;font-size:11px;overflow-wrap:anywhere;}
.settings-account-actions{display:flex;justify-content:flex-end;margin-top:10px;}
.settings-user-count{font-size:10px;font-weight:800;color:var(--ink-soft);white-space:nowrap;}
.settings-user-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px;min-width:0;}
.settings-user-search{position:relative;display:flex;align-items:center;flex:1 1 300px;min-width:200px;}
.settings-user-search svg{position:absolute;left:11px;width:15px;height:15px;fill:none;stroke:var(--slate);stroke-width:2;pointer-events:none;}
.settings-user-search input{width:100%;min-width:0;border:1.5px solid var(--line);background:var(--card);border-radius:12px;padding:10px 12px 10px 34px;font:inherit;color:var(--ink);}
.settings-user-tool{white-space:nowrap;}
.settings-filter-summary{font-size:9.5px;color:var(--slate);margin:0 2px 9px;line-height:1.4;}
.settings-user-table-wrap{width:100%;max-width:100%;overflow:hidden;}
.settings-user-table{width:100%;min-width:0!important;table-layout:fixed;}
.settings-user-table th,.settings-user-table td{vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:24%;}
.settings-user-table th:nth-child(2),.settings-user-table td:nth-child(2){width:22%;}
.settings-user-table th:nth-child(3),.settings-user-table td:nth-child(3){width:14%;}
.settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:14%;}
.settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:26%;}
.settings-user-name{white-space:normal!important;line-height:1.2;}
.settings-user-mobile-meta{display:none;margin-top:3px;font-size:9px;color:var(--slate);font-weight:600;}
.settings-user-actions{display:flex;justify-content:flex-end;gap:5px;overflow:visible!important;text-overflow:clip!important;}
.settings-user-actions .btn{min-width:0;padding-left:8px;padding-right:8px;}
.settings-owner-lock{font-size:9.5px;color:var(--slate);font-weight:700;}
.settings-user-pager{margin-top:10px;}
.settings-user-empty{text-align:center;margin:14px 0 4px;}

@media (max-width:767px){
 .settings-display-layout{grid-template-columns:1fr;gap:12px;}
 .settings-account-grid{grid-template-columns:1fr 1fr;}
 .settings-account-grid>div:last-child{grid-column:1/-1;}
 .settings-user-table th:nth-child(2),.settings-user-table td:nth-child(2){display:none;}
 .settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:32%;display:table-cell;}
 .settings-user-table th:nth-child(3),.settings-user-table td:nth-child(3){width:18%;display:table-cell;}
 .settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:18%;display:table-cell;}
 .settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:32%;display:table-cell;}
 .settings-user-mobile-meta{display:block;}
 .settings-user-actions{flex-wrap:wrap;}
 .settings-user-actions .btn{flex:1 1 78px;font-size:9px;}
}
@media (max-width:520px){
 .settings-account-grid{grid-template-columns:1fr;}
 .settings-account-grid>div:last-child{grid-column:auto;}
 .settings-account-actions .btn{width:100%;}
 .settings-user-toolbar{display:grid;grid-template-columns:1fr 1fr;}
 .settings-user-search{grid-column:1/-1;min-width:0;}
 .settings-user-tool{width:100%;min-width:0;}
 .settings-user-table th:nth-child(3),.settings-user-table td:nth-child(3){display:none;}
 .settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:40%;display:table-cell;}
 .settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:20%;display:table-cell;}
 .settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:40%;display:table-cell;}
 .settings-user-actions{display:grid;grid-template-columns:1fr;gap:4px;}
 .settings-user-actions .btn{width:100%;}
 .settings-user-pager{font-size:9px;}
}

/* Pengaturan v2: tabel rapi + kelola akun + password Owner */
.settings-display-layout{align-items:start;}
.settings-display-layout>div{min-width:0;}
.settings-mini-label{text-align:left;}
.settings-density{width:100%;}
.settings-account-actions{gap:8px;flex-wrap:wrap;align-items:center;}
.settings-user-table th,.settings-user-table td{box-sizing:border-box;}
.settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:26%;text-align:left;}
.settings-user-table th:nth-child(2),.settings-user-table td:nth-child(2){width:22%;text-align:left;}
.settings-user-table th:nth-child(3),.settings-user-table td:nth-child(3){width:18%;text-align:left;}
.settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:14%;text-align:center;}
.settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:20%;text-align:center;}
.settings-user-actions{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-width:0;overflow:visible!important;}
.settings-user-actions .btn{width:auto;min-width:70px;max-width:100%;padding-left:10px;padding-right:10px;white-space:nowrap;}
.settings-manage-summary{margin:10px 0;}
.settings-manage-summary .diffline{align-items:flex-start;gap:16px;}
.settings-manage-summary .diffline b{max-width:65%;text-align:right;overflow-wrap:anywhere;}

@media (max-width:767px){
 .settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:34%;display:table-cell;}
 .settings-user-table th:nth-child(3),.settings-user-table td:nth-child(3){width:20%;display:table-cell;}
 .settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:20%;display:table-cell;}
 .settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:26%;display:table-cell;}
 .settings-user-actions{display:flex;flex-wrap:nowrap;}
 .settings-user-actions .btn{min-width:62px;font-size:9px;}
}
@media (max-width:520px){
 .settings-account-actions{display:grid;grid-template-columns:1fr;}
 .settings-account-actions .btn{width:100%;}
 .settings-user-table th:nth-child(1),.settings-user-table td:nth-child(1){width:42%;display:table-cell;}
 .settings-user-table th:nth-child(4),.settings-user-table td:nth-child(4){width:24%;display:table-cell;}
 .settings-user-table th:nth-child(5),.settings-user-table td:nth-child(5){width:34%;display:table-cell;}
 .settings-user-actions{display:flex;}
 .settings-user-actions .btn{width:auto;min-width:58px;}
}

/* Flow V2 foundation: Master Produk/Petugas */
.master-product-v2-table th:nth-child(1),.master-product-v2-table td:nth-child(1){width:24%;}
.master-product-v2-table th:nth-child(2),.master-product-v2-table td:nth-child(2){width:42%;}
.master-product-v2-table th:nth-child(3),.master-product-v2-table td:nth-child(3){width:15%;}
.master-product-v2-table th:nth-child(4),.master-product-v2-table td:nth-child(4){width:10%;}
.master-product-v2-table th:nth-child(5),.master-product-v2-table td:nth-child(5){width:9%;overflow:visible;}
.master-rate-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;min-width:0;}
.master-rate-summary>div{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;padding:2px 0;border-bottom:1px dashed var(--line-soft);}
.master-rate-summary>div:nth-last-child(-n+2){border-bottom:0;}
.master-rate-summary span{font-size:8px;color:var(--slate);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.master-rate-summary b{font-size:9px;white-space:nowrap;}
.master-rate-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr));}
.master-worker-processes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.master-worker-processes label{display:flex;align-items:center;gap:6px;padding:9px 10px;border:1px solid var(--line-soft);border-radius:10px;background:var(--surface-soft);font-size:10px;font-weight:700;}
@media (max-width:720px){
 .master-rate-summary{grid-template-columns:1fr;}
 .master-rate-summary>div:nth-last-child(-n+2){border-bottom:1px dashed var(--line-soft);}
 .master-rate-summary>div:last-child{border-bottom:0;}
 .master-rate-grid-v2{grid-template-columns:1fr;}
 .master-worker-processes{grid-template-columns:1fr;}
}
