body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background-color: #e9ecef;
  padding: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.controls-wrapper {
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  gap: 10px;
  background: white;
  padding: 10px 15px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid #ccc;
}

select,
input,
button {
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

select:focus,
input:focus {
  border-color: #5d140b;
}

.btn {
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 15px;
}

.fetch-btn {
  background: #5d140b;
  padding: 8px 12px;
}

.fetch-btn:hover {
  background: #3d0d07;
}

.export-btn {
  background: #28a745;
  height: 40px;
}

.export-btn:hover {
  background: #218838;
}

.edit-btn {
  background: #007bff;
  height: 40px;
}

.edit-btn:hover {
  background: #0056b3;
}

.edit-btn.locked {
  background: #dc3545;
}

.report-card {
  width: 100%;
  max-width: 1000px;
  background: white;
  padding: 20px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
  min-width: 800px;
}

th {
  background: #f4f4f4;
  color: #222;
  padding: 8px 5px;
  border: 1px solid #666;
  text-align: center;
  font-weight: bold;
  white-space: nowrap;
}

td {
  border: 1px solid #888;
  padding: 6px;
  text-align: center;
  color: #333;
  white-space: nowrap;
}

.editable,
.editable-exp {
  transition: 0.2s;
  background-color: #fafafa;
}

.editable.active,
.editable-exp.active {
  cursor: text;
  background-color: #fff;
}

.editable.active:hover,
.editable-exp.active:hover {
  background-color: #eef;
  outline: 1px dashed #007bff;
}

.editable.active:focus,
.editable-exp.active:focus {
  outline: 2px solid #007bff;
  background-color: #fff;
}

.normal-col,
.ot-col {
  background: #f8f9fa;
  color: #000;
  font-weight: bold;
  min-width: 50px;
}

.friday-row {
  background: #fdeaea;
  color: #a00;
  font-weight: bold;
}

.footer-summary {
  display: flex;
  justify-content: space-between; /* Adds clean space between the two tables */
  align-items: flex-start; /* Fixes vertical stretching so items align top */
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #aaa;
  flex-wrap: wrap;
  gap: 20px;
}

.summary-table {
  width: auto; /* Hugs the text tightly */
  min-width: 170px;
  border-collapse: collapse;
  font-size: 14px;
}

.summary-table td {
  padding: 4px; 
  text-align: left;
  border: none;
}

/* ':' വരുന്ന നടുവിലെ കോളം ഒതുങ്ങി നിൽക്കാൻ */
.summary-table td:nth-child(2) {
  width: 1%;
  padding: 4px 10px;
}

.summary-table td:last-child {
  text-align: right;
  font-weight: bold;
}

.total-amt {
  font-size: 18px;
  color: #5d140b;
  font-weight: bold;
}

#saveIndicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  display: none;
  font-weight: bold;
  z-index: 1000;
}

.go-back {
  background: #6c757d;
  height: 40px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.pin-box {
  background: white;
  padding: 25px;
  border-radius: 8px;
  width: 300px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.pin-box h3 {
  margin-top: 0;
  color: #5d140b;
}

.pin-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 5px;
  border: 2px solid #ccc;
  border-radius: 6px;
  margin: 15px 0;
  box-sizing: border-box;
}

.pin-input:focus {
  border-color: #5d140b;
}

.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-cancel {
  background: #6c757d;
  padding: 10px;
  width: 100%;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-verify {
  background: #5d140b;
  padding: 10px;
  width: 100%;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .controls-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  .controls {
    justify-content: center;
  }

  .footer-summary {
    flex-direction: column;
    gap: 15px;
  }

  .summary-table {
    width: 100%;
  }
}

.expense-field {
  font-family: inherit;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid transparent;
  color: #333;
  outline: none;
  pointer-events: none;
}

#expenseAmt {
  font-size: 16px;
  font-weight: bold;
  text-align: left;
  width: 100px;
  padding: 4px;
  color: #5d140b;
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Removes spin buttons for ALL number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Custom Bottom-line Input Style for Add New Expense */
.bottom-line-input {
  border: none !important;
  border-bottom: 2px solid #ccc !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 8px 5px !important;
  font-size: 13px !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.2s;
}

.bottom-line-input:focus {
  border-bottom: 2px solid #5d140b !important;
}

#expenseDesc {
  width: 100%;
  font-size: 13px;
  margin-top: 5px;
  padding: 4px 0;
  min-height: 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#expenseAmt::placeholder {
  color: transparent;
}
#expenseDesc:empty:before {
  content: attr(placeholder);
  color: transparent;
}

.expense-field.edit-mode {
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  pointer-events: auto;
}

#expenseAmt.edit-mode::placeholder {
  color: #999;
}
#expenseDesc.edit-mode:empty:before {
  color: #999;
}

#expenseDesc.edit-mode {
  min-height: 50px;
  padding: 8px;
}

.edit-only {
  display: none !important;
}
.edit-mode-active .edit-only.table-cell {
  display: table-cell !important;
}
.edit-mode-active .edit-only.flex-box {
  display: flex !important;
}

.expense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.expense-table th {
  background: #f8f9fa;
  border-bottom: 2px solid #5d140b;
  padding: 6px;
  text-align: left;
  color: #5d140b;
}
.expense-table td {
  padding: 6px;
  border-bottom: 1px solid #ccc;
  text-align: left;
  border-left: none;
  border-right: none;
}
