/* 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;justify-content:space-between;min-width:0;gap:8px;}
  .topbar>div:first-child{flex:1 1 auto;min-width:0;}
  .topbar .greet,.topbar .store,.topbar .date{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .top-actions{flex:0 0 auto;min-width:0;gap:6px;}
  .sync-pill{padding:0 8px;}
  .avatar-button{display:block;width:38px;min-width:38px;max-width:38px;padding:0;overflow:hidden;font-size:0;line-height:35px;}
  .avatar-button::after{content:attr(data-initials);font-size:12px;}
  .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 / DESKTOP LAYOUT
   Breakpoint mengikuti ruang CSS viewport, bukan model perangkat.
   Sidebar compact dipakai pada kelas tablet/split-view.
   ====================================================== */
@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%;
    min-height:0;
    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);
    overflow-x:hidden;
    overflow-y:auto;
    scrollbar-width:thin;
    overscroll-behavior:contain;
  }
  .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:calc(var(--app-height) - 112px);
    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;}
}

/* Screen Contract: tablet / narrow desktop = compact shell. */
@media (min-width:768px) and (max-width:1100px){
  body{padding:16px 12px;}
  .device,.device.sidebar-collapsed{
    height:calc(var(--app-height) - 32px);
    min-height:0;
    max-height:calc(var(--app-height) - 32px);
    grid-template-columns:88px minmax(0,1fr);
    border-radius:20px;
  }
  .navbar,.device.sidebar-collapsed .navbar{padding:18px 8px calc(14px + env(safe-area-inset-bottom));}
  .navbar::before,.device.sidebar-collapsed .navbar::before{
    visibility:visible;
    width:44px;
    height:44px;
    flex-basis:44px;
    margin:0 auto 10px;
  }
  .sidebar-toggle{display:none;}
  .navbtn,.device.sidebar-collapsed .navbtn{
    width:100%;
    min-height:54px;
    padding:6px 3px;
    gap:3px;
    flex-direction:column;
    justify-content:center;
  }
  .navbtn svg,.device.sidebar-collapsed .navbtn svg{width:34px;height:34px;padding:7px;}
  .navbtn span,.device.sidebar-collapsed .navbtn span{display:block;font-size:9px;line-height:1.05;text-align:center;white-space:normal;}
  .navbtn.active,.device.sidebar-collapsed .navbtn.active{background:var(--primary-tint);}
  .topbar{padding:18px 22px 14px;}
  .content{max-width:none;padding:18px 20px 48px;}
  .overlay{padding:16px;}
  .sheet{max-height:calc(var(--app-height) - 64px);}
  .fab{right:28px;bottom:28px;}
}

/* ======================================================
   Udhma-Produksi: adaptasi struktur nav dan tab.
   ====================================================== */
.nav-items{display:flex;flex:1;width:100%;min-width:0;}
.nav-slide{display:none;}
@media (max-width:767px){
  .navbar{min-width:0;align-items:center;padding:6px 4px calc(10px + env(safe-area-inset-bottom));}
  .nav-items{display:flex;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--primary) transparent;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;}
  .nav-items::-webkit-scrollbar{height:3px;}
  .nav-items::-webkit-scrollbar-thumb{background:var(--primary);border-radius:3px;}
  .nav-items .navbtn{flex:0 0 64px;min-width:64px;min-height:48px;padding:5px 1px;gap:2px;}
  .device:not(.slider-nav) .nav-items .navbtn{flex:1 1 0;min-width:0;}
  .nav-items .navbtn svg{width:20px;height:20px;}
  .nav-items .navbtn span{font-size:9px;line-height:1.1;white-space:nowrap;}
  .device.slider-nav .nav-slide{display:grid;place-items:center;flex:0 0 34px;width:34px;min-height:44px;padding:0;border:0;background:transparent;color:var(--primary-dark);font-size:26px;font-weight:700;cursor:pointer;}
  .device.slider-nav .nav-slide:disabled{opacity:.3;cursor:default;}
}
.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:1 1 auto;
    width:100%;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    scrollbar-gutter:stable;
  }
  .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;}
  .master-finance-category-table th:nth-child(1),.master-finance-category-table td:nth-child(1){display:table-cell;}
  .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;}
  .master-finance-category-table th:nth-child(1),.master-finance-category-table td:nth-child(1){display:table-cell;}
  .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:8%;text-align:center;}
.stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:54%;text-align:left;}
.stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:16%;text-align:center;}
.stock-current-table th:nth-child(4),.stock-current-table td:nth-child(4){width:22%;text-align:center;}
.stock-current-table input[type=checkbox]{width:15px;height:15px;margin:0;}
.stock-detail-matrix{width:100%;min-width:0!important;table-layout:fixed;}
.stock-detail-matrix th,.stock-detail-matrix td{padding:7px 4px;text-align:center;white-space:normal;overflow-wrap:anywhere;}
.stock-detail-matrix th:first-child,.stock-detail-matrix td:first-child{display:table-cell!important;text-align:left;width:24%;font-weight:700;}
.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:9%;}
  .stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:50%;}
  .stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:17%;}
  .stock-current-table th:nth-child(4),.stock-current-table td:nth-child(4){width:24%;}
  .stock-detail-matrix th,.stock-detail-matrix td{padding:6px 2px;font-size:9px;}
  .stock-detail-matrix th{font-size:7.5px;}
  .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:10%;}
  .stock-current-table th:nth-child(2),.stock-current-table td:nth-child(2){width:48%;}
  .stock-current-table th:nth-child(3),.stock-current-table td:nth-child(3){width:17%;}
  .stock-current-table th:nth-child(4),.stock-current-table td:nth-child(4){width:25%;}
  .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 Udhma.
   ====================================================== */
.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.finance-tabs-admin{grid-template-columns:repeat(6,minmax(0,1fr));}
.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 .finance-report-customer{grid-column:1/-1;}
.finance-report-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;}
.finance-report-actions .btn{width:100%;}
.finance-empty-metric{font-size:22px;font-weight:700;color:var(--slate);}

/* Keuangan: pola transaksi/pembayaran mengikuti sample Gudang Udhma. */
.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 .finance-report-customer{grid-column:auto;}
  .finance-report-actions{grid-template-columns:1fr;}
  .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;}
  .finance-tabs.finance-tabs-admin button:nth-child(5){grid-column:3 / span 2;}
  .finance-tabs.finance-tabs-admin button:nth-child(6){grid-column:5 / 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 otomatis Owner-only, Pengeluaran, dan Void.
   Menjaga pola compact/responsive yang sudah dipakai.
   ====================================================== */
.finance-invoice-item-row.has-auto-hpp{
  grid-template-columns:auto minmax(0,1fr) minmax(132px,170px) minmax(132px,170px);
}
.finance-invoice-price-field>b{display:flex;align-items:center;min-height:38px;padding:8px 10px;border:1px solid var(--line-soft);border-radius:10px;background:var(--paper);font-size:11px;line-height:1.25;}
.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-item-row.has-auto-hpp{grid-template-columns:auto minmax(0,1fr) minmax(118px,150px);}
  .finance-invoice-item-row.has-auto-hpp .finance-invoice-price-field:last-child{grid-column:2/-1;padding-left:0;}
  .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,.finance-invoice-item-row.has-auto-hpp{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;}
.stock-trx-builder{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:end;}
.stock-trx-builder .field{margin:0;}
.stock-trx-builder #stock-trx-item-info{grid-column:1/-1;margin:0;}
.stock-trx-builder #stock-trx-add-item{grid-column:1/-1;}
.stock-trx-cart-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line-soft);}
.stock-trx-cart-row:last-child{border-bottom:0;}
.stock-trx-cart-row>div{min-width:0;}
.stock-trx-cart-row b,.stock-trx-cart-row .small{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-trx-builder{grid-template-columns:1fr 1fr;}
  .stock-trx-builder .field:first-child{grid-column:1/-1;}
  .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-trx-builder{grid-template-columns:1fr;}
  .stock-trx-builder .field:first-child{grid-column:auto;}
  .stock-batch-list{max-height:48vh;}
}

/* Reject Owner dashboard: ringkas, full-width, tanpa horizontal scroll. */
.reject-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.reject-summary-card{display:flex;min-width:0;flex-direction:column;gap:3px;padding:11px 12px;border:1px solid var(--line);border-radius:14px;background:var(--card);}
.reject-summary-card span{font-size:9px;font-weight:800;color:var(--slate);text-transform:uppercase;letter-spacing:.04em;}
.reject-summary-card b{font-size:18px;line-height:1.1;overflow-wrap:anywhere;}
.reject-summary-card small{font-size:9px;color:var(--slate);line-height:1.3;}
.reject-afkir-card{padding:13px 14px;}
.reject-afkir-main{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.reject-afkir-eyebrow{font-size:9px;font-weight:800;color:var(--slate);letter-spacing:.05em;}
.reject-afkir-value{margin-top:3px;font-size:22px;font-weight:900;line-height:1.05;}
.reject-afkir-sub{margin-top:4px;font-size:9.5px;color:var(--slate);}
.reject-afkir-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;}
.reject-afkir-meta>div,.reject-division-grid>div{display:flex;min-width:0;flex-direction:column;gap:3px;padding:9px 10px;border:1px solid var(--line-soft);border-radius:11px;background:var(--paper);}
.reject-afkir-meta span,.reject-division-grid span{font-size:8.5px;color:var(--slate);}
.reject-afkir-meta b,.reject-division-grid b{font-size:11px;overflow-wrap:anywhere;}
.reject-block-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:9px;}
.reject-block-head b,.reject-block-head span{display:block;}
.reject-block-head b{font-size:11.5px;}
.reject-block-head span{margin-top:2px;font-size:9px;color:var(--slate);}
.reject-breakdown{padding:12px 14px;}
.reject-division-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.reject-division-grid small{font-size:8.5px;color:var(--slate);}
.reject-quick-range{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:9px;}
.reject-quick-range .btn{min-height:31px;padding:5px 9px;font-size:9.5px;}
.reject-owner-table{width:100%;min-width:0!important;table-layout:fixed;text-align:center;}
.reject-owner-table th,.reject-owner-table td{min-width:0;padding:8px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;}
.reject-owner-table th{font-size:8px;white-space:normal;line-height:1.12;}
.reject-owner-table td:nth-child(2){white-space:normal;line-height:1.16;}
.reject-owner-table td:last-child{overflow:visible;}
.reject-owner-table td:last-child .btn{min-width:0;max-width:100%;padding:5px 6px;font-size:9px;}
.reject-owner-table th:nth-child(1),.reject-owner-table td:nth-child(1){width:15%;}
.reject-owner-table th:nth-child(2),.reject-owner-table td:nth-child(2){width:29%;}
.reject-owner-table th:nth-child(3),.reject-owner-table td:nth-child(3){width:12%;}
.reject-owner-table th:nth-child(4),.reject-owner-table td:nth-child(4){width:10%;}
.reject-owner-table th:nth-child(5),.reject-owner-table td:nth-child(5){width:9%;}
.reject-owner-table th:nth-child(6),.reject-owner-table td:nth-child(6){width:15%;}
.reject-owner-table th:nth-child(7),.reject-owner-table td:nth-child(7){width:10%;}
@media (max-width:767px){
  .reject-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .reject-division-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .reject-owner-table th,.reject-owner-table td{display:table-cell!important;padding:7px 2px;font-size:8.5px;}
  .reject-owner-table th{font-size:7px;}
  .reject-owner-table th:nth-child(1),.reject-owner-table td:nth-child(1){width:16%;}
  .reject-owner-table th:nth-child(2),.reject-owner-table td:nth-child(2){width:30%;}
  .reject-owner-table th:nth-child(3),.reject-owner-table td:nth-child(3){width:12%;}
  .reject-owner-table th:nth-child(4),.reject-owner-table td:nth-child(4){width:9%;}
  .reject-owner-table th:nth-child(5),.reject-owner-table td:nth-child(5){width:8%;}
  .reject-owner-table th:nth-child(6),.reject-owner-table td:nth-child(6){width:15%;}
  .reject-owner-table th:nth-child(7),.reject-owner-table td:nth-child(7){width:10%;}
}
@media (max-width:420px){
  .reject-summary-card{padding:9px 10px;}
  .reject-summary-card b{font-size:15px;}
  .reject-afkir-main{align-items:flex-start;}
  .reject-afkir-meta{grid-template-columns:1fr;}
  .reject-owner-table th,.reject-owner-table td{padding-left:1px;padding-right:1px;font-size:7.6px;}
  .reject-owner-table th{font-size:6.3px;}
  .reject-owner-table td:last-child .btn{padding:3px 4px;font-size:7.5px;}
}


/* Reject UI compact revision: Owner ringkas, Admin operasional, operator 5 kolom. */
.reject-summary-grid-compact{grid-template-columns:repeat(4,minmax(0,1fr));}
.reject-owner-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.reject-owner-meta span{display:inline-flex;align-items:center;gap:4px;padding:6px 8px;border:1px solid var(--line-soft);border-radius:999px;background:var(--card);font-size:8.8px;color:var(--slate);}
.reject-owner-meta b{color:var(--ink);font-size:9px;}
.reject-owner-compact-row{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:8px;margin-top:8px;}
.reject-afkir-card-compact{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;}
.reject-afkir-inline{display:flex;align-items:baseline;gap:7px;margin-top:3px;}
.reject-afkir-inline b{font-size:17px;}
.reject-afkir-inline span{font-size:8.8px;color:var(--slate);}
.reject-division-inline{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;padding:10px 12px;font-size:8.8px;}
.reject-division-inline>span{color:var(--slate);font-weight:700;}
.reject-division-inline b{font-size:9.5px;}
.reject-division-inline i{font-style:normal;color:var(--line);}
.reject-operator-table{width:100%!important;min-width:100%!important;max-width:100%!important;table-layout:fixed;text-align:center;}
.reject-operator-table th,.reject-operator-table td{display:table-cell!important;min-width:0;padding:8px 4px;text-align:center;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reject-operator-table th{font-size:8px;white-space:normal;line-height:1.1;}
.reject-operator-table td:nth-child(2){white-space:normal;line-height:1.15;overflow-wrap:anywhere;}
.reject-operator-table td:last-child{overflow:visible;}
.reject-operator-actions{display:flex;justify-content:center;gap:4px;flex-wrap:wrap;}
.reject-operator-actions .btn{min-width:0;max-width:100%;padding:5px 7px;font-size:8.5px;}
.reject-operator-table th:nth-child(1),.reject-operator-table td:nth-child(1){width:19%;}
.reject-operator-table th:nth-child(2),.reject-operator-table td:nth-child(2){width:31%;}
.reject-operator-table th:nth-child(3),.reject-operator-table td:nth-child(3){width:11%;}
.reject-operator-table th:nth-child(4),.reject-operator-table td:nth-child(4){width:18%;}
.reject-operator-table th:nth-child(5),.reject-operator-table td:nth-child(5){width:21%;}
@media (max-width:767px){
  .reject-summary-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr));}
  .reject-owner-compact-row{grid-template-columns:1fr;}
  .reject-operator-table th,.reject-operator-table td{padding:7px 2px;font-size:8px;}
  .reject-operator-table th{font-size:6.8px;}
  .reject-operator-actions .btn{padding:4px 5px;font-size:7.6px;}
}
@media (max-width:420px){
  .reject-owner-meta{gap:4px;}
  .reject-owner-meta span{padding:5px 6px;font-size:7.8px;}
  .reject-operator-table th,.reject-operator-table td{padding-left:1px;padding-right:1px;font-size:7.2px;}
  .reject-operator-table th{font-size:6.1px;}
  .reject-operator-actions{gap:2px;}
  .reject-operator-actions .btn{padding:3px 4px;font-size:7px;}
}

/* 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>.master-rate-size-row{grid-column:1/-1;display:grid;grid-template-columns:minmax(76px,.7fr) minmax(0,1.3fr);align-items:start;justify-content:initial;gap:6px;padding:4px 0;}
.master-rate-summary>.master-rate-scalar .master-rate-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.master-rate-summary .master-rate-label{font-size:8px;color:var(--slate);}
.master-rate-size-values{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0;}
.master-rate-size-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:3px 6px;border:1px solid var(--line-soft);border-radius:999px;background:var(--surface-soft);font-size:8px;line-height:1.2;white-space:nowrap;}
.master-rate-summary .master-rate-size-chip b{font-size:8px;white-space:nowrap;}
.master-rate-summary .master-rate-size-chip span{font-size:8px;color:var(--ink);white-space:nowrap;}
.master-rate-empty{font-size:8px;color:var(--slate);}
.master-rate-summary b{font-size:9px;white-space:nowrap;}
.master-rate-summary>div:last-child{border-bottom:0;}
.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-grid-v2{grid-template-columns:1fr;}
 .master-worker-processes{grid-template-columns:1fr;}
}

/* Dashboard, Stok, dan Pengaturan: layout bersih dan responsif. */
.dashboard-metric-row,
.dashboard-attention-grid{
  align-items:stretch;
}
.dashboard-metric-row .stat-card,
.dashboard-attention-grid .stat-card{
  display:flex;
  min-height:102px;
  flex-direction:column;
  justify-content:center;
}
.dashboard-attention-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.stock-search-inline{
  grid-column:1/-1;
}
.settings-account-card .help-p{
  line-height:1.45;
}
.settings-account-card>.help-p{
  max-width:760px;
  margin:10px auto 0;
}

@media (max-width:640px){
  .dashboard-metric-row,
  .dashboard-attention-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-metric-row>.stat-card:last-child,
  .dashboard-attention-grid>.stat-card:last-child{
    grid-column:1/-1;
  }
  .stock-cutting-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:420px){
  .dashboard-metric-row,
  .dashboard-attention-grid,
  .stock-cutting-actions{
    grid-template-columns:1fr;
  }
  .dashboard-metric-row>.stat-card:last-child,
  .dashboard-attention-grid>.stat-card:last-child{
    grid-column:auto;
  }
}

/* Master Produk: multi-size dropdown + warna/variasi */
.master-chip-list{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:34px;padding:7px 8px;border:1px solid var(--line-soft);border-radius:10px;background:var(--surface-soft);}
.master-chip{appearance:none;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);padding:5px 9px;font:inherit;font-size:9px;font-weight:800;line-height:1;cursor:pointer;}
.master-chip:hover{border-color:var(--primary);color:var(--primary);}
#prod-custom-size-box[hidden]{display:none!important;}

/* Produksi/Jahit: tabel full-width, contained, tanpa geser horizontal. */
.data-table th,
.data-table td{
  text-align:center;
  vertical-align:middle;
}

.production-table-card .table-wrap{
  display:block;
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.production-jahit-admin-table,
.production-jahit-worker-table{
  display:table;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  table-layout:fixed;
  margin:0;
}
.production-jahit-admin-table th,
.production-jahit-admin-table td,
.production-jahit-worker-table th,
.production-jahit-worker-table td{
  display:table-cell;
  text-align:center;
  vertical-align:middle;
  min-width:0;
  padding-left:4px;
  padding-right:4px;
}
.production-jahit-admin-table td:nth-child(3),
.production-jahit-worker-table td:nth-child(2){
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
  text-overflow:clip;
  line-height:1.15;
}
.production-jahit-admin-table td:nth-child(2),
.production-jahit-worker-table td:nth-child(1),
.production-jahit-admin-table td:nth-child(5),
.production-jahit-worker-table td:nth-child(3),
.production-jahit-admin-table td:nth-child(6),
.production-jahit-worker-table td:nth-child(4){
  white-space:nowrap;
}
.production-jahit-admin-table td:last-child,
.production-jahit-worker-table td:last-child{
  overflow:visible;
  text-overflow:clip;
}
.production-jahit-admin-table td:last-child .btn,
.production-jahit-worker-table td:last-child .btn{
  width:auto;
  max-width:100%;
  min-width:0;
  margin-inline:auto;
  white-space:nowrap;
}
.production-jahit-admin-table .badge,
.production-jahit-worker-table .badge{
  display:inline-block;
  max-width:100%;
  white-space:normal;
  line-height:1.05;
}

/* Admin Jahit: Model paling lebar; semua kolom tetap tampil. */
.production-jahit-admin-table th:nth-child(1),.production-jahit-admin-table td:nth-child(1){width:4%;}
.production-jahit-admin-table th:nth-child(2),.production-jahit-admin-table td:nth-child(2){width:9%;}
.production-jahit-admin-table th:nth-child(3),.production-jahit-admin-table td:nth-child(3){width:28%;}
.production-jahit-admin-table th:nth-child(4),.production-jahit-admin-table td:nth-child(4){width:14%;}
.production-jahit-admin-table th:nth-child(5),.production-jahit-admin-table td:nth-child(5){width:15%;}
.production-jahit-admin-table th:nth-child(6),.production-jahit-admin-table td:nth-child(6){width:8%;}
.production-jahit-admin-table th:nth-child(7),.production-jahit-admin-table td:nth-child(7){width:11%;}
.production-jahit-admin-table th:nth-child(8),.production-jahit-admin-table td:nth-child(8){width:11%;}

/* Login Jahit: Model paling lebar dan tabel tetap memenuhi card. */
.production-jahit-worker-table th:nth-child(1),.production-jahit-worker-table td:nth-child(1){width:11%;}
.production-jahit-worker-table th:nth-child(2),.production-jahit-worker-table td:nth-child(2){width:22%;}
.production-jahit-worker-table th:nth-child(3),.production-jahit-worker-table td:nth-child(3){width:16%;}
.production-jahit-worker-table th:nth-child(4),.production-jahit-worker-table td:nth-child(4){width:15%;}
.production-jahit-worker-table th:nth-child(5),.production-jahit-worker-table td:nth-child(5){width:14%;}
.production-jahit-worker-table th:nth-child(6),.production-jahit-worker-table td:nth-child(6){width:22%;}
.jahit-worker-actions{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px;}
.jahit-worker-status-tabs{display:flex;gap:8px;align-items:center;margin:0 0 12px;}
.jahit-worker-status-tabs button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:7px 14px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink-soft);font-weight:750;cursor:pointer;}
.jahit-worker-status-tabs button.active{background:var(--primary);border-color:var(--primary);color:#fff;}
.jahit-worker-status-tabs button span{min-width:24px;padding:2px 7px;border-radius:999px;background:var(--paper);color:var(--ink);font-size:12px;text-align:center;}
.jahit-worker-status-tabs button.active span{background:rgba(255,255,255,.2);color:#fff;}

.jahit-variation-alloc{
  margin:0 0 8px;
  padding:8px;
  border:1px solid var(--line-soft);
  border-radius:10px;
  background:var(--surface-soft);
}

@media (max-width:767px){
  .jahit-worker-status-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:10px;}
  .jahit-worker-status-tabs button{min-height:36px;padding:6px 8px;gap:5px;font-size:12px;}
  .jahit-worker-status-tabs button span{min-width:20px;padding:2px 5px;font-size:10px;}
  /* Override aturan generik production-data-table: kolom Jahit tidak boleh disembunyikan. */
  .production-jahit-admin-table th:nth-child(1),.production-jahit-admin-table td:nth-child(1),
  .production-jahit-admin-table th:nth-child(2),.production-jahit-admin-table td:nth-child(2),
  .production-jahit-admin-table th:nth-child(3),.production-jahit-admin-table td:nth-child(3),
  .production-jahit-admin-table th:nth-child(4),.production-jahit-admin-table td:nth-child(4),
  .production-jahit-admin-table th:nth-child(5),.production-jahit-admin-table td:nth-child(5),
  .production-jahit-admin-table th:nth-child(6),.production-jahit-admin-table td:nth-child(6),
  .production-jahit-admin-table th:nth-child(7),.production-jahit-admin-table td:nth-child(7),
  .production-jahit-admin-table th:nth-child(8),.production-jahit-admin-table td:nth-child(8),
  .production-jahit-worker-table th,.production-jahit-worker-table td{
    display:table-cell!important;
  }
  .production-jahit-admin-table th,.production-jahit-admin-table td,
  .production-jahit-worker-table th,.production-jahit-worker-table td{
    padding:7px 2px;
    font-size:8.8px;
  }
  .production-jahit-admin-table th,
  .production-jahit-worker-table th{
    font-size:7px;
    letter-spacing:0;
  }
  .production-jahit-admin-table td:last-child .btn,
  .production-jahit-worker-table td:last-child .btn{
    min-height:24px;
    padding:3px 4px;
    font-size:8px;
    border-radius:7px;
  }
  .production-jahit-admin-table .badge,
  .production-jahit-worker-table .badge{
    padding:3px 4px;
    font-size:7px;
  }
  .production-jahit-worker-table td:last-child .btn-row{
    display:grid;
    grid-template-columns:1fr;
    gap:3px;
    justify-content:stretch!important;
    width:100%;
  }
  .production-jahit-worker-table td:last-child .btn-row .btn{width:100%;}
  .production-jahit-worker-table thead{display:none!important;}
  .production-jahit-worker-table,
  .production-jahit-worker-table tbody,
  .production-jahit-worker-table tr{display:block!important;width:100%!important;}
  .production-jahit-worker-table tr{margin:8px 0;border:1px solid var(--line-soft);border-radius:12px;overflow:hidden;background:var(--card);}
  .production-jahit-worker-table td{display:grid!important;grid-template-columns:minmax(105px,38%) minmax(0,1fr);gap:8px;align-items:center;text-align:right!important;padding:8px 10px!important;border-bottom:1px dashed var(--line-soft);font-size:12px!important;white-space:normal!important;}
  .production-jahit-worker-table td:last-child{border-bottom:0;}
  .production-jahit-worker-table td::before{content:attr(data-label);font-size:10px;font-weight:750;color:var(--slate);text-align:left;}
  .jahit-worker-actions{justify-content:flex-end;}
  .jahit-worker-actions .btn{width:auto!important;min-height:28px!important;padding:5px 8px!important;font-size:10px!important;}
}

@media (max-width:420px){
  .production-jahit-admin-table th,.production-jahit-admin-table td,
  .production-jahit-worker-table th,.production-jahit-worker-table td{
    padding-left:1px;
    padding-right:1px;
    font-size:7.8px;
  }
  .production-jahit-admin-table th,
  .production-jahit-worker-table th{font-size:6.4px;}
  .production-jahit-admin-table th:nth-child(1),.production-jahit-admin-table td:nth-child(1){width:4%;}
  .production-jahit-admin-table th:nth-child(2),.production-jahit-admin-table td:nth-child(2){width:9%;}
  .production-jahit-admin-table th:nth-child(3),.production-jahit-admin-table td:nth-child(3){width:29%;}
  .production-jahit-admin-table th:nth-child(4),.production-jahit-admin-table td:nth-child(4){width:13%;}
  .production-jahit-admin-table th:nth-child(5),.production-jahit-admin-table td:nth-child(5){width:15%;}
  .production-jahit-admin-table th:nth-child(6),.production-jahit-admin-table td:nth-child(6){width:8%;}
  .production-jahit-admin-table th:nth-child(7),.production-jahit-admin-table td:nth-child(7){width:11%;}
  .production-jahit-admin-table th:nth-child(8),.production-jahit-admin-table td:nth-child(8){width:11%;}

}

/* Produksi · Kancing / QC / Finishing mengikuti pola tabel Jahit/Lubang yang sudah aman.
   Semua kolom ringkas tetap tampil, full-width, contained, tanpa horizontal scroll. */
.production-kancing-table,.production-qc-table,.production-finishing-table{
  display:table;width:100%!important;min-width:100%!important;max-width:100%!important;
  table-layout:fixed;margin:0;
}
.production-kancing-table th,.production-kancing-table td,
.production-qc-table th,.production-qc-table td,
.production-finishing-table th,.production-finishing-table td{
  display:table-cell;min-width:0;padding-left:4px;padding-right:4px;text-align:center;vertical-align:middle;
}
.production-kancing-table td:nth-child(3),
.production-qc-table td:nth-child(2),
.production-finishing-table td:nth-child(2){
  white-space:normal;overflow-wrap:anywhere;word-break:normal;text-overflow:clip;line-height:1.15;
}
.production-kancing-table td:nth-child(2),.production-kancing-table td:nth-child(4),.production-kancing-table td:nth-child(5),
.production-qc-table td:nth-child(4),.production-qc-table td:nth-child(5),.production-qc-table td:nth-child(6),.production-qc-table td:nth-child(7),
.production-finishing-table td:nth-child(4),.production-finishing-table td:nth-child(5),.production-finishing-table td:nth-child(6),.production-finishing-table td:nth-child(7){white-space:nowrap;}
.production-kancing-table td:last-child,.production-qc-table td:last-child,.production-finishing-table td:last-child{overflow:visible;text-overflow:clip;}
.production-kancing-table td:last-child .btn,.production-qc-table td:last-child .btn,.production-finishing-table td:last-child .btn{
  width:auto;max-width:100%;min-width:0;margin-inline:auto;padding-left:5px;padding-right:5px;white-space:nowrap;
}
.production-kancing-table .badge,.production-qc-table .badge,.production-finishing-table .badge{
  display:inline-block;max-width:100%;white-space:normal;line-height:1.05;
}

/* Kancing: No | Job | Model | Total | Tahap | Status | Aksi */
.production-kancing-table th:nth-child(1),.production-kancing-table td:nth-child(1){width:4%;}
.production-kancing-table th:nth-child(2),.production-kancing-table td:nth-child(2){width:12%;}
.production-kancing-table th:nth-child(3),.production-kancing-table td:nth-child(3){width:31%;}
.production-kancing-table th:nth-child(4),.production-kancing-table td:nth-child(4){width:11%;}
.production-kancing-table th:nth-child(5),.production-kancing-table td:nth-child(5){width:10%;}
.production-kancing-table th:nth-child(6),.production-kancing-table td:nth-child(6){width:17%;}
.production-kancing-table th:nth-child(7),.production-kancing-table td:nth-child(7){width:15%;}

/* QC: No | Model | Petugas | Masuk | Bagus | Reject | Tahap | Status | Aksi */
.production-qc-table th:nth-child(1),.production-qc-table td:nth-child(1){width:4%;}
.production-qc-table th:nth-child(2),.production-qc-table td:nth-child(2){width:24%;}
.production-qc-table th:nth-child(3),.production-qc-table td:nth-child(3){width:14%;}
.production-qc-table th:nth-child(4),.production-qc-table td:nth-child(4){width:9%;}
.production-qc-table th:nth-child(5),.production-qc-table td:nth-child(5){width:9%;}
.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:8%;}
.production-qc-table th:nth-child(8),.production-qc-table td:nth-child(8){width:13%;}
.production-qc-table th:nth-child(9),.production-qc-table td:nth-child(9){width:10%;}

/* Finishing: No | Model | Petugas | Masuk | Selesai | Sisa | Tahap | Status | Aksi */
.production-finishing-table th:nth-child(1),.production-finishing-table td:nth-child(1){width:4%;}
.production-finishing-table th:nth-child(2),.production-finishing-table td:nth-child(2){width:24%;}
.production-finishing-table th:nth-child(3),.production-finishing-table td:nth-child(3){width:14%;}
.production-finishing-table th:nth-child(4),.production-finishing-table td:nth-child(4){width:9%;}
.production-finishing-table th:nth-child(5),.production-finishing-table td:nth-child(5){width:9%;}
.production-finishing-table th:nth-child(6),.production-finishing-table td:nth-child(6){width:9%;}
.production-finishing-table th:nth-child(7),.production-finishing-table td:nth-child(7){width:8%;}
.production-finishing-table th:nth-child(8),.production-finishing-table td:nth-child(8){width:13%;}
.production-finishing-table th:nth-child(9),.production-finishing-table td:nth-child(9){width:10%;}

@media (max-width:767px){
  .production-kancing-table th,.production-kancing-table td,
  .production-qc-table th,.production-qc-table td,
  .production-finishing-table th,.production-finishing-table td{
    display:table-cell!important;padding:7px 2px;font-size:8.8px;
  }
  .production-kancing-table th,.production-qc-table th,.production-finishing-table th{font-size:7px;letter-spacing:0;}
  .production-kancing-table td:last-child .btn,.production-qc-table td:last-child .btn,.production-finishing-table td:last-child .btn{
    min-height:24px;padding:3px 4px;font-size:8px;border-radius:7px;
  }
  .production-kancing-table .badge,.production-qc-table .badge,.production-finishing-table .badge{padding:3px 4px;font-size:7px;}
}
@media (max-width:420px){
  .production-kancing-table th,.production-kancing-table td,
  .production-qc-table th,.production-qc-table td,
  .production-finishing-table th,.production-finishing-table td{padding-left:1px;padding-right:1px;font-size:7.8px;}
  .production-kancing-table th,.production-qc-table th,.production-finishing-table th{font-size:6.4px;}
}

/* Produksi · Login Lubang: Aksi harus muat Detail + Setor/Perbaiki tanpa geser horizontal. */
.production-lubang-worker-table th:nth-child(1),
.production-lubang-worker-table td:nth-child(1){width:10%;}
.production-lubang-worker-table th:nth-child(2),
.production-lubang-worker-table td:nth-child(2){width:29%;}
.production-lubang-worker-table th:nth-child(3),
.production-lubang-worker-table td:nth-child(3){width:14%;}
.production-lubang-worker-table th:nth-child(4),
.production-lubang-worker-table td:nth-child(4){width:10%;}
.production-lubang-worker-table th:nth-child(5),
.production-lubang-worker-table td:nth-child(5){width:15%;}
.production-lubang-worker-table th:nth-child(6),
.production-lubang-worker-table td:nth-child(6){width:22%;}

.production-lubang-worker-table td:last-child{
  overflow:visible;
  text-overflow:clip;
}
.production-lubang-worker-table td:last-child .btn-row{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:center!important;
  gap:4px;
  width:100%;
  min-width:0;
}
.production-lubang-worker-table td:last-child .btn-row .btn{
  flex:1 1 0;
  width:auto;
  min-width:0;
  max-width:100%;
  margin:0;
  padding-left:4px;
  padding-right:4px;
  white-space:nowrap;
}

@media (max-width:767px){
  .production-lubang-worker-table th,
  .production-lubang-worker-table td{
    padding:6px 1.5px;
    font-size:8.6px;
  }
  .production-lubang-worker-table th{
    font-size:6.8px;
    letter-spacing:0;
    line-height:1.05;
  }
  .production-lubang-worker-table th:nth-child(1),
  .production-lubang-worker-table td:nth-child(1){width:10%;}
  .production-lubang-worker-table th:nth-child(2),
  .production-lubang-worker-table td:nth-child(2){width:29%;}
  .production-lubang-worker-table th:nth-child(3),
  .production-lubang-worker-table td:nth-child(3){width:14%;}
  .production-lubang-worker-table th:nth-child(4),
  .production-lubang-worker-table td:nth-child(4){width:9%;}
  .production-lubang-worker-table th:nth-child(5),
  .production-lubang-worker-table td:nth-child(5){width:14%;}
  .production-lubang-worker-table th:nth-child(6),
  .production-lubang-worker-table td:nth-child(6){width:24%;}
  .production-lubang-worker-table .badge{
    padding:2px 3px;
    font-size:6.8px;
    line-height:1.05;
    white-space:normal;
  }
  .production-lubang-worker-table td:last-child .btn-row{
    display:grid;
    grid-template-columns:1fr;
    gap:2px;
    width:100%;
    margin:0!important;
    justify-content:stretch!important;
  }
  .production-lubang-worker-table td:last-child .btn-row .btn{
    width:100%;
    min-width:0;
    min-height:22px;
    padding:2px 2px;
    border-radius:6px;
    font-size:7.4px;
    line-height:1;
    white-space:nowrap;
  }
}

@media (max-width:420px){
  .production-lubang-worker-table th,
  .production-lubang-worker-table td{
    padding:5px 1px;
    font-size:8px;
  }
  .production-lubang-worker-table th{font-size:6.2px;}
  .production-lubang-worker-table th:nth-child(1),
  .production-lubang-worker-table td:nth-child(1){width:10%;}
  .production-lubang-worker-table th:nth-child(2),
  .production-lubang-worker-table td:nth-child(2){width:29%;}
  .production-lubang-worker-table th:nth-child(3),
  .production-lubang-worker-table td:nth-child(3){width:14%;}
  .production-lubang-worker-table th:nth-child(4),
  .production-lubang-worker-table td:nth-child(4){width:9%;}
  .production-lubang-worker-table th:nth-child(5),
  .production-lubang-worker-table td:nth-child(5){width:14%;}
  .production-lubang-worker-table th:nth-child(6),
  .production-lubang-worker-table td:nth-child(6){width:24%;}
  .production-lubang-worker-table td:last-child .btn-row{gap:2px;}
  .production-lubang-worker-table td:last-child .btn-row .btn{
    min-height:20px;
    padding:2px 1px;
    font-size:7px;
    border-radius:5px;
  }
}

.master-price-hpp-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}.master-price-hpp-grid>.small{margin-bottom:6px}@media(max-width:700px){.master-price-hpp-grid{grid-template-columns:1fr}}

.stock-receipt-table{width:100%;min-width:0!important;table-layout:fixed;}
.stock-receipt-table th,.stock-receipt-table td{padding:7px 4px;font-size:9px;white-space:normal;overflow-wrap:anywhere;}
.stock-receipt-table th:nth-child(1),.stock-receipt-table td:nth-child(1){display:table-cell!important;width:8%;text-align:center;}
.stock-receipt-table th:nth-child(2),.stock-receipt-table td:nth-child(2){width:37%;text-align:left;}
.stock-receipt-table th:nth-child(3),.stock-receipt-table td:nth-child(3){width:12%;text-align:center;}
.stock-receipt-table th:nth-child(4),.stock-receipt-table td:nth-child(4){width:20%;text-align:right;}
.stock-receipt-table th:nth-child(5),.stock-receipt-table td:nth-child(5){width:23%;text-align:right;}

/* Upah operator (Cutting/Jahit/Lubang): responsif berdasarkan lebar area konten/sheet, bukan lebar window. */
.wage-operator-responsive{container-type:inline-size;}
.wage-operator-responsive .wage-responsive-table th:nth-child(1),
.wage-operator-responsive .wage-responsive-table td:nth-child(1){display:table-cell;}

@container (max-width:700px){
  .wage-operator-responsive.finance-table-card{padding:0;overflow:visible;}
  .wage-operator-responsive .table-wrap{overflow:visible;}
  .wage-operator-responsive .wage-responsive-table{display:block;width:100%;min-width:0!important;table-layout:auto;background:transparent;}
  .wage-operator-responsive .wage-responsive-table thead{display:none;}
  .wage-operator-responsive .wage-responsive-table tbody{display:grid;width:100%;gap:10px;padding:0;}
  .wage-operator-responsive .wage-responsive-table tbody tr{display:grid;width:100%;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 14px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--card);overflow:hidden;}
  .wage-operator-responsive .wage-responsive-table tbody td{display:flex!important;width:auto!important;min-width:0!important;align-items:flex-start;justify-content:space-between;gap:10px;padding:7px 0!important;border:0!important;border-bottom:1px dashed var(--line-soft)!important;text-align:right!important;font-size:11px!important;line-height:1.35!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;word-break:normal;}
  .wage-operator-responsive .wage-responsive-table tbody td::before{content:attr(data-label);display:block;flex:0 0 auto;color:var(--slate);font-size:9px;line-height:1.25;font-weight:800;letter-spacing:.025em;text-align:left;text-transform:uppercase;}
  .wage-operator-responsive .wage-responsive-table tbody td>b,
  .wage-operator-responsive .wage-responsive-table tbody td>strong{min-width:0;max-width:72%;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;}
  .wage-operator-responsive .wage-responsive-table tbody td:nth-last-child(-n+2){border-bottom:0!important;}

  .wage-operator-responsive .wage-summary-table td[data-label="Petugas"]{display:none!important;}
  .wage-operator-responsive .wage-summary-table td[data-label="Divisi"],
  .wage-operator-responsive .wage-summary-table td[data-label="Aksi"]{grid-column:1/-1;}
  .wage-operator-responsive .wage-summary-table td[data-label="Divisi"]{padding-top:2px!important;font-size:13px!important;font-weight:800!important;}
  .wage-operator-responsive .wage-summary-table td[data-label="Aksi"]{padding:10px 0 2px!important;border-bottom:0!important;}
  .wage-operator-responsive .wage-summary-table td[data-label="Aksi"]::before{display:none;}
  .wage-operator-responsive .wage-summary-table .finance-row-actions{width:100%;justify-content:stretch;}
  .wage-operator-responsive .wage-summary-table .finance-row-actions .btn{flex:1 1 0;width:100%;min-height:38px;}
  .wage-operator-responsive .wage-summary-table .badge{justify-self:auto;}

  .wage-operator-responsive .wage-detail-table td[data-label="Produk"],
  .wage-operator-responsive .wage-detail-table td[data-label="Referensi"],
  .wage-operator-responsive .wage-detail-table td[data-label="Aksi"]{grid-column:1/-1;}
  .wage-operator-responsive .wage-detail-table td[data-label="Produk"]{display:block!important;padding-top:2px!important;text-align:left!important;}
  .wage-operator-responsive .wage-detail-table td[data-label="Produk"]::before{margin-bottom:4px;}
  .wage-operator-responsive .wage-detail-table td[data-label="Produk"] b{display:block;max-width:100%;font-size:13px;line-height:1.3;text-align:left;white-space:normal!important;overflow-wrap:anywhere;}
  .wage-operator-responsive .wage-detail-table td[data-label="Referensi"]{text-align:left!important;}
  .wage-operator-responsive .wage-detail-table td[data-label="Referensi"]::before{margin-right:10px;}
  .wage-operator-responsive .wage-detail-table td[data-label="Aksi"]{padding:10px 0 2px!important;border-bottom:0!important;}
  .wage-operator-responsive .wage-detail-table td[data-label="Aksi"]::before{display:none;}
  .wage-operator-responsive .wage-detail-table td[data-label="Aksi"] select{width:100%;max-width:none;min-height:38px;}
}

@container (max-width:460px){
  .wage-operator-responsive .wage-responsive-table tbody tr{grid-template-columns:1fr;padding:9px 11px;}
  .wage-operator-responsive .wage-responsive-table tbody td{grid-column:1/-1!important;font-size:10.5px!important;}
  .wage-operator-responsive .wage-responsive-table tbody td:nth-last-child(-n+2){border-bottom:1px dashed var(--line-soft)!important;}
  .wage-operator-responsive .wage-responsive-table tbody td:last-child{border-bottom:0!important;}
  .wage-operator-responsive .wage-summary-table td[data-label="Petugas"]{display:none!important;}
}
/* Produksi · Cutting/Lubang operator: aksi dan data utama tetap terbaca pada tablet/HP. */
.production-table-card:has(.production-data-table [data-action="cutting-detail"]){container-type:inline-size;}

/* Cutting login: desktop/tablet sempit tetap tabel, tetapi produk/petugas boleh wrap dan Aksi ditumpuk. */
@media (min-width:768px) and (max-width:1099px){
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(2),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(2){width:12%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(3),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(3){width:23%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(4),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(4){width:15%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(5),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(5){width:13%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(6),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(6){width:11%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(7),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(7){width:14%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(8),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(8){width:12%;}
}

.production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(3),
.production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(4){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere;
  line-height:1.15;
}
.production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:last-child{
  overflow:visible!important;
  text-overflow:clip!important;
}
.production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:last-child .btn-row{
  display:grid;
  grid-template-columns:1fr;
  gap:3px;
  width:100%;
  min-width:0;
  margin:0;
  justify-content:stretch;
}
.production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:last-child .btn{
  width:100%;
  min-width:0;
  max-width:none;
  margin:0;
  white-space:nowrap;
}

@media (max-width:767px){
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(2),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(2){width:13%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(3),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(3){width:24%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(4),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(4){width:14%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(5),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(5){width:13%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(6),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(6){width:11%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(7),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(7){width:13%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(8),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(8){width:12%;}
}

@media (max-width:520px){
  /* Petugas tidak perlu mengambil ruang pada login Cutting: akun hanya melihat datanya sendiri. */
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(4),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(4){display:none!important;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(2),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(2){width:14%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(3),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(3){width:31%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(5),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(5){width:15%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(6),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(6){width:14%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(7),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(7){width:14%;}
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) th:nth-child(8),
  .production-table-card:has(.production-data-table [data-action="cutting-detail"]) .production-data-table:not(.production-cutting-table) td:nth-child(8){width:12%;}
}

/* Lubang login: SPK disembunyikan pada tablet/HP; ruang diprioritaskan ke Model dan Aksi. */
@media (max-width:1099px){
  .production-lubang-worker-table th:nth-child(1),
  .production-lubang-worker-table td:nth-child(1){display:none!important;}
  .production-lubang-worker-table th:nth-child(2),
  .production-lubang-worker-table td:nth-child(2){width:31%!important;}
  .production-lubang-worker-table th:nth-child(3),
  .production-lubang-worker-table td:nth-child(3){width:15%!important;}
  .production-lubang-worker-table th:nth-child(4),
  .production-lubang-worker-table td:nth-child(4){width:10%!important;}
  .production-lubang-worker-table th:nth-child(5),
  .production-lubang-worker-table td:nth-child(5){width:17%!important;}
  .production-lubang-worker-table th:nth-child(6),
  .production-lubang-worker-table td:nth-child(6){width:27%!important;}
  .production-lubang-worker-table td:nth-child(2){
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere;
    line-height:1.15;
  }
  .production-lubang-worker-table td:last-child{overflow:visible!important;}
  .production-lubang-worker-table td:last-child .btn-row{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    width:100%!important;
    margin:0!important;
    justify-content:stretch!important;
  }
  .production-lubang-worker-table td:last-child .btn-row .btn{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:28px;
    padding:4px 5px!important;
    margin:0!important;
    font-size:8.5px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
}

@media (max-width:520px){
  .production-lubang-worker-table th,.production-lubang-worker-table td{padding-left:2px!important;padding-right:2px!important;}
  .production-lubang-worker-table th:nth-child(2),.production-lubang-worker-table td:nth-child(2){width:30%!important;}
  .production-lubang-worker-table th:nth-child(3),.production-lubang-worker-table td:nth-child(3){width:15%!important;}
  .production-lubang-worker-table th:nth-child(4),.production-lubang-worker-table td:nth-child(4){width:10%!important;}
  .production-lubang-worker-table th:nth-child(5),.production-lubang-worker-table td:nth-child(5){width:17%!important;}
  .production-lubang-worker-table th:nth-child(6),.production-lubang-worker-table td:nth-child(6){width:28%!important;}
  .production-lubang-worker-table td:last-child .btn-row .btn{min-height:24px;font-size:7.8px!important;padding:3px 3px!important;}
}

/* ======================================================
   Upah & Gaji v24: struktur card, bukan tabel sempit.
   Rekap petugas dan rincian transaksi selalu menampilkan
   nama/nominal lengkap tanpa ellipsis atau horizontal scroll.
   ====================================================== */
.wage-recap-list{
  display:grid;
  gap:10px;
  width:100%;
  min-width:0;
}
.wage-recap-card{
  min-width:0;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--card);
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset;
}
.wage-recap-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}
.wage-recap-person{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px 9px;
  min-width:0;
}
.wage-recap-person strong{
  min-width:0;
  color:var(--ink);
  font-family:'Space Grotesk',sans-serif;
  font-size:14px;
  font-weight:800;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.wage-recap-person span{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--primary-tint);
  color:var(--primary-dark);
  font-size:9px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
}
.wage-recap-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:11px;
}
.wage-recap-metric{
  min-width:0;
  padding:8px 9px;
  border:1px solid var(--line-soft);
  border-radius:10px;
  background:var(--surface-soft,var(--paper));
}
.wage-recap-metric span{
  display:block;
  margin-bottom:3px;
  color:var(--slate);
  font-size:9px;
  font-weight:700;
  line-height:1.2;
}
.wage-recap-metric b{
  display:block;
  min-width:0;
  color:var(--ink);
  font-family:'Space Grotesk',sans-serif;
  font-size:12.5px;
  font-weight:800;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}
.wage-recap-due b{color:var(--primary-dark);}
.wage-recap-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line-soft);
}
.wage-recap-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  min-width:0;
}
.wage-recap-actions .btn{
  min-height:32px;
  padding:6px 11px;
  font-size:10px;
  white-space:nowrap;
}

.wage-tx-list{
  display:grid;
  gap:9px;
  width:100%;
  min-width:0;
}
.wage-tx-card{
  min-width:0;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card);
}
.wage-tx-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.wage-tx-title{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-width:0;
}
.wage-tx-title strong{
  min-width:0;
  color:var(--ink);
  font-family:'Space Grotesk',sans-serif;
  font-size:13.5px;
  font-weight:800;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}
.wage-tx-title span{
  flex:0 0 auto;
  color:var(--slate);
  font-size:9.5px;
  font-weight:700;
  white-space:nowrap;
}
.wage-tx-reference{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:8px;
  align-items:start;
  margin-top:7px;
  padding-top:7px;
  border-top:1px dashed var(--line-soft);
}
.wage-tx-reference span{
  color:var(--slate);
  font-size:9px;
  font-weight:700;
}
.wage-tx-reference b{
  min-width:0;
  color:var(--ink-soft);
  font-size:10px;
  font-weight:700;
  text-align:right;
  white-space:normal;
  overflow-wrap:anywhere;
}
.wage-tx-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  margin-top:9px;
}
.wage-tx-metrics>div{
  min-width:0;
  padding:7px 8px;
  border-radius:9px;
  background:var(--surface-soft,var(--paper));
}
.wage-tx-metrics span{
  display:block;
  margin-bottom:2px;
  color:var(--slate);
  font-size:8.5px;
  font-weight:700;
}
.wage-tx-metrics b{
  display:block;
  min-width:0;
  color:var(--ink);
  font-family:'Space Grotesk',sans-serif;
  font-size:11px;
  font-weight:800;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}
.wage-tx-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:9px;
}
.wage-tx-actions select{
  width:auto;
  min-width:132px;
  min-height:34px;
  padding:6px 30px 6px 10px;
  font-size:10px;
}
.wage-detail-actions{margin-top:12px;}

@media (max-width:700px){
  .wage-recap-card{padding:12px;}
  .wage-recap-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .wage-recap-metric b{font-size:12px;}
  .wage-tx-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .wage-tx-metrics b{font-size:11px;}
}
@media (max-width:420px){
  .wage-recap-person{display:grid;gap:6px;}
  .wage-recap-person span{width:max-content;max-width:100%;}
  .wage-recap-metrics{gap:6px;}
  .wage-recap-metric{padding:7px 8px;}
  .wage-recap-foot{align-items:stretch;flex-direction:column;}
  .wage-recap-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;}
  .wage-recap-actions .btn{width:100%;}
  .wage-tx-title{display:grid;gap:4px;}
  .wage-tx-title span{white-space:normal;}
  .wage-tx-reference{grid-template-columns:1fr;}
  .wage-tx-reference b{text-align:left;}
  .wage-tx-actions select{width:100%;min-width:0;}
  .wage-detail-actions{display:grid;grid-template-columns:1fr;}
  .wage-detail-actions .btn{width:100%;}
}

/* Master: 5 tab tetap muat tanpa scroll horizontal. */
.master-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;}
.master-tabs button{min-width:0;white-space:normal;line-height:1.15;padding-left:7px;padding-right:7px;}
.master-finance-category-card{width:100%;max-width:100%;overflow:hidden;padding:0;}
.master-finance-category-table{width:100%;min-width:0!important;table-layout:fixed;}
.master-finance-category-table th,.master-finance-category-table td{padding:10px 8px;vertical-align:middle;}
.master-finance-category-table th:first-child,.master-finance-category-table td:first-child{width:78%;white-space:normal;overflow-wrap:anywhere;}
.master-finance-category-table th:last-child,.master-finance-category-table td:last-child{width:22%;text-align:right;}
.master-finance-category-table td:last-child .btn{min-width:72px;}
@media (max-width:560px){
  .master-tabs{grid-template-columns:repeat(2,minmax(0,1fr));}
  .master-finance-category-table,.master-finance-category-table tbody{display:block;width:100%;}
  .master-finance-category-table thead{display:none;}
  .master-finance-category-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:9px 10px;border-bottom:1px solid var(--line-soft);}
  .master-finance-category-table tr:last-child{border-bottom:0;}
  .master-finance-category-table td,.master-finance-category-table td:nth-child(n){display:block!important;width:auto!important;padding:0;border:0!important;overflow:visible;text-overflow:clip;}
  .master-finance-category-table td::before{display:none!important;}
  .master-finance-category-table td:last-child .btn{width:auto;min-width:72px;}
  .master-finance-category-table td[colspan]{grid-column:1/-1;text-align:center;padding:12px 0!important;}
}

/* Master Bahan Baku - UI/frontend stage. */
.master-material-card{width:100%;max-width:100%;overflow:hidden;padding:0;}
.master-material-table{width:100%;min-width:0!important;table-layout:fixed;border-collapse:collapse;}
.master-material-table th,.master-material-table td{padding:12px 12px;vertical-align:middle;}
.master-material-table th{font-size:11.5px!important;letter-spacing:.03em;color:var(--slate);}
.master-material-table td{font-size:14px!important;line-height:1.45;}
.master-material-table td b{font-weight:800;}
/* Master Bahan Baku tidak boleh mewarisi aturan tabel Produksi yang menyembunyikan kolom pertama. */
.master-material-table th:first-child,.master-material-table td:first-child{display:table-cell!important;white-space:normal;overflow-wrap:anywhere;}
.master-material-table:not(.has-owner-price) th:nth-child(1),.master-material-table:not(.has-owner-price) td:nth-child(1){width:34%;text-align:left;}
.master-material-table:not(.has-owner-price) th:nth-child(2),.master-material-table:not(.has-owner-price) td:nth-child(2){width:26%;text-align:left;}
.master-material-table:not(.has-owner-price) th:nth-child(3),.master-material-table:not(.has-owner-price) td:nth-child(3){width:14%;text-align:left;}
.master-material-table:not(.has-owner-price) th:nth-child(4),.master-material-table:not(.has-owner-price) td:nth-child(4){width:12%;text-align:center;}
.master-material-table:not(.has-owner-price) th:nth-child(5),.master-material-table:not(.has-owner-price) td:nth-child(5){width:14%;text-align:center;}
.master-material-table.has-owner-price th:nth-child(1),.master-material-table.has-owner-price td:nth-child(1){width:24%;text-align:left;}
.master-material-table.has-owner-price th:nth-child(2),.master-material-table.has-owner-price td:nth-child(2){width:18%;text-align:left;}
.master-material-table.has-owner-price th:nth-child(3),.master-material-table.has-owner-price td:nth-child(3){width:10%;text-align:left;}
.master-material-table.has-owner-price th:nth-child(4),.master-material-table.has-owner-price td:nth-child(4){width:22%;text-align:right;}
.master-material-table.has-owner-price th:nth-child(5),.master-material-table.has-owner-price td:nth-child(5){width:12%;text-align:center;}
.master-material-table.has-owner-price th:nth-child(6),.master-material-table.has-owner-price td:nth-child(6){width:14%;text-align:center;}
.master-material-table td:last-child{padding-right:12px;}
.master-material-table td:last-child .btn{min-width:74px;margin:0 auto;display:inline-flex;justify-content:center;}
.master-material-form{display:grid;gap:8px;min-width:0;}
.master-material-form>.field{margin-bottom:0;}
.master-owner-only-note{display:grid;gap:3px;padding:10px 11px;border:1px solid var(--line-soft);border-radius:10px;background:var(--surface-soft);}
.master-owner-only-note b{font-size:10.5px;}
.master-owner-only-note span{font-size:9.5px;line-height:1.35;color:var(--slate);}
@media (max-width:560px){
  .master-material-table,.master-material-table tbody{display:block;width:100%;}
  .master-material-table thead{display:none;}
  .master-material-table tr{display:grid;grid-template-columns:1fr 1fr;gap:0;padding:8px 9px;border-bottom:1px solid var(--line-soft);}
  .master-material-table tr:last-child{border-bottom:0;}
  .master-material-table td,.master-material-table td:nth-child(n){display:flex!important;width:auto!important;min-width:0;justify-content:space-between;gap:8px;padding:7px 6px;border:0!important;white-space:normal!important;font-size:12.5px!important;}
  .master-material-table td::before{content:attr(data-label);flex:0 0 auto;max-width:48%;font-size:8.5px;font-weight:800;color:var(--slate);text-transform:uppercase;letter-spacing:.03em;}
  .master-material-table td:first-child,.master-material-table td:last-child{grid-column:1/-1;}
  .master-material-table td:first-child{display:block!important;}
  .master-material-table td:first-child::before{display:block;margin-bottom:3px;max-width:none;}
  .master-material-table td:last-child::before{display:none;}
  .master-material-table td:last-child .btn{width:100%;}
  .master-material-table td[colspan]{grid-column:1/-1!important;display:block!important;text-align:center;}
  .master-material-table td[colspan]::before{display:none;}
}


/* ======================================================
   Keuangan v41: UI client sederhana + kartu seperti Upah.
   ====================================================== */
.finance-tabs.finance-tabs-simple{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.finance-tabs.finance-tabs-simple button{grid-column:auto!important;min-height:40px;padding:8px 10px;font-size:12px;}
.finance-date-simple{display:grid;grid-template-columns:minmax(130px,1fr) minmax(130px,1fr) auto auto;gap:8px;align-items:end;margin-bottom:12px;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--card);}
.finance-date-simple .field{margin:0;min-width:0;}
.finance-date-simple .field label{font-size:9.5px;}
.finance-date-simple input{width:100%;min-width:0;}
.finance-date-simple>.btn{min-height:42px;white-space:nowrap;}
.finance-summary-simple .finance-summary-card .lbl{font-size:10px;}
.finance-summary-simple .finance-summary-card .val{font-size:18px;}
.finance-summary-simple .finance-summary-card .mini{font-size:9.5px;}
.finance-simple-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;margin-bottom:12px;}
.finance-simple-toolbar-end{display:flex;justify-content:flex-end;}
.finance-simple-toolbar .finance-search{min-width:0;}
.finance-simple-toolbar>.btn{min-height:40px;white-space:nowrap;}
.finance-recap-list{margin-bottom:10px;}
.finance-recap-card .badge{flex:0 0 auto;}
.finance-recap-footnote{min-width:0;color:var(--slate);font-size:9.5px;font-weight:600;line-height:1.35;overflow-wrap:anywhere;}
.finance-recap-note{margin-top:9px;padding:8px 9px;border:1px solid var(--line-soft);border-radius:10px;background:var(--surface-soft,var(--paper));color:var(--ink-soft);font-size:10px;line-height:1.4;overflow-wrap:anywhere;}
.finance-expense-metrics{grid-template-columns:repeat(3,minmax(0,1fr));}
@container (max-width:560px){.finance-tabs.finance-tabs-simple{grid-template-columns:repeat(2,minmax(0,1fr));}.finance-tabs.finance-tabs-simple button{grid-column:auto!important;min-height:40px;}}
@media (max-width:700px){.finance-date-simple{grid-template-columns:1fr 1fr;}.finance-date-simple>.btn{width:100%;}.finance-simple-toolbar{grid-template-columns:1fr;}.finance-simple-toolbar>.btn{width:100%;}.finance-expense-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:420px){.finance-date-simple{grid-template-columns:1fr;}.finance-expense-metrics{grid-template-columns:1fr;}.finance-recap-card .wage-recap-head{align-items:flex-start;}}

/* Keuangan v42: daftar ringkas -> popup detail/riwayat. */
.finance-list-toolbar{display:grid;grid-template-columns:minmax(180px,280px);gap:8px;align-items:end;margin-bottom:12px;}
.finance-list-toolbar-actions{grid-template-columns:minmax(180px,280px) auto;justify-content:space-between;}
.finance-list-toolbar .field{margin:0;min-width:0;}
.finance-list-toolbar select{width:100%;min-width:0;}
.finance-list-toolbar>.btn{min-height:42px;white-space:nowrap;}
.finance-expense-toolbar-compact{
  display:grid;
  grid-template-columns:minmax(240px,1fr) minmax(190px,260px) auto auto;
  gap:8px;
  align-items:end;
  width:100%;
  margin-bottom:12px;
}
.finance-expense-toolbar-compact .field{margin:0;min-width:0;}
.finance-expense-toolbar-compact .finance-search{width:100%;}
.finance-expense-toolbar-compact select{width:100%;min-width:0;height:44px;}
.finance-expense-toolbar-compact>.btn{min-height:44px;height:44px;padding-inline:16px;white-space:nowrap;}
.finance-simple-list{display:grid;gap:8px;margin-bottom:10px;}
.finance-simple-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto 18px;gap:12px;align-items:center;width:100%;min-width:0;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:var(--card);color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:none;}
.finance-simple-row:hover{border-color:color-mix(in srgb,var(--primary) 35%,var(--line));background:var(--primary-tint);}
.finance-simple-main{display:grid;gap:3px;min-width:0;}
.finance-simple-main b{font-size:12px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.finance-simple-main small{font-size:9.5px;line-height:1.35;color:var(--slate);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.finance-simple-value{display:grid;gap:2px;text-align:right;white-space:nowrap;}
.finance-simple-value small{font-size:8.5px;color:var(--slate);}
.finance-simple-value b{font-size:11.5px;}
.finance-simple-status{display:flex;justify-content:flex-end;white-space:nowrap;}
.finance-simple-arrow{font-size:24px;line-height:1;color:var(--slate);}
.finance-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 14px;}
.finance-detail-summary-3{grid-template-columns:repeat(3,minmax(0,1fr));}
.finance-detail-summary>div{min-width:0;padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--paper);}
.finance-detail-summary span{display:block;font-size:8.5px;color:var(--slate);margin-bottom:4px;}
.finance-detail-summary b{display:block;font-size:11px;overflow-wrap:anywhere;}
.finance-detail-list{display:grid;gap:7px;}
.finance-detail-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;padding:9px 10px;border:1px solid var(--line-soft);border-radius:10px;background:var(--card);}
.finance-detail-row>div{display:grid;gap:3px;min-width:0;}
.finance-detail-row b{font-size:10.5px;line-height:1.3;}
.finance-detail-row span,.finance-detail-row small{font-size:9px;line-height:1.4;color:var(--slate);overflow-wrap:anywhere;}
.finance-detail-row-stack{align-items:flex-start;}
.finance-detail-amount{text-align:right;flex:0 0 auto;}
.finance-detail-empty{padding:10px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:9.5px;text-align:center;}
@media (max-width:900px){
  .finance-expense-toolbar-compact{grid-template-columns:minmax(0,1fr) minmax(180px,240px);}
  .finance-expense-toolbar-compact>.btn{width:100%;}
}
@media (max-width:700px){
  .finance-list-toolbar-actions{grid-template-columns:1fr;}
  .finance-list-toolbar-actions>.btn{width:100%;}
  .finance-expense-toolbar-compact{grid-template-columns:1fr;}
  .finance-expense-toolbar-compact>.btn{width:100%;}
  .finance-simple-row{grid-template-columns:minmax(0,1fr) auto 18px;gap:8px;padding:11px 12px;}
  .finance-simple-status{grid-column:1/3;justify-content:flex-start;}
  .finance-simple-arrow{grid-column:3;grid-row:1/3;align-self:center;}
  .finance-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr));}
  .finance-detail-summary-3{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:420px){
  .finance-simple-main small{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .finance-simple-value b{font-size:10.5px;}
  .finance-detail-row{align-items:flex-start;}
}


/* Master Produk form: compact sheet, field/flow tetap sama. */
.master-product-form-compact{display:grid;gap:8px;min-width:0;}
.master-product-form-compact h3{margin-bottom:2px;}
.master-product-form-compact>.field,
.master-product-form-compact .master-rate-grid .field{margin-bottom:0;}
.master-product-form-compact .field label{margin-bottom:4px;font-size:10.5px;line-height:1.2;}
.master-product-form-compact .field input,
.master-product-form-compact .field select{padding:8px 10px;font-size:13px;border-radius:10px;}
.master-product-form-compact .grid2{gap:8px;}
.master-product-form-compact .section-label{margin:7px 0 2px;font-size:9.5px;letter-spacing:.08em;line-height:1.2;}
.master-product-form-compact .master-price-hpp-grid{grid-template-columns:1fr;gap:0;}
.master-product-form-compact .master-price-hpp-grid .small{margin:0 0 3px;font-size:10px;line-height:1.2;}
.master-product-form-compact .master-rate-grid,
.master-product-form-compact .master-rate-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 8px;}
.master-product-form-compact .master-chip-list{min-height:30px;padding:5px 7px;gap:5px;border-radius:9px;}
.master-product-form-compact .master-chip{padding:4px 8px;font-size:8.5px;}
.master-product-form-compact .btn{min-height:38px;padding-top:8px;padding-bottom:8px;}
.master-product-form-compact .sheet-actions{margin-top:4px;}
@media(max-width:430px){
  .master-product-form-compact .master-rate-grid,
  .master-product-form-compact .master-rate-grid-v2{grid-template-columns:1fr;}
}

/* ======================================================
   Master v48: Petugas, Pelanggan, Kategori Keuangan.
   Tabel ringkas, font terbaca, 10 data/page tetap dari master.js.
   Produk tidak disentuh pada blok ini.
   ====================================================== */
.master-customer-card,
.master-worker-card,
.master-finance-category-card{
  width:100%;
  max-width:100%;
  overflow:hidden;
  padding:0;
}

.master-customer-table,
.master-worker-table,
.master-finance-category-table{
  width:100%;
  min-width:0!important;
  table-layout:fixed;
  border-collapse:collapse;
}

.master-customer-table thead th,
.master-worker-table thead th,
.master-finance-category-table thead th{
  padding:9px 10px;
  background:var(--paper);
  color:var(--slate);
  font-size:9px;
  font-weight:800;
  line-height:1.2;
  letter-spacing:.035em;
  text-transform:uppercase;
  border-bottom:1px solid var(--line-soft);
}

.master-customer-table tbody td,
.master-worker-table tbody td,
.master-finance-category-table tbody td{
  padding:9px 10px;
  color:var(--ink);
  font-size:11px;
  font-weight:500;
  line-height:1.3;
  vertical-align:middle;
  border-bottom:1px solid var(--line-soft);
}

.master-customer-table tbody tr:last-child td,
.master-worker-table tbody tr:last-child td,
.master-finance-category-table tbody tr:last-child td{border-bottom:0;}

.master-customer-table td b,
.master-worker-table td b,
.master-finance-category-table td b{
  font-size:11px;
  font-weight:700;
  line-height:1.3;
}

.master-customer-table .small,
.master-worker-table .small{
  margin-top:3px;
  color:var(--slate);
  font-size:9px;
  font-weight:500;
  line-height:1.3;
}

/* Pelanggan: 6 kolom aktual. */
.master-customer-table th:nth-child(1),
.master-customer-table td:nth-child(1){display:table-cell!important;width:22%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-customer-table th:nth-child(2),
.master-customer-table td:nth-child(2){width:14%;text-align:left;}
.master-customer-table th:nth-child(3),
.master-customer-table td:nth-child(3){display:table-cell!important;width:18%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-customer-table th:nth-child(4),
.master-customer-table td:nth-child(4){width:27%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-customer-table th:nth-child(5),
.master-customer-table td:nth-child(5){width:10%;text-align:center;}
.master-customer-table th:nth-child(6),
.master-customer-table td:nth-child(6){width:9%;text-align:right;overflow:visible;}

/* Petugas: 5 kolom aktual, jangan mewarisi pembagian kolom Pelanggan. */
.master-worker-table th:nth-child(1),
.master-worker-table td:nth-child(1){display:table-cell!important;width:24%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-worker-table th:nth-child(2),
.master-worker-table td:nth-child(2){display:table-cell!important;width:22%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-worker-table th:nth-child(3),
.master-worker-table td:nth-child(3){display:table-cell!important;width:32%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-worker-table th:nth-child(4),
.master-worker-table td:nth-child(4){display:table-cell!important;width:12%;text-align:center;}
.master-worker-table th:nth-child(5),
.master-worker-table td:nth-child(5){display:table-cell!important;width:10%;text-align:right;overflow:visible;}

.master-customer-table td:last-child .btn,
.master-worker-table td:last-child .btn,
.master-finance-category-table td:last-child .btn{
  width:auto;
  min-width:68px;
  min-height:30px;
  padding:5px 10px;
  border-radius:9px;
  font-size:9.5px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}

/* Kategori Keuangan: nama di kiri, aksi di kanan, tidak ada ruang kosong berlebihan. */
.master-finance-category-card .master-table-wrap{overflow:hidden;}
.master-finance-category-table tbody tr{height:44px;}
.master-finance-category-table th:first-child,
.master-finance-category-table td:first-child{
  display:table-cell!important;
  width:82%;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
}
.master-finance-category-table th:last-child,
.master-finance-category-table td:last-child{width:18%;text-align:right;}

@media (max-width:767px){
  .master-customer-table,
  .master-worker-table,
  .master-customer-table tbody,
  .master-worker-table tbody{
    display:block;
    width:100%;
  }
  .master-customer-table thead,
  .master-worker-table thead{display:none;}

  .master-customer-table tr,
  .master-worker-table tr{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 12px;
    width:100%;
    padding:8px 10px;
    border-bottom:1px solid var(--line-soft);
    box-sizing:border-box;
  }
  .master-customer-table tr:last-child,
  .master-worker-table tr:last-child{border-bottom:0;}

  .master-customer-table td,
  .master-worker-table td,
  .master-customer-table td:nth-child(n),
  .master-worker-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 0;
    border:0!important;
    color:var(--ink);
    font-size:10.5px;
    line-height:1.3;
    white-space:normal!important;
    overflow:visible;
    text-overflow:clip;
    text-align:right;
    box-sizing:border-box;
  }
  .master-customer-table td::before,
  .master-worker-table td::before{
    content:attr(data-label);
    flex:0 0 auto;
    max-width:48%;
    color:var(--slate);
    font-size:8px;
    font-weight:800;
    line-height:1.25;
    letter-spacing:.025em;
    text-align:left;
    text-transform:uppercase;
  }
  .master-customer-table td>* ,
  .master-worker-table td>*{min-width:0;overflow-wrap:anywhere;}

  .master-customer-table td:first-child,
  .master-worker-table td:first-child{
    grid-column:1/-1;
    display:block!important;
    padding:7px 0 8px;
    text-align:left!important;
    border-bottom:1px dashed var(--line-soft)!important;
  }
  .master-customer-table td:first-child::before,
  .master-worker-table td:first-child::before{
    display:block;
    max-width:none;
    margin-bottom:3px;
  }
  .master-customer-table td:first-child b,
  .master-worker-table td:first-child b{font-size:11px;}

  .master-customer-table td:nth-child(4){grid-column:1/-1;text-align:left!important;}
  .master-customer-table td:nth-child(4)::before{margin-right:auto;}
  .master-worker-table td:nth-child(3){grid-column:1/-1;text-align:left!important;}
  .master-worker-table td:nth-child(3)::before{margin-right:auto;}

  .master-customer-table td:last-child,
  .master-worker-table td:last-child{
    grid-column:1/-1;
    display:block!important;
    padding:7px 0 2px;
    text-align:right!important;
  }
  .master-customer-table td:last-child::before,
  .master-worker-table td:last-child::before{display:none;}
  .master-customer-table td:last-child .btn,
  .master-worker-table td:last-child .btn{width:100%;min-height:34px;}

  .master-customer-table td[colspan],
  .master-worker-table td[colspan]{grid-column:1/-1!important;display:block!important;text-align:center!important;}
  .master-customer-table td[colspan]::before,
  .master-worker-table td[colspan]::before{display:none;}
}

@media (max-width:560px){
  .master-finance-category-table,
  .master-finance-category-table tbody{display:block;width:100%;}
  .master-finance-category-table thead{display:none;}
  .master-finance-category-table tr{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    min-height:44px;
    height:auto;
    padding:7px 10px;
    border-bottom:1px solid var(--line-soft);
  }
  .master-finance-category-table tr:last-child{border-bottom:0;}
  .master-finance-category-table td,
  .master-finance-category-table td:nth-child(n){
    display:block!important;
    width:auto!important;
    padding:0;
    border:0!important;
    overflow:visible;
    text-overflow:clip;
  }
  .master-finance-category-table td:first-child{text-align:left!important;}
  .master-finance-category-table td:first-child b{font-size:11px;font-weight:700;}
  .master-finance-category-table td::before{display:none!important;}
  .master-finance-category-table td:last-child{text-align:right!important;}
  .master-finance-category-table td:last-child .btn{width:auto;min-width:68px;}
  .master-finance-category-table td[colspan]{grid-column:1/-1;text-align:center!important;padding:12px 0!important;}
}

@media (max-width:420px){
  .master-customer-table tr,
  .master-worker-table tr{grid-template-columns:1fr;padding:8px 9px;}
  .master-customer-table td,
  .master-worker-table td,
  .master-customer-table td:nth-child(n),
  .master-worker-table td:nth-child(n){grid-column:1/-1;}
}

/* ======================================================
   Master v49: responsive action-column fix.
   Petugas/Pelanggan berubah ke layout kartu lebih awal pada
   viewport aplikasi sempit agar Aksi tidak pernah terpotong.
   Kategori Keuangan menjaga header Aksi dan tombol Edit pada
   sumbu kolom yang sama.
   ====================================================== */

/* Kategori Keuangan: kolom aksi punya ruang tetap dan alignment konsisten. */
.master-finance-category-table th:first-child,
.master-finance-category-table td:first-child{
  width:auto!important;
}
.master-finance-category-table th:last-child,
.master-finance-category-table td:last-child{
  width:96px!important;
  min-width:96px;
  padding-left:8px;
  padding-right:8px;
  text-align:center!important;
  box-sizing:border-box;
}
.master-finance-category-table td:last-child .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0 auto;
}

/*
   Dengan sidebar aktif, viewport tablet/laptop kecil masih menyisakan
   area konten yang terlalu sempit untuk 5-6 kolom. Gunakan layout
   detail-per-baris sebelum kolom Aksi mulai terpotong.
*/
@media (max-width:1099px){
  .master-customer-table,
  .master-worker-table,
  .master-customer-table tbody,
  .master-worker-table tbody{
    display:block;
    width:100%;
  }
  .master-customer-table thead,
  .master-worker-table thead{display:none;}

  .master-customer-table tr,
  .master-worker-table tr{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 14px;
    width:100%;
    padding:9px 11px;
    border-bottom:1px solid var(--line-soft);
    box-sizing:border-box;
  }
  .master-customer-table tr:last-child,
  .master-worker-table tr:last-child{border-bottom:0;}

  .master-customer-table td,
  .master-worker-table td,
  .master-customer-table td:nth-child(n),
  .master-worker-table td:nth-child(n){
    display:flex!important;
    width:auto!important;
    min-width:0;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding:6px 0;
    border:0!important;
    color:var(--ink);
    font-size:10.5px;
    line-height:1.3;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip;
    text-align:right;
    box-sizing:border-box;
  }
  .master-customer-table td::before,
  .master-worker-table td::before{
    content:attr(data-label);
    flex:0 0 auto;
    max-width:46%;
    color:var(--slate);
    font-size:8px;
    font-weight:800;
    line-height:1.25;
    letter-spacing:.025em;
    text-align:left;
    text-transform:uppercase;
  }
  .master-customer-table td>*,
  .master-worker-table td>*{
    min-width:0;
    overflow-wrap:anywhere;
  }

  .master-customer-table td:first-child,
  .master-worker-table td:first-child{
    grid-column:1/-1;
    display:block!important;
    padding:7px 0 8px;
    text-align:left!important;
    border-bottom:1px dashed var(--line-soft)!important;
  }
  .master-customer-table td:first-child::before,
  .master-worker-table td:first-child::before{
    display:block;
    max-width:none;
    margin-bottom:3px;
  }

  .master-customer-table td:nth-child(4){grid-column:1/-1;text-align:left!important;}
  .master-customer-table td:nth-child(4)::before{margin-right:auto;}
  .master-worker-table td:nth-child(3){grid-column:1/-1;text-align:left!important;}
  .master-worker-table td:nth-child(3)::before{margin-right:auto;}

  .master-customer-table td:last-child,
  .master-worker-table td:last-child{
    grid-column:1/-1;
    display:block!important;
    width:100%!important;
    padding:8px 0 2px;
    text-align:right!important;
  }
  .master-customer-table td:last-child::before,
  .master-worker-table td:last-child::before{display:none;}
  .master-customer-table td:last-child .btn,
  .master-worker-table td:last-child .btn{
    width:100%;
    max-width:100%;
    min-height:34px;
    box-sizing:border-box;
  }

  .master-customer-table td[colspan],
  .master-worker-table td[colspan]{
    grid-column:1/-1!important;
    display:block!important;
    text-align:center!important;
  }
  .master-customer-table td[colspan]::before,
  .master-worker-table td[colspan]::before{display:none;}
}

@media (max-width:560px){
  /* Pertahankan Kategori Keuangan sebagai tabel 2 kolom yang jelas. */
  .master-finance-category-table{
    display:table!important;
    width:100%!important;
    table-layout:fixed;
  }
  .master-finance-category-table thead{display:table-header-group!important;}
  .master-finance-category-table tbody{display:table-row-group!important;}
  .master-finance-category-table tr{
    display:table-row!important;
    height:44px;
    min-height:0;
    padding:0!important;
    border:0!important;
  }
  .master-finance-category-table th,
  .master-finance-category-table td,
  .master-finance-category-table td:nth-child(n){
    display:table-cell!important;
    padding:9px 8px!important;
    vertical-align:middle;
    border-bottom:1px solid var(--line-soft)!important;
  }
  .master-finance-category-table tbody tr:last-child td{border-bottom:0!important;}
  .master-finance-category-table th:first-child,
  .master-finance-category-table td:first-child{text-align:left!important;}
  .master-finance-category-table th:last-child,
  .master-finance-category-table td:last-child{
    width:84px!important;
    min-width:84px;
    text-align:center!important;
  }
  .master-finance-category-table td:last-child .btn{
    min-width:62px;
    margin:0 auto;
  }
  .master-finance-category-table td[colspan]{
    display:table-cell!important;
    text-align:center!important;
    padding:12px 8px!important;
  }
}

/* Master Bahan Baku v56: rekap per nota seperti kartu Rekap Petugas. */
.master-material-note-list{display:grid;gap:10px;width:100%;min-width:0;margin-top:10px;}
.master-material-note-card{width:100%;}
.master-material-note-metrics{grid-template-columns:repeat(4,minmax(0,1fr));}
.master-material-note-metrics.is-admin{grid-template-columns:repeat(3,minmax(0,1fr));}
.master-material-note-card .wage-recap-person span{max-width:100%;overflow-wrap:anywhere;white-space:normal;}
.master-material-note-card .wage-recap-foot{margin-top:9px;}
@media (max-width:700px){
  .master-material-note-metrics,.master-material-note-metrics.is-admin{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:420px){
  .master-material-note-card{padding:12px;}
  .master-material-note-metrics,.master-material-note-metrics.is-admin{grid-template-columns:1fr 1fr;gap:7px;}
  .master-material-note-card .wage-recap-foot{align-items:center;}
}

/* Master Bahan Baku v57 - warna per nota, tetap ringkas. */
.master-material-color-list{margin:10px 0 2px;border:1px solid var(--line-soft);border-radius:12px;overflow:hidden;background:var(--card);}
.master-material-color-head,.master-material-color-row{display:grid;grid-template-columns:minmax(120px,1.2fr) repeat(3,minmax(92px,.8fr));gap:8px;align-items:center;padding:8px 10px;}
.master-material-color-head{background:var(--surface-soft);font-size:9px;font-weight:800;color:var(--slate);text-transform:uppercase;letter-spacing:.035em;}
.master-material-color-row{border-top:1px solid var(--line-soft);font-size:11.5px;}
.master-material-color-row:first-of-type{border-top:0;}
.master-material-color-head span:first-child,.master-material-color-row b{text-align:center;}
.master-material-color-head span:not(:first-child),.master-material-color-row span,.master-material-color-row strong{text-align:right;}
.master-material-color-row strong{color:var(--primary-dark);}
.master-material-color-row.is-empty{opacity:.62;}
.master-material-color-empty{margin:10px 0;padding:10px 12px;border:1px dashed var(--line);border-radius:10px;color:var(--slate);font-size:11px;}
.master-material-color-form{display:grid;gap:8px;}
.master-material-color-form-row{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(120px,.7fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface-soft);}
.master-material-color-form-row>.field{margin:0;}
.master-material-color-form-row>.btn{margin-bottom:1px;}
.master-material-color-total{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;background:var(--card);font-size:11px;}
.master-material-color-total b{font-size:13px;}
@media (max-width:600px){
  .master-material-color-head{display:none;}
  .master-material-color-row{grid-template-columns:1fr 1fr;gap:5px 10px;padding:9px 10px;}
  .master-material-color-row b{grid-column:1/-1;font-size:12px;}
  .master-material-color-row span,.master-material-color-row strong{text-align:left;font-size:10.5px;}
  .master-material-color-form-row{grid-template-columns:1fr 1fr;}
  .master-material-color-form-row>.btn{grid-column:1/-1;width:100%;}
}

/* Cutting v59: daftar Data Potongan menjadi kartu rekap untuk Owner/Admin dan Cutting. */
.cutting-recap-list{display:grid;gap:10px;width:100%;min-width:0;}
.cutting-recap-card{width:100%;}
.cutting-recap-meta{margin-top:5px;color:var(--slate);font-size:10px;font-weight:700;line-height:1.35;overflow-wrap:anywhere;}
.cutting-recap-metrics{grid-template-columns:repeat(4,minmax(0,1fr));}
.cutting-recap-remain b{color:var(--primary-dark);}
.cutting-recap-info{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px;}
.cutting-recap-info>div{min-width:0;padding:8px 9px;border:1px solid var(--line-soft);border-radius:10px;background:var(--card);}
.cutting-recap-info span{display:block;margin-bottom:3px;color:var(--slate);font-size:8.5px;font-weight:700;line-height:1.2;}
.cutting-recap-info b{display:block;min-width:0;color:var(--ink-soft);font-size:10.5px;font-weight:800;line-height:1.35;white-space:normal;overflow-wrap:anywhere;}
.cutting-recap-card .wage-recap-foot{margin-top:9px;}
@media (max-width:700px){
  .cutting-recap-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .cutting-recap-info{grid-template-columns:1fr;}
}
@media (max-width:420px){
  .cutting-recap-card{padding:12px;}
  .cutting-recap-metrics{grid-template-columns:1fr 1fr;gap:7px;}
  .cutting-recap-card .wage-recap-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  .cutting-recap-card .wage-recap-actions .btn:only-child{grid-column:1/-1;}
}

/* Master HPP Produk v79 - Owner only, read-only automatic costing. */
.master-tabs.is-owner{grid-template-columns:repeat(6,minmax(0,1fr));}
.master-hpp-card{width:100%;max-width:100%;overflow:hidden;padding:0;}
.master-hpp-table{width:100%;min-width:0!important;table-layout:fixed;border-collapse:collapse;}
.master-hpp-table thead th{padding:10px;background:var(--paper);color:var(--slate);font-size:9px;font-weight:800;letter-spacing:.035em;text-transform:uppercase;border-bottom:1px solid var(--line-soft);}
.master-hpp-table tbody td{padding:10px;color:var(--ink);font-size:11px;line-height:1.35;vertical-align:middle;border-bottom:1px solid var(--line-soft);}
.master-hpp-table tbody tr:last-child td{border-bottom:0;}
.master-hpp-table th:nth-child(1),.master-hpp-table td:nth-child(1){display:table-cell!important;width:17%;text-align:left;white-space:normal;overflow-wrap:anywhere;}
.master-hpp-table th:nth-child(2),.master-hpp-table td:nth-child(2){width:39%;text-align:left;}
.master-hpp-table th:nth-child(3),.master-hpp-table td:nth-child(3){width:16%;text-align:right;}
.master-hpp-table th:nth-child(4),.master-hpp-table td:nth-child(4){width:13%;text-align:center;}
.master-hpp-table th:nth-child(5),.master-hpp-table td:nth-child(5){width:15%;text-align:right;}
.master-hpp-table .small{margin-top:3px;color:var(--slate);font-size:9px;font-weight:500;}
.master-hpp-value b{color:var(--primary-dark);font-size:12px;}
.master-hpp-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0 14px;}
.master-hpp-detail-summary>div{padding:10px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface-soft);min-width:0;}
.master-hpp-detail-summary span{display:block;margin-bottom:4px;color:var(--slate);font-size:8.5px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;}
.master-hpp-detail-summary b{display:block;color:var(--ink);font-size:11.5px;line-height:1.35;white-space:normal;overflow-wrap:anywhere;}
.master-hpp-reference-list{display:grid;gap:7px;margin:8px 0 14px;}
.master-hpp-reference-list>div{padding:9px 10px;border:1px solid var(--line-soft);border-radius:10px;background:var(--card);font-size:10.5px;font-weight:700;color:var(--ink-soft);}
.master-hpp-breakdown{overflow:hidden;border:1px solid var(--line-soft);border-radius:12px;background:var(--card);}
.master-hpp-breakdown>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 11px;border-bottom:1px solid var(--line-soft);font-size:11px;}
.master-hpp-breakdown>div:last-child{border-bottom:0;}
.master-hpp-breakdown span{color:var(--slate);font-weight:700;}
.master-hpp-breakdown b{color:var(--ink);font-size:11.5px;white-space:nowrap;}
.master-hpp-breakdown b small{display:block;margin-top:3px;color:var(--slate);font-size:9px;font-weight:700;text-align:right;white-space:normal;}
.master-hpp-breakdown .master-hpp-breakdown-total{background:var(--surface-soft);}
.master-hpp-breakdown .master-hpp-breakdown-total span,.master-hpp-breakdown .master-hpp-breakdown-total b{color:var(--primary-dark);font-weight:900;}
.master-hpp-product{margin:8px 0;padding:9px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface-soft);}
.master-hpp-product>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 2px 7px;color:var(--ink);font-size:11px;}
.master-hpp-product>header span{color:var(--slate);font-size:9px;white-space:nowrap;}
@media (max-width:700px){
  .master-tabs.is-owner{grid-template-columns:repeat(2,minmax(0,1fr));}
  .master-hpp-detail-summary{grid-template-columns:1fr 1fr;}
}
@media (max-width:600px){
  .master-hpp-table,.master-hpp-table tbody{display:block;width:100%;}
  .master-hpp-table thead{display:none;}
  .master-hpp-table tr{display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;padding:10px;border-bottom:1px solid var(--line-soft);}
  .master-hpp-table tr:last-child{border-bottom:0;}
  .master-hpp-table td,.master-hpp-table td:nth-child(n){display:flex!important;width:auto!important;min-width:0;padding:0!important;border:0!important;text-align:left!important;align-items:flex-start;justify-content:space-between;gap:10px;}
  .master-hpp-table td::before{content:attr(data-label);flex:0 0 auto;color:var(--slate);font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;}
  .master-hpp-table td:first-child{grid-column:1/-1;display:block!important;}
  .master-hpp-table td:first-child::before{display:none;}
  .master-hpp-table td:last-child{grid-column:1/-1;justify-content:flex-end;}
  .master-hpp-table td:last-child::before{display:none;}
}
@media (max-width:420px){
  .master-hpp-detail-summary{grid-template-columns:1fr;}
  .master-hpp-table tr{grid-template-columns:1fr;}
  .master-hpp-table td{grid-column:1/-1;}
}

/* HPP nota cards match the approved global-per-note design. */
.master-hpp-note-list{display:grid;gap:12px;}
.master-hpp-note-card{width:100%;padding:14px 16px;}
.master-hpp-note-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--line-soft);}
.master-hpp-note-head>div{min-width:0;}
.master-hpp-eyebrow{display:block;color:var(--slate);font-size:8px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;}
.master-hpp-note-head h3{margin:4px 0;color:var(--ink);font-size:15px;line-height:1.2;}
.master-hpp-note-head p{margin:0;color:var(--slate);font-size:9px;line-height:1.4;}
.master-hpp-note-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0 12px;}
.master-hpp-note-metrics .wage-recap-metric{min-width:0;min-height:58px;padding:9px 10px;border:1px solid var(--line-soft);border-radius:10px;background:var(--surface-soft);}
.master-hpp-note-metrics .wage-recap-metric span{display:block;color:var(--slate);font-size:8px;line-height:1.25;}
.master-hpp-note-metrics .wage-recap-metric b{display:block;margin-top:4px;color:var(--ink);font-size:12px;line-height:1.25;overflow-wrap:anywhere;}
.master-hpp-note-metrics .wage-recap-due{background:#fff8ec;border-color:#f2dfbd;}
.master-hpp-note-metrics .wage-recap-due b{color:#a56700;}
.master-hpp-note-subtitle{display:block;margin:8px 0 6px;color:var(--slate);font-size:8px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;}
.master-hpp-note-calculation{overflow:hidden;border:1px solid var(--line-soft);border-radius:10px;background:var(--card);}
.master-hpp-note-calculation>div{display:grid;grid-template-columns:minmax(120px,1fr) minmax(150px,1.2fr) auto;align-items:center;gap:10px;padding:9px 11px;border-bottom:1px solid var(--line-soft);font-size:9px;}
.master-hpp-note-calculation>div:last-child{border-bottom:0;}
.master-hpp-note-calculation span:first-child{color:var(--slate);}
.master-hpp-note-calculation span:nth-child(2){color:var(--slate);text-align:right;}
.master-hpp-note-calculation b{color:var(--ink);font-size:10px;text-align:right;white-space:nowrap;}
.master-hpp-note-calculation .is-total{background:var(--surface-soft);font-weight:800;}
.master-hpp-note-calculation .is-total span:first-child,.master-hpp-note-calculation .is-total b{color:var(--primary-dark);}
.master-hpp-note-formula{display:grid;gap:3px;margin-top:9px;padding:9px 11px;border:1px solid #d5e9e1;border-radius:10px;background:#eaf5f0;color:var(--ink);font-size:9px;}
.master-hpp-note-formula b{color:var(--primary-dark);font-size:8px;}
.master-hpp-note-formula span{font-weight:800;}
.master-hpp-note-formula small{color:var(--slate);font-size:8px;line-height:1.35;}
.master-hpp-note-checks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.master-hpp-note-checks>div{padding:8px;border:1px solid var(--line-soft);border-radius:8px;background:var(--surface-soft);color:var(--slate);font-size:8px;line-height:1.35;}
.master-hpp-note-checks b{margin-right:4px;color:var(--primary-dark);}
.master-hpp-note-blockers p{margin:6px 0 0;color:#a56700;font-size:8px;}
.master-hpp-note-foot{align-items:center;margin-top:9px;padding-top:8px;border-top:1px solid var(--line-soft);}
.master-hpp-note-foot>span{color:var(--slate);font-size:8px;}
.master-hpp-load-error{margin:10px auto 0;max-width:95%;padding:8px 10px;border-radius:8px;background:#fff3f0;color:#934b3e;font-size:9px;overflow-wrap:anywhere;}
@media (max-width:700px){
  .master-hpp-note-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .master-hpp-note-checks{grid-template-columns:1fr;}
}
@media (max-width:460px){
  .master-hpp-note-card{padding:12px;}
  .master-hpp-note-head{align-items:flex-start;}
  .master-hpp-note-calculation>div{grid-template-columns:1fr auto;gap:4px 8px;}
  .master-hpp-note-calculation span:nth-child(2){grid-column:1;text-align:left;}
  .master-hpp-note-calculation b{grid-column:2;grid-row:1 / span 2;}
  .master-hpp-note-foot{align-items:flex-start;}
}

/* Dashboard process chart opens an inline, status-based queue breakdown. */
.dashboard-process-chart{min-width:0;text-align:left;transition:border-color .15s,box-shadow .15s;}
.dashboard-process-chart:hover{border-color:var(--primary);}
.dashboard-process-chart-trigger{all:unset;display:block;box-sizing:border-box;width:100%;color:inherit;text-align:left;cursor:pointer;}
.dashboard-process-chart-trigger:focus-visible{border-radius:8px;outline:2px solid var(--primary);outline-offset:4px;}
.dashboard-process-plot{border-radius:8px;cursor:pointer;}
.dashboard-process-plot:focus-visible{outline:2px solid var(--primary);outline-offset:4px;}
.dashboard-process-chart-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:10px;text-align:left;}
.dashboard-process-chart-head>span:first-child{flex:1 1 120px;min-width:0;}
.dashboard-process-chart-head .lbl{display:block;font-size:12px;font-weight:800;color:var(--ink);}
.dashboard-process-chart-head .mini{margin-top:4px;text-align:left;}
.dashboard-process-toggle{flex:0 0 auto;margin-left:auto;padding:6px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface-soft);color:var(--primary-dark);font-size:10px;font-weight:800;white-space:nowrap;}
.dashboard-process-chart.expanded{grid-column:1/-1;}
.dashboard-process-chart .chart{margin-top:12px;}
.dashboard-process-details{margin-top:14px;padding:12px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface-soft);text-align:left;}
.dashboard-process-details[hidden]{display:none;}
.dashboard-process-details-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:8px;}
.dashboard-process-details-head b{font-size:12px;color:var(--ink);}
.dashboard-process-details-head span{font-size:9px;color:var(--slate);}
.dashboard-process-detail-list{overflow:hidden;border:1px solid var(--line-soft);border-radius:9px;background:var(--card);}
.dashboard-process-detail-empty{padding:12px;color:var(--slate);font-size:10px;text-align:center;}
.dashboard-process-detail-row{display:grid;grid-template-columns:minmax(82px,.65fr) minmax(0,2fr) auto;align-items:center;gap:10px;padding:9px 10px;border-bottom:1px solid var(--line-soft);font-size:10px;}
.dashboard-process-detail-row:last-child{border-bottom:0;}
.dashboard-process-detail-row>b{color:var(--ink);}
.dashboard-process-detail-row>span{color:var(--slate);line-height:1.4;}
.dashboard-process-detail-row>strong{color:var(--primary-dark);white-space:nowrap;}
@media(max-width:700px){
  .dashboard-process-chart.expanded{grid-column:1/-1;}
  .dashboard-process-detail-row{grid-template-columns:minmax(70px,.6fr) minmax(0,2fr) auto;gap:7px;padding:8px;font-size:9px;}
}
@media(max-width:560px){
  .dashboard-chart-grid{grid-template-columns:minmax(0,1fr);}
}
@media(max-width:460px){
  .dashboard-process-details{padding:9px;}
  .dashboard-process-details-head{align-items:flex-start;flex-direction:column;gap:3px;}
  .dashboard-process-detail-row{grid-template-columns:1fr auto;align-items:start;}
  .dashboard-process-detail-row>b{grid-column:1;}
  .dashboard-process-detail-row>span{grid-column:1;}
  .dashboard-process-detail-row>strong{grid-column:2;grid-row:1/3;}
}

/* PDF preview gateway: tablet-first, tetap responsif pada Web/APK. */
.sheet:has(.pdf-preview-shell){max-width:min(1120px,calc(100vw - 48px));width:100%;}
.pdf-preview-shell{display:flex;flex-direction:column;gap:14px;min-width:0;}
.pdf-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;}
.pdf-preview-head h3{margin:0 0 5px;font-size:20px;}
.pdf-preview-head p{margin:0;color:var(--muted);line-height:1.5;}
.pdf-preview-size{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700;white-space:nowrap;}
.pdf-preview-frame{height:min(64vh,760px);min-height:420px;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#e9ecef;}
.pdf-preview-frame iframe{display:block;width:100%;height:100%;border:0;background:#fff;}
.pdf-preview-native-hint{display:grid;gap:7px;place-items:center;text-align:center;min-height:220px;padding:32px;border:1px solid var(--line);border-radius:18px;background:var(--card);}
.pdf-preview-native-hint b{font-size:20px;}
.pdf-preview-native-hint span{max-width:620px;color:var(--muted);line-height:1.55;}
.pdf-preview-actions{flex-wrap:wrap;}
.pdf-preview-actions .btn{min-height:46px;}
@media (min-width:1000px){
 .pdf-preview-frame{height:min(70vh,820px);}
 .pdf-preview-actions{justify-content:flex-end;}
 .pdf-preview-actions .btn{min-width:150px;min-height:50px;}
}
@media (max-width:767px){
 .sheet:has(.pdf-preview-shell){max-width:none;}
 .pdf-preview-head{display:grid;}
 .pdf-preview-size{justify-self:start;}
 .pdf-preview-frame{height:52vh;min-height:300px;}
 .pdf-preview-actions{display:grid;grid-template-columns:1fr 1fr;}
 .pdf-preview-actions .btn{width:100%;}
}
/* Phone production tables: readable text + local horizontal scroll, never page overflow. */
@media (max-width:767px){
  .production-table-card{overflow:visible;}
  .production-table-card .table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
  }
  .production-data-table{width:100%;min-width:720px!important;table-layout:auto;}
  .production-data-table th,.production-data-table td{padding:9px 7px;font-size:11px;}
  .production-data-table th{font-size:11px;line-height:1.2;letter-spacing:.03em;white-space:nowrap;}
  .production-data-table td:last-child .btn{min-height:44px;padding:8px 10px;font-size:11px;}
  .production-data-table .badge{font-size:9.5px;padding:5px 7px;}
  .toast{max-width:calc(100% - 24px);white-space:normal;text-align:center;}
}
