/* ===============================
   Loan Application Form + Slip
   =============================== */

/* ===== Wrapper ===== */
.ala-wrapper {
  max-width: 520px;
  margin: 30px auto;
  padding: 24px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  font-family: Arial, sans-serif;
}

/* ===== Form ===== */
.ala-form .ala-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.ala-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
  font-size: 14px;
}

/* Inputs & Selects */
.ala-form input[type="text"],
.ala-form input[type="tel"],
.ala-form input[type="file"],
.ala-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc !important;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
  transition: border 0.2s;
  background-color: #fff !important;   /* force white bg */
  color: #000 !important;              /* force black text */
  min-height: 40px !important;         /* visible height */
  display: block !important;
}

/* Placeholder text */
.ala-form input::placeholder,
.ala-form select::placeholder {
  color: #666 !important;
  opacity: 1 !important;
}

.ala-form input:focus,
.ala-form select:focus {
  border-color: #1976d2 !important;
  outline: none;
}

.ala-form input[readonly] {
  background: #f5f5f5 !important;
  color: #444 !important;
  cursor: not-allowed;
}

/* Buttons */
.ala-form button {
  width: 100%;
  padding: 12px;
  background: #1976d2;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.ala-form button:hover {
  background: #125ea4;
}

/* ===== Note ===== */
.ala-note {
  margin-top: 15px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  background: #f9f9f9;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid #1976d2;
}

/* ===============================
   Popup Slip Styling
   =============================== */

/* ===== Overlay ===== */
.ala-slip-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* ===== Popup Box ===== */
.ala-slip-popup {
  background: #fff;
  border-radius: 8px;
  width: 95%;
  max-width: 480px;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  animation: fadeIn 0.35s ease-in-out;
  border: 2px solid #1976d2;
}

/* ===== Close Button ===== */
.ala-slip-popup .ala-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 15px;
  cursor: pointer;
  line-height: 28px;
  text-align: center;
}
.ala-slip-popup .ala-close:hover {
  background: #7a0015;
}

/* ===== Header ===== */
.ala-slip-header {
  background: #388e3c;
  color: #fff;
  text-align: center;
  padding: 14px 10px;
  font-weight: bold;
  font-size: 18px;
  border-bottom: 2px solid #2e7d32;
  letter-spacing: 0.5px;
}

/* ===== Body Layout ===== */
.ala-slip-body {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

/* Sidebar (vertical text) */
.ala-slip-sidebar {
  background: #1976d2;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 14px 8px;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  letter-spacing: 2px;
}

/* ===== Table ===== */
.ala-slip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ala-slip-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.ala-slip-table tr:last-child td {
  border-bottom: none;
}
.ala-slip-table td:first-child {
  font-weight: 600;
  color: #222;
  width: 45%;
}
.ala-slip-table td:last-child {
  font-weight: normal;
  color: #333;
}

/* ===== Status Badge ===== */
.ala-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
}
.ala-status.eligible { background: #388e3c; }      /* Green */
.ala-status.not-eligible { background: #c62828; }  /* Red */
.ala-status.pending { background: #f9a825; }       /* Yellow */

/* ===== Notice ===== */
.ala-slip-notice {
  background: #fff3cd;
  padding: 12px;
  font-size: 13px;
  border-top: 1px solid #ddd;
  color: #333;
  text-align: center;
  line-height: 1.5;
}
.ala-slip-notice span {
  color: #d35400;
  font-weight: bold;
}

/* ===== Footer ===== */
.ala-slip-footer {
  text-align: center;
  font-size: 11px;
  color: #555;
  padding: 8px;
  background: #f1f1f1;
  border-top: 1px solid #ddd;
  font-style: italic;
}

/* ===== Download Button ===== */
.ala-slip-download {
  text-align: center;
  padding: 14px;
  border-top: 1px solid #ddd;
}
.ala-slip-download button {
  background: #2e7d32;
  color: #fff;
  padding: 10px 26px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: 0.3s;
}
.ala-slip-download button:hover {
  background: #1b5e20;
}

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

/* ===== Responsive ===== */
@media screen and (max-width: 480px) {
  .ala-slip-body {
    flex-direction: column;
  }
  .ala-slip-sidebar {
    writing-mode: horizontal-tb;
    padding: 8px;
    font-size: 14px;
  }
  .ala-slip-table td {
    padding: 7px;
    font-size: 13px;
  }
}
/* Force visibility for Akhuwat Loan Form fields */
.ala-wrapper .ala-form label {
  color: #222 !important;       /* dark labels */
  font-weight: 600 !important;
  font-size: 14px !important;
  display: block !important;
}

.ala-wrapper .ala-form select option {
  background: #fff !important;  /* dropdown bg */
  color: #000 !important;       /* dropdown text */
}

.ala-wrapper .ala-form select {
  background: #fff !important;
  color: #000 !important;
  border: 1px solid #444 !important;
}

.ala-wrapper .ala-form input,
.ala-wrapper .ala-form textarea {
  background: #fff !important;
  color: #000 !important;
  border: 1px solid #444 !important;
}
.ala-close {
  display: none !important;
}
/* Force loan form fields to display correctly */
.ala-form input,
.ala-form select,
.ala-form textarea,
.ala-form label {
  display: block !important;
  width: 100% !important;
  clear: both !important;
  margin-bottom: 15px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* ===== Viewer Form Styling ===== */
.ala-viewer {
  max-width: 400px;
  margin: 30px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ala-wrapper.ala-viewer label {
  display: block !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
  font-size: 14px !important;
  color: #222 !important;
  text-transform: none !important;  /* prevent uppercase */
  letter-spacing: normal !important;
}


.ala-viewer select,
.ala-viewer input[type="text"],
.ala-viewer input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  margin-bottom: 15px;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

.ala-viewer button {
  width: 100%;
  padding: 12px;
  background: #1976d2;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.ala-viewer button:hover {
  background: #125ea4;
}
/* Force CNIC & ID input text visible */
.ala-viewer select,
.ala-viewer input[type="text"],
.ala-viewer input[type="number"] {
  width: 100% !important;
  padding: 10px 12px !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  font-size: 15px !important;
  margin-bottom: 15px !important;
  background: #fff !important;
  color: #000 !important;
  box-sizing: border-box !important;
}

.ala-viewer input::placeholder {
  color: #666 !important;
  opacity: 1 !important;
}
/* Fix DataTables top bar text */
div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label {
    color: #000 !important;   /* black text */
    font-weight: 600;         /* make it bold for clarity */
}

/* Fix dropdown and search input text */
div.dataTables_wrapper select,
div.dataTables_wrapper input[type="search"] {
    color: #000 !important;   /* visible input text */
    background-color: #fff !important;
    border: 1px solid #ccc;   /* clean border */
    padding: 4px 6px;
    border-radius: 4px;
}
/* Fix DataTables entries dropdown width */
div.dataTables_wrapper .dataTables_length select {
    min-width: 70px !important;   /* enough for 10, 25, 50, 100 */
    padding: 4px 6px;
    text-align: center;           /* center numbers inside */
}
/* Make DataTables search bar prominent */
div.dataTables_wrapper div.dataTables_filter input[type="search"] {
    width: 250px !important;       /* bigger width */
    height: 40px !important;       /* taller box */
    font-size: 16px !important;    /* larger text */
    font-weight: 600;              /* bold text */
    color: #000 !important;        /* dark text */
    background-color: #fff !important;
    border: 2px solid #f1a200 !important;  /* highlight with theme color */
    border-radius: 6px;            /* rounded corners */
    padding: 6px 12px;             /* comfortable padding */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* subtle shadow */
}
* Fix CNIC Search Input Visibility */
#cnic_search {
    color: #000 !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: normal !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

#cnic_search::placeholder {
    color: #666 !important;
    opacity: 1 !important;
}

#cnic_search:focus {
    color: #000 !important;
    background-color: #fff !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    outline: none !important;
}
/* Fix slip table styling for PDF generation */
.ala-slip-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
}

.ala-slip-table td {
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 14px !important;
}

.ala-slip-table td:first-child {
    background: #f8f9fa !important;
    font-weight: bold !important;
    width: 40% !important;
}

.ala-slip-table tr:nth-child(even) td {
    background: #f8f9fa !important;
}