body {
  font-family: Arial, sans-serif;
  background: #fff;
  color: red;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

textarea,
input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 6px;
  font-size: 16px;
  box-sizing: border-box;
}

.form-group {
  margin: 0;
  padding: 0;
}

.container {
  width: 200mm; /* Reduced from 210mm to account for margins */
  margin: 0 auto;
  padding: 5mm; /* Reduced padding */
  box-sizing: border-box;
  border: 1px solid #000;
  page-break-inside: avoid;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo img {
  height: 70px;
}

.header-info {
  flex: 1;
  margin-left: 20px;
}

.header-info h1 {
  margin: 0;
  font-size: 24px;
}

.header-info .contact {
  font-size: 14px;
  margin-top: 5px;
}

.ins-box {
  border: 2px solid #d00000;
  padding: 6px;
  font-size: 14px;
  color: red;
  text-align: center;
  margin-bottom: 5px; /* Space between box and tax info */
  white-space: nowrap; /* Prevent line breaks */
}

.right-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: 20px;
}

.mt-15 {
  margin-top: 15px;
}

.mt-10 {
  margin-top: 10px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  gap: 20px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group input {
  padding: 6px;
  font-size: 16px;
}

.accreditation-box {
  margin-left: 20px; /* Space from contact info */
}

.tax-info {
  margin-left: 20px; /* Align with accreditation box */
  text-align: left;
  font-size: 14px; /* Increased from 12px */
  color: red;
  line-height: 1.4;
  margin-top: 8px; /* Space between box and tax info */
  font-weight: bold;
}

/* For better alignment of right-side elements */
.accreditation-box,
.tax-info {
  display: flex;
  flex-direction: column;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 16px;
  table-layout: fixed;
}

tr {
  page-break-inside: avoid;
}

th,
td {
  border: 1px solid #000;
  padding: 8px;
  vertical-align: top;
  word-wrap: break-word;
}

thead tr th:nth-child(1),
tbody tr td:nth-child(1) {
  width: 120px; /* Adjust this value as needed */
}

/* Adjust widths: Caption wider, Size smaller, Rate bigger */
thead tr th:nth-child(2),
tbody tr td:nth-child(2) {
  width: 30%; /* Caption wider */
}

thead tr th:nth-child(3),
tbody tr td:nth-child(3) {
  width: 20%; /* Size smaller */
}

thead tr th:nth-child(4),
tbody tr td:nth-child(4) {
  width: 25%; /* Size smaller */
}

thead tr th:nth-child(5),
tbody tr td:nth-child(5) {
  width: 25%; /* Rate bigger */
}

.size-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.size-box input {
  width: 100%;
  padding: 3px;
}

.position-radio {
  margin-top: 8px; 
  margin-bottom: 8px
}

/* Footer-like container */
.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
}

/* Left side: input + buttons */
.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 0 60%;
}

/* Signature block on the right */
.signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signature-block img {
  height: 50px;
  margin-bottom: 5px;
}

.signature-block span {
  font-weight: bold;
  font-size: 14px;
  color: red;
}

#form-actions button {
  padding: 8px 16px;
  font-size: 16px;
  color: red;
  background: white;
  border: 1px solid #d00000;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#form-actions button:hover {
  background-color: #d00000;
  color: white;
}

.input-area {
  width: 100%;
  box-sizing: border-box;
}

.input-area {
  box-sizing: border-box;
  resize: none;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.date-container, 
.rate-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-input {
  width: 100%;
  min-width: 110px;
  box-sizing: border-box;
  color: transparent !important;
  background: transparent !important;
  position: relative;
  z-index: 2; /* Keep input on top so it is clickable */
  caret-color: #333; /* Makes the typing cursor visible */
}

.date-display-label {
  position: absolute;
  left: 12px;
  pointer-events: none;
  font-family: inherit;
  font-size: 14px;
  color: #333;
  z-index: 1; /* Sit behind the input */
}

/* When the user clicks to type or pick a date */
.date-input:focus {
  color: #333 !important; /* Show the actual browser text (mm/dd/yyyy) */
}

/* Hide the custom label ONLY when the user is actively typing */
.date-input:focus + .date-display-label {
  visibility: hidden;
}

.date-with-delete {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative; /* Added to anchor the absolute span */
}

.date-input::-webkit-calendar-picker-indicator {
  position: relative;
  z-index: 3;
  cursor: pointer;
}

.deleteCaptionBtn {
  margin-top: 4px;
}

.delete-btn {
  margin-top: 5px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #d00000;
  background: white;
  color: red;
  border-radius: 3px;
  padding: 3px 6px;
  display: inline-block;
  transition: background-color 0.3s ease;
}
.delete-btn:hover {
  background-color: #d00000;
  color: white;
}

#date-buttons {
  margin-top: 10px;
  margin-bottom: 10px;
}

#date-buttons button {
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #d00000;
  background: white;
  color: red;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

#date-buttons button:hover {
  background-color: #d00000;
  color: white;
}

/* Modern Minimal Navigation Styles */
.top-nav-wrapper {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
  padding: 10px 0;
}

.top-nav-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 2px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-btn {
  position: relative;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover {
  color: #d00000;
}

.nav-btn.active {
  background: white;
  color: #d00000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #d00000;
}

.logout-btn {
  color: #d00000;
}

.logout-btn:hover {
  background: rgba(208, 0, 0, 0.05);
}

.btn-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
}

.nav-btn:nth-child(1) .btn-icon::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
  top: 0;
  left: 0;
}

.nav-btn:nth-child(1) .btn-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: currentColor;
  top: 4px;
  left: 3px;
  box-shadow: 0 3px 0 currentColor, 0 6px 0 currentColor;
}

.nav-btn:nth-child(2) .btn-icon::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  top: 4px;
  left: 0;
}

.nav-btn:nth-child(2) .btn-icon::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  background: currentColor;
  bottom: 2px;
  left: 0;
  box-shadow: 0 -3px 0 currentColor;
}

.nav-btn:nth-child(3) .btn-icon::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  top: 0;
  left: 0;
}

.nav-btn:nth-child(3) .btn-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: currentColor;
  top: 5px;
  left: 12px;
}

@media print {
  body {
    margin: 0;
    padding: 0;
    color: black;
  }

  .container {
    width: 190mm; /* Slightly smaller for print */
    padding: 5mm; /* Less padding for print */
    margin: 0 auto;
    border: none;     
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  #saveDownloadBtn,
  #resetBtn,
  #date-buttons,
  .delete-btn,
  .delete-date-btn {
    display: none !important;
  }  

  /* Add padding at bottom to prevent cutting */
  body:after {
    content: "";
    display: block;
    height: 100px;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-nav {
    padding: 2px;
  }

  .nav-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .btn-icon {
    width: 14px;
    height: 14px;
  }
}