/* Reset na Msingi */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Collateral Section */
.collateral-section {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}
.collateral-section h4 {
  margin-bottom: 10px;
}
.collateral-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.collateral-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e0e6ed;
  background-color: #f8f9fa;
}

/* Collateral Upload Container */
.collateral-upload-container {
  margin-top: 8px;
}

.collateral-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.add-collateral-btn {
  width: 120px;
  height: 100px;
  border: 2px dashed #007bff;
  border-radius: 6px;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #007bff;
}

.add-collateral-btn:hover {
  background-color: #e3f2fd;
  border-color: #0056b3;
}

.add-collateral-btn i {
  font-size: 24px;
  margin-bottom: 5px;
}

.add-collateral-btn span {
  font-size: 12px;
  font-weight: 500;
}

.collateral-preview-item {
  position: relative;
  width: 120px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
  border: 1px solid #e0e6ed;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.collateral-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #f8f9fa;
}

.collateral-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background-color 0.3s ease;
}

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

/* Simple badge styles if not already present */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge-success {
  background-color: #e6f4ea;
  color: #1e7e34;
  border-color: #b7e1c1;
}
.badge-light {
  background-color: #f8f9fa;
  color: #6c757d;
  border-color: #e9ecef;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #fff;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: #fff;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
}

.nav-link span {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 0;
    background: #f5f7fa;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
}

/* Bootstrap Offcanvas Customization */
.offcanvas-header.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.nav-link-mobile {
    color: #495057 !important;
    padding: 15px 20px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.nav-link-mobile:hover,
.nav-link-mobile.active {
    background-color: #667eea !important;
    color: white !important;
    transform: translateX(5px);
}

.nav-link-mobile i {
    width: 20px;
    text-align: center;
}

/* Top Header */
.top-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e6ed;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    border: 2px solid #667eea !important;
    color: #667eea !important;
    font-size: 1.2rem;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: #667eea !important;
    color: white !important;
    transform: scale(1.05);
}

.mobile-menu-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.top-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

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

/* Sections */
.section {
    display: none;
    background: white;
    margin: 30px;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 140px);
}

.section.active {
    display: block;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Dashboard Stats - Bootstrap Integration */
.stats-grid {
    /* Removed - using Bootstrap grid instead */
}

.stat-card {
    background: white;
    color: #2c3e50;
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card.gradient-purple::before {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.stat-card.gradient-blue::before {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.stat-card.gradient-indigo::before {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.gradient-purple .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.gradient-blue .stat-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.gradient-indigo .stat-icon {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}

.stat-icon i {
    font-size: 1.8rem;
}

.stat-content {
    flex: 1;
    text-align: left;
}

.stat-content h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
    line-height: 1;
}

/* Form Styles - Bootstrap Integration */
.card .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Transaction Search/Filter Container Enhancements */
#transactions .card:first-of-type {
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
}

#transactions .card:first-of-type:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

#transactions .card:first-of-type .card-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px 25px;
    border: none;
    position: relative;
    overflow: hidden;
}

#transactions .card:first-of-type .card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

#transactions .card:first-of-type .card-header h5 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

#transactions .card:first-of-type .card-header h5 i {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 50%;
    margin-right: 12px;
    backdrop-filter: blur(10px);
}

#transactions .card:first-of-type .card-body {
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Transaction Add Form Container Enhancements */
#transactions .card:nth-of-type(2) {
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
}

#transactions .card:nth-of-type(2):hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

#transactions .card:nth-of-type(2) .card-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 20px 25px;
    border: none;
    position: relative;
    overflow: hidden;
}

#transactions .card:nth-of-type(2) .card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

#transactions .card:nth-of-type(2) .card-header h5 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

#transactions .card:nth-of-type(2) .card-header h5 i {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 50%;
    margin-right: 12px;
    backdrop-filter: blur(10px);
}

#transactions .card:nth-of-type(2) .card-body {
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Enhanced Form Controls for Transaction Forms */
#transactions .form-control,
#transactions .form-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#transactions .form-control:focus,
#transactions .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#transactions .btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#transactions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Staff Registration Form Enhancements */
.card:has(#createStaffForm) {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
}

.card:has(#createStaffForm) .card-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 20px 25px;
    border: none;
}

.card:has(#createStaffForm) .card-header h5 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card:has(#createStaffForm) .card-header h5::before {
    content: "👥 ";
    margin-right: 10px;
    font-size: 24px;
}

.card:has(#createStaffForm) .card-header .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

#createStaffForm {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin: 0;
}

#createStaffForm .form-control,
#createStaffForm .form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#createStaffForm .form-control:focus,
#createStaffForm .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#createStaffForm .mb-3 {
    margin-bottom: 1.5rem !important;
    position: relative;
}

#createStaffForm .form-label::before {
    content: "📝";
    margin-right: 8px;
    font-size: 16px;
}

#createStaffForm .form-label[for="staffRole"]::before {
    content: "👔";
}

#createStaffForm .form-label[for="staffNumber"]::before {
    content: "📱";
}

#createStaffForm .form-label[for="staffAddress"]::before {
    content: "🏠";
}

#createStaffForm .form-label[for="staffIdImage"]::before {
    content: "🆔";
}

#createStaffForm .form-label[for="staffPassport"]::before {
    content: "📷";
}

#createStaffForm .form-label[for="staffBranchIds"]::before {
    content: "🏢";
}

#createStaffForm .form-label[for="staffPassword"]::before {
    content: "🔒";
}

#editStaffForm .form-label[for="editStaffPassword"]::before {
    content: "🔒";
}

#createStaffForm input[type="file"] {
    border: 2px dashed #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    padding: 20px;
    text-align: center;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#createStaffForm input[type="file"]:hover {
    border-color: #2980b9;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

#createStaffForm .btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#createStaffForm .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#createStaffForm .btn-primary::before {
    content: "✨ ";
    margin-right: 5px;
}

#createStaffForm .text-muted {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    margin-top: 8px;
    font-size: 13px;
    font-style: italic;
}

#createStaffForm .d-flex .btn-outline-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#createStaffForm .d-flex .btn-outline-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Edit Staff Modal Enhancements */
#editStaffModal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

#editStaffModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-bottom: none;
    position: relative;
}

#editStaffModal .modal-header::before {
    content: '\f007';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    opacity: 0.3;
}

#editStaffModal .modal-header h3 {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#editStaffModal .modal-header .close {
    color: white;
    font-size: 2em;
    font-weight: bold;
    opacity: 0.8;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#editStaffModal .modal-header .close:hover {
    opacity: 1;
    transform: scale(1.1);
}

#editStaffModal .modal-body {
    padding: 30px;
    background: white;
}

#editStaffModal .form-label {
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    position: relative;
}

#editStaffModal .form-label::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

#editStaffModal .form-control,
#editStaffModal .form-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#editStaffModal .form-control:focus,
#editStaffModal .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    transform: translateY(-1px);
}

#editStaffModal .btn {
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#editStaffModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#editStaffModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#editStaffModal .btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    background: transparent;
}

#editStaffModal .btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

#editStaffModal .btn-outline-success {
    border: 2px solid #28a745;
    color: #28a745;
    background: transparent;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#editStaffModal .btn-outline-success:hover {
    background: #28a745;
    color: white;
    transform: scale(1.1);
}

#editStaffModal .btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: transparent;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#editStaffModal .btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

#editStaffModal .text-muted {
    font-size: 0.8em;
    color: #6c757d !important;
    font-style: italic;
    margin-top: 5px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

#editStaffModal .mb-3 {
    margin-bottom: 25px !important;
}

#editStaffModal .d-flex.justify-content-between {
    margin-bottom: 10px;
}

#editStaffModal select[multiple] {
    min-height: 120px;
    background: #f8f9fa;
}

#editStaffModal select[multiple]:focus {
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Transaction Form Specific Styles */
.transaction-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.transaction-form .form-control.full-width {
    grid-column: 1 / -1;
}

.transaction-form .form-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.transaction-form .form-control input,
.transaction-form .form-control select,
.transaction-form .form-control textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.transaction-form .form-control input:focus,
.transaction-form .form-control select:focus,
.transaction-form .form-control textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.transaction-form .form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.transaction-form .form-actions .btn-primary,
.transaction-form .form-actions .btn-secondary {
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.transaction-form .form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.transaction-form .form-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* Legacy form group styles - kept for compatibility */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

.form-group input:not(.form-control),
.form-group select:not(.form-select),
.form-group textarea:not(.form-control) {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
}

/* Tables - Bootstrap Integration */
.table-responsive {
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    background: white;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.table-dark th {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    border-color: transparent;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0,0,0,0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.table .amount {
    font-weight: 600;
    color: #27ae60;
}

.table .payment-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.table .payment-method.mpesa {
    background: #e8f5e8;
    color: #2e7d32;
}

.table .payment-method.cash {
    background: #fff3e0;
    color: #f57c00;
}

.table .payment-method.bank {
    background: #e3f2fd;
    color: #1976d2;
}

/* Legacy table support */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table th {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f8f9fa;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 20px;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

/* Reports Section */
.reports-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.reports-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.reports-title-section {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.reports-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.reports-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

.reports-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 2;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.modern-report-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.modern-report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modern-report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.transaction-report::before {
    background: linear-gradient(90deg, #2196F3, #1976D2);
}

.client-report::before {
    background: linear-gradient(90deg, #FF9800, #F57C00);
}

.capital-report::before {
    background: linear-gradient(90deg, #9C27B0, #7B1FA2);
}

.report-card-header {
    padding: 25px 25px 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.report-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.report-title-section {
    flex: 1;
}

.report-title {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.report-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.report-card-body {
    padding: 0 25px 25px 25px;
}

.date-filter-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.date-input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.modern-date-input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.modern-date-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.modern-report-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.modern-report-btn.primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.modern-report-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.modern-report-btn.secondary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.modern-report-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.modern-report-btn.outline {
    background: white;
    color: #666;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modern-report-btn.outline:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.report-content-modern {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #fafafa;
}

.chart-section-wrapper {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.report-table th,
.report-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.report-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-table tr:hover {
    background-color: #f8f9fa;
}

.report-summary {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.report-summary h4 {
    margin: 0 0 15px 0;
    color: #2e7d32;
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.1rem;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #4CAF50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reports-header {
        padding: 25px 20px;
    }
    
    .reports-main-title {
        font-size: 2rem;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .date-filter-modern {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-group {
        min-width: auto;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .modern-report-btn {
        width: 100%;
    }
    
    .chart-section-wrapper {
        padding: 20px 15px;
    }
}

/* Chart Big View Styling */
.chart-big-view {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 30px;
    border-radius: 16px;
    min-height: 400px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow-x: auto;
    width: 100%;
}

.chart-big-view svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .chart-big-view {
        padding: 20px;
        margin: 15px 0;
    }
}

/* Modern Chart Section */
.modern-chart-section {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.04);
    margin: 40px 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}

.chart-title-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 40px;
    text-align: center;
    position: relative;
}

.chart-title-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.chart-main-title {
    margin: 0 0 8px 0;
    font-size: 2.2em;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.chart-subtitle {
    margin: 0;
    font-size: 1.1em;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.chart-filter-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px 40px;
    border-bottom: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.input-wrapper label {
    font-size: 0.95em;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modern-date-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    font-size: 1em;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.modern-date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.modern-chart-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
}

.modern-chart-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modern-chart-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-chart-display {
    padding: 20px;
    background: transparent;
    min-height: 600px;
    display: block;
    width: 100%;
    position: relative;
}

.modern-chart-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.modern-chart-display svg {
    width: 100% !important;
    height: 600px !important;
    display: block;
    margin: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .chart-title-area {
        padding: 25px 20px;
    }
    
    .chart-main-title {
        font-size: 1.8em;
    }
    
    .chart-subtitle {
        font-size: 1em;
    }
    
    .chart-filter-panel {
        padding: 20px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .input-wrapper {
        min-width: auto;
    }
    
    .modern-chart-display {
        padding: 15px;
        min-height: 500px;
    }
    
    .modern-chart-display svg {
        height: 500px !important;
    }
    
    .modern-chart-btn {
        justify-content: center;
    }
}

/* Modal Transactions Table */
.modal:not(.fade) .modal-body h4 {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
    margin: 30px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.modal:not(.fade) .modal-body h4::before {
    content: '📋';
    font-size: 1.2em;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.transactions-table thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.transactions-table thead th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.transactions-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f3f4;
}

.transactions-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.01);
}

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

.transactions-table tbody td {
    padding: 15px 12px;
    color: #34495e;
    font-size: 0.95em;
    border: none;
    vertical-align: middle;
}

.transactions-table tbody td:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.transactions-table tbody td:nth-child(3) {
    color: #27ae60;
    font-weight: 600;
    font-size: 1.05em;
}

.transactions-table tbody td:nth-child(4) {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    color: #3498db;
    font-weight: 600;
    border-radius: 6px;
    margin: 2px;
    text-align: center;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.2em;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .payment-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .method-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .transactions-table {
        font-size: 0.85em;
    }
    
    .transactions-table thead th,
    .transactions-table tbody td {
        padding: 10px 8px;
    }
    
    .client-info p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .client-info p strong {
        min-width: auto;
    }
}

/* Backup Styles */
.backup-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.backup-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.backup-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.backup-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.backup-card p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Custom Modal Styles (for loan details modal) */
.modal:not(.fade) {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(52, 73, 94, 0.8) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal:not(.fade) .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal:not(.fade) .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c, #f39c12);
    z-index: 1;
}

.modal:not(.fade) .modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    z-index: 2;
}

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

.modal-actions .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.modal:not(.fade) .modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal:not(.fade) .modal-header h3::before {
    content: '💰';
    font-size: 1.2em;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Loan Details Modal Specific Styles */
.loan-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.info-item span {
    display: block;
    color: #34495e;
    font-size: 1.1em;
    font-weight: 500;
}

.loan-progress {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-bottom: 25px;
}

.loan-progress h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.progress-bar {
    background: #e9ecef;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9em;
    color: #34495e;
}

.progress-info span {
    font-weight: 500;
}

.payment-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-history-table thead {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.payment-history-table th,
.payment-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.payment-history-table th {
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-history-table tbody tr:hover {
    background: #f8f9fa;
}

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

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

.status.active {
    background: #fff3cd;
    color: #856404;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid transparent;
}

.close-modal:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    transform: rotate(90deg) scale(1.1);
}

.modal:not(.fade) .modal-body {
    padding: 30px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.client-info {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid #d6eaf8;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.1);
    position: relative;
    overflow: hidden;
}

.client-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.client-info h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-info h4::before {
    content: '👤';
    font-size: 1.2em;
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.client-info p {
    margin: 12px 0;
    color: #34495e;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
}

.client-info p:last-child {
    border-bottom: none;
}

.client-info p strong {
    color: #2c3e50;
    min-width: 120px;
    font-weight: 600;
}

/* Payment Summary Styles */
.payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.summary-card h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .amount {
    font-size: 2em;
    font-weight: 700;
    color: #27ae60;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

/* Payment Methods Styles */
.payment-methods {
    margin: 30px 0;
}

.payment-methods h4 {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.payment-methods h4::before {
    content: '💳';
    font-size: 1.2em;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.method-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.method-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.method-card h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.method-card p {
    margin: 8px 0;
    color: #34495e;
    font-size: 0.95em;
}

.method-card p:last-child {
    color: #27ae60;
    font-weight: 600;
    font-size: 1.1em;
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
}

.summary-card h5 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.summary-card .amount {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.view-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.view-btn:hover {
    background-color: #138496;
}

/* Date Filter Styles */
.date-filter-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.date-filter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.date-filter-container h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter-container h3::before {
    content: '📅';
    font-size: 1.1rem;
}

.date-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.date-input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 14px;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.filter-status {
    margin-top: 15px;
    padding: 10px;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
    font-size: 14px;
}

.filter-status span {
    font-weight: 500;
}

/* Export Section Styles */
.export-section {
    margin-top: 15px;
    margin-bottom: 15px;
    text-align: right;
}

.export-section .btn-success {
    margin-left: 10px;
}

/* Transaction Filter Styles */
.transaction-filters-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.search-group {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.search-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.date-filter-group,
.payment-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-buttons-group {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-group label,
.date-filter-group label,
.payment-filter-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

/* Client Form Styles */
.client-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.client-form::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    pointer-events: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-control {
    position: relative;
}

.form-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-shadow: none;
}

.form-control input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.form-control input:focus {
    outline: none;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.form-control input::placeholder {
    color: #999;
    font-style: italic;
}

.form-actions {
    text-align: center;
    margin-top: 20px;
}

.form-actions .btn-primary {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(39, 174, 96, 0.4);
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.form-actions .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.3);
}

/* Client Controls */
.client-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.client-controls input {
    flex: 1;
    min-width: 300px;
    padding: 12px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.client-controls input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.client-controls .btn-secondary {
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    white-space: nowrap;
}

/* BAYALIMO MICROFINANCE Logo Styles */
.logo {
    transition: transform 0.3s ease;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo:hover {
    transform: scale(1.05);
}

.sidebar-header .logo {
    border: 2px solid #2c5aa0;
}

.offcanvas-header .logo {
    border: 2px solid rgba(255,255,255,0.3);
}

/* Brand Colors */
.brand-primary {
    color: #2c5aa0 !important;
}

.brand-secondary {
    color: #dc3545 !important;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    .top-header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .top-header h1 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }
    
    .header-actions {
        margin-top: 5px;
        width: 100%;
        text-align: center;
    }
    
    .mobile-menu-toggle {
        padding: 6px 10px !important;
        font-size: 1rem;
    }
    
    .section {
        margin: 15px;
        padding: 20px;
    }
    
    .top-header {
        padding: 15px 20px;
    }
    
    .top-header h1 {
        font-size: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .client-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .client-controls input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 5px;
    }
    
    .stat-card {
        padding: 25px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 15px;
        width: 60px;
        height: 60px;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .date-filter-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .date-input-group {
        min-width: auto;
        width: 100%;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
    
    .backup-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .payment-summary {
        grid-template-columns: 1fr;
    }
    
    .date-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-group {
        min-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
        margin-top: 10px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group {
        min-width: 100%;
    }
    
    .date-filter-group,
    .payment-filter-group {
        min-width: 100%;
    }
    
    .filter-buttons-group {
        justify-content: center;
        margin-top: 10px;
    }
    
    /* Reports responsive */
    .reports-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .report-card {
        padding: 20px;
    }
    
    .date-filter {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .date-filter button {
        padding: 15px;
        font-size: 1em;
    }
    
    .report-content {
        padding: 15px;
    }
    
    .report-content h4 {
        font-size: 1.1em;
    }
    
    .report-content p {
        font-size: 1em;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        margin: 10px 0;
    }
    
    .nav-menu li {
        min-width: 120px;
    }
    
    .nav-link {
        justify-content: center;
        flex-direction: column;
        padding: 10px;
        text-align: center;
    }
    
    .nav-link i {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section.active {
    animation: fadeIn 0.5s ease;
}

/* Success Message */
.success-message {
    background: linear-gradient(45deg, #27ae60, #229954);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.success-message.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

/* Error Message */
.error-message {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.error-message.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}



/* General Message Styles */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.message.success {
    background: linear-gradient(45deg, #27ae60, #229954);
}

.message.error {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.message.warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}



/* Transaction Summary */
.transactions-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.transactions-summary h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.total-amount {
    font-weight: bold;
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.transactions-summary p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Transaction and Client Items */
.transaction-item, .client-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.transaction-item:hover, .client-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.transaction-number {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.transaction-id {
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

.transaction-info, .client-info {
    flex: 1;
}

.transaction-info h4, .client-info h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.transaction-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.transaction-details p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.transaction-details strong {
    color: #2c3e50;
}

.amount {
    color: #27ae60;
    font-weight: bold;
    font-size: 16px;
}

.payment-method {
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    color: #27ae60;
    font-weight: bold;
}

.status-deleted {
    color: #e74c3c;
    font-weight: bold;
}

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

.client-info p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

/* FAINI NOTES Styles */
.fine-notes-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.fine-notes-section h4 {
    color: #dc3545;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dc3545;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fine-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
}

.fine-info p {
    margin: 5px 0;
    color: #856404;
    font-weight: 600;
}

.add-fine-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.add-fine-form h5 {
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.fine-records {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.fine-records h5 {
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.fine-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fine-table thead {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.fine-table th,
.fine-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.fine-table th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.fine-table tbody tr {
    transition: all 0.3s ease;
}

.fine-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.fine-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.fine-table tbody tr:nth-child(even):hover {
    background-color: #e9ecef;
}

.btn-danger-small {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-danger-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

/* Responsive Design for Fine Notes */
/* Client Search Dropdown Styles */
.client-search-container {
    position: relative;
}

.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
}

.client-option {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

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

.client-option:last-child {
    border-bottom: none;
}

.client-option.selected {
    background-color: #007bff;
    color: white;
}

.client-option .client-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.client-option .client-phone {
    font-size: 12px;
    color: #6c757d;
}

.client-option.selected .client-name,
.client-option.selected .client-phone {
    color: white;
}

.no-clients-found {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.client-search-container input:focus + .client-dropdown {
    display: block;
}

/* Pending Client Transaction Styles */
.pending-client-row {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.pending-client {
    color: #856404;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.pending-client i {
    margin-right: 5px;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.875em;
    transition: all 0.2s;
    margin-right: 5px;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    transform: translateY(-1px);
}

.btn-warning i {
    margin-right: 4px;
}

/* Assignment Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.assign-client-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.transaction-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.transaction-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.transaction-info p {
    margin: 5px 0;
    color: #555;
}

.client-assignment-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.no-results {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fine-notes-section {
        padding: 15px;
        margin: 20px 0;
    }
    
    .add-fine-form,
    .fine-records {
        padding: 15px;
    }
    
    .fine-table {
        font-size: 12px;
    }
    
    .fine-table th,
    .fine-table td {
        padding: 8px 10px;
    }
    
    .btn-danger-small {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .client-dropdown {
        max-height: 150px;
    }
    
    .client-dropdown-item {
        padding: 10px 12px;
    }
    
    .btn-warning {
        padding: 4px 8px;
        font-size: 0.8em;
    }
    
    .pending-client {
        font-size: 0.9em;
    }
}

/* Multi-user support styles */
.user-status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    font-size: 0.9rem;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.user-status-indicator.multiple-users {
    background: #ffc107;
    color: #212529;
    animation: pulse 2s infinite;
}

.user-status-indicator i {
    margin-right: 8px;
}

.user-status-indicator small {
    font-size: 0.75rem;
    opacity: 0.8;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255,193,7,0.4);
    }
    100% {
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}

.multi-user-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1040;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Database busy indicator */
.database-busy {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 1060;
    text-align: center;
}

.database-busy .spinner-border {
    margin-bottom: 10px;
}

/* Enhanced save button for multi-user */
.save-btn-multi {
    position: relative;
}

.save-btn-multi.saving {
    pointer-events: none;
}

.save-btn-multi.saving::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Loan Styles */
.loan-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.loan-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.loan-form .client-search-container {
    position: relative;
}

.loan-form .client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.loan-form .client-option {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.loan-form .client-option:hover {
    background: #f9fafb;
}

.loan-form .client-option:last-child {
    border-bottom: none;
}

.loan-form .client-name {
    font-weight: 500;
    color: #374151;
}

.loan-form .client-phone {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.loan-form .no-results {
    padding: 0.75rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.loans-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-collapse: collapse;
}

.loans-table th,
.loans-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.loans-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.loans-table tbody tr:hover {
    background: #f8f9fa;
}

.loan-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.loan-status.active {
    background: #fff3cd;
    color: #856404;
}

.loan-status.completed {
    background: #d1edff;
    color: #0c5460;
}

.loan-status.overdue {
    background: #f8d7da;
    color: #721c24;
}

.loan-status.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.loan-status.status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.loan-actions {
    display: flex;
    gap: 5px;
}

.loan-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-view {
    background: #007bff;
    color: white;
}

.btn-pay {
    background: #28a745;
    color: white;
}

.btn-view:hover {
    background: #0056b3;
}

.btn-pay:hover {
    background: #1e7e34;
}

/* Additional gradient colors for loan stats */
.gradient-green {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

/* Client Details Section Styles */
.client-details-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #28a745;
}

.client-details-section h4 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.loan-details-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.loan-details-section h4 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

/* Payment History Table Styles */
.payment-history-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-collapse: collapse;
    margin-top: 15px;
}

.payment-history-table th,
.payment-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.payment-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.payment-history-table tbody tr:hover {
    background: #f8f9fa;
}

.payment-history-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Modal Content Adjustments for Better Scrolling */
.loan-details-modal {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
}

.loan-details-modal .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
}

/* Branch Usage Chart Modal Styles */
.modal-xl {
    max-width: 95vw;
    width: 95vw;
    height: 90vh;
}

.modal-xl .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 20px;
}

.chart-modal-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.filter-group-modal {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.input-wrapper-modal {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.input-wrapper-modal label {
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.modal-chart-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    min-height: 400px;
    border: 2px solid #e9ecef;
}

.modern-chart-btn.secondary {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modern-chart-btn.secondary:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 98vw;
        width: 98vw;
        height: 95vh;
    }
    
    .filter-group-modal {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-wrapper-modal {
        min-width: 100%;
    }
    
    .chart-modal-controls {
        padding: 15px;
    }
}