/* Adimas Herbal — gaya tambahan di luar utilitas Tailwind */

/* ================= LEMBAR TRANSAKSI GAYA EXCEL ================= */
/* Kolom: No | Bahan | [Stok] | Berat Awal | Harga | [Harga Jual Baru] | Revaksi | Berat Bersih | Subtotal | hapus */
.xl-sheet { --xl-cols: 40px minmax(170px, 3fr) minmax(110px, 1.1fr) minmax(120px, 1.3fr) 92px minmax(110px, 1.1fr) minmax(130px, 1.4fr) 40px; }
.xl-sheet.xl-hjual { --xl-cols: 40px minmax(170px, 3fr) minmax(110px, 1.1fr) minmax(120px, 1.3fr) minmax(120px, 1.3fr) 92px minmax(110px, 1.1fr) minmax(130px, 1.4fr) 40px; }
.xl-sheet.xl-jual { --xl-cols: 40px minmax(170px, 3fr) 100px minmax(110px, 1.1fr) minmax(120px, 1.3fr) 92px minmax(110px, 1.1fr) minmax(130px, 1.4fr) 40px; }

.xl-head, .xl-row { display: grid; grid-template-columns: var(--xl-cols); }
.xl-head > div {
  padding: 9px 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #dbe8fe; background: linear-gradient(180deg, #13275c, #070c1c); border-right: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.xl-head > div:first-child { border-top-left-radius: 12px; text-align: center; }
.xl-head > div:last-child { border-top-right-radius: 12px; border-right: 0; }
.xl-head .xl-r { text-align: right; }

.xl-cell {
  position: relative; display: flex; align-items: center; min-height: 40px; background: #fff;
  border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0;
}
.xl-row > .xl-cell:first-child { border-left: 1px solid #e2e8f0; }
.xl-cell input {
  width: 100%; height: 100%; min-height: 40px; padding: 8px 10px; border: 0; outline: none; background: transparent;
  font-size: 14px; color: #0f172a;
}
.xl-cell input.xl-num { text-align: right; font-variant-numeric: tabular-nums; }
.xl-cell input.xl-warn { color: #be123c; font-weight: 600; }
.xl-cell:focus-within { box-shadow: inset 0 0 0 2px #2556eb; background: #f5f8ff; z-index: 3; }
.xl-no { justify-content: center; background: #f1f5f9; color: #64748b; font-size: 12px; font-weight: 600; }
.xl-ro { justify-content: flex-end; padding: 0 10px; background: #f8fafc; color: #334155; font-variant-numeric: tabular-nums; font-size: 14px; }
.xl-ro.xl-left { justify-content: flex-start; }
.xl-del { justify-content: center; }
.xl-row.xl-err > .xl-cell { background: #fff1f2; }
.xl-row.xl-err > .xl-cell:focus-within { background: #ffe4e6; }
.xl-errmsg { grid-column: 1 / -1; padding: 5px 12px 6px 54px; font-size: 12px; font-weight: 500; color: #be123c; background: #fff1f2; border: 1px solid #fecdd3; border-top: 0; }
.xl-label { display: none; }

/* input dengan akhiran satuan / % di dalam sel */
.xl-sfx { position: relative; flex: 1; align-self: stretch; display: flex; }
.xl-cell input.xl-has-sfx { padding-right: 34px; }
.xl-sfx-txt { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #94a3b8; pointer-events: none; }
.xl-c-rev .xl-sfx-txt { right: 8px; }
.xl-c-rev input.xl-has-sfx { padding-right: 22px; }

/* tombol cepat revaksi: muncul di bawah sel saat sel revaksi difokus */
.xl-rev-quick {
  display: none; position: absolute; right: -1px; top: calc(100% + 2px); z-index: 40; gap: 4px; padding: 4px;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 12px 28px -10px rgba(2, 6, 23, .35);
}
.xl-c-rev:focus-within .xl-rev-quick { display: flex; }
.xl-rev-quick button {
  min-width: 42px; padding: 4px 8px; border-radius: 7px; border: 1px solid #cbd5e1; background: #fff;
  font-size: 12px; font-weight: 600; color: #475569;
}
.xl-rev-quick button:hover { background: #eff5ff; }
.xl-rev-quick button.on { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }

.xl-ac {
  position: absolute; left: -1px; top: calc(100% + 2px); z-index: 40; width: max(100%, 340px); max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(2, 6, 23, .35); padding: 4px;
}
.xl-ac button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 13px; }
.xl-ac button.on, .xl-ac button:hover { background: #eff5ff; }

@media (max-width: 1023.98px) {
  .xl-head { display: none; }
  .xl-row {
    grid-template-columns: 1fr 1fr; gap: 10px 10px; padding: 12px; margin-bottom: 12px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  }
  .xl-row > .xl-cell, .xl-row > .xl-cell:first-child { border: 0; min-height: 0; display: block; background: transparent; }
  .xl-cell:focus-within { box-shadow: none; background: transparent; }
  .xl-label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
  .xl-cell input { height: auto; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
  .xl-cell input:focus { border-color: #2556eb; box-shadow: 0 0 0 4px rgba(37, 86, 235, .15); }
  .xl-no { order: 0; display: flex !important; align-items: center; justify-content: flex-start; font-size: 13px; color: #1e348a; }
  .xl-del { order: 1; display: flex !important; justify-content: flex-end; }
  .xl-c-bahan { order: 2; grid-column: 1 / -1; }
  .xl-c-stok { order: 3; grid-column: 1 / -1; }
  .xl-c-qty { order: 4; }
  .xl-c-harga { order: 5; }
  .xl-c-hjual { order: 5; grid-column: 1 / -1; }
  .xl-c-rev { order: 6; }
  .xl-c-bersih { order: 6; }
  .xl-c-bersih > span:last-child { display: block; text-align: left; min-height: 44px; padding-top: 4px; }
  .xl-sfx { display: block; }
  .xl-sfx-txt { right: 12px; font-size: 14px; }
  .xl-rev-quick { display: flex; position: static; margin-top: 6px; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .xl-rev-quick button { flex: 1; padding: 6px 8px; font-size: 13px; }
  .xl-c-sub { order: 7; grid-column: 1 / -1; display: flex !important; justify-content: space-between; align-items: center; border-top: 1px dashed #e2e8f0 !important; padding-top: 8px; font-weight: 700; }
  .xl-c-sub .xl-label { margin: 0; }
  .xl-ro { padding: 0; background: transparent; }
  .xl-row.xl-err { border-color: #fda4af; background: #fff1f2; }
  .xl-row.xl-err > .xl-cell { background: transparent; }
  .xl-errmsg { order: 8; padding: 6px 10px; border-radius: 10px; border: 1px solid #fecdd3; }
  .xl-ac { width: 100%; }
}

/* ================= CETAK ================= */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .print-page { box-shadow: none !important; margin: 0 !important; border: 0 !important; max-width: none !important; }
  @page { margin: 12mm; }
  thead { display: table-header-group; }
  tr, td, th { page-break-inside: avoid; }
}
