
/* ==================================================
   DAPUR MBA ATUN
   STYLE.CSS
   Website Nota Digital
   ================================================== */

/* 1. FONT & RESET */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #8b4327;
  --primary-dark: #62301d;
  --primary-light: #fff0e4;

  --accent: #e7a35c;
  --accent-dark: #c77e38;

  --background: #faf7f3;
  --surface: #ffffff;
  --surface-soft: #fffaf6;

  --text: #322720;
  --text-muted: #85786e;
  --border: #eee4dc;

  --success: #247650;
  --danger: #b94843;

  --shadow:
    0 5px 24px rgba(85, 48, 27, 0.045);

  --radius: 16px;
  --radius-sm: 10px;

  --font-main: 'DM Sans', sans-serif;
  --font-heading: 'Nunito', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

img {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(199, 126, 56, 0.45);
  outline-offset: 3px;
}

/* 2. HEADER WEBSITE */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.header-container {
  width: min(100% - 48px, 1440px);
  min-height: 84px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-info {
  min-width: 0;
}

.brand-info h1 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
  color: var(--primary-dark);
}

.brand-info p {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.header-label {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #f3d9c5;
  padding: 8px 15px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 3. MAIN LAYOUT */

.main-container {
  width: min(100% - 48px, 1440px);
  margin: 34px auto 70px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.form-panel,
.preview-panel {
  min-width: 0;
}

.panel-heading,
.preview-heading {
  margin-bottom: 22px;
}

.section-label {
  display: inline-block;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  margin-bottom: 7px;
}

.panel-heading h2,
.preview-heading h2 {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.3;
}

.panel-heading p,
.preview-heading p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}

/* 4. FORM CARD */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 25px;
  margin-bottom: 20px;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.card-number {
  width: 34px;
  height: 34px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;

  font-size: 12px;
  font-weight: 800;
}

.card-heading h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 900;
}

.card-description {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 18px;
}

/* 5. FORM INPUT */

.form-group {
  margin-bottom: 18px;
  min-width: 0;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #5d4a3e;
}

.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;

  border: 1px solid #e9dfd6;
  border-radius: var(--radius-sm);
  background: #fffdfb;

  padding: 12px 14px;
  min-height: 46px;

  color: var(--text);
  font-size: 14px;

  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(231, 163, 92, 0.13);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a69a90;
}

.form-group input[readonly] {
  background: #f8f4f0;
  color: #7d6c60;
  cursor: default;
}

.form-group input[type="date"] {
  color-scheme: light;
}

.form-group input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* 6. DAFTAR ITEM DINAMIS */

/*
  JavaScript nantinya membuat elemen:

  .item-card
  .item-card-header
  .item-number
  .item-fields
  .item-subtotal
  .btn-remove
*/

.item-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 18px;
}

.item-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 17px;
  min-width: 0;
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.item-number {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}

.item-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.item-fields .form-group {
  margin-bottom: 0;
}

.item-fields .form-group:first-child {
  grid-column: 1 / -1;
}

.item-subtotal {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed #dfd0c4;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  font-size: 12px;
  color: var(--text-muted);
}

.item-subtotal strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 7. BUTTONS */

.btn {
  border: none;
  border-radius: 11px;
  min-height: 46px;
  padding: 12px 17px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  font-size: 13px;
  font-weight: 800;
  text-align: center;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-add {
  width: 100%;
  background: #fff8f1;
  color: var(--primary);
  border: 1px dashed #d8a780;
}

.btn-add:hover {
  background: #ffeddb;
}

.btn-add span {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.btn-remove {
  background: #fff0ef;
  color: var(--danger);
  border: 1px solid #f2d4d1;
  border-radius: 8px;
  padding: 7px 11px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 700;
}

.btn-remove:hover {
  background: #ffe5e2;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions .btn-print {
  grid-column: 1 / -1;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid #e6d6ca;
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-print {
  background: #2e6e50;
  color: white;
}

.btn-print:hover {
  background: #22563d;
}

/* 8. FORM SUMMARY */

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;

  font-size: 13px;
  color: #6d5d52;
}

.summary-row strong {
  color: var(--text);
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.total-row {
  border-top: 1px dashed #e7d8cd;
  padding-top: 17px;
  margin-top: 16px;
  margin-bottom: 8px;

  color: var(--primary-dark);
  font-weight: 800;
}

.total-row strong {
  font-size: 22px;
  color: var(--primary);
}

.summary-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* 9. NOTA PAPER */

.nota-paper {
  background: #fff;
  border: 1px solid #ebe0d7;
  border-radius: 5px;

  width: 100%;
  max-width: 600px;

  min-height: 650px;
  margin: 0 auto;

  padding: 32px 28px;

  box-shadow:
    0 9px 35px rgba(68, 42, 24, 0.07);

  color: #332820;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* 10. HEADER NOTA */

.nota-header {
  text-align: center;
  margin-bottom: 25px;
}

.nota-logo {
  width: 85px;
  height: 85px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.nota-header h2 {
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.3;
}

.nota-header p {
  font-size: 11px;
  color: #765c4d;
  margin-top: 3px;
}

.nota-divider {
  height: 2px;
  background: var(--primary);
  margin: 19px 0 15px;
}

.nota-header h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--primary-dark);
}

/* 11. INFORMASI NOTA */

.nota-information {
  margin-bottom: 23px;
}

.nota-info-row {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  gap: 10px;
  padding: 5px 0;
  font-size: 11px;
}

.nota-info-row span {
  color: #857366;
}

.nota-info-row strong {
  color: #352920;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

/* 12. TABEL NOTA */

.nota-table-wrapper {
  width: 100%;
  min-width: 0;
}

.nota-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10.5px;
}

.nota-table th {
  padding: 10px 7px;
  background: #f7eee6;
  color: #69432d;
  text-align: left;
  font-weight: 800;
  line-height: 1.3;
}

.nota-table td {
  padding: 11px 7px;
  border-bottom: 1px solid #f1e8e0;
  vertical-align: top;
  line-height: 1.4;
}

.nota-table th:first-child {
  border-radius: 5px 0 0 5px;
}

.nota-table th:last-child {
  border-radius: 0 5px 5px 0;
}

.col-item {
  width: 36%;
  overflow-wrap: anywhere;
}

.col-qty {
  width: 14%;
  text-align: center !important;
}

.col-price {
  width: 24%;
  text-align: right !important;
}

.col-subtotal {
  width: 26%;
  text-align: right !important;
}

.nota-table td:nth-child(2) {
  text-align: center;
}

.nota-table td:nth-child(3),
.nota-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 13. TOTAL NOTA */

.nota-totals {
  margin-top: 20px;
  margin-left: auto;
  width: min(100%, 310px);
}

.nota-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;

  padding: 6px 0;
  font-size: 11px;
}

.nota-total-row span {
  color: #806d60;
}

.nota-total-row strong {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.grand-total {
  border-top: 1px solid #d7b79e;
  border-bottom: 1px solid #d7b79e;
  margin: 8px 0;
  padding: 12px 0;
}

.grand-total span {
  font-weight: 800;
  color: var(--primary-dark);
}

.grand-total strong {
  color: var(--primary);
  font-size: 17px;
}

/* 14. CATATAN NOTA */

.nota-notes {
  margin-top: 23px;
  padding: 12px 14px;
  border: 1px solid #f0e4da;
  background: #fffcf9;
  border-radius: 8px;
}

.nota-notes strong {
  display: block;
  font-size: 11px;
  color: var(--primary-dark);
  margin-bottom: 3px;
}

.nota-notes p {
  font-size: 11px;
  color: #736254;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 15. STEMPEL + TANDA TANGAN */

/*
  Stempel berada di lapisan atas (z-index 2).
  Tanda tangan berada di bawahnya (z-index 1).

  Gambar idealnya berlatar transparan.
*/

.nota-signature-section {
  display: flex;
  justify-content: flex-end;

  margin-top: 32px;
  min-height: 190px;
}

.signature-container {
  width: 190px;
  text-align: center;
}

.signature-label {
  color: #735b4b;
  font-size: 11px;
  margin-bottom: 5px;
}

.signature-assets {
  position: relative;
  width: 170px;
  height: 120px;
  margin: 0 auto;
}

.signature-stamp {
  position: absolute;
  width: 105px;
  height: 105px;
  object-fit: contain;

  left: 50%;
  top: 0;

  transform: translateX(-50%) rotate(-9deg);
  z-index: 2;

  opacity: 0.87;
}

.signature-image {
  position: absolute;
  width: 160px;
  height: 80px;
  object-fit: contain;

  left: 50%;
  bottom: 0;

  transform: translateX(-50%);
  z-index: 1;
}

.signature-name {
  display: inline-block;
  min-width: 145px;

  border-top: 1px solid #7d6555;
  padding-top: 7px;

  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 900;
  color: var(--primary-dark);
}

/* 16. FOOTER NOTA */

.nota-footer {
  margin-top: 26px;
  border-top: 1px dashed #e7d7ca;
  padding-top: 13px;
  text-align: center;
}

.nota-footer p {
  font-size: 10px;
  color: #968376;
  line-height: 1.7;
}

/* 17. CUSTOM TOAST */

.toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;

  z-index: 1000;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;

  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;

  padding: 14px 16px;
  width: 100%;

  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-weight: 600;

  pointer-events: auto;
  animation: toastIn 0.25s ease both;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.is-leaving {
  animation: toastOut 0.2s ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ==============================================
   RESPONSIVE TABLET
   ============================================== */

@media (max-width: 1100px) {

  .main-container {
    grid-template-columns: 1fr;
    gap: 35px;
    max-width: 760px;
  }

  .nota-paper {
    max-width: 600px;
  }

}

/* ==============================================
   RESPONSIVE HP
   ============================================== */

@media (max-width: 600px) {

  body {
    font-size: 13px;
  }

  .header-container {
    width: calc(100% - 28px);
    min-height: 72px;
  }

  .brand {
    gap: 9px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand-info h1 {
    font-size: 17px;
  }

  .brand-info p {
    font-size: 10px;
  }

  .header-label {
    padding: 6px 9px;
    font-size: 10px;
  }

  .main-container {
    width: calc(100% - 24px);
    margin-top: 25px;
    margin-bottom: 45px;
    gap: 32px;
  }

  .panel-heading h2,
  .preview-heading h2 {
    font-size: 22px;
  }

  .panel-heading p,
  .preview-heading p {
    font-size: 12px;
  }

  .form-card {
    padding: 18px 15px;
    border-radius: 13px;
    margin-bottom: 14px;
  }

  .card-heading {
    gap: 10px;
    margin-bottom: 19px;
  }

  .card-heading h3 {
    font-size: 15px;
  }

  .card-number {
    width: 31px;
    height: 31px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .item-card {
    padding: 14px;
  }

  .item-fields {
    gap: 10px;
  }

  .btn {
    min-height: 48px;
    padding: 12px;
    font-size: 12px;
  }

  .total-row strong {
    font-size: 20px;
  }

  .nota-paper {
    padding: 22px 13px;
    min-height: 550px;
    box-shadow: 0 5px 20px rgba(68, 42, 24, 0.05);
  }

  .nota-logo {
    width: 68px;
    height: 68px;
  }

  .nota-header h2 {
    font-size: 20px;
  }

  .nota-header p {
    font-size: 10px;
  }

  .nota-header h3 {
    font-size: 13px;
  }

  .nota-info-row {
    font-size: 10px;
    gap: 6px;
  }

  .nota-table {
    font-size: 9px;
  }

  .nota-table th,
  .nota-table td {
    padding: 9px 3px;
  }

  .col-item {
    width: 34%;
  }

  .col-qty {
    width: 12%;
  }

  .col-price {
    width: 25%;
  }

  .col-subtotal {
    width: 29%;
  }

  .nota-totals {
    width: min(100%, 290px);
  }

  .nota-total-row {
    font-size: 10px;
  }

  .grand-total strong {
    font-size: 15px;
  }

  .nota-signature-section {
    margin-top: 25px;
  }

  .signature-container {
    width: 170px;
  }

  .signature-assets {
    width: 155px;
  }

  .signature-stamp {
    width: 95px;
    height: 95px;
  }

  .signature-image {
    width: 145px;
  }

  .toast-container {
    right: 12px;
    bottom: 12px;
  }

}

/* ==============================================
   HP KECIL
   ============================================== */

@media (max-width: 380px) {

  .header-label {
    display: none;
  }

  .main-container {
    width: calc(100% - 16px);
  }

  .form-card {
    padding: 16px 12px;
  }

  .item-fields {
    grid-template-columns: 1fr;
  }

  .item-fields .form-group:first-child {
    grid-column: auto;
  }

  .nota-paper {
    padding: 18px 9px;
  }

  .nota-table {
    font-size: 8px;
  }

  .nota-table th,
  .nota-table td {
    padding: 8px 2px;
  }

  .grand-total strong {
    font-size: 14px;
  }

}

/* ==============================================
   PRINT A5
   ============================================== */

@page {
  size: A5 portrait;
  margin: 0;
}

@media print {

  :root {
    color-scheme: light;
  }

  html,
  body {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff !important;
  }

  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .site-header,
  .form-panel,
  .preview-heading,
  .toast-container {
    display: none !important;
  }

  .main-container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .preview-panel {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .nota-paper {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 11mm 10mm !important;

    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    background: white !important;

    font-size: 10px !important;
  }

  .nota-header {
    margin-bottom: 16px;
  }

  .nota-logo {
    width: 65px;
    height: 65px;
  }

  .nota-header h2 {
    font-size: 20px;
  }

  .nota-header p {
    font-size: 10px;
  }

  .nota-divider {
    margin: 13px 0 10px;
  }

  .nota-information {
    margin-bottom: 15px;
  }

  .nota-info-row {
    font-size: 10px;
    padding: 3px 0;
  }

  .nota-table {
    font-size: 9px;
  }

  .nota-table th,
  .nota-table td {
    padding: 7px 4px;
  }

  .nota-table thead {
    display: table-header-group;
  }

  .nota-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .nota-totals {
    margin-top: 14px;
  }

  .nota-total-row {
    padding: 4px 0;
    font-size: 10px;
  }

  .grand-total {
    padding: 9px 0;
  }

  .grand-total strong {
    font-size: 15px;
  }

  .nota-signature-section {
    margin-top: 20px;
    min-height: 160px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .signature-assets {
    height: 110px;
  }

  .signature-stamp {
    width: 95px;
    height: 95px;
  }

  .signature-image {
    width: 145px;
    height: 75px;
  }

  .nota-footer {
    margin-top: 16px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

}

/* ==============================================
   REDUCED MOTION
   ============================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

}

/* =====================================================
   DAPUR MBA ATUN
   UPDATE CSS - WHATSAPP & DOWNLOAD PNG
   ===================================================== */

/* 1. TATA LETAK TOMBOL AKSI */

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.form-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 48px;

  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;

  padding: 12px 14px;
  border-radius: 11px;

  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;

  white-space: normal;
  overflow-wrap: anywhere;

  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.form-actions .btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Reset dan Simpan tetap sejajar */

.form-actions .btn-secondary,
.form-actions .btn-primary {
  grid-column: auto;
}

/* WhatsApp dibuat menonjol */

.form-actions .btn-whatsapp {
  grid-column: 1 / -1;
  background: #218653;
  color: #ffffff;
  border: 1px solid #218653;
}

.form-actions .btn-whatsapp:hover {
  background: #176d42;
  border-color: #176d42;
  box-shadow: 0 5px 15px rgba(33, 134, 83, 0.16);
}

/* Download PNG */

.form-actions .btn-download {
  grid-column: auto;
  background: #fff5e9;
  color: #874627;
  border: 1px solid #e9c6a5;
}

.form-actions .btn-download:hover {
  background: #ffebd5;
  border-color: #dba878;
}

/* Cetak PDF */

.form-actions .btn-print {
  grid-column: auto;
  background: #74442d;
  color: #ffffff;
  border: 1px solid #74442d;
}

.form-actions .btn-print:hover {
  background: #59321f;
  border-color: #59321f;
}

/* Interaksi tombol */

.form-actions .btn:not(:disabled):active {
  transform: scale(0.98);
}

.form-actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* 2. PENGATURAN PREVIEW NOTA */

.nota-paper {
  background: #ffffff;
  color: #332820;
  overflow-wrap: anywhere;
}

.nota-table-wrapper {
  width: 100%;
  min-width: 0;
}

.nota-table {
  width: 100%;
  table-layout: fixed;
}

/* Pastikan gambar tidak melebar */

.nota-logo,
.signature-stamp,
.signature-image {
  display: block;
  max-width: 100%;
}

/* Stempel menimpa tanda tangan */

.signature-assets {
  position: relative;
  isolation: isolate;
}

.signature-stamp {
  z-index: 2;
}

.signature-image {
  z-index: 1;
}

/* 3. RESPONSIVE TABLET */

@media (max-width: 768px) {

  .form-actions {
    gap: 10px;
  }

  .form-actions .btn {
    min-height: 48px;
    padding: 12px 10px;
  }

}

/* 4. RESPONSIVE HP */

@media (max-width: 480px) {

  .form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .form-actions .btn {
    min-height: 49px;
    padding: 11px 9px;
    font-size: 11px;
    border-radius: 10px;
    gap: 6px;
  }

  .form-actions .btn svg {
    width: 16px;
    height: 16px;
  }

  /* WhatsApp tetap satu baris penuh */

  .form-actions .btn-whatsapp {
    grid-column: 1 / -1;
    font-size: 13px;
  }

  /* Download dan cetak berdampingan */

  .form-actions .btn-download,
  .form-actions .btn-print {
    grid-column: auto;
  }

  .nota-paper {
    max-width: 100%;
  }

}

/* 5. HP SANGAT KECIL */

@media (max-width: 350px) {

  .form-actions {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    grid-column: 1 / -1;
    font-size: 12px;
    min-height: 46px;
  }

}

/* 6. SAAT CETAK / SIMPAN PDF */

@media print {

  .form-actions,
  .btn-whatsapp,
  .btn-download,
  .btn-print {
    display: none !important;
  }

  .nota-paper {
    background: #ffffff !important;
  }

  .signature-assets {
    position: relative !important;
  }

  .signature-stamp {
    position: absolute !important;
    z-index: 2 !important;
  }

  .signature-image {
    position: absolute !important;
    z-index: 1 !important;
  }

}

/* 7. AKSESIBILITAS */

@media (prefers-reduced-motion: reduce) {

  .form-actions .btn {
    transition: none !important;
  }

}

/* ============================================
   DAPUR MBA ATUN
   PERBAIKAN STEMPEL + TANDA TANGAN
   ============================================ */

.nota-signature-section {
  display: flex;
  justify-content: flex-end;
  margin-top: 35px;
  min-height: 220px;
  break-inside: avoid;
}

.signature-container {
  width: 240px;
  max-width: 100%;
  text-align: center;
}

.signature-label {
  font-size: 12px;
  margin-bottom: 10px;
  color: #633b27;
}

.signature-assets {
  position: relative;
  isolation: isolate;
  width: 220px;
  max-width: 100%;
  height: 160px;
  margin: 0 auto;
}

/* STEMPEL DI BELAKANG */

.signature-stamp {
  position: absolute;
  display: block;
  width: 135px;
  height: 135px;
  max-width: none;
  object-fit: contain;

  left: 50%;
  top: 0;

  transform: translateX(-50%) rotate(-8deg);

  z-index: 1;
  opacity: 0.8;
}

/* TANDA TANGAN DI ATAS STEMPEL */

.signature-image {
  position: absolute;
  display: block;
  width: 190px;
  height: 100px;
  max-width: none;
  object-fit: contain;

  left: 50%;
  top: 45px;

  transform: translateX(-50%);

  z-index: 3;
  opacity: 1;
}

/* NAMA DI BAWAH TANDA TANGAN */

.signature-name {
  display: inline-block;
  min-width: 175px;
  border-top: 1px solid #785341;
  padding-top: 8px;
  margin-top: 4px;

  font-size: 13px;
  font-weight: 900;
  color: #62301d;
}

/* RESPONSIVE HP */

@media (max-width: 600px) {
  .signature-container {
    width: 210px;
  }

  .signature-assets {
    width: 205px;
    height: 155px;
  }

  .signature-stamp {
    width: 125px;
    height: 125px;
  }

  .signature-image {
    width: 180px;
    height: 95px;
    top: 40px;
  }
}

/* CETAK PDF */

@media print {
  .nota-signature-section {
    min-height: 190px;
    margin-top: 24px;
  }

  .signature-assets {
    width: 220px;
    height: 160px;
  }

  .signature-stamp {
    width: 135px;
    height: 135px;
    z-index: 1 !important;
  }

  .signature-image {
    width: 190px;
    height: 100px;
    top: 45px;
    z-index: 3 !important;
  }
}
