/* Leave Rule Configuration modal - complete styling to match reference */
#leaveRuleModal.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}
#leaveRuleModal .modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 1000px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 98vh;
  display: flex;
  flex-direction: column;
  height: 95vh;
}
#leaveRuleModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid rgba(237, 32, 71, 0.1);
  flex-shrink: 0;
}
#leaveRuleModal .modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #ed2047;
  margin: 0;
  -webkit-text-fill-color: #ed2047;
  background: none;
}
#leaveRuleModal .modal-close {
  background: #e5e7eb;
  border: none;
  font-size: 18px;
  color: #4b5563;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
#leaveRuleModal .modal-close:hover {
  background: #d1d5db;
  color: #1f2937;
}
#leaveRuleModal .modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
}
#leaveRuleModal .modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  flex-wrap: wrap;
}
#leaveRuleModal .leave-last-updated {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: #6b7280;
  font-size: 12px;
}
#leaveRuleModal .modal-footer .btn-cancel,
#leaveRuleModal .modal-footer .btn-save {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
#leaveRuleModal .modal-footer .btn-cancel {
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #374151;
}
#leaveRuleModal .modal-footer .btn-cancel:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
#leaveRuleModal .modal-footer .btn-save {
  border: none;
  background: linear-gradient(to right, #ed2047, #f26225);
  color: #fff;
}
#leaveRuleModal .modal-footer .btn-save:hover {
  background: linear-gradient(to right, #d91a3d, #e55a1f);
}
#leaveRuleModal .modal-footer .btn-save:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Leave Types section */
#leaveRuleModal .leave-rule-types-container {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#leaveRuleModal .leave-rule-employment-section {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}
#leaveRuleModal .leave-rule-employment-section .weekend-off-title {
  margin-bottom: 10px;
}
#leaveRuleModal .leave-rule-employment-section .leave-types-container {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: auto;
  display: block;
  min-height: 56px;
}
#leaveRuleModal .leave-rule-employment-section .leave-types-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: auto;
  display: block;
  min-height: 56px;
  padding-right: 6px;
}
#leaveRuleModal .leave-rule-employment-section .leave-types-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#leaveRuleModal .leave-rule-employment-section .leave-types-table-wrap::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
#leaveRuleModal .leave-rule-employment-section .leave-types-table-wrap::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
#leaveRuleModal .weekend-off-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#leaveRuleModal .weekend-off-title > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
#leaveRuleModal .weekend-off-title .fa-list {
  color: #6b7280;
  font-size: 14px;
}
#leaveRuleModal .add-leave-type-btn {
  background: #ed2047;
  color: #fff;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s;
}
#leaveRuleModal .add-leave-type-btn:hover {
  background: #d91a3d;
}
#leaveRuleModal .leave-types-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
  padding-right: 8px;
}
#leaveRuleModal .leave-types-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#leaveRuleModal .leave-types-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
#leaveRuleModal .leave-types-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
#leaveRuleModal .leave-types-container::-webkit-scrollbar-thumb:hover {
  background: #ed2047;
}

/* Table-like grid: No. | Type Name | Leave Credit | After month | Apply before Days | Cashin | Carry Forward | Reset Period | Manager Approval | delete */
#leaveRuleModal .leave-type-header,
#leaveRuleModal .leave-type-row {
  display: grid;
  grid-template-columns: 50px 160px 100px 90px 130px 80px 110px 90px 200px 44px;
  gap: 10px 12px;
  align-items: center;
  min-width: min-content;
}
#leaveRuleModal .leave-type-header {
  font-weight: 700;
  color: #374151;
  font-size: 13px;
  padding: 8px 0 10px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 4px;
  flex-shrink: 0;
}
#leaveRuleModal .leave-type-header > div {
  text-align: center;
}
#leaveRuleModal .leave-type-header > div:first-child {
  text-align: center;
}
#leaveRuleModal .leave-type-header > div:nth-child(2) {
  text-align: left;
}
#leaveRuleModal .leave-type-row {
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
}
#leaveRuleModal .leave-type-row:last-child {
  border-bottom: none;
}
#leaveRuleModal .leave-type-row input,
#leaveRuleModal .leave-type-row select {
  height: 38px;
  padding: 8px 10px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
#leaveRuleModal .leave-type-row input:focus,
#leaveRuleModal .leave-type-row select:focus {
  border-color: #ed2047;
  outline: none;
  box-shadow: 0 0 0 2px rgba(237, 32, 71, 0.15);
}
#leaveRuleModal .leave-type-row input[readonly] {
  background: #f3f4f6;
  text-align: center;
  color: #6b7280;
}
#leaveRuleModal .leave-type-row select {
  cursor: pointer;
  appearance: auto;
}
#leaveRuleModal .leave-type-row .del-row-btn {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}
#leaveRuleModal .leave-type-row .del-row-btn:hover:not(:disabled) {
  background: #b91c1c;
}
#leaveRuleModal .leave-type-row .del-row-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#leaveRuleModal .leave-types-empty-hint {
  padding: 16px 8px;
  color: #6b7280;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}
