:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f4f6f9;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
}

.pb-nav {
  padding-bottom: calc(84px + var(--safe-bottom));
}

.bottom-nav {
  padding-bottom: var(--safe-bottom);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Modal overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 16px;
  }
}

.modal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
  .modal-sheet {
    border-radius: 20px;
  }
}

/* Hợp đồng chuẩn mẫu Đà Lạt - Vũ Đức Hải */
.contract-paper {
  background: #ffffff;
  color: #b91c1c;
  font-family: "Times New Roman", Times, Georgia, serif;
  padding: 24px 22px;
  line-height: 1.55;
  font-size: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.contract-paper .contract-value {
  color: #111827;
  font-weight: 600;
}

.contract-paper .dotted-line {
  border-bottom: 1px dotted #b91c1c;
  padding: 0 4px;
  display: inline-block;
  min-width: 120px;
}

.signature-canvas {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  touch-action: none;
  cursor: crosshair;
  width: 100%;
  height: 160px;
}

/* Chế độ in hợp đồng (A4/A5 gọn đẹp, ẩn toàn bộ giao diện app) */
@media print {
  body * {
    visibility: hidden !important;
  }
  #contract-print-area,
  #contract-print-area * {
    visibility: visible !important;
  }
  #contract-print-area {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12mm 14mm !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
  .no-print {
    display: none !important;
  }
}
