/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 260px;
  --header-height: 50px;
  --primary-color: #2c3e50;
  --primary-hover: #34495e;
  --active-color: #3498db;
  --success-color: #27ae60;
  --success-hover: #229954;
  --danger-color: #e74c3c;
  --danger-hover: #c0392b;
  --bg-color: #f5f7fa;
  --text-color: #333;
  --border-color: #e1e8ed;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: auto;
  min-width: 320px;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 320px;
}

/* Header Styles */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* Header Left Section */
.header-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  margin-right: 12px;
  z-index: 1001;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  width: 24px;
  height: 18px;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: white;
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-toggle.active .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.sidebar-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.header-label {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  margin-left: 10px;
}

/* Header Center Section */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.header-title-mobile {
  display: none;
}

.header-title-desktop {
  display: block;
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.username {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.role-badge {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--danger-color);
  color: white;
  border: 1px solid var(--danger-color);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  height: fit-content;
}

.logout-btn:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

.logout-text {
  display: inline;
}

@media (max-width: 768px) {
  .logout-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
  }
}

@media (max-width: 480px) {
  .logout-btn {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .logout-text {
    font-size: 0.7rem;
  }
}

/* App Body */
.app-body {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  min-width: 0;
  overflow-x: auto;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: white;
  box-shadow: var(--shadow);
  overflow-y: auto;
  transition: var(--transition);
  z-index: 999;
}

.sidebar-nav {
  padding: 20px 0;
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.nav-list {
  list-style: none;
  flex: 1;
  padding-bottom: 80px;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
}

.nav-link.active {
  background-color: #e8f4f8;
  color: var(--active-color);
  border-left-color: var(--active-color);
  font-weight: 600;
}

.sidebar-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background-color: white;
}

.nav-link-home-btn {
  background-color: var(--danger-color) !important;
  color: white !important;
  border-radius: 6px;
  border-left: none !important;
  justify-content: center;
  font-weight: 600;
  margin: 0;
}

.nav-link-home-btn:hover {
  background-color: var(--danger-hover) !important;
  color: white !important;
}

.nav-icon {
  font-size: 1.2rem;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 0.95rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 20px 30px 30px 26px;
  transition: var(--transition);
  min-width: 0;
}

.content-wrapper {
  width: 100%;
  min-width: 0;
}

.welcome-section {
  background-color: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.welcome-section h2 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 2rem;
}

.welcome-section p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.page-info {
  color: #999;
  font-size: 0.95rem;
  margin-top: 10px;
}

/* Page Content Styles */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h2 {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #e8e8e8;
  color: var(--primary-color);
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
  background-color: #d5d5d5;
  border-color: #b8b8b8;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary-color);
}

.modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.8;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.modal-body {
  padding: 24px;
}

.form-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h4 {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--danger-color);
}

.form-error {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
  white-space: pre-line;
  line-height: 1.5;
}

.form-error.show {
  display: block;
}

/* Upload Tabs Styles */
.upload-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  gap: 0;
}

.upload-tab {
  flex: 1;
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-color);
  transition: var(--transition);
  font-weight: 500;
}

.upload-tab:hover {
  background-color: #f5f7fa;
  color: var(--active-color);
}

.upload-tab.active {
  color: var(--active-color);
  border-bottom-color: var(--active-color);
  background-color: #f0f7ff;
}

.upload-tab-content {
  display: none;
}

.upload-tab-content.active {
  display: block;
}

.sample-csv-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f0f7ff;
  border-radius: 8px;
  text-align: center;
}

.sample-csv-text {
  margin-bottom: 10px;
  color: var(--text-color);
  font-size: 0.95rem;
}

.sample-csv-section button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Upload Area Styles */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background-color: #fafafa;
  transition: var(--transition);
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--active-color);
  background-color: #f0f7ff;
}

.upload-area.dragover {
  border-color: var(--active-color);
  background-color: #e8f4f8;
  border-style: solid;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.upload-text {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 8px;
  font-weight: 500;
}

.upload-subtext {
  font-size: 0.9rem;
  color: #999;
  margin: 10px 0;
}

.form-success {
  margin-top: 15px;
  padding: 12px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  color: #155724;
  text-align: center;
  font-weight: 500;
}

/* Upload Progress Styles */
.upload-progress-container {
  margin-top: 20px;
  margin-bottom: 20px;
}

.upload-progress-bar {
  width: 100%;
  height: 24px;
  background-color: #e1e8ed;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--active-color), #5dade2);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 12px;
  position: relative;
}

.upload-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

.upload-progress-text {
  text-align: center;
  margin-top: 8px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Upload Errors Container */
.upload-errors-container {
  margin-top: 20px;
  border: 2px solid var(--danger-color);
  border-radius: 8px;
  background-color: #fff5f5;
  max-height: 400px;
  overflow-y: auto;
}

.upload-errors-header {
  padding: 12px 16px;
  background-color: #fee;
  border-bottom: 1px solid var(--danger-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.upload-errors-header strong {
  color: var(--danger-color);
  font-size: 1rem;
}

.btn-close-errors {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--danger-color);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-close-errors:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

.upload-errors-list {
  padding: 12px;
}

.upload-error-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background-color: white;
  border-left: 4px solid var(--danger-color);
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.upload-error-item:last-child {
  margin-bottom: 0;
}

.upload-error-row {
  font-weight: 600;
  color: var(--danger-color);
  margin-bottom: 4px;
}

.upload-error-message {
  color: var(--text-color);
}

.file-info {
  margin-top: 20px;
  padding: 12px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-name {
  color: var(--text-color);
  font-size: 0.95rem;
  flex: 1;
  text-align: left;
  word-break: break-all;
}

.file-remove {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--danger-color);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-left: 10px;
}

.file-remove:hover {
  background-color: #ffeaea;
}

/* Fee Types List Styles */
.fee-types-list-container {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.list-title {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.fee-types-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fafafa;
}

.fee-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: white;
}

.fee-type-item:last-child {
  border-bottom: none;
}

.fee-type-item:hover {
  background-color: #f8f9fa;
}

.fee-type-info {
  flex: 1;
}

.fee-type-name {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.fee-type-description {
  color: #666;
  font-size: 0.85rem;
}

.fee-type-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-width: auto;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Scrollbar styling for fee types list */
.fee-types-list::-webkit-scrollbar {
  width: 8px;
}

.fee-types-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.fee-types-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.fee-types-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Multi-select Styles */
.multiselect-container {
  position: relative;
  width: 100%;
}

.multiselect-display {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: white;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-color);
  min-height: 42px;
  display: flex;
  align-items: center;
  position: relative;
}

.multiselect-display::after {
  content: "▼";
  position: absolute;
  right: 12px;
  font-size: 0.75rem;
  color: #999;
  pointer-events: none;
}

.multiselect-display:hover {
  border-color: var(--active-color);
}

.multiselect-display.active {
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.multiselect-display.active::after {
  content: "▲";
}

.multiselect-display.error {
  border-color: var(--danger-color);
}

.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.multiselect-dropdown.show {
  display: block;
}

.multiselect-options {
  padding: 4px 0;
}

.multiselect-option {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
  margin: 0;
  gap: 8px;
}

.multiselect-option:hover {
  background-color: #f8f9fa;
}

.multiselect-option span {
  cursor: pointer;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  line-height: 1.4;
  flex: 1;
}

.multiselect-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  order: -1;
}

/* Fee Type Amount Inputs */
#feeTypeAmountsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.fee-type-amount-group {
  background-color: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 15px;
  transition: var(--transition);
}

.fee-type-amount-group:hover {
  border-color: var(--active-color);
  background-color: #f0f7ff;
}

.fee-type-amount-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.fee-type-amount-row label {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--text-color);
  min-width: 150px;
  flex-shrink: 0;
  margin: 0;
}

.fee-type-amount-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: var(--transition);
  max-width: 200px;
}

.fee-type-amount-input:focus {
  outline: none;
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.fee-type-amount-input.error {
  border-color: var(--danger-color);
}

.fee-type-amount-group .form-error {
  margin-top: 6px;
  margin-left: 165px; /* Align with input field */
}

.page-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

/* Table Styles */
.table-container {
  width: 100%;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.table-filters {
  width: 100%;
}

.filter-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Consistent height for all form elements */
.search-box,
.filter-select,
.btn-filter,
.btn-clear {
  height: 40px;
  box-sizing: border-box;
}

.search-box {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: white;
  transition: var(--transition);
}

.search-box-narrow {
  max-width: 145px; /* 10% increase from 120px */
  flex: 0 0 145px;
  min-width: 120px;
}

/* Payment History specific search box - 60% width */
.search-box-payment-history {
  min-width: 150px; /* 60% of 250px */
  max-width: 240px; /* 60% of 400px */
}

.search-box:focus {
  outline: none;
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-select {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  min-width: 150px;
  transition: var(--transition);
  font-weight: 500;
}

.filter-select:hover {
  border-color: var(--active-color);
}

.filter-select:focus {
  outline: none;
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Date Range Picker */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background-color: white;
  transition: var(--transition);
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  height: 40px;
  box-sizing: border-box;
}

.date-range-picker:hover {
  border-color: var(--active-color);
}

.date-range-picker:focus-within {
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.date-range-input {
  flex: 1;
  border: none;
  padding: 10px 8px;
  font-size: 0.9rem;
  background-color: transparent;
  outline: none;
  min-width: 0;
  width: 0; /* Allow flexbox to control width */
}

.date-range-input:focus {
  outline: none;
}

.date-range-start {
  border-right: 1px solid var(--border-color);
  border-radius: 6px 0 0 6px;
}

.date-range-end {
  border-left: 1px solid var(--border-color);
  border-radius: 0 6px 6px 0;
}

.date-range-separator {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-filter {
  white-space: nowrap;
  font-weight: 600;
}

.btn-clear {
  white-space: nowrap;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  position: relative;
  max-width: 100%;
}

.data-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  background-color: white;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  table-layout: auto;
  display: table;
}

.data-table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
  color: white;
}

.data-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.data-table th:first-child {
  padding-left: 16px;
}

.data-table th:last-child {
  padding-right: 16px;
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-color);
  white-space: nowrap;
}

.data-table td:first-child {
  padding-left: 16px;
  font-weight: 500;
  color: var(--primary-color);
}

.data-table td:last-child {
  padding-right: 16px;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: #f0f4f8;
  transform: scale(1.001);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .empty {
  text-align: center;
  padding: 30px;
  color: #666;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.table-info {
  color: #666;
  font-size: 0.9rem;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  flex-wrap: nowrap;
  gap: 10px;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pagination-info {
  color: #666;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  position: absolute;
  right: 0;
}

.pagination-info-short {
  display: none;
}

.pagination-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin: 0 auto;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background-color: #f8f9fa;
  border-color: var(--active-color);
  color: var(--active-color);
}

.pagination-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  cursor: default;
}

.pagination-btn.disabled {
  background-color: #f5f5f5;
  border-color: var(--border-color);
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .pagination {
    padding: 12px 0;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-info {
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .pagination-info-full {
    display: none;
  }

  .pagination-info-short {
    display: inline;
  }

  .pagination-controls {
    gap: 3px;
    flex-shrink: 0;
  }

  .pagination-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .pagination {
    padding: 10px 0;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-info {
    font-size: 0.7rem;
  }

  .pagination-controls {
    gap: 2px;
  }

  .pagination-btn {
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    font-size: 0.7rem;
  }
}

.btn-action {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  margin-right: 5px;
  position: relative;
  z-index: 1;
}

.btn-action.btn-edit {
  background-color: var(--active-color);
  color: white;
}

.btn-action.btn-edit:hover {
  background-color: #2980b9;
}

.btn-action.btn-delete {
  background-color: var(--danger-color);
  color: white;
}

.btn-action.btn-delete:hover {
  background-color: var(--danger-hover);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px 15px;
    position: relative;
    z-index: 1;
  }

  .sidebar-overlay {
    display: block;
  }

  .header-center {
    display: none;
  }

  .header-title-mobile {
    display: block;
    font-size: 1.2rem;
    margin: 0;
    margin-left: 10px;
  }

  .header-title-desktop {
    display: none;
  }

  .header-label {
    display: none;
  }

  .username {
    font-size: 0.85rem;
  }

  .page-content {
    padding: 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .page-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .btn {
    flex: 1;
    min-width: 120px;
  }

  .role-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 100%;
    max-width: 100%;
  }

  .date-range-picker {
    min-width: 100%;
    max-width: 100%;
  }

  .filter-select {
    min-width: 100%;
  }

  .btn-filter,
  .btn-clear {
    width: 100%;
  }

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-x: scroll;
    overflow-y: visible;
    width: 100%;
    max-width: 100vw;
  }

  .data-table {
    font-size: 0.85rem;
    min-width: 700px;
    width: max-content;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 12px;
  }

  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 12px;
  }

  .btn-action {
    padding: 4px 8px;
    font-size: 0.8rem;
    margin-right: 3px;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .welcome-section {
    padding: 30px 20px;
  }

  .welcome-section h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 10px;
  }

  .header-title-mobile {
    font-size: 1rem;
  }

  .header-label {
    display: none;
  }

  .user-info {
    gap: 8px;
  }

  .username {
    font-size: 0.8rem;
  }

  .role-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .filter-form {
    gap: 8px;
  }

  .search-box-narrow {
    min-width: 150px;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .filter-select {
    min-width: 120px;
    flex: 1 1 auto;
  }

  .search-box {
    min-width: 100%;
    max-width: 100%;
  }

  .date-range-picker {
    min-width: 100%;
    max-width: 100%;
  }

  .filter-select {
    min-width: 100%;
  }

  .date-range-separator {
    padding: 0 2px;
    font-size: 0.8rem;
  }

  .date-range-input {
    padding: 10px 6px;
    font-size: 0.85rem;
  }

  .btn-filter,
  .btn-clear {
    width: 100%;
  }

  .page-content {
    padding: 10px;
  }

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-x: scroll;
    overflow-y: visible;
    width: 100%;
    max-width: 100vw;
  }

  .data-table {
    font-size: 0.8rem;
    min-width: 600px;
    width: max-content;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 0.8rem;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 8px;
  }

  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 8px;
  }

  .btn-action {
    padding: 3px 6px;
    font-size: 0.75rem;
    margin-right: 2px;
  }

  .search-box,
  .filter-select,
  .btn-filter,
  .btn-clear {
    height: 36px;
    font-size: 0.85rem;
  }

  .nav-text {
    font-size: 0.9rem;
  }

  .nav-link {
    padding: 10px 15px;
  }
}

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  padding: 14px 18px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(400px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  font-size: 20px;
  font-weight: bold;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-color);
}

/* Toast Type Styles */
.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast-success .toast-icon {
  background-color: var(--success-color);
  color: white;
}

.toast-error {
  border-left: 4px solid var(--danger-color);
}

.toast-error .toast-icon {
  background-color: var(--danger-color);
  color: white;
}

.toast-warning {
  border-left: 4px solid #f39c12;
}

.toast-warning .toast-icon {
  background-color: #f39c12;
  color: white;
}

.toast-info {
  border-left: 4px solid var(--active-color);
}

.toast-info .toast-icon {
  background-color: var(--active-color);
  color: white;
}

/* Mobile Toast Styles */
@media (max-width: 768px) {
  .toast-container {
    top: 60px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* Payment Mode Badge Styles */
.payment-mode-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-mode-badge.payment-mode-cash {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.payment-mode-badge.payment-mode-upi {
  background-color: #cfe2ff;
  color: #084298;
  border: 1px solid #b6d4fe;
}

/* Billing Interface Styles */
.billing-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.billing-selection {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.billing-selection h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.selection-grid .form-group {
  margin-bottom: 0;
}

.required {
  color: var(--danger-color);
  margin-left: 3px;
}

.billing-box {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.billing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.billing-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

#addFeeTypeBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #e9ecef;
  color: #6c757d;
  border-color: #dee2e6;
}

#addFeeTypeBtn:disabled:hover {
  background-color: #e9ecef;
  color: #6c757d;
  border-color: #dee2e6;
  transform: none;
  box-shadow: none;
}

.pending-fees-message {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.pending-fees-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.fee-types-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  min-height: 100px;
}

.billing-fee-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  display: flex;
  position: relative;
  gap: 16px;
}

.billing-fee-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.fee-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.fee-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.fee-item-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-color);
  min-width: 0;
}

.fee-item-amount-label {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 500;
  white-space: nowrap;
}

.fee-item-term {
  font-size: 0.9rem;
  color: #666;
  min-width: 0;
}

.fee-item-amount-input-wrapper {
  min-width: 0;
  max-width: 200px;
  grid-column: 2;
}

.fee-item-amount-input-wrapper .amount-input {
  width: 100%;
}

.fee-item-spacer {
  /* Spacer removed - not needed with grid */
}

.btn-remove {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  flex-shrink: 0;
  align-self: center;
}

.btn-remove:hover {
  background-color: #fee;
}

.billing-summary {
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
}

.summary-value {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-color);
}

.billing-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* Fee Type Modal Styles */
.available-fee-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.fee-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #f8f9fa;
}

.fee-type-item .fee-type-info {
  flex: 1;
}

.fee-type-item .fee-type-name {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.fee-type-item .fee-type-details {
  font-size: 0.85rem;
  color: #666;
}

/* Confirmation Popup Styles */
.confirmation-modal-content {
  max-width: 450px;
}

.confirmation-content {
  text-align: center;
  padding: 20px 0;
}

.confirmation-message {
  font-size: 1.1rem;
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
}

.confirmation-modal-content .modal-footer {
  justify-content: center;
  gap: 15px;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  padding: 2rem;
}

.login-card {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.login-card .form-group {
  margin-bottom: 1.5rem;
}

.login-card .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.login-card .form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
}

.login-card .form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  display: none;
}

.btn-login {
  width: 100%;
  padding: 0.75rem;
  background-color: #2c3e50;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-login:hover {
  background-color: #34495e;
}

.btn-login:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.back-link {
  text-align: center;
  margin-top: 1rem;
}

.btn-back {
  display: inline-block;
  width: 100%;
  padding: 0.75rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

.btn-back:hover {
  background-color: #4b5563;
}

.demo-credentials {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  text-align: center;
}

.demo-credentials p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.demo-credentials .username-label,
.demo-credentials .password-label {
  color: #2c3e50;
}

.demo-credentials .username-value {
  color: #3498db;
  font-weight: 600;
}

.demo-credentials .password-value {
  color: #e74c3c;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .billing-container {
    gap: 20px;
  }

  .billing-selection,
  .billing-box {
    padding: 15px;
  }

  .selection-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .billing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .billing-actions {
    flex-direction: column;
  }

  .billing-actions .btn {
    width: 100%;
  }

  .fee-item-header {
    flex-direction: column;
    gap: 10px;
  }

  .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .confirmation-modal-content {
    max-width: 90%;
  }
}
