/* Custom Styles for SỔ NỢ TÍN THÀNH */

/* Animation classes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbar */
.scrollbar-thin::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dynamic theme transition for Debt Form (Ghi sổ nợ) */
#debtFormCard.theme-ung-tien {
  background-color: #fef2f2 !important; /* Soft Red */
  border-color: #fca5a5 !important;
  color: #7f1d1d !important; /* Dark Red */
}

#debtFormCard.theme-ung-tien #debtModalHeader {
  background-color: #fee2e2 !important;
  border-bottom-color: #fecaca !important;
}

#debtFormCard.theme-ung-tien #debtModalTitle {
  color: #991b1b !important;
}

#debtFormCard.theme-ung-tien #debtModalIcon {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}

#debtFormCard.theme-ung-tien #btnSubmitDebt {
  background-color: #dc2626 !important;
}
#debtFormCard.theme-ung-tien #btnSubmitDebt:hover {
  background-color: #b91c1c !important;
}

#debtFormCard.theme-tra-tien {
  background-color: #ecfdf5 !important; /* Soft Green */
  border-color: #6ee7b7 !important;
  color: #064e3b !important; /* Dark Green */
}

#debtFormCard.theme-tra-tien #debtModalHeader {
  background-color: #d1fae5 !important;
  border-bottom-color: #a7f3d0 !important;
}

#debtFormCard.theme-tra-tien #debtModalTitle {
  color: #065f46 !important;
}

#debtFormCard.theme-tra-tien #debtModalIcon {
  background-color: #059669 !important;
  color: #ffffff !important;
}

#debtFormCard.theme-tra-tien #btnSubmitDebt {
  background-color: #059669 !important;
}
#debtFormCard.theme-tra-tien #btnSubmitDebt:hover {
  background-color: #047857 !important;
}

/* Sticky styles for Tables on Mobile (< lg) */
@media (max-width: 1023px) {
  .matrix-sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: inherit;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  }
  thead .matrix-sticky-col {
    z-index: 25;
  }
}

/* On Desktop (PC >= 1024px), fit all columns in 1 screen width */
@media (min-width: 1024px) {
  .matrix-col-driver {
    width: 15% !important;
    min-width: 150px;
  }
  .matrix-col-month {
    width: 6.07% !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    white-space: nowrap !important;
  }
}

/* Mobile Touch Active States */
@media (hover: none) {
  button:active, a:active {
    opacity: 0.85;
    transform: scale(0.98);
  }
}

/* Print Styling for A4 Portrait */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-export, .no-print, header, nav, #loginScreen {
    display: none !important;
  }
  #driverDebtExportArea {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }
  #exportFooterInfo {
    display: flex !important;
  }
}
