/* General Body & Font Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: #f0f2f5;
  margin: 0;
  background-color: #ffffff;
}

/* Header Styles */
.top-header {
  background-color: #ffffff;
  padding: 10px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative; /* For positioning the profile modal */
}
.logo-container,
.profile-container {
  display: flex;
  align-items: center;
  gap: 15px;
}
.profile-container {
  cursor: pointer; /* Indicate it's clickable */
}
.logo {
  height: 40px;
}
.profile-icon {
  height: 35px;
  border-radius: 25px;
}
.logo-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
}
.profile-text {
  font-size: 1rem;
  font-weight: 500;
}

/* --- NEW PROFILE MODAL STYLES --- */
.profile-modal {
  display: none; /* Hidden by default */
  position: absolute;
  top: 60px; /* Position below the header */
  right: 20px; /* Align with the profile icon */
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 1100;
  width: 200px;
  border: 1px solid #e0e0e0;
  animation: fadeIn 0.2s;
}
.profile-modal.show {
  display: block;
}
.profile-modal-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 15px; /* Center and add space below */
}
.profile-modal-name {
  text-align: center;
  font-weight: 600;
  color: #333;
  margin: 0;
  font-size: 1.1rem;
}
/* --- END NEW STYLES --- */

/* Main Content Layout */
.main-content {
  padding: 20px;
}
.main-dashboard-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 25px;
}

.Loan-container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #ffffff;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Loan Selection Area */
.Loan_Details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
}
.loan-select {
  padding: 10px 20px;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  min-width: 300px;
  text-align: center;
}
.loan-info-wrapper {
  display: flex;
  gap: 25px;
  color: #555;
}

.Heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  background-color: #34eba1;
  text-align: center;
  padding: 12px;
  border-bottom: 1px solid #dcdcdc;
  margin: 0;
}
.card-body {
  padding: 25px;
}

/* First Row Layout */
.first-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* left card */
.left-container {
  border: 2px solid black;
}

/* right card */
.right-grid {
  border: 2px solid black;
}

/* "Coming Up" Card Specifics */
.coming-up-body {
  font-size: 1.1rem;
}
.coming-up-item {
  margin: 0 0 15px 0;
}
.current-balance {
  margin: 30px 0 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}

/* "Payment Confirmation" Card Specifics */
.button-enclosure {
  background-color: #f7f7f7;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border: 1px solid #e0e0e0;
}
.btn {
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: #0d6efd;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn:hover {
  background-color: #0b5ed7;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Table Styles */
.table-wrapper {
  overflow-x: auto;
  border: 2px solid black;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}
.data-table thead {
  background-color: #e9f9ee;
}
.data-table th {
  font-weight: 600;
  color: #333;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Modal Styles (Unchanged) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}
.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: slideIn 0.3s;
}
.close-btn {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close-btn:hover {
  color: #000;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideIn {
  from {
    transform: translateY(-50px);
  }
  to {
    transform: translateY(0);
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .top-header {
    padding: 10px 15px;
  }
  .logo-text,
  .profile-text {
    display: none; /* Hide text on small screens to save space */
  }
  .main-content {
    padding: 10px;
  }
  .Loan-container {
    padding: 15px;
  }
  .first-row {
    grid-template-columns: 1fr;
  }
  .loan-select {
    min-width: unset;
    width: 100%;
  }
  .button-enclosure {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}