@font-face {
  font-family: 'SesameFutura';
  src: url('../fonts/SesameFutura.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Use this font globally */
body,
input,
select,
button,
label,
a,
h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-family: 'SesameFutura', Arial, Helvetica, sans-serif;
}

/* Specific Sections */
#header,
.hero,
#footer {
  font-family: 'SesameFutura', Arial, Helvetica, sans-serif;
}

#header h1,
#header h2,
#footer p,
.hero h2 {
  font-family: 'SesameFutura', Arial, Helvetica, sans-serif;
}

body {
  /* font-family: 'Helvetica Neue', Arial, sans-serif; */
  font-family: 'SesameFutura', Arial, Helvetica, sans-serif;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  color: #000;
  /*background-color: #fff6ec;*/

}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.logo {
  width: 120px;
  margin-right: 30px;
}

.logo img {
  width: 150%;
  height: auto;
}

.business-info {
  flex: 1;
  text-align: right;
  margin-top: 30px;
}

.business-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 5px;
}

.contact-info {
  font-size: 14px;
}

.invoice-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.left-col {
  display: flex;
  flex-direction: column;
  width: 48%;
}

.left-col label {
  font-weight: 600;
  margin-bottom: 5px;
}

/* .left-col input {
  padding: 6px 8px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  width: 100%;
} */

.left-col input {
  padding: 6px 8px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  width: 100%;
  background-color: #fff !important;
  color: #000 !important;
}

/* Remove blue focus/background from name and contact inputs */
.left-col input:focus,
.left-col input:active {
  outline: none !important;
  box-shadow: none !important;
  background-color: #fff !important;
  border-color: #ccc !important;
  color: #000 !important;
}

/* Remove Chrome autofill blue color */
.left-col input:-webkit-autofill,
.left-col input:-webkit-autofill:hover,
.left-col input:-webkit-autofill:focus,
.left-col input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  caret-color: #000 !important;
  transition: background-color 9999s ease-in-out 0s;
}


.right-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 48%;
  gap: 40px;
  text-align: right;
}

.right-row span {
  font-weight: 600;
  font-size: 1em;
  white-space: nowrap;
}

.right-row input[type="date"] {
  padding: 4px 6px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  /* font-family: inherit; */
  width: auto;
}

.payment-info {
  margin-bottom: 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #000;
  font-weight: 600;
  /*background-color: #f0e5d8;*/
  /*background-color: #E4E4E4;*/
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e0e0;
}

/* Inputs inside table cells */
table tbody td input {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  /* font-family: inherit; */
  font-size: 1em;
}

table tbody td input[type='number'] {
  text-align: right;
}

.totals {
  max-width: 300px;
  margin-left: auto;
  /*background: #f0e5d8;*/
  /*background: #E4E4E4;*/
  padding: 15px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1em;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

#add-service-btn {
  padding: 10px 20px;
  font-size: 1em;
  /*background-color: #007b5e;*/
  background-color: #c55527;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 20px;
}

#add-service-btn:hover {
  background-color: #c55527;
}

.buttons {
  margin-top: 30px;
  text-align: center;
}

.buttons button {
  padding: 10px 25px;
  font-size: 1em;
  background-color: #c55527;
  /*background-color: #007b5e;*/
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.buttons button:hover {
  background-color: #004d3a;
}

/* Remove button styles */
.remove-btn {
  background-color: transparent;
  border: none;
  color: black;
  font-weight: bold;
  font-size: 1.3em;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
  user-select: none;
  margin-top: 7px;
  transition: color 0.2s ease;
}

.remove-btn:hover {
  color: darkred;
}

/* Style dropdown select boxes like inputs */
select.service-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 1em;
  /* font-family: inherit; */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  /*background-color: #fff6ec; */
  color: #000;
  appearance: none;
  /* Remove default arrow for some browsers */
  -webkit-appearance: none;
  /* Safari and Chrome */
  -moz-appearance: none;
  /* Firefox */
  cursor: pointer;
}

/* Optional: add a custom arrow using background image */
select.service-select {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray"><polygon points="0,0 16,0 8,8"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  /* add right padding to avoid overlap */
}

/* On focus highlight (optional) */
select.service-select:focus {
  outline: none;
  border-color: #007b5e;
  box-shadow: 0 0 3px #007b5e;
}

select.therapist-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 1em;
  /* font-family: inherit; */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  /*background-color: #fff6ec; */
  color: #000;
  appearance: none;
  /* Remove native arrow on some browsers */
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* Optional: add subtle focus style */
select.therapist-select:focus {
  outline: none;
  border-color: #007b5e;
  box-shadow: 0 0 3px #007b5e;
}

/* Optional: Add custom arrow icon */
select.therapist-select {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray"><polygon points="0,0 16,0 8,8"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

#discount-amount {
  display: none;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#discount-amount {
  display: none;
}

.discount-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discount-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.discount-controls input[type="radio"] {
  margin: 0;
}

.discount-type-selection {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  padding-left: 10px;
}

.discount-type-selection label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.discount-type-selection input[type="radio"] {
  margin: 0;
}

@page {
  size: A5 portrait;
  margin: 8mm;
}

@media print {

  /* body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  } */
  html,
  body {
    width: 148mm;
    min-height: 210mm;
    margin: 0 auto;
    padding: 0;
  }

  body {
    max-width: none !important;
    padding: 8mm !important;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 11px;
  }

  /* Hide remove buttons */
  .remove-btn {
    display: none !important;
  }

  /* Hide the Add Service button */
  #add-service-btn {
    display: none !important;
  }

  /* Hide the Print Invoice button */
  .buttons {
    display: none !important;
  }

  /* Remove input borders and backgrounds for cleaner print */
  /* input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  } */
  /* Remove input borders, focus color, and autofill color for print */
  input,
  input:focus,
  input:active,
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  textarea,
  textarea:focus,
  textarea:active {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }

  /* Remove calendar dropdown arrow in date input (webkit browsers) */
  input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
  }

  /* Remove calendar dropdown arrow in Firefox */
  input[type="date"]::-moz-calendar-picker-indicator {
    display: none;
  }

  /* Remove calendar dropdown arrow in Edge/IE */
  input[type="date"]::-ms-clear {
    display: none;
  }

  input,
  textarea {
    background-color: transparent;
  }

  input:focus,
  input:active,
  textarea:focus,
  textarea:active {
    outline: none;
    box-shadow: none;
    background-color: transparent;
  }

  table tbody td {
    vertical-align: middle;
  }

  /* Align price, qty, total numeric cells to right */
  table tbody td:nth-child(2),
  table tbody td:nth-child(3) {
    text-align: right;
  }

  /* Align service name (1st column) left */
  table tbody td:nth-child(1) {
    text-align: left;
  }

  /* Also align headers */
  table thead th:nth-child(2),
  table thead th:nth-child(3),
  table thead th:nth-child(4) {
    text-align: right;
  }

  table thead th:nth-child(1) {
    text-align: left;
  }

  table thead th:last-child {
    display: none !important;
  }

  /* Hide the "Remove" column cells */
  table tbody td:last-child {
    display: none !important;
  }

  /* Remove blue highlight and autofill background on all inputs */
  input,
  textarea {
    /*background-color: #fff6ec; */
    transition: background-color 0.3s ease;
  }

  input:focus,
  input:active,
  textarea:focus,
  textarea:active {
    outline: none !important;
    box-shadow: none !important;
    /*background-color: #fff6ec !important;*/
  }

  /* Remove Chrome autofill background color */
  /* input:-webkit-autofill,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0px 1000px #fff6ec inset !important;
    -webkit-text-fill-color: #000 !important;
    transition: background-color 5000s ease-in-out 0s;
  } */
  input:-webkit-autofill,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #000 !important;
    transition: background-color 9999s ease-in-out 0s;
  }

  body,
  th,
  .totals,
  table tbody td {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Remove borders around select dropdown in service column */
  table tbody td select.service-select {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    pointer-events: none;
    /* Optional: disable interaction during print */
  }

  /* Also remove border around price input */
  table tbody td input.price {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Remove border and background from therapist select on print */
  table tbody td select.therapist-select {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    pointer-events: none;
    /* disable interaction */
    padding: 0;
    /* remove padding for tighter layout */
    margin: 0;
  }

  /* Align all table cells vertically middle */
  table tbody td {
    vertical-align: middle !important;
  }

  /* Align numeric columns (price, qty) to right */
  table tbody td:nth-child(3),
  table tbody td:nth-child(4) {
    text-align: right !important;
  }

  /* Align therapist and service columns left */
  table tbody td:nth-child(1),
  table tbody td:nth-child(2) {
    text-align: left !important;
  }

  /* Force fixed table layout */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    border-spacing: 0 !important;
  }

  /* Set explicit widths for all columns */
  table thead th,
  table tbody td {
    padding: 8px 10px !important;
    overflow-wrap: break-word;
  }

  table thead th:nth-child(1),
  table tbody td:nth-child(1) {
    width: 25% !important;
    /* Therapist */
    text-align: left !important;
  }

  table thead th:nth-child(2),
  table tbody td:nth-child(2) {
    width: 35% !important;
    /* Service */
    text-align: left !important;
  }

  table thead th:nth-child(3),
  table tbody td:nth-child(3) {
    width: 20% !important;
    /* Price */
    text-align: right !important;
  }

  table thead th:nth-child(4),
  table tbody td:nth-child(4) {
    width: 10% !important;
    /* Qty */
    text-align: right !important;
  }

  table thead th:nth-child(5),
  table tbody td:nth-child(5) {
    display: none !important;
    /* Remove last column */
  }

  /* Vertically center content */
  table tbody td {
    vertical-align: middle !important;
  }

  .discount-type-selection {
    display: none;
  }

  #discount {
    display: none !important;
  }

  #discount-amount {
    display: inline !important;
  }

  .discount-controls {
    display: flex !important;
  }
}

.signature-section {
  margin-top: 50px;
  margin-bottom: 30px;
}

.signature-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.signature-line span {
  font-size: 14px;
  color: #666;
}

.signature-box {
  width: 200px;
  height: 60px;
  border-bottom: 1px solid #000;
}

@media print {
  .signature-section {
    margin-top: 50px;
    margin-bottom: 30px;
  }

  .signature-line {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }

  .signature-box {
    width: 200px;
    height: 60px;
    border-bottom: 1px solid #000;
  }
}