.time-box {
  background: rgb(240, 227, 248);
  padding: 2px 5px;
  border-radius: 7px;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: max-content;
}
.time-box span:nth-child(2) {
  font-size: 10px;
}

.jobID {
  color: var(--tg-primary-600);
  font-weight: 600;
}

.status-badge {
  border: 1px solid grey;
}

.tg-status-badge {
  padding: 2px 10px;
  border-radius: 15px;
  font-weight: 400;
  color: white;
  font-size: 0.8rem;
  font-weight: 400;
}
.legend-color-box {
  min-width: 10px;
  height: 10px;
  border: 1px solid red;
}


/* --- Grid Row Default Backgrounds --- */
.status-grid > div:nth-child(1) { background: var(--primary-gd); padding: 5px; font-weight: 500; color: white; }
.status-grid > div:nth-child(2) { background: var(--pending-gd); }
.status-grid > div:nth-child(3) { background: var(--awaiting-gd); }
.status-grid > div:nth-child(4) { background: var(--confirm-gd); }
.status-grid > div:nth-child(5) { background: var(--deposit-gd); }
.status-grid > div:nth-child(6) { background: var(--complete-gd); }
.status-grid > div:nth-child(7) { background: var(--noshow-gd); }
.status-grid > div:nth-child(8) { background: var(--cancelled-gd); }

/* --- Grid Row Hover Backgrounds --- */
.status-grid > div:nth-child(2):hover { background: var(--pending-cl); }
.status-grid > div:nth-child(3):hover { background: var(--awaiting-cl); }
.status-grid > div:nth-child(4):hover { background: var(--confirm-cl); }
.status-grid > div:nth-child(5):hover { background: var(--deposit-cl); }
.status-grid > div:nth-child(6):hover { background: var(--complete-cl); }
.status-grid > div:nth-child(7):hover { background: var(--noshow-cl); }
.status-grid > div:nth-child(8):hover { background: var(--cancelled-cl); }


.status-section {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
  height: max-content;
}
.chart-container {
  position: relative;
  width: 210px;
  border-radius: 10px;
  max-height: 190px;
  height: 100%;
}
.chart-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.chart-text .total-job {
  font-size: 32px;
  font-weight: 700;
  color: #343a40;
}
.chart-text .total-label {
  font-size: 14px;
  color: #6c757d;
}
.status-summary {
  flex-grow: 1;
}
.status-summary h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  color: #343a40;
}

.status-grid {
  display: grid;
  gap: 3px;
}
.status-grid > div {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0px;
  border-radius: 5px;
  padding: 2px;
}
.status-grid > div li {
  list-style: none;
  text-align: center;
  background: rgba(255, 255, 255, 0.329);
}

.status-grid > div li:nth-child(1) {
  font-weight: 500;
  text-align: start;
  padding-left: 15px;
}
.status-grid > div:nth-child(1) li {
  background: transparent;
  color: white;
}


#editAppointmentModal .form-control {border:none;}



/* --- Main Container --- */
.financial-summary {
    font-family: sans-serif;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding:5px 16px;
    width: 100%;
    margin: auto;
    background-color: #f9fafb;
}

/* --- Rows --- */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
}
.summary-row:last-child {
    border-bottom: none;
}
.summary-label {
    flex-basis: 120px;
    color: var(--tg-primary-500);
    font-weight: 500;
}
.summary-details {
    flex-grow: 1;
    display: flex;
    gap: 8px;
    padding: 0 7px;
}
.summary-amount {
    flex-basis: 120px;
    text-align: right;
    font-weight: 500;
    color: var(--text-color);
}
.summary-amount.is-negative {
    color: var(--success-color);
}
.summary-row.is-outstanding .summary-amount {
    color: var(--danger-color);
    font-weight: bold;
}




/* --- Detail Pills --- */
.detail-pill {
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.8rem;
    background-color: #f0f0f0;
    color: #6b7280;
    border-radius: 20px;
        cursor: pointer;
}

.detail-pill  input {
    display: none;
}
.detail-pill:has(input[type="checkbox"]:checked) {
        background: rgb(27, 131, 1);
        color: rgb(247, 246, 246);
    }

.detail-pill.is-checked {
    background-color: var(--pill-bg);
    color: var(--success-color);
    font-weight: 500;
}
.detail-pill input[type="checkbox"] {
    margin: 0;
}
.detail-pill label {
    margin: 0;
}

/* --- Responsive for Mobile --- */
@media (max-width: 640px) {
    .summary-row {
        flex-wrap: wrap;
    }
    .summary-label, .summary-amount {
        flex-basis: 50%;
    }
    .summary-details {
        flex-basis: 100%;
        padding: 8px 0;
        order: 3; /* ย้ายรายละเอียดมาอยู่ล่างสุด */
    }
}

.info-section-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    border: 1px dashed var(--tg-primary);
    border-radius: 0.5rem;
    font-family: sans-serif;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden; /* เพิ่มเพื่อความเรียบร้อย */

    /* --- ส่วนที่เพิ่มเข้ามาสำหรับ Background SVG --- */
    background-color: transparent;


}
.bf {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
}

.info-column {
    line-height: 1.6;
    z-index: 1;
}
.info-header {
    font-weight: bold;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.3rem;
    font-size: 0.9rem;
    color: var(--tg-primary)
}
.info-column p {
    margin: 0.25rem 0;
    color: #374151;
}
.edit-icon {
    margin-left: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 1rem;
}
.edit-icon:hover {
    color: #1f2937;
}

.card-payment {
    border: grey 1px solid;
    min-width: max-content;
    /* max-width:  */
    min-height: 700px;
    background: white;
    padding: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
}

.card-payment section:nth-child(2) {
    flex-grow: 1;
    overflow-y: auto;
}

.card-payment section:nth-child(3) {
    min-height: 175px;
}
.card-payment section:nth-child(3) table th {
    background: var(--tg-white);
    color: var(--tg-primary-500);
    border-radius: 7px 7px 0px 0px;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.card-payment table {
    width: 100%;
}

.card-payment table * {
    font-size: 0.8rem;
}

.card-payment table thead th {
    background: var(--tg-primary-500);
    color: white;
    padding: 5px;
}

.card-payment table tbody .hd-row {
    background: white;
    border-radius: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.card-payment table tbody tr td {
    padding: 5px;
}

.card-payment table tbody .hd-row td {
    font-weight: 600;
    padding: 5px;
}

.card-payment table tbody tr td .qty-unit {
    font-size: 0.8rem;
    color: grey;
}

.card-payment table tbody tr td:nth-last-child(1),
.card-payment table thead tr th:nth-last-child(1) {
    text-align: end;
}

.card-payment table tr>:nth-child(1) {
    border-radius: 7px 0px 0px 7px;
}

.card-payment table tr> :nth-last-child(1) {
    border-radius: 0px 7px 7px 0px;
}

.card-payment .head-id {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--tg-primary-700);
    margin-bottom: 0.5rem;
}

.card-payment .tg-form-group {
    border: rgb(206, 206, 206) 1px solid;
}

.card-payment .tg-form-group label {
    color: grey;
}

.card-payment .tg-form-group .form-control {
    padding: 0px 7px;
    height: 30px;
}

.card-payment .bt {
    padding: 5px;
    height: 40px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(30deg, var(--tg-primary-500), var(--tg-sky-600));
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
    border: none;
}

.card-payment .bt:active {
    scale: 0.95;
}

.card-payment .bt i {
    font-size: 1.3rem;
    color: white;
    /* color:var(--tg-primary-500); */
}

.table-transfer-items {
    width: 100%;
}

.table-transfer-items * {
    font-size: 0.8rem;
}

.table-transfer-items thead th {
    background: var(--tg-primary-500);
    color: white;
    padding: 5px;
}

.table-transfer-items thead tr th {
    text-align: center;
}

.table-transfer-items tr :nth-child(4),
.table-transfer-items tr :nth-child(5) {
    text-align: end;
}

.table-transfer-items tbody tr td:nth-last-child(1),
.table-transfer-items thead tr th:nth-last-child(1) {
    text-align: end;
}

.table-transfer-items tbody tr td {
    text-align: center;
    padding: 5px;
}

.table-transfer-items tbody tr td:nth-child(1) {
    border-radius: 7px 0px 0px 7px;
}

.table-transfer-items tbody tr td:nth-last-child(1) {
    border-radius: 0px 7px 7px 0px;
}

.table-transfer-items .transfer-amount.form-control {
    font-size: 0.8rem;
    width: 100px;
    height: 25px;
    padding: 0px 5px;
}

.bt-close {
    position: absolute;
    top: 5px;
    right: 3px;
    border-radius: 50%;
    padding: 7px;
    width: 25px;
    height: 25px;
    background: red;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bt-close i {
    color: white;
}

.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 90px;
    gap: 0.3em;
    padding: 0px;
    margin-bottom: 0.5rem;
}

.payment-grid button {
    box-shadow: none;
    background: rgb(240, 239, 239);
}

@media (max-width: 800px) {
    .payment-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.box-p {
    display: flex;
}

.box-p div {
    display: grid;
    padding: 7px 15px;
    ;
    position: relative;
    width: max-content;
    color: var(--tg-primary);
}

.box-p div span:nth-child(1) {
    white-space: nowrap;
    font-size: 0.7rem;
    color: #8e8f8f;
}

.box-p div span:nth-child(2) {
    font-size: 1.2rem;
    font-weight: 600;
}

.box-p .ll {
    position: absolute;
    bottom: 0px;
}

.receivePayment {
    border-top: 2px dashed var(--tg-sky-400);
    padding: 10px 0px;
    margin-top: 10px;
}

.total-payment {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
}

.total-payment textarea {
    flex: 1;
    border: rgb(168, 166, 166) 1px solid;
    min-height: 95px;
    resize: none;
    padding: 7px;
    border-radius: 8px;
}

.total-payment textarea:active,
.total-payment textarea:focus {
    outline: none;
    border-style: solid;
}

.total-payment > div {
    width: 240px;
    background: var(--tg-primary-100);
    border: none;
    box-shadow: rgba(107, 175, 196, 0.02) 0px 1px 3px 0px, rgba(12, 131, 121, 0.15) 0px 0px 0px 1px;
    border-radius: 7px;
    color: #2c2a2a;
    padding: 15px;
    text-align: center;
}

.total-payment>div > span:nth-child(2) {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 5px;
}

.summary-footer {
    display: flex;
    justify-content: end;
    gap: 10px;
    align-items: center;
}

.table-receipt tr td:nth-child(2) {
    text-align: end;
}

.table-receipt tr td:nth-child(2)>div {
    display: flex;
    align-items: center;
    justify-content: end;
}

.table-receipt tr td:nth-child(2)>div i {
    border: transparent 1px dashed;
    padding: 3px;
    font-size: 15px;
}

.table-receipt tr td:nth-child(2)>div i:hover {
    border: red 1px dashed;
    padding: 3px;
    border-radius: 5px;
}

.creditCard-form {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.tg-modal-creditCard {
    width: 300px;
}

.createChequeForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}




.md-xl.w-90 {
    min-width: 1800px;
}

.search-filters {
    display: flex;
    align-items: end;
    gap: 0.2rem;
}

.search-filters>div {
    width: 150px;
}






.tg-form-group-pc .form-control {
    border: none;
    text-align: center;
}

.form-control:active,
.form-control:focus {
    box-shadow: none !important;
    outline: none !important;
}

.showSelect tr > :nth-child(1) , .showSelect tr > :nth-child(2){
    max-width: 40px;
}
.showSelect tr > :nth-child(3) {
   width: 170px;
}
 .showSelect tr > :nth-child(4) , .showSelect tr > :nth-child(6), .showSelect tr > :nth-child(7){
   width: 80px;
}

.showSelect tr> :nth-child(10) {
    text-align: end;
   max-width: 40px;
}

.showSelect thead tr {
    border-top: rgb(112, 108, 108) 1px solid;
    border-bottom: rgb(112, 108, 108) 1px solid;
}

.showSelect tbody tr:nth-last-child(1) {
    background: rgb(245, 245, 245);
}



.offCanvasLayer {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 1rem;
}

.table-totals tr td {
    min-width: 150px;
    white-space: nowrap;
    text-align: end;
    padding: 3px 10px;
    font-size: 0.9rem;
}

.table-totals tr:nth-child(1) td:nth-child(2) {
    border-top: 1px solid grey;
}

.table-totals tr:nth-last-child(1) td:nth-child(2) {
    border-top: 1px solid grey;
    border-bottom: 3px double grey;
}

.ProposalOffCanvas * {
    font-size: 0.8rem;
}

.header {
    color: var(--tg-primary-600);
    font-size: 1.3rem;
}



.doc_details .items {
    border-radius: 7px;
    background: var(--tg-primary-100);
    background: linear-gradient(120deg, rgb(224, 250, 253), rgb(227, 243, 250)) !important;
    padding: 5px 7px;
    white-space: nowrap;
    width: max-content;
}

.doc_details .items span:nth-child(2) {
    font-weight: 600;
}

.d-grid4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.d-grid5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.d-grid6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}



.selectDepositType {
    max-width: 80px;
    font-size: 0.8rem !important;
    border: none !important;
    text-align: end;
}

.selectDepositType:focus,
.selectDepositType:active {
    outline: none !important;
    box-shadow: none !important;
}


