/* ============================================================
   THE LITTLE ROO — Admin OS v5.7 Design System (formal)
   ============================================================ */
:root {
  /* Formal corporate teal navy palette */
  --olive: #234B5C;
  --olive-2: #2C5C70;
  --olive-3: #3A7086;
  --olive-50: #F0F4F6;
  --olive-100: #DAE5EA;

  --sky: #B9DDE3;
  --sky-50: #F1F8F9;
  --sand: #C69863;
  --sand-50: #FAF3EA;

  --pink: #f3c6cf; --pink-2: #e89aa7; --rose: #d94870;
  --peach: #f5b993; --mint: #a7d4b5; --emerald: #2f9e5f;
  --teal: #4a97a5; --sky-2: #6fa8b8; --lav: #b8a4d0; --gold: #c69439;

  --success: #218649; --success-bg: #E6F3EC;
  --warning: #A66D14; --warning-bg: #FBF3DF;
  --danger:  #B0362A; --danger-bg:  #FBEAE8;
  --info:    #1F6D8C; --info-bg:    #E4F2F7;

  --ink:    #1a1f2e;
  --ink-2:  #3d4757;
  --ink-3:  #7a8494;
  --line:   #dfe4eb;
  --line-2: #ecf0f4;
  --bg:     #F5F7FA;
  --surface:#FFFFFF;
  --surface-2:#FAFBFC;

  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(20,40,60,.05);
  --shadow:    0 2px 6px rgba(20,40,60,.06);
  --shadow-lg: 0 12px 32px rgba(20,40,60,.14);
  --shadow-card: 0 1px 3px rgba(20,40,60,.05);
  --topbar-h: 62px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--olive-2); text-decoration: none; }
a:hover { color: var(--olive); }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ============================================================
   TOPBAR — corporate horizontal navbar with dropdowns
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: stretch;
  padding: 0 24px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(20,40,60,.02);
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px;
  padding-right: 24px; border-right: 1px solid var(--line-2);
  margin-right: 20px; flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 7px;
  background: linear-gradient(135deg, var(--olive) 0%, var(--olive-2) 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .5px;
  box-shadow: 0 1px 3px rgba(35,75,92,.25);
}
.brand-title .brand-name { font-weight: 700; font-size: 14.5px; color: var(--ink); line-height: 1.1; }
.brand-title .brand-sub  { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.topbar-nav { display: flex; align-items: stretch; flex: 1; gap: 2px; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  background: transparent; border: 0; cursor: pointer;
  position: relative; font-family: inherit;
  transition: color .12s;
}
.topbar-link:hover { color: var(--olive); }
.topbar-link.active {
  color: var(--olive); font-weight: 600;
}
.topbar-link.active::after {
  content: ""; position: absolute; bottom: 0; left: 12px; right: 12px;
  height: 2.5px; background: var(--olive); border-radius: 2px 2px 0 0;
}
.topbar-link svg { opacity: .55; transition: transform .15s; }
.topbar-dropdown { position: relative; display: inline-flex; align-items: stretch; }
.topbar-dropdown.open .topbar-link svg { transform: rotate(180deg); }

.topbar-dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 150;
  animation: ddSlide .18s ease;
}
.topbar-dropdown.open .topbar-dropdown-menu { display: block; }
.topbar-dropdown-menu-right { right: 0; left: auto; }
.topbar-dropdown-item {
  display: block; padding: 8px 12px; font-size: 13px;
  color: var(--ink-2); border-radius: 5px; text-decoration: none;
  transition: background .1s;
}
.topbar-dropdown-item:hover { background: var(--olive-50); color: var(--olive); }
.topbar-dropdown-item.active { background: var(--olive-50); color: var(--olive); font-weight: 600; }
.topbar-dropdown-divider { height: 1px; background: var(--line-2); margin: 4px 6px; }
@keyframes ddSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-left: 20px; }
.topbar-icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-2);
  transition: all .12s;
}
.topbar-icon-btn:hover { background: var(--olive-50); color: var(--olive); }
.notif-dot {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  padding: 0 4px; border: 1.5px solid var(--surface);
}
.topbar-user { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--olive) 0%, var(--olive-3) 100%);
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.user-info .user-name { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.1; }
.user-info .user-role { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.user-menu { display: inline-flex; }

.topbar-toggle {
  display: none; background: transparent; border: 0;
  width: 40px; height: 40px; align-self: center; cursor: pointer;
  flex-direction: column; gap: 4px; padding: 8px;
}
.topbar-toggle span { display: block; height: 2px; background: var(--ink-2); border-radius: 1px; }

/* Mobile responsive */
@media (max-width: 900px) {
  .topbar { padding: 0 12px; }
  .topbar-toggle { display: flex; }
  .topbar-nav {
    position: absolute; top: var(--topbar-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 8px; box-shadow: var(--shadow-lg);
    display: none; align-items: stretch;
  }
  body.nav-open .topbar-nav { display: flex; }
  .topbar-link { justify-content: space-between; padding: 12px 14px; width: 100%; }
  .topbar-link.active::after { display: none; }
  .topbar-link.active { background: var(--olive-50); border-radius: 6px; }
  .topbar-dropdown { display: block; }
  .topbar-dropdown-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; margin: 4px 0; }
  .topbar-dropdown.open .topbar-dropdown-menu { display: block; }
  .topbar-brand .brand-title { display: none; }
  .user-info { display: none; }
  .topbar-user { padding-left: 6px; }
}

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  padding: 22px 28px; max-width: 1400px; width: 100%;
  margin: 0 auto; flex: 1;
}
@media (max-width: 900px) { .content { padding: 16px 12px; } }

h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 600; margin: 0 0 10px; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
h4 { font-size: 13.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-top: 18px; margin-bottom: 8px; }
p { margin: 0 0 10px; }

.text-muted { color: var(--ink-3); }
.text-bold  { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-green { color: var(--success); }
.text-red   { color: var(--danger); }
.text-danger { color: var(--danger); }
.no-print   { }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 14px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.no-data { text-align: center; padding: 32px; color: var(--ink-3); }

/* Card */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

/* Buttons — formal */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; text-decoration: none;
  transition: all .12s; font-family: inherit; line-height: 1.4;
}
.btn:hover { background: var(--olive-50); color: var(--olive); border-color: var(--olive-100); }
.btn-primary { background: var(--olive); color: #fff; border-color: var(--olive); }
.btn-primary:hover { background: var(--olive-2); color: #fff; border-color: var(--olive-2); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #196937; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #8f2b21; color: #fff; }
.btn-light { background: var(--surface); color: var(--ink-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 8px 11px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; transition: border .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(35,75,92,.08);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-3); }
textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 140px; }
.input-prefix { position: relative; display: flex; }
.input-prefix .prefix {
  padding: 8px 10px; background: var(--olive-50); color: var(--olive-2);
  border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px;
  font-size: 12px; font-weight: 600;
}
.input-prefix input { border-radius: 0 6px 6px 0; }

/* Alerts */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px;
  font-size: 13px; border: 1px solid transparent;
}
.alert-sukses  { background: var(--success-bg); color: var(--success); border-color: #c2e4ce; }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: #f0c4be; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #ecdca8; }
.alert-info    { background: var(--info-bg); color: var(--info); border-color: #bfe0ec; }

/* Table */
.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.data thead th {
  background: var(--surface-2); color: var(--ink-2); font-weight: 600;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1.5px solid var(--line);
}
table.data tbody tr:hover { background: var(--olive-50); }
.row-actions a, .row-actions button { display: inline-block; margin: 0 3px; text-decoration: none; font-size: 15px; opacity: .7; }
.row-actions a:hover, .row-actions button:hover { opacity: 1; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; font-size: 11px; font-weight: 600; border-radius: 4px; }
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--line-2); color: var(--ink-3); }
.badge-neutral  { background: var(--olive-50); color: var(--olive-2); }
.badge-danger   { background: var(--danger-bg); color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg); color: var(--info); }
.badge-cair, .badge-lunas       { background: var(--success-bg); color: var(--success); }
.badge-tertahan, .badge-tempo   { background: var(--warning-bg); color: var(--warning); }
.badge-bisa_ditarik             { background: var(--info-bg); color: var(--info); }

/* Tabs (in-page) */
.tabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; overflow-x: auto; padding-bottom: 0; }
.tabs a {
  padding: 10px 16px; font-size: 13px; color: var(--ink-3); font-weight: 500;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap;
}
.tabs a:hover { color: var(--olive-2); }
.tabs a.active { color: var(--olive); border-bottom-color: var(--olive); font-weight: 600; }

/* KPI cards — formal single tone */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; position: relative;
  box-shadow: var(--shadow-card); transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20,40,60,.08); border-color: var(--olive-100); }
.kpi::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--olive); border-radius: 0 3px 3px 0; }
.kpi .label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; margin-bottom: 4px; }
.kpi .value { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.kpi .sub   { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.kpi .ico { position: absolute; right: 14px; top: 14px; opacity: .3; color: var(--olive); }

/* Login page */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--olive) 0%, #17313d 100%); padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: var(--r-lg); padding: 32px;
  max-width: 400px; width: 100%; box-shadow: var(--shadow-lg);
}
.login-card h1 { text-align: center; margin-bottom: 6px; }
.login-card > p { text-align: center; color: var(--ink-3); margin-bottom: 24px; }


/* ============================================================
   MODAL (from v5.1+)
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,30,45,.55);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 40px 16px; overflow-y: auto; backdrop-filter: blur(3px);
}
.modal-backdrop.show { display: flex; animation: fadeIn .18s ease; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 900px; margin: auto;
  animation: modalIn .22s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column; max-height: calc(100vh - 80px);
}
.modal-sm { max-width: 480px; }
.modal-md { max-width: 680px; }
.modal-lg { max-width: 1100px; }
/* Input Massal khusus desktop → modal selebar mungkin (sampai 1720px / 96% layar) */
.modal-xl { max-width: min(1720px, 96vw); }

/* ============================================================
   Input Massal Produksi — layout menyamping (tabel per-batch)
   Modal dibuat lebar; kolom Produk & Kain diberi ruang besar +
   TANPA potong-teks (ellipsis), jadi nama produk panjang terbaca.
   Kalau modal lebih sempit dari tabel, .table-wrap men-scroll
   horizontal — tetap menyamping, tidak pernah menumpuk ke bawah.
   ============================================================ */
#massTable { min-width: 1180px; }
#massTable th, #massTable td { padding: 9px 10px; vertical-align: middle; }
#massTable thead th { white-space: nowrap; }
#massTable .th-sub { font-weight: 400; color: var(--ink-3); font-size: 10px; }
#massTable .col-produk { min-width: 300px; }   /* lebar — nama produk panjang muat */
#massTable .col-bahan  { min-width: 208px; }
#massTable .col-produk select,
#massTable .col-bahan select { width: 100%; }   /* tanpa max-width / ellipsis */
#massTable .col-num { width: 84px; }
#massTable .col-num input { text-align: right; width: 100%; }
#massTable .col-total { width: 78px; text-align: right; }
#massTable .col-jahit2 { min-width: 150px; }
#massTable .col-jahit2 .input-prefix { margin: 0; }
#massTable .col-jahit2 input { text-align: right; width: 100%; }
#massTable .col-act { width: 46px; text-align: center; padding-left: 4px; padding-right: 4px; }
#massTable .mc-computed { font-weight: 700; color: var(--olive); text-align: right; }
#massTable .mrow-del {
  background: transparent; border: 1px solid var(--line); color: var(--ink-3);
  border-radius: 6px; width: 30px; height: 30px; line-height: 1; cursor: pointer;
  font-size: 14px; font-family: inherit; transition: all .12s;
}
#massTable .mrow-del:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
#massTable tbody tr:hover { background: var(--olive-50); }

/* Preview bahan tambahan (resep) di bawah tiap baris input massal */
#massTable tr.mrow-aux td { padding: 0; border-top: 0; }
#massTable tr.mrow-aux:hover { background: transparent; }
.maux-cell { padding: 5px 12px 8px 12px; font-size: 11px; line-height: 1.5; color: var(--ink-3); background: var(--olive-50); border-bottom: 1px solid var(--line); }
.maux-tag { font-weight: 700; color: var(--olive); }
.maux-rp { color: var(--ink-3); }
.maux-cell strong { color: var(--olive); }

/* Biaya lain berulang — SATU baris menyamping (grid: keterangan | Rp | ✕) */
.bl-list { display: flex; flex-direction: column; gap: 8px; }
.bl-row { display: grid; grid-template-columns: 1fr 200px 40px; gap: 8px; align-items: center; }
.bl-row .bl-ket { width: 100%; min-width: 0; }
.bl-row .bl-nom { margin: 0; }
.bl-row .bl-nom input { width: 100%; }
.bl-row .bl-del {
  background: transparent; border: 1px solid var(--line); color: var(--ink-3);
  border-radius: 6px; width: 40px; height: 38px; cursor: pointer;
  font-size: 14px; font-family: inherit; transition: all .12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.bl-row .bl-del:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.bl-total { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.bl-total strong { color: var(--ink-2); }

/* Pajak: input % + hasil Rp */
.pajak-out { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pajak-out strong { color: var(--olive); }

/* Layar sempit: biaya lain tetap menyamping, hanya kolom Rp mengecil */
@media (max-width: 700px) {
  .bl-row { grid-template-columns: 1fr 130px 38px; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent;
  cursor: pointer; font-size: 18px; color: var(--ink-3);
  display: grid; place-items: center; transition: all .12s;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap;
}
.modal-foot .btn { min-width: 100px; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
body.modal-open { overflow: hidden; }

/* ============================================================
   OPSI DROPDOWN INLINE (v5.1)
   ============================================================ */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.opt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-sm); }
.opt-card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1.5px solid var(--olive-50); margin-bottom: 8px; }
.opt-card-head h4 { margin: 0; font-size: 13px; color: var(--olive-2); font-weight: 700; text-transform: capitalize; }
.opt-card-head .opt-count { font-size: 11px; color: var(--ink-3); background: var(--olive-50); padding: 2px 9px; border-radius: 20px; }
.opt-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13.5px; border-bottom: 1px dashed transparent; transition: border .12s; }
.opt-item:hover { border-bottom-color: var(--line-2); }
.opt-item .opt-val { flex: 1; }
.opt-item .opt-rm { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; transition: all .14s; opacity: 0; }
.opt-item:hover .opt-rm { opacity: 1; }
.opt-rm:hover { background: var(--danger-bg); color: var(--danger); }
.opt-add { display: flex; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.opt-add input { padding: 6px 9px; font-size: 13px; flex: 1; }
.opt-add button { width: 30px; height: 30px; border-radius: 6px; border: 0; background: var(--olive); color: #fff; cursor: pointer; font-size: 16px; font-weight: 600; display: grid; place-items: center; }
.opt-add button:hover { background: var(--olive-2); }
.opt-newgroup { background: var(--olive-50); border: 1.5px dashed var(--olive-3); border-radius: var(--r); padding: 14px; display: flex; gap: 8px; align-items: center; }

/* ============================================================
   MEDIA UPLOAD (v5.3-5.5) — dropzone, preview, library, reorder
   ============================================================ */
.upload-zone { border: 2px dashed var(--olive); border-radius: var(--r); padding: 18px 14px; text-align: center; cursor: pointer; background: var(--olive-50); transition: all .14s ease; margin-top: 4px; }
.upload-zone:hover { background: var(--olive-100); border-color: var(--olive-2); transform: translateY(-1px); }
.upload-zone.drag { background: var(--olive-100); border-style: solid; border-color: var(--olive); transform: scale(1.01); box-shadow: 0 4px 14px rgba(35,75,92,.18); }
.upload-zone.uploading { opacity: .55; pointer-events: none; }
.upload-zone .upload-icon { font-size: 26px; margin-bottom: 4px; line-height: 1; }
.upload-zone .upload-text { font-weight: 600; color: var(--olive); font-size: 13.5px; }
.upload-zone small { color: var(--ink-3); font-size: 11px; display: block; margin-top: 3px; }

.media-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-preview:empty { display: none; }
.media-preview .media-item { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-sm); cursor: grab; }
.media-preview .media-item:active { cursor: grabbing; }
.media-preview .media-item.dragging { opacity: .4; transform: scale(.95); }
.media-preview .media-item a { display: block; width: 100%; height: 100%; }
.media-preview .media-item img, .media-preview .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-preview .media-rm { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.65); color: #fff; border: 0; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; transition: background .12s; z-index: 2; }
.media-preview .media-rm:hover { background: var(--danger); }
.media-actions { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); display: flex; justify-content: space-between; padding: 0 3px; opacity: 0; transition: opacity .14s ease; pointer-events: none; }
.media-item:hover .media-actions { opacity: 1; pointer-events: auto; }
@media (hover: none) { .media-actions { opacity: 1; pointer-events: auto; } }
.media-move { background: rgba(0,0,0,.65); color: #fff; border: 0; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; font-weight: 700; display: grid; place-items: center; transition: all .12s; }
.media-move:hover:not(:disabled) { background: var(--olive); transform: scale(1.1); }
.media-move:disabled { opacity: .3; cursor: not-allowed; }

.library-btn { display: block; width: 100%; background: var(--olive-50); color: var(--olive); border: 1px solid var(--olive-100); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-top: 6px; font-weight: 600; transition: all .12s; }
.library-btn:hover { background: var(--olive-100); border-color: var(--olive-3); }
.library-panel { margin-top: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; animation: modalIn .2s ease; }
.library-head { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.library-head .library-search { flex: 1; padding: 7px 11px; font-size: 13px; border: 1px solid var(--line); border-radius: 7px; }
.library-grid { overflow-y: auto; min-height: 120px; max-height: 320px; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; padding: 4px; background: var(--bg); border-radius: 7px; }
.library-item { position: relative; aspect-ratio: 1; border-radius: 7px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface); transition: all .12s; }
.library-item:hover { border-color: var(--olive-3); transform: scale(1.03); }
.library-item.selected { border-color: var(--olive); box-shadow: 0 0 0 3px var(--olive-100); }
.library-item.chosen { opacity: .55; cursor: not-allowed; border-color: var(--success); }
.library-item img, .library-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-item-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 2px 5px; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); color: #fff; font-size: 10px; }
.library-badge { position: absolute; top: 3px; left: 3px; font-size: 8.5px; font-weight: 700; padding: 2px 5px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; }
.library-badge-chosen { background: var(--success); color: #fff; }
.library-badge-used { background: rgba(0,0,0,.6); color: #fff; }
.library-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.library-loading, .library-empty { grid-column: 1/-1; text-align: center; padding: 30px 10px; color: var(--ink-3); font-size: 13px; }

/* ============================================================
   TIER HARGA + HPP WARNING (v5.6)
   ============================================================ */
.select-with-add { display: flex; gap: 4px; align-items: stretch; }
.select-with-add select { flex: 1; min-width: 0; }
.btn-add-opt {
  background: var(--olive-50); color: var(--olive); border: 1px solid var(--line);
  padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 700;
  display: grid; place-items: center; transition: all .12s; flex-shrink: 0;
}
.btn-add-opt:hover { background: var(--olive); color: #fff; border-color: var(--olive); }

.tier-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.tier-item { background: var(--olive-50); border: 1px solid var(--olive-100); border-radius: var(--r); padding: 12px 14px; }
.tier-item-head { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--olive-100); }
.tier-item-ref { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.tier-item-ref strong { color: var(--ink); font-size: 13px; }
.tier-item-rm { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--danger-bg); color: var(--danger); cursor: pointer; font-size: 18px; line-height: 1; font-weight: 700; display: grid; place-items: center; transition: all .12s; flex-shrink: 0; }
.tier-item-rm:hover { background: var(--danger); color: #fff; transform: scale(1.05); }

input.below-hpp { border-color: var(--danger) !important; background: var(--danger-bg) !important; color: var(--danger); font-weight: 600; }
.hpp-warning { color: var(--danger); font-size: 11.5px; font-weight: 600; margin-top: 3px; min-height: 14px; }
.tier-banner { background: linear-gradient(135deg, #ede2f6 0%, #f4dfd0 100%); color: #5b3388; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 6px; margin-top: 4px; border: 1px solid #d5b8f0; }
.tier-badge { font-size: 11px; font-weight: 600; color: #5b3388; background: #f3e8ff; padding: 2px 8px; border-radius: 4px; margin-top: 4px; display: inline-block; }

/* ============================================================
   v5.7 — FILE MANAGER (Google Drive-style)
   ============================================================ */
.fm-toolbar { display: flex; gap: 8px; padding: 12px 16px; background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; border: 1px solid var(--line); border-bottom: 0; flex-wrap: wrap; align-items: center; }
.fm-toolbar .fm-breadcrumb { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); overflow-x: auto; }
.fm-toolbar .fm-breadcrumb a { color: var(--ink-2); text-decoration: none; padding: 4px 8px; border-radius: 4px; }
.fm-toolbar .fm-breadcrumb a:hover { background: var(--olive-50); color: var(--olive); }
.fm-toolbar .fm-breadcrumb .sep { color: var(--ink-3); opacity: .5; }
.fm-toolbar .fm-breadcrumb .current { font-weight: 600; color: var(--ink); padding: 4px 8px; }

.fm-container {
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); min-height: 320px;
  position: relative;
}
.fm-container.dropping { background: var(--olive-50); }
.fm-container.dropping::after { content: "⬆ Drop file untuk upload"; position: absolute; inset: 20px; border: 2.5px dashed var(--olive); border-radius: var(--r); display: grid; place-items: center; font-weight: 600; color: var(--olive); background: rgba(240,244,246,.9); pointer-events: none; z-index: 5; }

.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 14px; }
.fm-item {
  position: relative; border-radius: var(--r); padding: 12px 8px 8px;
  border: 2px solid transparent; cursor: pointer; background: var(--surface);
  text-align: center; transition: all .12s; user-select: none;
}
.fm-item:hover { background: var(--olive-50); border-color: var(--olive-100); }
.fm-item.selected { background: var(--olive-100); border-color: var(--olive); }
.fm-item.drag-over { border-color: var(--success); background: var(--success-bg); box-shadow: 0 0 0 3px rgba(46,158,95,.15); }
.fm-item .fm-thumb {
  width: 68px; height: 68px; margin: 0 auto 8px; border-radius: 6px;
  background: var(--surface-2); display: grid; place-items: center;
  overflow: hidden; border: 1px solid var(--line-2);
}
.fm-item .fm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fm-item .fm-thumb .fm-icon { font-size: 32px; color: var(--ink-3); }
.fm-item.folder .fm-thumb { background: linear-gradient(135deg, var(--olive-50), var(--olive-100)); }
.fm-item.folder .fm-thumb .fm-icon { color: var(--olive); }
.fm-item .fm-name { font-size: 12px; color: var(--ink); word-break: break-word; line-height: 1.3; font-weight: 500; }
.fm-item .fm-meta { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.fm-item.dragging { opacity: .3; }

.fm-item-menu {
  position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity .12s;
  width: 24px; height: 24px; border-radius: 4px; border: 0;
  background: rgba(255,255,255,.9); cursor: pointer;
  display: grid; place-items: center; font-size: 14px; color: var(--ink-2);
}
.fm-item:hover .fm-item-menu, .fm-item.selected .fm-item-menu { opacity: 1; }
.fm-item-menu:hover { background: var(--surface); color: var(--olive); box-shadow: var(--shadow-sm); }

.fm-empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.fm-empty .fm-empty-icon { font-size: 48px; opacity: .3; margin-bottom: 10px; }

.fm-context {
  position: fixed; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 4px;
  min-width: 180px; z-index: 250; display: none;
}
.fm-context.show { display: block; animation: modalIn .12s ease; }
.fm-context button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px;
  background: transparent; border: 0; text-align: left; font-size: 13px;
  color: var(--ink-2); border-radius: 5px; cursor: pointer;
}
.fm-context button:hover { background: var(--olive-50); color: var(--olive); }
.fm-context button.danger:hover { background: var(--danger-bg); color: var(--danger); }
.fm-context hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }

/* ============================================================
   v5.8 — FILE SHARING (share dialog + share list)
   ============================================================ */
.share-list { display: flex; flex-direction: column; gap: 8px; }
.share-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2);
}
.share-item-info { flex: 1; min-width: 0; }
.share-item-perm { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.share-item-url input {
  width: 100%; font-family: monospace; font-size: 11px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2);
}
.share-item-meta { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
#shareResult .flex input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.share-create { padding: 2px; }

/* ============================================================
   v5.7 — SPREADSHEET EDITOR (soft & friendly, responsive)
   ============================================================ */
.sheet-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.sheet-page-head .sheet-title-group h2 { margin: 0 0 4px; }
.sheet-page-head .sheet-subtitle { color: var(--ink-3); font-size: 13px; margin: 0; }

/* Sheet tab switcher — soft segmented pills */
.sheet-switch {
  display: inline-flex; gap: 5px; padding: 5px;
  background: var(--olive-50); border: 1px solid var(--olive-100);
  border-radius: 14px; margin: 16px 0 18px; flex-wrap: wrap;
}
.sheet-switch a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; transition: all .18s cubic-bezier(.4,0,.2,1); white-space: nowrap;
}
.sheet-switch a:hover { background: rgba(255,255,255,.7); color: var(--olive); }
.sheet-switch a.active {
  background: var(--surface); color: var(--olive); font-weight: 600;
  box-shadow: 0 2px 8px rgba(35,75,92,.12);
}
.sheet-switch a span { font-size: 15px; }

/* Toolbar — soft floating bar */
.sheet-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: 0 2px 10px rgba(20,40,60,.05);
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20;
}
.sheet-toolbar .toolbar-spacer { flex: 1; min-width: 8px; }
.sheet-toolbar .sheet-info { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.sheet-toolbar .sheet-export { display: inline-flex; gap: 6px; padding-right: 10px; margin-right: 4px; border-right: 1px solid var(--line-2); }
.sheet-toolbar .dirty-count {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--warning-bg); color: var(--warning);
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.sheet-toolbar .dirty-count::before { content: "●"; font-size: 7px; }
.sheet-toolbar .dirty-count:empty { display: none; }
.sheet-toolbar .btn { border-radius: 9px; }

/* The sheet container — soft rounded card */
.sheet-wrap {
  overflow: auto; max-height: 66vh; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: 0 2px 12px rgba(20,40,60,.05);
  -webkit-overflow-scrolling: touch; padding: 2px;
}
.sheet {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px; table-layout: auto; min-width: 640px;
}
.sheet th, .sheet td { padding: 0; position: relative; border: 0; }
.sheet thead th {
  background: var(--surface-2);
  color: var(--ink-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 13px 14px; position: sticky; top: 0; z-index: 4;
  border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left;
}
.sheet thead th:first-child {
  position: sticky; left: 0; z-index: 5; text-align: center;
  min-width: 46px; width: 46px; border-top-left-radius: 12px;
}
.sheet thead th:last-child { border-top-right-radius: 12px; }
.sheet tbody th {
  background: var(--surface-2); text-align: center; font-weight: 600;
  color: var(--ink-3); font-size: 11px; padding: 0 8px;
  position: sticky; left: 0; z-index: 3; min-width: 46px; width: 46px;
}
.sheet tbody td { background: var(--surface); vertical-align: middle; }
.sheet tbody tr td, .sheet tbody tr th { border-bottom: 1px solid var(--line-2); transition: background .14s ease; }
.sheet tbody tr:last-child td, .sheet tbody tr:last-child th { border-bottom: 0; }
.sheet tbody tr:hover td { background: var(--olive-50); }
.sheet tbody tr:hover th { background: var(--olive-100); }
.sheet tbody tr.dirty td { background: #FFFAEC; }
.sheet tbody tr.dirty th { background: #FBEFCB; color: var(--warning); }
.sheet tbody tr.new-row td { background: #EEF9F1; }
.sheet tbody tr.new-row th { background: #D6F0DE; color: var(--success); }
.sheet tbody tr.blank-row td { background: var(--surface); }
.sheet tbody tr.blank-row th { background: var(--surface-2); color: transparent; }
.sheet tbody tr.blank-row .sheet-cell::placeholder { color: var(--ink-3); opacity: .3; }
.sheet tbody tr.deleting td { background: var(--danger-bg); opacity: .5; text-decoration: line-through; }

/* Cells — softer, roomier */
.sheet-cell {
  width: 100%; border: 0; background: transparent; padding: 12px 14px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  outline: none; min-height: 44px; box-sizing: border-box;
  transition: box-shadow .12s ease, background .12s ease; border-radius: 7px;
}
.sheet-cell::placeholder { color: var(--ink-3); opacity: .45; }
.sheet-cell:focus {
  background: #FFFEF7;
  box-shadow: inset 0 0 0 2px var(--olive); z-index: 2; position: relative;
}
.sheet-cell[readonly] {
  background: var(--surface-2); color: var(--ink-3); cursor: default;
  font-size: 12.5px; font-style: italic;
}
.sheet-cell[readonly]:focus { box-shadow: none; }
select.sheet-cell.dropdown-cell {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a8494' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 28px;
}

/* Actions column — sticky right */
.sheet .col-actions {
  min-width: 58px; width: 58px; text-align: center;
  background: var(--surface); position: sticky; right: 0; z-index: 3;
}
.sheet thead th.col-actions { z-index: 5; background: var(--surface-2); }
.sheet tbody tr:hover .col-actions { background: var(--olive-50); }
.sheet tbody tr.dirty .col-actions { background: #FFFAEC; }
.sheet tbody tr.new-row .col-actions { background: #EEF9F1; }
.sheet .col-actions button {
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent;
  cursor: pointer; color: var(--ink-3); font-size: 15px;
  display: inline-grid; place-items: center; transition: all .14s;
}
.sheet .col-actions button:hover { background: var(--danger-bg); color: var(--danger); transform: scale(1.12); }

/* Empty / loading states */
.sheet-empty { text-align: center; padding: 54px 20px; color: var(--ink-3); }
.sheet-empty .sheet-empty-icon { font-size: 44px; opacity: .3; margin-bottom: 10px; }

/* Mobile / tablet — card layout below 720px */
@media (max-width: 720px) {
  .sheet-switch { width: 100%; gap: 4px; }
  .sheet-switch a { flex: 1; justify-content: center; padding: 9px 8px; font-size: 12px; }
  .sheet-toolbar { position: static; padding: 12px; border-radius: var(--r-lg); }
  .sheet-toolbar .btn { flex: 1; justify-content: center; min-width: 0; }
  .sheet-toolbar .sheet-export { width: 100%; padding: 0; margin: 0; border: 0; order: 5; }
  .sheet-toolbar .sheet-export .btn { flex: 1; }
  .sheet-toolbar .toolbar-spacer { display: none; }
  .sheet-toolbar .sheet-info { width: 100%; text-align: center; order: 10; padding-top: 4px; }
  .sheet-toolbar .dirty-count { width: 100%; justify-content: center; order: 9; }

  .sheet-wrap { max-height: none; border: 0; box-shadow: none; background: transparent; overflow: visible; padding: 0; }
  .sheet, .sheet thead, .sheet tbody, .sheet th, .sheet td, .sheet tr { display: block; }
  .sheet { min-width: 0; }
  .sheet thead { display: none; }
  .sheet tbody tr {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); margin-bottom: 14px; padding: 10px 12px 12px;
    box-shadow: 0 2px 8px rgba(20,40,60,.05); position: relative;
  }
  .sheet tbody tr.dirty { border-color: #EFD68C; box-shadow: 0 0 0 2px #FFFAEC; }
  .sheet tbody tr.new-row { border-color: #A5DBB8; box-shadow: 0 0 0 2px #EEF9F1; }
  .sheet tbody tr:hover td, .sheet tbody tr:hover th { background: transparent; }
  .sheet tbody th {
    position: static; width: auto; text-align: left; padding: 4px 6px 10px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--olive); background: transparent; border: 0;
    border-bottom: 1px dashed var(--line-2); margin-bottom: 8px;
  }
  .sheet tbody th::before { content: "Baris "; }
  .sheet tbody tr.blank-row th { color: var(--ink-3); }
  .sheet tbody tr.blank-row th::before { content: "Baris kosong"; }
  .sheet tbody td {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 6px; border: 0; background: transparent; min-height: 46px;
  }
  .sheet tbody td::before {
    content: attr(data-label); flex: 0 0 38%; max-width: 38%;
    font-size: 11.5px; font-weight: 600; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: .03em;
  }
  .sheet-cell { min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
  .sheet-cell:focus { background: #FFFEF7; }
  .sheet .col-actions {
    position: static; width: auto; background: transparent; border: 0;
    text-align: right; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line-2);
  }
  .sheet tbody tr:hover .col-actions, .sheet tbody tr.dirty .col-actions, .sheet tbody tr.new-row .col-actions { background: transparent; }
  .sheet .col-actions::before {
    content: "Aksi"; float: left; font-size: 11.5px; font-weight: 600;
    color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; margin-top: 7px;
  }
}

/* ============================================================
   v5.7 — WHATSAPP BLAST
   ============================================================ */
.wa-composer { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 900px) { .wa-composer { grid-template-columns: 1fr; } }
.wa-preview {
  background: #075E54; border-radius: var(--r-lg); padding: 20px; position: sticky; top: calc(var(--topbar-h) + 20px);
}
.wa-bubble {
  background: #DCF8C6; border-radius: 8px; padding: 8px 12px; max-width: 100%;
  font-size: 13px; color: #303030; box-shadow: 0 1px 1px rgba(0,0,0,.1); position: relative;
  white-space: pre-wrap; word-wrap: break-word;
}
.wa-bubble::after { content: ""; position: absolute; top: 0; right: -6px; width: 0; height: 0; border: 6px solid transparent; border-top-color: #DCF8C6; border-right: 0; }
.wa-bubble .wa-time { font-size: 10px; color: #78877a; text-align: right; margin-top: 4px; }
.wa-preview .wa-label { color: rgba(255,255,255,.8); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.wa-recipient-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.wa-recipient-list label { display: flex; padding: 8px 12px; gap: 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-weight: normal; margin: 0; }
.wa-recipient-list label:last-child { border-bottom: 0; }
.wa-recipient-list label:hover { background: var(--olive-50); }
.wa-recipient-list input[type=checkbox] { width: auto; }
.wa-recipient-count { background: var(--olive); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
.wa-var-chip { display: inline-block; background: var(--info-bg); color: var(--info); font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 4px; margin: 2px; cursor: pointer; font-family: monospace; }
.wa-var-chip:hover { background: var(--info); color: #fff; }
.wa-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.wa-status.pending  { background: var(--warning-bg); color: var(--warning); }
.wa-status.sent     { background: var(--success-bg); color: var(--success); }
.wa-status.failed   { background: var(--danger-bg); color: var(--danger); }

/* Utility */
.form-inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* Preview packing otomatis di form penjualan */
.packing-preview { margin-top: 8px; padding: 8px 12px; background: var(--olive-50); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.packing-preview .pp-tag { font-weight: 700; color: var(--olive); }
.packing-preview .pp-note { color: var(--ink-3); font-size: 11px; }
.packing-preview strong { color: var(--olive); }

/* ===== Banner Website (modul banner) ===== */
.banner-prev { display:block; margin-top:8px; max-width:100%; max-height:150px; border-radius:8px; border:1px solid var(--line); object-fit:cover; }
.banner-thumb { width:80px; height:52px; object-fit:cover; border-radius:6px; border:1px solid var(--line); background:var(--olive-50); }
.tag-grup { display:inline-block; padding:2px 9px; border-radius:999px; background:var(--olive-100); color:var(--olive); font-size:11px; font-weight:700; }
.badge-ok { background:var(--olive-100); color:var(--olive); }
.badge-off { background:var(--danger-bg); color:var(--danger); }
.api-hint { background:var(--olive-50); border:1px solid var(--line); border-radius:10px; padding:12px 14px; font-size:13px; line-height:1.9; }
.api-hint .api-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.api-hint code { background:#fff; border:1px solid var(--line); border-radius:6px; padding:2px 8px; font-size:12px; color:var(--ink-2); }

/* ===== Daftar produksi terkelompok (grup batch) ===== */
#prodTable .plist-grp { cursor:pointer; background:var(--olive-50); }
#prodTable .plist-grp:hover { background:var(--olive-100); }
#prodTable .plist-grp > td { border-top:2px solid var(--olive-100); }
.grp-badge { display:inline-flex; align-items:center; gap:9px; }
.grp-exp { width:26px; height:26px; flex:0 0 26px; border-radius:50%; border:1px solid var(--olive-100); background:#fff; color:var(--olive); cursor:pointer; font-size:14px; line-height:1; display:inline-flex; align-items:center; justify-content:center; transition:transform .25s ease, background .2s; padding:0; }
#prodTable .plist-grp:hover .grp-exp { background:#fff; }
#prodTable .plist-grp.open .grp-exp { transform:rotate(180deg); }
.grp-icon { font-size:15px; }
.grp-code { font-weight:700; color:var(--olive); letter-spacing:.3px; }
.grp-pill { display:inline-block; padding:1px 9px; border-radius:999px; background:var(--olive); color:#fff; font-size:11px; font-weight:700; font-variant-numeric:tabular-nums; }
#prodTable .plist-detail { background:#fafbfc; }
#prodTable .plist-detail > td { border-top:0; }
#prodTable .plist-detail > td:first-child { box-shadow:inset 3px 0 0 var(--olive-100); }
.detail-batch { padding-left:24px !important; color:var(--ink-3); font-size:12px; }
.detail-conn { color:var(--olive); opacity:.45; margin-right:5px; }
/* Mode pilih & kelompokkan */
#prodTable .pick-wrap { display:none; margin-right:9px; vertical-align:middle; }
#prodTable.sel-on .pick-wrap { display:inline-block; }
#prodTable.sel-on .pick-cb { width:16px; height:16px; cursor:pointer; vertical-align:middle; }
#prodTable.sel-on .plist-row:not(.plist-grp) { cursor:pointer; }
#prodTable.sel-on .plist-row:not(.plist-grp):hover { background:var(--olive-50); }
.sel-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 14px; background:var(--olive-50); border:1px solid var(--olive-100); border-radius:10px; margin-bottom:12px; font-size:13px; }
.sel-bar .sel-n { font-weight:700; color:var(--olive); }
.btn.active { background:var(--olive); color:#fff; border-color:var(--olive); }

/* ===== Picker gambar dari File Manager (modul banner) ===== */
.fm-picker{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;}
.fm-picker[hidden]{display:none;}
.fm-picker-panel{background:#fff;border-radius:14px;width:min(820px,96vw);max-height:86vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.3);}
.fm-picker-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line);}
.fm-picker-head strong{white-space:nowrap;}
.fm-picker-head input{flex:1;border:1px solid var(--line);border-radius:8px;padding:7px 11px;font-size:14px;font-family:inherit;}
.fm-picker-grid{padding:14px;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;}
.fmp-item{border:1px solid var(--line);border-radius:10px;background:#fff;padding:0;cursor:pointer;overflow:hidden;display:flex;flex-direction:column;transition:border-color .15s,box-shadow .15s;font-family:inherit;}
.fmp-item:hover{border-color:var(--olive);box-shadow:0 3px 10px rgba(35,75,92,.15);}
.fmp-item img{width:100%;height:96px;object-fit:cover;display:block;background:var(--olive-50);}
.fmp-item span{font-size:11px;color:var(--ink-3);padding:5px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ===== Kartu progres upload (File Manager) ===== */
.upload-prog{position:fixed;right:20px;bottom:20px;z-index:9998;width:300px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 34px rgba(0,0,0,.16);padding:14px 16px;}
.upload-prog[hidden]{display:none;}
.up-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:600;margin-bottom:8px;gap:10px;}
.up-head #upLabel{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.up-head #upPct{color:var(--olive);font-variant-numeric:tabular-nums;}
.up-bar{height:8px;background:var(--olive-50);border-radius:999px;overflow:hidden;}
.up-fill{height:100%;background:var(--olive);width:0;transition:width .2s ease;}
.up-sub{font-size:11px;color:var(--ink-3);margin-top:7px;}
.up-note{font-size:10px;color:var(--ink-3);opacity:.85;margin-top:3px;}

/* ============================================================
   v7.0 — PENYERAGAMAN TAMPILAN (fondasi)
   Blok ini ADITIF: tidak ada aturan lama yang dihapus, hanya
   ditimpa lewat urutan cascade. Menghapus blok ini mengembalikan
   tampilan persis seperti sebelumnya.
   Palet inti (--olive teal navy, --sand) sengaja TIDAK diubah.
   ============================================================ */

/* --- Skala jarak & ukuran kontrol: satu sumber, bukan angka lepas --- */
:root {
  --ctl-h: 38px;          /* tinggi baku input, select, tombol */
  --ctl-h-sm: 30px;
  --ctl-h-lg: 44px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --ring: 0 0 0 3px rgba(35, 75, 92, .14);   /* cincin fokus baku */
  --ring-danger: 0 0 0 3px rgba(176, 54, 42, .14);
}

/* ============================================================
   1. ALERT — memperbaiki nama kelas yang tidak pernah cocok
   PHP mengirim .alert-success / .alert-danger, CSS lama hanya
   punya .alert-sukses / .alert-error, sehingga SEMUA pesan
   sukses dan error (termasuk error login) tampil tanpa warna.
   Kedua penamaan didukung supaya kode lama tetap jalan.
   ============================================================ */
.alert-success, .alert-sukses { background: var(--success-bg); color: var(--success); border-color: #c2e4ce; }
.alert-danger,  .alert-error  { background: var(--danger-bg);  color: var(--danger);  border-color: #f0c4be; }
.alert-warning                { background: var(--warning-bg); color: var(--warning); border-color: #ecdca8; }
.alert-info                   { background: var(--info-bg);    color: var(--info);    border-color: #bfe0ec; }

.alert {
  position: relative;
  padding: 11px 14px 11px 16px;
  border-radius: var(--r-sm);
  line-height: 1.45;
  align-items: center;
}
/* Garis aksen kiri: status terbaca sebelum teksnya dibaca */
.alert::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: currentColor; opacity: .85;
}
.alert > svg { flex: 0 0 auto; }
.alert strong { font-weight: 600; }

/* ============================================================
   2. IKON — SVG sebaris, menggantikan emoji
   Emoji tampil berbeda di tiap OS (dan sebagian tidak ada
   glyph-nya di Windows), itu penyebab utama kesan tidak rapi.
   Ukuran ikut font induknya lewat 1em, jadi selalu sebanding.
   ============================================================ */
.ico {
  width: 1em; height: 1em; flex: 0 0 auto;
  vertical-align: -.125em;          /* sejajar baseline teks */
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ico-lg { width: 1.25em; height: 1.25em; }
.ico-muted { opacity: .55; }

/* ============================================================
   3. TOMBOL — tinggi seragam + hierarki yang hilang
   .btn-lg dipakai di login.php, kas dan pembelian tetapi tidak
   pernah didefinisikan, sehingga tombol utama ("Login",
   "Simpan") tampil sama besar dengan tombol sekunder.
   ============================================================ */
.btn {
  min-height: var(--ctl-h);
  padding: 0 14px;
  gap: 7px;
  font-weight: 500;
  letter-spacing: .005em;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
}
.btn-sm { min-height: var(--ctl-h-sm); padding: 0 10px; font-size: 12px; gap: 5px; }
.btn-lg { min-height: var(--ctl-h-lg); padding: 0 20px; font-size: 14px; font-weight: 600; }
.btn-block { width: 100%; }

/* Fokus keyboard terlihat jelas (aksesibilitas + navigasi cepat) */
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-danger:focus-visible { box-shadow: var(--ring-danger); }

/* Tombol yang ditekan terasa menekan, bukan diam */
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[disabled] {
  opacity: .55; cursor: not-allowed; transform: none;
  pointer-events: none;
}
/* Tombol utama diberi sedikit bobot supaya jadi jangkar mata */
.btn-primary { box-shadow: 0 1px 2px rgba(35,75,92,.18); }

/* ============================================================
   4. FORM — tinggi seragam, keadaan error, teks bantuan
   ============================================================ */
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select, textarea {
  min-height: var(--ctl-h);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 72px; padding: 9px 11px; line-height: 1.5; }

input:focus, select:focus, textarea:focus { box-shadow: var(--ring); }
input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) { border-color: var(--olive-100); }

/* Select diberi anak panah sendiri supaya seragam lintas browser */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a8494' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

/* Label: penanda wajib yang konsisten, bukan bintang lepas */
label .req, .req-mark { color: var(--danger); font-weight: 700; margin-left: 2px; }
label.lbl { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }

/* Teks bantuan & pesan kesalahan per kolom */
.field-hint {
  display: block; font-size: 11.5px; color: var(--ink-3);
  margin-top: 4px; line-height: 1.45;
}
.field-error {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--danger); font-weight: 500; margin-top: 4px;
}
.form-col.has-error input,
.form-col.has-error select,
.form-col.has-error textarea,
input.is-error, select.is-error, textarea.is-error {
  border-color: var(--danger); background: #fffbfb;
}
.form-col.has-error input:focus, input.is-error:focus { box-shadow: var(--ring-danger); }

/* Baris form: jarak vertikal seragam */
.form-row { margin-bottom: var(--sp-4); gap: var(--sp-3); }
.form-row:last-of-type { margin-bottom: 0; }

/* Baris tombol di dasar form, terpisah garis supaya jelas titik akhirnya */
.form-actions {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap;
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--line-2);
}
.form-actions .spacer { margin-left: auto; }

/* --- Angka & uang: rata kanan dan lebar digit tetap --- */
.input-rupiah, input[inputmode="numeric"], input[type="number"], .input-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.input-prefix { align-items: stretch; }
.input-prefix .prefix {
  display: flex; align-items: center;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  white-space: nowrap;
}
.input-prefix input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-prefix:focus-within .prefix { border-color: var(--olive); color: var(--olive); }

/* Tombol "+" tambah opsi: setinggi select di sebelahnya */
.select-with-add { display: flex; gap: 6px; align-items: stretch; }
.select-with-add select { flex: 1; min-width: 0; }
.btn-add-opt {
  flex: 0 0 auto; width: var(--ctl-h); min-height: var(--ctl-h);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--olive-50); color: var(--olive-2);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-add-opt:hover { background: var(--olive-100); border-color: var(--olive-100); color: var(--olive); }
.btn-add-opt:focus-visible { outline: none; box-shadow: var(--ring); }

/* ============================================================
   5. TABEL — angka sebanding, kepala lengket, aksi yang bisa diklik
   ============================================================ */
table.data { font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; vertical-align: middle; }
table.data thead th { white-space: nowrap; }

/* Kolom angka selalu rata kanan dengan lebar digit tetap */
table.data td.text-right, table.data th.text-right { font-variant-numeric: tabular-nums; }

/* Baris selang-seling tipis: mata tidak lompat baris pada tabel lebar */
table.data tbody tr:nth-child(even) { background: var(--surface-2); }
table.data tbody tr:hover { background: var(--olive-50); }
table.data tfoot td { border-top: 1.5px solid var(--line); }

/* ------------------------------------------------------------
   JUDUL KOLOM MENGIKUTI SAAT DIGULIR (pemilik, 2026-08-04)
   ------------------------------------------------------------
   Permintaannya: "saat scroll down header table ikut turun ke
   bawah, agar user tidak lupa column dari masing-masing table."
   Jadi judul kolom MENGIKUTI layar — terkunci tepat di bawah menu
   atas — selama tabelnya masih terlihat, lalu ikut pergi begitu
   tabel habis.

   Tiga hal yang menggagalkan percobaan-percobaan sebelumnya, dan
   ketiganya harus benar bersamaan atau fiturnya diam-diam mati:

   1. `.table-wrap` dulu `overflow-x: auto`, dan itu MEMBUATNYA
      menjadi wadah bergulir (overflow-y ikut jadi auto). Judul
      lalu menempel pada kotak itu, bukan pada layar — dan karena
      tinggi kotak = tinggi isinya, hasilnya tidak menempel sama
      sekali. Inilah sebab sebenarnya, bukan DataTables.

   2. `border-collapse: collapse` membuat `position: sticky` pada
      sel tabel TIDAK mengunci di Chrome. Sudah `sticky`, sudah
      dapat acuan yang benar, tetap ikut tergulir. Karena garis
      tabel di sini hanya `border-bottom` per sel, beralih ke
      `separate` + `border-spacing: 0` tidak mengubah tampilan
      sedikit pun — tidak ada garis yang menggandakan diri.

   3. DataTables memasang aturan `position` sendiri lewat CSS dari
      CDN. Selektor di sini sengaja lebih spesifik
      (`.table-wrap table.data thead > tr > th`) supaya menang
      tanpa perlu `!important`. Bukan karena DataTables memindahkan
      tabel — ia hanya membungkusnya dengan `.dataTables_wrapper`,
      yang bukan wadah bergulir.

   Batasnya:
   - Hanya di layar >= 901px. Di ponsel, bisa menggeser tabel lebar
     ke samping jauh lebih penting daripada judul yang mengikuti,
     jadi di sana `overflow-x: auto` tetap dipakai.
   - `@media screen`, supaya cetakan tidak tersentuh sama sekali —
     perbaikan cetak sebelumnya harus tetap utuh.
   - Tabel yang lebih lebar dari layar kini menggeser HALAMAN, bukan
     kotaknya. Itu justru benar: judul tetap sejajar dengan kolomnya
     saat digeser ke samping, yang tidak mungkin terjadi kalau
     kotaknya sendiri yang bergulir.
   - z-index 3 sengaja di bawah topbar (100), supaya judul lewat DI
     BAWAH menu atas, bukan menimpanya.
   ------------------------------------------------------------ */
/* Sisa kelas dari percobaan lama — dinetralkan supaya tidak ada
   kotak gulir tertinggal bila .tall masih tertulis di suatu markup. */
.table-wrap.tall { max-height: none; overflow-x: auto; border: 0; }

@media screen and (min-width: 901px) {
  /* Lepaskan wadah bergulir supaya acuan menempel = layar. */
  .table-wrap { overflow: visible; }

  /* Syarat agar sticky mengunci pada sel tabel (lihat catatan 2). */
  table.data { border-collapse: separate; border-spacing: 0; }

  .table-wrap table.data thead > tr > th,
  /* Varian `.dataTable` BUKAN hiasan. DataTables memasang
     `position: relative` sendiri lewat CSS dari CDN, dan header.php
     memuat app.css LEBIH DULU (baris 56) daripada CSS DataTables
     (baris 57) — jadi pada spesifisitas seimbang DataTables yang
     menang, dan judul di Pembelian/Master Data diam-diam tidak
     menempel sementara modul lain menempel. Menambah satu kelas
     menaikkan spesifisitas cukup untuk menang tanpa `!important`.
     Diuji dengan urutan pemuatan yang sama persis seperti produksi. */
  .table-wrap table.data.dataTable thead > tr > th {
    position: sticky;
    top: var(--topbar-h);
    z-index: 3;
    /* Latar WAJIB pekat — kalau tembus, baris yang lewat di
       belakangnya terbaca menumpuk dengan judul. */
    background: var(--surface-2);
  }

  /* DI DALAM MODAL yang menggulir adalah `.modal-body`, bukan halaman.
     Menempel pada acuan itu dengan `top: var(--topbar-h)` membuat judul
     mengambang 62px DI DALAM modal, terpisah dari barisnya — persis
     gejala "judul terdorong ke tengah tabel" yang pernah dilaporkan.
     Di sana acuannya nol: judul duduk di tepi atas isi modal (secara
     visual 22px dari tepi kotak, karena .modal-body ber-padding 22px).
     Tabel item Pembelian/Penjualan/Produksi semuanya tinggal di sini. */
  .modal-body .table-wrap table.data thead > tr > th,
  .modal-body .table-wrap table.data.dataTable thead > tr > th { top: 0; }
}

/* Aksi baris: dulu tautan emoji setinggi teks — sasaran klik
   terlalu kecil, terutama di layar sentuh */
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin: 0 1px; padding: 0;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-3);
  font-size: 14px; line-height: 1; opacity: 1;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.row-actions a:hover, .row-actions button:hover {
  background: var(--olive-50); color: var(--olive); border-color: var(--olive-100);
}
.row-actions a.act-danger:hover, .row-actions button.act-danger:hover {
  background: var(--danger-bg); color: var(--danger); border-color: #f0c4be;
}
.row-actions a:focus-visible, .row-actions button:focus-visible { outline: none; box-shadow: var(--ring); }

/* ============================================================
   6. KARTU, TAB, BADGE — perataan jarak
   ============================================================ */
.card { padding: var(--sp-5); margin-bottom: var(--sp-4); }
.card-head { margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); }
.card-head h2, .card-head h3 { margin: 0; line-height: 1.3; }
.card-head .sub {
  display: block; font-size: 12.5px; font-weight: 400;
  color: var(--ink-3); margin-top: 3px;
}
.card-head .head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; line-height: 1.5; border-radius: 999px;
  white-space: nowrap;
}
.tabs a { padding: 10px 16px; }

/* Baris penyaring di atas tabel: dikelompokkan supaya terbaca
   sebagai satu alat, bukan kontrol yang berserak */
.filter-bar {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  padding: var(--sp-3); margin-bottom: var(--sp-4);
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.filter-bar > * { margin: 0; }
.filter-bar input, .filter-bar select { width: auto; min-width: 140px; }
.filter-bar .filter-label {
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .04em;
}

/* ============================================================
   7. TOAST — memakai token warna, bukan hex yang ditulis ulang
   di app.js (dua salinan warna selalu berakhir tidak sama)
   ============================================================ */
.toast {
  position: fixed; top: 78px; right: 20px; z-index: 300;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; max-width: 380px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500; line-height: 1.45;
  box-shadow: var(--shadow-lg);
  animation: toastIn .18s ease;
  transition: opacity .3s, transform .3s, top .2s;
  white-space: pre-line;   /* satu pemanggil menggabung daftar error dgn baris baru */
}
.toast.hide { opacity: 0; transform: translateX(8px); }
.toast-sukses, .toast-success { background: var(--success-bg); color: var(--success); border-color: #c2e4ce; }
.toast-error,  .toast-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: #f0c4be; }
.toast-warning { background: var(--warning-bg); color: var(--warning); border-color: #ecdca8; }
.toast-info    { background: var(--info-bg);    color: var(--info);    border-color: #bfe0ec; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   8. MODAL — kepala & kaki yang tegas
   ============================================================ */
.modal-head { align-items: center; }
.modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--line-2); color: var(--ink); }
.modal-close:focus-visible { outline: none; box-shadow: var(--ring); }
.modal-foot {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line-2); background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-foot .spacer { margin-left: auto; }

/* Keadaan memuat: teks berkedip halus, bukan emoji jam pasir */
.loading-state {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 44px 20px; color: var(--ink-3); font-size: 13px;
}
.spinner {
  width: 15px; height: 15px; flex: 0 0 auto;
  border: 2px solid var(--olive-100); border-top-color: var(--olive);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   9. HALAMAN LOGIN
   ============================================================ */
.login-card .btn-lg { margin-top: var(--sp-2); }
.login-card label { margin-bottom: 5px; }
.login-card .form-row { margin-bottom: var(--sp-3); }
.login-card h2 { text-align: center; margin: 0 0 4px; font-size: 19px; }
/* Lambang login memakai identitas yang sama dengan topbar; sebelumnya
   sebuah emoji tanpa gaya CSS apa pun, rata kiri sebesar teks biasa. */
.login-mark {
  width: 52px; height: 52px; margin: 0 auto var(--sp-4);
  border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--olive) 0%, var(--olive-2) 100%);
  color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(35,75,92,.28);
}
.login-sub  { text-align: center; color: var(--ink-3); margin-bottom: var(--sp-5); font-size: 12.5px; }
.login-foot { text-align: center; color: var(--ink-3); margin: var(--sp-5) 0 0; font-size: 11.5px; }

/* ============================================================
   10. CETAK — laporan keluar bersih tanpa kontrol layar
   ============================================================ */
@page { margin: 12mm; }

@media print {
  .topbar, .filter-bar, .no-print, .row-actions, .btn { display: none !important; }
  .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 12px; }

  /* Selokan dalam 5mm: dialog cetak boleh menimpa @page (pilihan
     "Margins: None") dan tiap printer punya area tak-tercetak di tepi
     kertas yang tidak diketahui peramban. Tanpa ini, tepi kanan tabel
     bisa hilang meski secara hitungan sudah muat. */
  .content { padding: 0 5mm; }

  /* `overflow-x:auto` menghasilkan bilah gulir di layar, tetapi di atas
     kertas tidak ada yang bisa digulir — isinya sekadar TERPOTONG di
     tepi kanan. Ini berlaku untuk SEMUA pembungkus tabel, bukan hanya
     yang .tall. */
  .table-wrap, .table-wrap.tall {
    max-height: none !important; overflow: visible !important; border: 0;
    /* `margin:-4px; padding:4px` di atas menjaga cincin fokus agar tidak
       terpotong di layar, tetapi menambah 8px pada lebar total — cukup
       untuk membuang tepi kanan tabel dari kertas. */
    margin: 0 !important; padding: 0 !important;
  }

  table.data { font-size: 10.5px; }
  table.data th, table.data td { padding: 5px 6px; overflow-wrap: anywhere; }
  table.data thead { display: table-header-group; }   /* judul kolom terulang tiap halaman */
  table.data tr { break-inside: avoid; }
  table.data tbody tr:nth-child(even) { background: #f6f8fa; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   11. LAYAR SEMPIT
   ============================================================ */
@media (max-width: 640px) {
  .card { padding: var(--sp-4); }
  .form-row { flex-direction: column; gap: var(--sp-3); }
  .form-col { min-width: 0; width: 100%; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .table-wrap.tall { max-height: calc(100vh - 180px); }
  .toast { left: 12px; right: 12px; max-width: none; top: 70px; }
}

/* Menghormati pengguna yang mematikan animasi di sistemnya */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   12. INPUT MASSAL PRODUKSI — sumber angka qty pakai
   ============================================================ */
/* Pemilih kecil di atas kolom qty: menyatakan DARI MANA angka itu
   berasal (resep, manual, atau faktur pembelian). Diletakkan di dalam
   sel yang sama supaya asal angka terbaca tepat di sebelah angkanya —
   bukan di kolom lain yang harus dicari-cari. */
#massTable .mqty-src {
  width: 100%; min-height: 0; height: 23px;
  padding: 2px 18px 2px 6px;
  margin-bottom: 3px;
  font-size: 10.5px; line-height: 1.2;
  color: var(--ink-3); background-color: var(--surface-2);
  border-radius: 5px; background-position: right 5px center;
}
#massTable .mqty-src:focus { color: var(--ink); }
/* Keterangan di bawah kolom kain: menyebutkan resep yang dipakai
   dan berapa faktur pembelian tersedia. */
#massTable .mkain-nota {
  font-size: 10.5px; line-height: 1.45; color: var(--ink-3);
  margin-top: 4px; padding-left: 1px;
}

/* ============================================================
   13. SPREADSHEET IKUT ATURAN YANG SAMA (pemilik, 2026-08-04)
   ============================================================ */
/* Modul ini punya aturannya sendiri sejak dibuat (app.css 640-729),
   dirancang mirip Excel: judul kolom, nomor baris DAN kolom Aksi
   membeku, semuanya di dalam kotak gulir sendiri setinggi 66vh.

   Sekarang disamakan dengan modul lain — judul kolom mengikuti
   LAYAR, bukan kotak, dan halaman hanya punya satu batang gulir.

   Yang perlu diketahui sebelum mengubah ini lagi:

   - Tidak pernah ada tabrakan CSS dengan modul lain. Kelas `.sheet*`
     hanya dipakai `modules/spreadsheet/index.php`, dan tabelnya
     memakai `class="sheet"` saja — tanpa `.data` maupun `.auto-dt`.
     Yang dulu berbeda adalah PERILAKUNYA, bukan aturannya bentrok.
     Karena itu aturan `table.data` di atas tidak menjangkaunya dan
     lembar ini perlu blok sendiri.

   - `.sheet` sudah `border-collapse: separate` sejak awal, jadi
     tidak perlu perlakuan seperti `table.data` (lihat catatan 2 di
     bagian judul kolom).

   - Nomor baris dan kolom Aksi TIDAK dibekukan lagi. Membekukannya
     ke arah samping hanya masuk akal di dalam kotak bergulir; kalau
     acuannya layar, keduanya akan melayang di atas halaman. Yang
     diminta adalah judul yang mengikuti, dan itulah yang dipasang.

   - Tidak ada JavaScript yang bergantung pada kotak gulir ini
     (dicek: tidak ada scrollTop/clientHeight/getBoundingClientRect
     di modulnya), jadi melepasnya tidak menyentuh logika simpan,
     tandai-kotor, atau ekspor.
   ------------------------------------------------------------ */

/* Batang alat: panel biasa, tidak lagi mengambang saat digulir. */
.sheet-toolbar { position: static; z-index: auto; }

/* Kotak lembar: tinggi mengikuti isinya, halaman yang menggulir. */
.sheet-wrap { max-height: none; overflow-x: auto; overflow-y: visible; }

/* Beku ke samping dilepas — lihat catatan di atas. */
.sheet thead th:first-child,
.sheet thead th.col-actions,
.sheet tbody th,
.sheet .col-actions {
  position: relative;
  top: auto; left: auto; right: auto;
  z-index: auto;
}

@media screen and (min-width: 901px) {
  /* Acuan menempel = layar, sama seperti tabel lain. */
  .sheet-wrap { overflow: visible; }

  .sheet thead th,
  .sheet thead th:first-child,
  .sheet thead th.col-actions {
    position: sticky;
    top: var(--topbar-h);
    left: auto; right: auto;
    z-index: 3;
    background: var(--surface-2);
  }
}

/* ============================================================
   14. FILE MANAGER — seleksi banyak & pindah folder (2026-08-16)
   ============================================================ */
/* Kotak seleksi (marquee): tarik di area kosong ala Windows Explorer.
   position:fixed karena koordinatnya dihitung dari viewport. */
.fm-marquee{
  position:fixed;z-index:90;pointer-events:none;
  border:1.5px dashed var(--olive);border-radius:4px;
  background:rgba(35,75,92,.08);
}
/* Selama menarik kotak, seleksi teks dimatikan — tanpa ini separuh nama
   file ikut ter-highlight biru dan hasilnya terlihat seperti kerusakan. */
body.fm-selecting{user-select:none;-webkit-user-select:none}

/* Bilah seleksi: melayang di bawah-tengah, hanya tampil saat ada pilihan. */
.fm-selbar{
  position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:80;
  display:flex;gap:10px;align-items:center;
  background:var(--surface, #fff);border:1px solid var(--line);
  border-radius:99px;padding:8px 10px 8px 18px;
  box-shadow:0 6px 24px rgba(20,40,60,.16);
  font-size:13px;
}
.fm-selbar[hidden]{display:none}

/* Bayangan seret berjumlah ("📦 12 item") — difoto compositor saat dragstart,
   lalu elemennya langsung dibuang. Ditaruh di luar layar supaya tidak berkedip. */
.fm-drag-ghost{
  position:fixed;top:-200px;left:-200px;z-index:99;
  background:var(--olive);color:#fff;font-size:13px;font-weight:600;
  padding:8px 14px;border-radius:9px;box-shadow:0 4px 14px rgba(20,40,60,.3);
}

/* Breadcrumb sebagai sasaran jatuh saat menyeret item. */
.fm-breadcrumb a.drag-over{
  background:var(--success-bg);outline:2px dashed var(--success);
  outline-offset:2px;border-radius:6px;
}

/* Pohon folder di dialog "Pindahkan ke…". */
.mv-tree{
  max-height:300px;overflow:auto;border:1px solid var(--line);
  border-radius:9px;padding:6px;margin-top:6px;background:var(--surface, #fff);
}
.mv-tree label{
  display:flex;gap:8px;align-items:center;padding:6px 8px;border-radius:7px;
  cursor:pointer;font-size:13.5px;
}
.mv-tree label:hover{background:var(--olive-50)}
.mv-tree label:has(input:checked){background:var(--olive-100)}
.mv-tree input[type=radio]{width:auto;margin:0;flex:0 0 auto}

/* ============================================================
   15. PERBAIKAN (rework) pada modul produksi
   ------------------------------------------------------------
   Tanda "!" pada daftar batch adalah inti permintaannya: mengingat
   batch mana yang barangnya sedang diperbaiki. Ia dibuat bulat dan
   berwarna peringatan supaya terbaca sebagai TANDA, bukan sebagai
   tanda baca yang kebetulan menempel di ujung nomor batch.
   ============================================================ */
.pb-tanda {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; margin-left: 6px;
  border-radius: 50%;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
  font-size: 11px; font-weight: 800; line-height: 1;
  vertical-align: middle; cursor: help;
}
/* Berdenyut PELAN dan hanya sekilas berubah — daftar batch dilihat
   berlama-lama, dan kedipan cepat membuat orang berhenti melihatnya. */
@media (prefers-reduced-motion: no-preference) {
  .pb-tanda { animation: pbDenyut 2.6s ease-in-out infinite; }
  @keyframes pbDenyut { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
}

/* Kolom baru di tabel input massal */
#massTable .col-ketp { min-width: 170px; }
#massTable .col-ketp input { width: 100%; }

/* ---- Panel perbaikan ---- */
.pb-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.pb-batch { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.pb-head-num { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; text-align: right; }
.pb-head-num strong { font-size: 15px; }

.pb-form { margin-top: 12px; }
.pb-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.pb-tambah {
  margin-top: 14px; padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px;
}

.pb-progres { margin-top: 16px; }
.pb-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--line-2); margin-bottom: 10px;
}
.pb-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--success);
  transition: width .35s ease;
}
.pb-angka {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px; font-size: 12px;
}
.pb-angka strong { font-size: 14px; }

.pb-kaki {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
