#timesheetForm {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.form-group {
    margin-bottom: 15px;
    text-align: center;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input,
.form-group select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    box-sizing: border-box;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
input[type="time"], select {
    width: 100px;
}
button {
    padding: 10px 20px;
    background-color: #C2AE7E;
    color: white;
    border: none;
    cursor: pointer;
}
button:hover {
    background-color: #a8976d;
}
.signature-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.signature-label {
    font-weight: bold;
}
@media screen and (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        display: none;
    }
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }
    td {
        border: none;
        border-bottom: 1px solid #ddd;
        position: relative;
        padding: 10px 5px;
        text-align: center;
    }
    td:before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }
    td[data-label="Day"] {
        font-weight: bold;
        background-color: #f0f0f0;
    }
    input[type="time"], 
    input[type="text"],
    select {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        text-align: center;
    }

    .form-group input,
    .form-group select {
        max-width: 100%;
    }
}

/* Add these styles to your existing CSS */
.form-group {
    margin-bottom: 15px;
    text-align: center;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    box-sizing: border-box;
    margin: 0 auto;
}

@media screen and (max-width: 768px) {
    .form-group input[type="text"] {
        max-width: 100%;
    }
}

input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Force date input to be the same height across browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
}

/* iOS-specific styles */
@supports (-webkit-touch-callout: none) {
  #timesheetForm input[type="date"] {
    min-height: 40px;
  }
}

.signature-error {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #c00;
  background: #fff5f5;
}

/* Ensure form controls align consistently inside the timesheet table */
#timesheetForm table td input,
#timesheetForm table td select {
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
}

/* Optional: keep the control vertically consistent */
#timesheetForm table td select {
  min-height: 40px;
}

/* Signature pads: stop scroll capture and improve mobile usability */
#timesheetForm .signature-group {
  overflow: hidden;
}

#timesheetForm canvas.signature-pad {
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* --- Signature pads: force a visible, non-collapsing canvas on mobile --- */
#timesheetForm .signature-pad-wrap,
#timesheetForm .signature-pad-container,
#timesheetForm .signature-container {
  width: 100%;
  max-width: 100%;
  display: block;
}

#timesheetForm canvas.signature-pad,
#timesheetForm #candidateSignaturePad,
#timesheetForm #clientSignaturePad {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;

  /* Critical: prevent “0 height” collapse caused by theme/table/flex rules */
  height: 220px !important;
  min-height: 220px !important;

  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 6px;
  box-sizing: border-box;

  /* Keep your existing interaction rules */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 768px) {
  #timesheetForm canvas.signature-pad,
  #timesheetForm #candidateSignaturePad,
  #timesheetForm #clientSignaturePad {
    height: 180px !important;
    min-height: 180px !important;
  }
}

