/* ==========================================================================
   EXPORT DOCUMENTS (INVOICE TAGIHAN & WORK ORDER) STYLES
   ========================================================================== */

/* MODAL WRAPPER */
.doc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.doc-modal-backdrop.show {
  display: flex;
}

.doc-modal-container {
  background: #f1f5f9;
  border-radius: 14px;
  width: 100%;
  max-width: 980px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 2rem;
  transition: max-width 0.25s ease;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-modal-container.landscape-mode {
  max-width: 1220px;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* MODAL TOOLBAR */
.doc-toolbar {
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-tab-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.doc-tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.doc-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.doc-toolbar-middle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pay-mode-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  margin-right: 0.2rem;
}

.btn-pay-mode {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-pay-mode:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-pay-mode.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.doc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-save-doc {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1.8px solid #34d399;
  padding: 0.58rem 1.45rem;
  border-radius: 8px;
  font-size: 0.925rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.48), 0 0 0 1px rgba(16, 185, 129, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
  margin-left: 0.65rem;
}

.btn-save-doc:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #a7f3d0;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.65), 0 0 0 2px rgba(52, 211, 153, 0.45);
}

.btn-save-doc:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-save-doc svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.btn-reset-doc {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-reset-doc:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-export-excel {
  background: #107c41; /* Excel green */
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-export-excel:hover {
  background: #0b6a36;
}

.btn-export-csv {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-export-csv:hover {
  background: #0369a1;
}

.btn-print-doc {
  background: #475569;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-print-doc:hover {
  background: #334155;
}

.btn-close-doc {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-doc:hover {
  color: #ffffff;
}

/* EDITABLE HINT NOTICE */
.doc-edit-notice {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.5rem 1.25rem;
  font-size: 0.775rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-saved-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  color: #475569;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.doc-saved-status.saved {
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  font-weight: 700;
}

.btn-add-addon-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8fafc;
  color: #0284c7;
  border: 1px dashed #38bdf8;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.btn-add-addon-row:hover {
  background: #e0f2fe;
  border-color: #0284c7;
}

/* DOCUMENT CANVAS / PAPER SIMULATOR */
.doc-canvas-area {
  padding: 1.5rem;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  background: #64748b;
}

.doc-paper {
  position: relative;
  background: #ffffff;
  width: 210mm;
  min-height: 297mm;
  padding: 6mm 10mm;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8.5pt;
  line-height: 1.3;
  box-sizing: border-box;
}

.doc-paper.landscape {
  width: 297mm;
  min-height: 205mm;
  padding: 8mm 12mm;
}

/* INVOICE SPECIFIC STYLES - FIT 1 HALAMAN PRESISI */
.inv-header-bar {
  background: #0284c7;
  color: #ffffff;
  text-align: center;
  padding: 4px 8px;
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.inv-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.inv-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-logo-img {
  height: 38px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.inv-logo-svg {
  width: 36px;
  height: 36px;
}

.inv-brand-text {
  font-size: 15pt;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
}

.inv-brand-sub {
  font-size: 6.5pt;
  letter-spacing: 0.3em;
  font-weight: bold;
}

.inv-company-info {
  font-size: 7.8pt;
  line-height: 1.25;
}

.inv-company-info table {
  width: 100%;
  border-collapse: collapse;
}

.inv-company-info td {
  padding: 1px 3px;
  vertical-align: top;
}

.inv-company-info td:first-child {
  font-weight: bold;
  width: 48px;
}

/* CUSTOMER & META ROW */
.inv-meta-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 7.8pt;
}

.inv-client-info table,
.inv-meta-table {
  width: 100%;
  border-collapse: collapse;
}

.inv-client-info td {
  padding: 1.5px 3px;
  vertical-align: top;
  line-height: 1.22;
}

.inv-client-info td:first-child {
  font-weight: bold;
  width: 90px;
}

.inv-meta-table {
  border: 1px solid #000;
}

.inv-meta-table td {
  border: 1px solid #000;
  padding: 1.5px 4px;
  line-height: 1.22;
}

.inv-meta-table td:first-child {
  background: #f1f5f9;
  font-weight: bold;
  width: 85px;
}

.inv-meta-table td:nth-child(2) {
  width: 8px;
  text-align: center;
  background: #f1f5f9;
}

.inv-meta-table td:nth-child(3) {
  font-weight: 600;
}

/* BANNER SPESIFIKASI BAHAN (MEWAKILI SEMUA UKURAN DI TABEL) */
.inv-fabric-spec-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 6px;
  font-size: 7.8pt;
  line-height: 1.3;
}

.inv-spec-badge {
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 6.8pt;
  padding: 1.5px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.inv-spec-name {
  color: #0369a1;
  font-weight: 700;
}

.inv-spec-note {
  color: #64748b;
  font-size: 7.5pt;
}

/* ITEMS TABLE */
.inv-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.8pt;
  margin-bottom: 6px;
}

.inv-items-table th {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #000;
  padding: 3px 4px;
  text-align: center;
  font-weight: bold;
}

.inv-items-table td {
  border: 1px solid #000;
  padding: 1.5px 4px;
  vertical-align: middle;
  line-height: 1.18;
}

.inv-items-table tr.section-row td {
  background: #f8fafc;
  font-weight: bold;
}

.inv-items-table .col-no { width: 30px; text-align: center; }
.inv-items-table .col-vertical { width: 30px; text-align: center; font-weight: bold; writing-mode: vertical-lr; transform: rotate(180deg); background: #f8fafc; font-size: 7.5pt; letter-spacing: 0.5px; }
.inv-items-table .col-addon-single { width: 30px; text-align: center; font-weight: bold; font-size: 6.8pt; background: #f8fafc; color: #0284c7; letter-spacing: 0.5px; }
.inv-items-table .col-item { }
.inv-items-table .col-qty { width: 45px; text-align: center; }
.inv-items-table .col-price { width: 95px; text-align: right; }
.inv-items-table .col-total { width: 110px; text-align: right; font-weight: 600; }

.inv-total-row td {
  font-weight: bold;
  background: #f1f5f9;
}

/* NOTES & PAYMENT BOX */
.inv-notes-box {
  margin-top: 3px;
  margin-bottom: 5px;
  font-size: 7.5pt;
  line-height: 1.22;
}

.inv-bank-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.inv-bank-logo {
  width: 40px;
  height: auto;
}

.inv-bank-info {
  font-size: 7.8pt;
  line-height: 1.25;
}

.inv-bank-info strong {
  font-size: 8.5pt;
  display: block;
}

/* LUNAS STAMP */
.inv-lunas-stamp {
  position: absolute;
  top: 155px;
  right: 38px;
  border: 3.5px solid #16a34a;
  color: #16a34a;
  font-size: 16pt;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 4px 18px;
  border-radius: 8px;
  transform: rotate(-10deg);
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
  background: rgba(240, 253, 244, 0.95);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25), 0 4px 12px rgba(22, 163, 74, 0.18);
  z-index: 10;
}

/* SIGNATURES */
.inv-signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  font-size: 8pt;
  margin-top: 14px;
  margin-bottom: 6px;
}

.inv-sign-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.inv-sign-title {
  font-weight: bold;
  font-size: 8.5pt;
  color: #0f172a;
  margin-bottom: 6px;
}

.inv-sign-space {
  height: 62px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  position: relative;
}

.inv-signature-img {
  max-height: 58px;
  max-width: 125px;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.inv-sign-name {
  font-weight: bold;
  font-size: 8.5pt;
  text-decoration: underline;
  line-height: 1.3;
}

.inv-sign-role {
  font-size: 7.2pt;
  color: #334155;
}

.wo-sign-space {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 4px 0;
}

/* ==========================================================================
   WORK ORDER / LEMBAR KERJA PRODUKSI SPECIFIC STYLES
   ========================================================================== */
.wo-header-title {
  text-align: center;
  font-size: 14pt;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.wo-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.wo-logo-img {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.wo-meta-box {
  border: 1.5px solid #000;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  margin-bottom: 12px;
  font-size: 8.5pt;
}

.wo-meta-cell {
  padding: 4px 8px;
  border-right: 1.5px solid #000;
}

.wo-meta-cell:last-child {
  border-right: none;
}

.wo-meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
}

.wo-meta-label {
  font-weight: bold;
  min-width: 110px;
}

/* 3-COLUMN WORK ORDER BODY */
.wo-body-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.5fr 1fr;
  border: 1.5px solid #000;
  margin-bottom: 8px;
  font-size: 8pt;
}

.wo-specs-col {
  border-right: 1.5px solid #000;
  padding: 6px;
}

.wo-specs-table {
  width: 100%;
  border-collapse: collapse;
}

.wo-specs-table td {
  padding: 2.5px 3px;
  vertical-align: top;
}

.wo-specs-table td:first-child {
  font-weight: bold;
  width: 105px;
}

.wo-specs-table td:nth-child(2) {
  width: 8px;
  text-align: center;
}

.wo-specs-table td:nth-child(3) {
  font-weight: 600;
}

/* CENTER MOCKUP DISPLAY */
.wo-mockup-col {
  border-right: 1.5px solid #000;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  min-height: 250px;
  position: relative;
}

.wo-upload-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  width: 90%;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.wo-upload-dropzone:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.wo-uploaded-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wo-uploaded-img {
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.wo-img-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 6px;
}

.btn-wo-img-action {
  font-size: 7.5pt;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  color: #334155;
  transition: background 0.15s;
}

.btn-wo-img-action:hover {
  background: #e2e8f0;
}

/* RIGHT SIZE BREAKDOWN */
.wo-sizes-col {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wo-sizes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 8pt;
}

.wo-sizes-table th {
  background: #dbeafe;
  border-bottom: 1.5px solid #000;
  border-left: 1px solid #000;
  padding: 4px 2px;
  font-weight: bold;
}

.wo-sizes-table th:first-child {
  border-left: none;
}

.wo-sizes-table td {
  border-bottom: 1px solid #cbd5e1;
  border-left: 1px solid #cbd5e1;
  padding: 2.5px 4px;
}

.wo-sizes-table td:first-child {
  border-left: none;
  font-weight: bold;
  text-align: left;
  padding-left: 6px;
}

.wo-sizes-table tr.total-row td {
  border-top: 1.5px solid #000;
  border-bottom: 1.5px solid #000;
  background: #f1f5f9;
  font-weight: bold;
}

.wo-size-action-col {
  width: 22px;
  text-align: center;
  padding: 0 !important;
  border: none !important;
  border-bottom: 1px solid #cbd5e1 !important;
  background: transparent !important;
}

.wo-sizes-table th.wo-size-action-col {
  border-bottom: 1.5px solid #000 !important;
  background: #dbeafe !important;
}

.wo-sizes-table tr.total-row td.wo-size-action-col {
  border-top: 1.5px solid #000 !important;
  border-bottom: 1.5px solid #000 !important;
  background: #f1f5f9 !important;
}

.btn-del-wo-size {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.3;
  transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

.wo-sizes-table tr:hover .btn-del-wo-size {
  opacity: 1;
  color: #ef4444;
}

.btn-del-wo-size:hover {
  color: #b91c1c;
  transform: scale(1.2);
}

.wo-add-size-wrap {
  margin: 4px 0 6px 0;
  display: flex;
  justify-content: flex-end;
}

.btn-add-wo-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px dashed #3b82f6;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 7.5pt;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-wo-size:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
  color: #1e40af;
}

.wo-cs-sign-box {
  margin-top: auto;
  padding: 8px;
  text-align: center;
  border-top: 1px solid #000;
}

.wo-cs-sign-box .cs-title {
  font-weight: bold;
  font-size: 8.5pt;
  margin-bottom: 40px;
}

.wo-cs-sign-box .cs-name {
  font-weight: bold;
  font-size: 8.5pt;
}

/* BOTTOM WARNING & NOTES */
.wo-notes-bar {
  background: #dbeafe;
  border: 1.5px solid #000;
  border-top: none;
  padding: 4px 8px;
  font-size: 8pt;
  margin-bottom: 8px;
}

.wo-warning-box {
  border: 1.5px solid #000;
  padding: 6px 10px;
  text-align: center;
  font-size: 7.5pt;
  font-weight: bold;
  background: #ffffff;
  line-height: 1.35;
}

/* LIVE EDITABLE FIELDS HIGHLIGHT */
.editable-field {
  outline: none;
  padding: 1px 3px;
  border-radius: 2px;
  transition: all 0.15s ease;
  min-height: 1.2em;
}

.editable-field:hover {
  background: #fef08a !important; /* Soft yellow hint on hover */
  box-shadow: 0 0 0 1px #eab308;
  cursor: text;
}

.editable-field:focus {
  background: #fef9c3 !important;
  box-shadow: 0 0 0 1.5px #2563eb;
}

/* PRINT MEDIA STYLES (FIT 1-PAGE & RATA ATAS GUARANTEE) */
/* PRINT MEDIA STYLES (FIT 1-PAGE & RATA ATAS GUARANTEE) */
@page {
  size: auto;
  margin: 4mm 6mm;
}

@media print {
  /* Hilangkan SELURUH elemen web induk dari aliran cetak agar tinggi dokumen luar 0px */
  body > *:not(#docModalBackdrop) {
    display: none !important;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Modal container menjadi root cetak yang langsung menempel di sudut paling atas kertas */
  #docModalBackdrop {
    display: block !important;
    position: static !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    overflow: visible !important;
    border: none !important;
  }

  .doc-modal-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: none !important;
  }

  /* Hilangkan toolbar modal dan notice bar dari cetakan */
  .doc-toolbar,
  .doc-edit-notice,
  .no-print,
  .wo-size-action-col,
  .btn-del-wo-size,
  .wo-add-size-wrap,
  .btn-add-wo-size,
  #btnAddWoSizeNotice {
    display: none !important;
  }

  .doc-canvas-area {
    display: block !important;
    position: static !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  /* Sembunyikan sheet yang tidak aktif */
  .doc-paper[style*="display: none"],
  .doc-paper[style*="display:none"] {
    display: none !important;
  }

  /* Kertas Dokumen - Rata Atas, Bebas Page Break, Fit 1 Halaman */
  .doc-paper {
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-before: avoid !important;
    break-before: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    box-sizing: border-box !important;
  }

  /* Cegah pemecahan halaman pada semua elemen dan baris */
  tr, td, th,
  .inv-top-grid,
  .inv-meta-grid,
  .inv-items-table,
  .inv-notes-box,
  .inv-bank-card,
  .inv-signature-grid,
  .wo-header-title,
  .wo-brand-center,
  .wo-meta-box,
  .wo-body-grid,
  .wo-notes-bar,
  .wo-warning-box {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* =======================================================
     INVOICE (PORTRAIT) - FIT 1 HALAMAN PRESISI & RATA ATAS
     ======================================================= */
  .doc-paper:not(.landscape) {
    width: 100% !important;
    max-width: 210mm !important;
    max-height: 288mm !important;
    padding: 2.5mm 6mm !important;
    overflow: hidden !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .inv-header-bar {
    padding: 3px 6px !important;
    font-size: 11pt !important;
    margin-bottom: 4px !important;
  }

  .inv-fabric-spec-bar {
    padding: 2px 4px !important;
    margin-bottom: 3px !important;
    font-size: 6.8pt !important;
  }

  .inv-spec-badge {
    font-size: 6.2pt !important;
    padding: 1px 3px !important;
  }

  .inv-spec-note {
    font-size: 6.5pt !important;
  }

  .inv-top-grid {
    gap: 6px !important;
    margin-bottom: 4px !important;
  }

  .inv-logo-img {
    height: 32px !important;
    max-width: 160px !important;
  }

  .inv-company-info {
    font-size: 6.8pt !important;
    line-height: 1.16 !important;
  }

  .inv-company-info td {
    padding: 0.5px 2px !important;
  }

  .inv-meta-grid {
    gap: 6px !important;
    margin-bottom: 4px !important;
    font-size: 6.8pt !important;
  }

  .inv-client-info td,
  .inv-meta-table td {
    padding: 1px 2px !important;
    line-height: 1.16 !important;
  }

  .inv-items-table {
    font-size: 6.8pt !important;
    margin-bottom: 4px !important;
  }

  .inv-items-table th {
    padding: 2px 2px !important;
  }

  .inv-items-table td {
    padding: 1px 2px !important;
    line-height: 1.14 !important;
  }

  .inv-notes-box {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    font-size: 6.8pt !important;
    line-height: 1.15 !important;
  }

  .inv-bank-card {
    padding: 3px 6px !important;
    margin-bottom: 4px !important;
    gap: 6px !important;
  }

  .inv-bank-logo {
    width: 36px !important;
  }

  .inv-bank-info {
    font-size: 6.8pt !important;
    line-height: 1.15 !important;
  }

  .inv-bank-info strong {
    font-size: 7.8pt !important;
  }

  .inv-signature-grid {
    margin-top: 10px !important;
    margin-bottom: 4px !important;
    font-size: 7.2pt !important;
  }

  .inv-sign-title {
    font-size: 7.8pt !important;
    margin-bottom: 4px !important;
  }

  .inv-sign-space {
    height: 52px !important;
    min-height: 52px !important;
    margin-bottom: 4px !important;
  }

  .inv-signature-img {
    max-height: 50px !important;
    max-width: 110px !important;
  }

  .inv-sign-name {
    font-size: 8pt !important;
  }

  .inv-sign-role {
    font-size: 6.8pt !important;
  }

  /* =======================================================
     WORK ORDER (LANDSCAPE) - FIT 1 HALAMAN PRESISI & RATA ATAS
     ======================================================= */
  .doc-paper.landscape {
    width: 100% !important;
    max-width: 297mm !important;
    padding: 3mm 6mm !important;
  }

  .wo-header-title {
    padding: 2px !important;
    font-size: 11pt !important;
    margin-bottom: 3px !important;
  }

  .wo-brand-center {
    gap: 6px !important;
    margin-bottom: 4px !important;
  }

  .wo-logo-img {
    height: 28px !important;
    max-width: 160px !important;
  }

  .wo-meta-box {
    margin-bottom: 4px !important;
    font-size: 7pt !important;
  }

  .wo-meta-cell {
    padding: 2px 4px !important;
  }

  .wo-meta-row {
    margin-bottom: 1.5px !important;
  }

  .wo-body-grid {
    margin-bottom: 4px !important;
    font-size: 7pt !important;
  }

  .wo-specs-col {
    padding: 4px !important;
  }

  .wo-specs-table td {
    padding: 1px 2px !important;
  }

  .wo-mockup-col {
    min-height: 160px !important;
    padding: 4px !important;
  }

  .wo-uploaded-img {
    max-height: 155px !important;
  }

  .wo-sizes-table {
    font-size: 7pt !important;
  }

  .wo-sizes-table th {
    padding: 2px 2px !important;
  }

  .wo-sizes-table td {
    padding: 1.2px 2px !important;
  }

  .wo-cs-sign-box {
    padding: 4px !important;
  }

  .wo-cs-sign-box .cs-title {
    font-size: 7pt !important;
    margin-bottom: 22px !important;
  }

  .wo-cs-sign-box .cs-name {
    font-size: 7pt !important;
  }

  .wo-notes-bar {
    padding: 2px 5px !important;
    font-size: 6.8pt !important;
    margin-bottom: 3px !important;
  }

  .wo-warning-box {
    padding: 3px 6px !important;
    font-size: 6.5pt !important;
    line-height: 1.2 !important;
  }

  .editable-field:hover,
  .editable-field:focus {
    background: transparent !important;
    box-shadow: none !important;
  }

  .wo-img-actions {
    display: none !important;
  }
}

/* ==========================================================================
   INVOICE LIST / DAFTAR INVOICE MODAL & NAVBAR STYLES
   ========================================================================== */

/* Navbar Button & Badge */
.btn-top-inv-list {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-top-inv-list:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-top-inv-list .btn-icon {
  font-size: 0.95rem;
}

.btn-nav-inv-tab {
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-inv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.btn-top-inv-list:hover .nav-inv-badge {
  background: #ffffff;
  color: #ef4444;
}

/* Modal Overlay */
.inv-list-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.inv-list-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.inv-list-modal {
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.inv-list-overlay.show .inv-list-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.inv-list-header {
  background: #0f172a;
  color: #ffffff;
  padding: 1.1rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.inv-list-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.inv-list-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.inv-list-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: #ffffff;
}

.inv-list-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.2rem 0 0 0;
}

.inv-list-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-create-new-inv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 0.825rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-create-new-inv:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-close-inv-list {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-inv-list:hover {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
}

/* Toolbar: Search & Filter */
.inv-list-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.inv-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  width: 320px;
  max-width: 100%;
  transition: border-color 0.2s;
}

.inv-search-box:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inv-search-box .search-icon {
  font-size: 0.85rem;
  color: #94a3b8;
}

.inv-search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.825rem;
  font-family: inherit;
  color: #0f172a;
}

.inv-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.inv-tab-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inv-tab-pill:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.inv-tab-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* Content Area */
.inv-list-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.6rem;
  background: #ffffff;
  min-height: 280px;
}

.inv-table-wrapper {
  overflow-x: auto;
}

.inv-manager-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.825rem;
}

.inv-manager-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}

.inv-manager-table td {
  padding: 0.85rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.inv-manager-table tr:hover td {
  background: #f8fafc;
}

/* Cell Elements */
.inv-num-cell strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.inv-date-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.inv-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.inv-type-badge.jersey {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.inv-type-badge.kaos {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.inv-client-cell strong {
  display: block;
  font-size: 0.85rem;
  color: #0f172a;
}

.inv-client-cell span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-price-cell strong {
  display: block;
  font-size: 0.875rem;
  color: #047857;
  font-weight: 800;
}

.inv-price-cell span {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
}

.inv-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.inv-status-pill.lunas {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.inv-status-pill.dp {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.inv-status-pill.unpaid {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Actions in Table */
.inv-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-inv-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inv-edit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-inv-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inv-preview:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-inv-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
}

.btn-inv-delete:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

/* Empty State */
.inv-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem;
  text-align: center;
}

.inv-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.75;
}

.inv-list-empty h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.4rem 0;
}

.inv-list-empty p {
  font-size: 0.825rem;
  color: #64748b;
  max-width: 360px;
  margin: 0 0 1.25rem 0;
  line-height: 1.45;
}

/* Footer */
.inv-list-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
}

/* Toolbar button in sheet modal */
.btn-list-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-list-doc:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.btn-new-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-new-doc:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

