:root {
  /* Earth-tone color palette from first page */
  --primary-green: rgba(26, 58, 110, 0.78);
  --dark-green: rgba(20, 45, 95, 0.88);
  --light-green: #e8efea;
  --accent-brown: #8b6347;
  --muted-green: #886349;
  --text-dark: rgb(35 77 145 / 0.78);
  --text-muted: rgb(10 62 143 / 0.78);
  --shadow: 0 2px 15px rgba(105, 109, 35, 0.08);
  --border-light: #d4e0d7;
}

/* BODY AND GENERAL STYLES */
body {
  background: linear-gradient(
    135deg,
    #f0f4f1 0%,
    #5f634a15 50%,
    #a1592610 100%
  );
  font-family: "Roboto", sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
}

/* PAGE CONTENT STYLES */
.page-title {
  color: var(--dark-green);
  font-weight: 600;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  border-bottom: 2px solid var(--accent-brown);
  padding-bottom: 8px;
}

.page-title::after {
  content: "";
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-brown), var(--muted-green));
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.dashboard-card {
  background: linear-gradient(135deg, white 0%, #5f634a08 100%);
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(161, 89, 38, 0.1);
  padding: 30px;
  margin-bottom: 30px;
  border: 2px solid var(--border-light);
  border-left: 4px solid var(--accent-brown);
  border-top: 2px solid var(--muted-green);
  border-bottom: 2px solid var(--accent-brown);
  border-right: 4px solid var(--muted-green);
  transition: all 0.3s ease;
}

/* .dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(161, 89, 38, 0.15);
  border-color: var(--muted-green);
} */

.section-header {
  font-size: 1.4rem;
  margin-bottom: 25px;
  color: var(--dark-green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-brown);
  position: relative;
}

.section-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--muted-green);
}

.section-header i {
  color: var(--accent-brown);
  font-size: 1.2rem;
}

.key-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--light-green);
  font-size: 1rem;
  transition: all 0.3s ease;
}

/* .key-value:hover {
  background: linear-gradient(
    90deg,
    var(--light-green) 0%,
    rgba(95, 99, 74, 0.1) 100%
  );
  transform: translateX(5px);
  border-radius: 8px;
  padding-left: 10px;
} */

.key-value:last-child {
  border-bottom: none;
}

.key-value span:first-child {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
}

.key-value span:last-child {
  color: var(--text-dark);
  font-weight: 500;
}

.list-group-item {
  border: none;
  padding: 15px 20px;
  margin-bottom: 8px;
  background: linear-gradient(
    135deg,
    var(--light-green) 0%,
    rgba(95, 99, 74, 0.1) 100%
  );
  border-radius: 10px;
  border-left: 4px solid var(--accent-brown);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background: linear-gradient(90deg, #e8f0ea 0%, #5f634a20 100%);
  transform: translateX(8px);
  border-left: 4px solid var(--accent-brown);
  box-shadow: 0 2px 8px rgba(161, 89, 38, 0.15);
}

.list-group-item span {
  font-weight: 500;
  color: var(--text-dark);
}

/* BUTTONS */
.btn-custom {
  background: linear-gradient(
    135deg,
    var(--accent-brown) 0%,
    var(--muted-green) 100%
  );
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
}

.btn-custom:hover {
  background: linear-gradient(
    135deg,
    var(--muted-green) 0%,
    var(--accent-brown) 100%
  );
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(161, 89, 38, 0.3);
  border: 2px solid var(--accent-brown);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--accent-brown) 0%,
    var(--muted-green) 50%,
    var(--dark-green) 100%
  );
  border: none;
  color: white;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(161, 89, 38, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(161, 89, 38, 0.4);
  background: linear-gradient(
    135deg,
    var(--muted-green) 0%,
    var(--accent-brown) 50%,
    var(--primary-green) 100%
  );
  border: 2px solid var(--accent-brown);
}

.btn-preview {
  /* background: linear-gradient(135deg, var(--accent-brown) 0%, var(--muted-green) 50%, var(--dark-green) 100%); */
  background: var(--accent-brown);
  border: none;
  color: white;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(161, 89, 38, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
  margin-bottom: 50px;
}

.btn-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(161, 89, 38, 0.4);
  background: #6e3b16;
  color: white;
  /* background: linear-gradient(135deg, var(--muted-green) 0%, var(--accent-brown) 50%, var(--primary-green) 100%); */
  border: 2px solid var(--accent-brown);
}

/* TABLES */
.table {
  background: linear-gradient(135deg, white 0%, #5f634a05 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(161, 89, 38, 0.08);
  margin: 0;
  border: 2px solid var(--border-light);
}

.table thead th {
  background: var(--muted-green);
  color: white;
  font-weight: 600;
  padding: 20px 15px;
  text-align: center;
  border: 1px solid #868b6b;
  font-size: 0.9rem;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.table tbody td {
  padding: 15px;
  border-color: var(--border-light);
  color: var(--text-dark);
  vertical-align: middle;
}

/* .table tbody tr:hover {
  background: linear-gradient(
    90deg,
    var(--light-green) 0%,
    rgba(95, 99, 74, 0.1) 100%
  );
  transform: translateX(5px);
} */

/* STATUS BADGES */
.status-badge {
  padding: 6px 16px;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-paid {
  background: linear-gradient(
    135deg,
    var(--muted-green) 0%,
    var(--primary-green) 100%
  );
  color: white;
}

.status-unpaid {
  background: linear-gradient(135deg, var(--accent-brown) 0%, #d67517 100%);
  color: white;
}

.status-active {
  background: linear-gradient(
    135deg,
    var(--accent-brown) 0%,
    var(--muted-green) 100%
  );
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pending {
  background: linear-gradient(135deg, var(--muted-green) 0%, #999 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: linear-gradient(
    135deg,
    var(--light-green) 0%,
    rgba(95, 99, 74, 0.1) 100%
  );
  border-radius: 15px;
  border: 2px solid var(--border-light);
  border-left: 4px solid var(--accent-brown);
}

.empty-state i {
  font-size: 3rem;
  color: var(--accent-brown);
  margin-bottom: 15px;
}

/* FORM ELEMENTS */
.form-control,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-brown);
  box-shadow: 0 0 0 3px rgba(161, 89, 38, 0.15);
  transform: translateY(-1px);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--muted-green);
}

.form-control[readonly] {
  background: linear-gradient(135deg, #f8f9fa 0%, rgba(95, 99, 74, 0.1) 100%);
  border-color: var(--muted-green);
  cursor: not-allowed;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .dashboard-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .key-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .table-responsive {
    font-size: 0.875rem;
  }

  .list-group-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .table-responsive {
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Add smooth scrolling for iOS devices */
    border: 1px solid var(--border-light); /* Add a subtle border for the scrollable area */
    border-radius: 12px;
  }

  /* Keep the table itself from collapsing, so it maintains its full width and is scrollable */
  .table {
    width: 100%;
    min-width: 600px; /* This is an important trick. It ensures the table is always wider than the viewport, forcing the scrollbar. Adjust this value if needed. */
  }

  .table thead th,
  .table tbody td {
    padding: 10px 12px;
    white-space: nowrap; /* Prevent content from wrapping to keep a consistent column width */
    font-size: 0.85rem;
  }

  .table tbody td:first-child {
    text-align: center;
  }
}

/* ADDITIONAL UTILITY CLASSES */
.text-danger {
  color: var(--accent-brown) !important;
}

.bg-light {
  background: linear-gradient(
    135deg,
    var(--light-green) 0%,
    rgba(161, 89, 38, 0.05) 100%
  ) !important;
}

.accent-border {
  border: 2px solid var(--accent-brown);
  border-radius: 8px;
}

.muted-bg {
  background: linear-gradient(
    135deg,
    rgba(95, 99, 74, 0.1) 0%,
    rgba(161, 89, 38, 0.05) 100%
  );
}

.highlight-text {
  color: var(--accent-brown);
  font-weight: 600;
}

.subtitle-muted {
  color: var(--muted-green);
  font-size: 0.9rem;
}

/* HOVER EFFECTS */
.list-hover {
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  padding: 12px;
  border-radius: 8px;
}

/* .list-hover:hover {
  background: linear-gradient(90deg, #e8f0ea 0%, #5f634a20 100%);
  transform: translateX(8px);
  border-left: 3px solid var(--accent-brown);
  box-shadow: 0 2px 8px rgba(161, 89, 38, 0.15);
} */

/* LINKS */
a {
  text-decoration: none !important;
  color: var(--accent-brown);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--muted-green);
}

.disabled-link {
  color: var(--muted-green);
  pointer-events: none;
  cursor: not-allowed;
}

/* FORM SECTIONS */
.form-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(232, 239, 234, 0.4) 0%,
    rgba(95, 99, 74, 0.1) 100%
  );
  border-radius: 15px;
  border-left: 4px solid var(--accent-brown);
  border-right: 2px solid var(--muted-green);
  box-shadow: 0 4px 12px rgba(161, 89, 38, 0.08);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--dark-green);
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-brown), var(--muted-green));
  border-radius: 2px;
}

.info-note {
  background: linear-gradient(135deg, #e8efea 0%, rgba(161, 89, 38, 0.1) 100%);
  border-left: 4px solid var(--accent-brown);
  border-right: 2px solid var(--muted-green);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--dark-green);
  box-shadow: 0 2px 8px rgba(95, 99, 74, 0.1);
}

@media (max-width: 768px) {
  .form-section {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 1rem;
  }

  .table thead th {
    padding: 10px 5px;
    font-size: 0.7rem;
  }

  .table tbody td,
  a {
    padding: 5px;
  }
}
