/* ===============================
   MBH Nota Klinik v3.6 — Clean Layout + CAP/TTD Fixed
   =============================== */

/* --- Container Nota --- */
.nota-container {
  width: 100%;
  max-width: 550px;
  background: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  margin: 25px auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  font-family: "Poppins", sans-serif;
  color: #001a33;
  font-size: 13.5px;
  line-height: 1.45;
}

/* --- HEADER --- */
.nota-container header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border-bottom: 1px solid #c8d9f0;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.nota-container header .logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.nota-container header .clinic-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nota-container header .clinic-info h2 {
  margin: 0;
  color: #003366;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.nota-container header .clinic-info p {
  margin: 2px 0;
  font-size: 13.5px;
  color: #001a33;
  line-height: 1.3;
}

.nota-container header .clinic-info small {
  font-size: 12.5px;
  color: #004080;
  margin-top: 2px;
  display: block;
}

/* --- HR --- */
.nota-container hr {
  border: none;
  border-top: 1px solid #c8d9f0;
  margin: 10px 0 15px 0;
}

/* --- DATA PASIEN --- */
.nota-info p {
  margin: 4px 0;
  font-size: 13.2px;
  color: #002244;
}

.nota-info b {
  color: #001a33;
}

/* --- TABEL --- */
.nota-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.nota-table th,
.nota-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #d3e0f5;
}

.nota-table th {
  background: #eef5ff;
  color: #003366;
  font-weight: 600;
}

.totalBox {
  text-align: right;
  font-weight: 600;
  margin-top: 8px;
  color: #003366;
  font-size: 13.5px;
}

/* ===============================
   MBH Nota Klinik v3.7 — Cap Enlarged + Clean Signature
   =============================== */

/* ==== CAP & TTD FIXED PROFESSIONAL ALIGN ==== */
.cap-ttd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  text-align: right;
  margin-top: 25px;
  margin-right: 25px;
  line-height: 1.2;
}

/* Lokasi & tanggal di atas cap */
.cap-ttd #lokasiCap,
.cap-ttd #tglCap {
  font-size: 12.8px;
  color: #003366;
  font-weight: 500;
  margin: 2px 0;
}

/* Cap — diperbesar agar tampak jelas seperti nota asli */
.cap-ttd .cap-img {
  position: absolute;
  right: 5px;              /* nempel kanan */
  bottom: 38px;            /* sejajar bawah ttd */
  max-width: 95px;         /* diperbesar dari 70 → 95px */
  height: auto;
  object-fit: contain;
  opacity: 0.33;           /* transparan alami */
  z-index: 1;
  transform: none;
}

/* TTD di atas cap */
.cap-ttd .ttd-img {
  position: relative;
  max-width: 115px;        /* auto menyesuaikan */
  height: auto;
  margin-top: 20px;
  margin-right: 8px;
  object-fit: contain;
  z-index: 2;
}

/* Nama petugas — hanya nama saja, tanpa label */
.cap-ttd #petugas {
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: #001a33;
  z-index: 3;
  margin-right: 8px;
  line-height: 1.2;
}

/* Cetak aman */
@media print {
  .cap-ttd {
    page-break-inside: avoid;
  }
  .cap-ttd .cap-img {
    opacity: 0.45;
  }
}

/* ==== FIX SIZE TTD — Compact Professional Layout ==== */
.cap-ttd .ttd-img {
  position: relative;
  max-width: 90px;      /* batas maksimum lebar tanda tangan */
  height: auto;         /* biar proporsional */
  margin-top: 20px;
  margin-right: 10px;   /* tetap di kanan */
  object-fit: contain;
  z-index: 2;
}


/* ==== FINAL TTD & CAP ULTRA COMPACT ALIGNMENT v3.9 ==== */
.cap-ttd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  text-align: right;
  margin-top: 8px;        /* lebih rapat dari atas */
  margin-right: 25px;
  line-height: 1.1;       /* super padat antar baris */
}

/* Lokasi dan tanggal */
.cap-ttd #lokasiCap,
.cap-ttd #tglCap {
  font-size: 12.8px;
  color: #003366;
  font-weight: 500;
  margin: 0;              /* hapus semua jarak vertikal */
  padding: 0;
}

/* Cap di belakang TTD */
.cap-ttd .cap-img {
  position: absolute;
  right: 18px;
  bottom: 30px;
  height: 65px;
  object-fit: contain;
  opacity: 0.35;
  z-index: 1;
}

/* TTD di atas cap, kecil proporsional & rapat */
.cap-ttd .ttd-img {
  position: relative;
  max-width: 80px;        /* ukuran proporsional */
  height: auto;
  margin-top: 3px;        /* rapat ke tanggal */
  margin-bottom: 2px;     /* rapat ke nama petugas */
  object-fit: contain;
  z-index: 2;
}

/* Nama petugas — langsung nempel di bawah TTD */
.cap-ttd #petugas {
  margin: 0;              /* hapus semua margin */
  padding: 0;
  font-size: 13.2px;
  font-weight: 500;
  color: #001a33;
  z-index: 3;
}

/* ==========================================
   MBH FORM INPUT v3.5 — Clean Professional Form (Final)
   ========================================== */

form {
  background: #ffffff;
  border-radius: 12px;
  padding: 25px 30px;
  margin: 30px auto;
  max-width: 620px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-family: "Poppins", sans-serif;
  color: #001a33;
}

form h2,
form h3 {
  text-align: center;
  color: #003366;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  border-bottom: 1px solid #d0e0f5;
  padding-bottom: 8px;
}

/* Label dan Input */
form label {
  display: block;
  font-weight: 500;
  color: #002a5a;
  font-size: 13.5px;
  margin-bottom: 5px;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c7d7f3;
  border-radius: 8px;
  font-size: 13.5px;
  color: #001a33;
  background: #f8fbff;
  outline: none;
  margin-bottom: 12px;
  transition: 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
  background: #fff;
}

/* Daftar layanan */
.daftar-layanan {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #d0e0f5;
}

.daftar-layanan h4 {
  color: #003366;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Tabel atau baris input layanan */
.itemRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.itemRow input {
  flex: 1;
  min-width: 80px;
}

.itemRow button {
  background: #ff5c5c;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.3s;
}

.itemRow button:hover {
  background: #e04444;
}

/* Tombol utama */
button,
.btn-primary,
.btn-submit {
  display: inline-block;
  background: #007bff;
  color: #fff;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}

button:hover,
.btn-primary:hover,
.btn-submit:hover {
  background: #005fcc;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Total box */
.totalBox {
  background: #eef5ff;
  border-radius: 8px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #003366;
  margin-top: 15px;
}

/* Footer form */
form footer {
  text-align: center;
  font-size: 12.5px;
  color: #777;
  margin-top: 25px;
}

/* Responsif */
@media (max-width: 600px) {
  form {
    padding: 18px;
    margin: 20px 10px;
  }
  .itemRow {
    flex-direction: column;
    align-items: stretch;
  }
  button,
  .btn-primary,
  .btn-submit {
    width: 100%;
  }
}
/* ===============================
   MBH CARE — PRINT SAFE MODE (A5)
   =============================== */

@media print {
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Biar hanya nota yang tercetak */
  .nota-container {
    width: 100% !important;
    max-width: 550px !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  /* Sembunyikan elemen non-nota (form, tombol, footer) */
  form,
  .form-container,
  .nota-actions,
  header nav,
  footer,
  button,
  .btn,
  .no-print {
    display: none !important;
    visibility: hidden !important;
  }

  /* Biar pas di halaman PDF (tanpa spasi ekstra) */
  html,
  body {
    width: 148mm;   /* A5 width */
    height: 210mm;  /* A5 height */
    overflow: hidden !important;
  }

  /* Atur supaya text tajam dan font sesuai */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* ===============================
   SAFE MOBILE VIEW (CHROME / ANDROID)
   =============================== */

@media screen and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .nota-container {
    max-width: 96%;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }

  input,
  select,
  textarea,
  button {
    font-size: 15px;
  }

  /* Disable Chrome mobile crash saat print */
  @media print {
    html,
    body {
      -webkit-print-color-adjust: exact !important;
      transform: none !important;
      zoom: 1 !important;
    }
  }
}
/* ===============================
   MBH FORM INPUT — FIX HEADER LOGO
   =============================== */
.form-container {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  max-width: 680px;
  margin: 40px auto;
  font-family: "Poppins", sans-serif;
  color: #001a33;
  transition: all 0.3s ease-in-out;
}

/* Logo form kecil proporsional */
.form-container header img {
  width: 90px;
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
  opacity: 0.95;
}

.form-container header {
  text-align: center;
  border-bottom: 1px solid #c8d9f0;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.form-container h2 {
  font-size: 18px;
  color: #003366;
  font-weight: 600;
  margin-top: 8px;
}

/* Rapi di HP */
@media (max-width: 768px) {
  .form-container {
    padding: 18px;
    margin: 20px auto;
  }
  .form-container header img {
    width: 80px;
  }
}
