/* ===================================
   GLOBAL STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Disable hover effects for single card layout pages */
.single-card-layout .card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    border-color: #e5e7eb !important;
    scale: none !important;
    transform: none !important;
}

/* Also disable hover for auto-height cards and any nested cards */
.single-card-layout .card.auto-height:hover,
.single-card-layout .dashboard-grid .card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    border-color: #e5e7eb !important;
    scale: none !important;
    transform: none !important;
}

/* Single card layout form styling - center content but keep text left-aligned */
.single-card-layout .card {
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: none !important;
    height: auto !important;
}

.single-card-layout .card > * {
    max-width: 600px;
    width: 100%;
    text-align: left;
    align-self: center;
}

.single-card-layout .card > .form-group {
    align-self: stretch;
    width: 100%;
    max-width: 600px;
}

.single-card-layout .card > .form-group {
    align-self: center !important;
    width: 100% !important;
    max-width: 600px !important;
    display: block !important;
    text-align: left !important;
}

.single-card-layout .card h2 {
    text-align: center;
    margin-bottom: 30px;
    max-width: 600px;
    width: 100%;
}

/* Results content should use full width */
.single-card-layout #results-content {
    max-width: none !important;
    width: 100% !important;
}

.single-card-layout #results-title {
    max-width: none !important;
    width: 100% !important;
}

/* Fix checkbox layout in single card layout */
.single-card-layout .card > .form-group:has(.checkbox-label) {
    max-width: 600px !important;
    width: 100% !important;
    align-self: center !important;
    white-space: nowrap !important;
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

.single-card-layout .checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-card-layout .checkbox-input {
    flex-shrink: 0;
    cursor: pointer;
}

/* Ensure form labels maintain original styling in single card layout - only override layout properties */
.single-card-layout .form-group label {
    max-width: 600px !important;
    width: 100% !important;
}

.single-card-layout .form-group input,
.single-card-layout .form-group select,
.single-card-layout .form-group textarea {
    max-width: 600px !important;
    width: 100% !important;
}

/* Breadcrumb dropdown menu styles */
.breadcrumb-menu {
    position: relative;
    margin-left: auto;
}

/* Basis badge inside breadcrumb — compact pill */
.breadcrumb-basis-item .basis-badge {
    padding: 3px 10px;
    font-size: 0.78em;
    border-radius: 4px;
}


/* Client-only view: two cards (Stats + Bank Search), full-width 2-column grid */
.dashboard-grid.client-view {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 700px) {
    .dashboard-grid.client-view {
        grid-template-columns: 1fr;
    }
}


.breadcrumb-menu-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.breadcrumb-menu-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.breadcrumb-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 260px;
    z-index: 9999;
    display: none !important;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.breadcrumb-dropdown.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

.breadcrumb-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.breadcrumb-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.breadcrumb-divider {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.breadcrumb-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.breadcrumb-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.breadcrumb-dropdown-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 500;
}

.breadcrumb-dropdown-item i {
    margin-right: 8px;
    width: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1d4ed8 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

/* ===================================
   BREADCRUMB NAVIGATION
   =================================== */
.breadcrumb {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
    flex-wrap: nowrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #666;
    font-weight: 600;
}

.breadcrumb-separator {
    color: #999;
    user-select: none;
}

/* ===================================
   NAVIGATION CARDS
   =================================== */
.nav-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.nav-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.nav-card-icon {
    font-size: 48px;
    color: #3b82f6;
    margin-bottom: 15px;
}

.nav-card-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e3a8a;
}

.nav-card-description {
    color: #666;
    line-height: 1.6;
}

/* ===================================
   LAYOUT
   =================================== */
.main-container {
    max-width: 1320px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    grid-auto-rows: auto;
}

.dashboard-grid .card.auto-height {
    align-self: start;
}

/* ===================================
   HEADER & LOGO SECTION
   =================================== */
.logo-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    margin-bottom: 2px;
}

.logo-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo {
    height: 60px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    filter: brightness(1.2) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.fallback-logo {
    display: none;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.logo-text {
    font-size: 2.2rem;
    letter-spacing: 3px;
    margin-bottom: -5px;
}

.logo-subtext {
    font-size: 1rem;
    letter-spacing: 4px;
    opacity: 0.9;
    font-weight: 300;
}

/* User info and logout button */
#user-info {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    font-size: 0.9em;
    color: white;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Tenant badge styling */
.tenant-badge {
    font-weight: 500;
    font-size: 0.95em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tenant-badge i {
    font-size: 0.9em;
    opacity: 0.9;
}

#logout-btn {
    display: none;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

#logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header {
    text-align: center;
    padding: 10px 0 15px 0;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 15px 35px rgba(30, 64, 175, 0.3);
}

.header h1 {
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 8px;
}

/* ===================================
   CARDS
   =================================== */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-height: 630px;
    max-height: 750px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.card.auto-height {
    min-height: auto;
    max-height: none;
}

.card.compact-card {
    min-height: 240px;
    max-height: none;
    padding: 20px;
}

.card.compact-card h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.card.compact-card p {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.card:hover {
    background: rgba(240, 249, 255, 0.98);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.8), 
                0 10px 40px rgba(30, 64, 175, 0.5),
                0 0 60px rgba(59, 130, 246, 0.3);
    border-color: rgb(59, 130, 246);
    scale: 1.02;
}

.card h2 {
    color: #1e40af;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-healthy {
    background-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.status-unhealthy {
    background-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.status-warning {
    background-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.btn {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
}

.btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #6b7280);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.btn-full-width {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    display: flex;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

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

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

.info-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 15px;
}

.info-item {
    text-align: center;
    padding: 12px 10px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.info-item strong {
    display: block;
    font-size: 1.4rem;
    color: #1e40af;
    margin-bottom: 4px;
}

.info-item span {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Database statistics container - prevent layout shift */
#db-stats {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.stats-details h4 {
    color: #1e40af;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(37, 99, 235, 0.1);
    padding-bottom: 8px;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 0.8s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #ecfdf5;
    border-left-color: #10b981;
    color: #047857;
}

.alert-error {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

.alert-warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #d97706;
}

.hidden {
    display: none;
}

.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Pagination Styles */
.pagination-info {
    text-align: center;
    margin: 15px 0;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-controls button {
    min-width: 40px;
    height: 36px;
    border-radius: 6px;
    font-size: 14px;
}

.pagination-controls .btn {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
}

.pagination-controls .btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.pagination-controls .btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.pagination-controls .btn-secondary:hover {
    background-color: #d1d5db;
    transform: translateY(-1px);
}

@media (max-width: 1200px) and (min-width: 901px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (max-width: 900px) and (min-width: 769px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .info-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .pagination-controls {
        gap: 3px;
    }
    
    .pagination-controls button {
        min-width: 35px;
        height: 32px;
        font-size: 12px;
    }
}

/* Message boxes */
.message-box {
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
    line-height: 1.5;
}

.message-box i {
    margin-right: 8px;
}

.message-success {
    display: block !important;
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.message-info {
    display: block !important;
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb !important;
}

.message-warning {
    display: block !important;
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeaa7 !important;
}

.message-error {
    display: block !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

/* ===================================
   AUTOCOMPLETE & DROPDOWNS
   =================================== */
.autocomplete-dropdown {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 5px;
    display: none;
    background: white;
}

.autocomplete-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
}

.autocomplete-item {
    padding: 5px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-item:hover {
    background-color: #f0f0f0;
}

.autocomplete-load-more {
    padding: 8px;
    cursor: pointer;
    border-top: 2px solid #ddd;
    background: #f0f7ff;
    text-align: center;
    color: #0369a1;
    font-weight: 500;
}

.autocomplete-load-more:hover {
    background-color: #dbeafe;
}

.autocomplete-no-results {
    color: #666;
    padding: 10px;
}

.autocomplete-error {
    color: #dc2626;
    padding: 10px;
}

/* ===================================
   HELPER TEXT & LABELS
   =================================== */
.helper-text {
    color: #666;
    font-size: 0.85em;
}

.helper-text-sm {
    color: #666;
    font-size: 0.85em;
    display: block;
    margin-top: 4px;
}

/* ===================================
   SPACING UTILITIES
   =================================== */
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mr-5 { margin-right: 5px; }
.mr-10 { margin-right: 10px; }
.mr-15 { margin-right: 15px; }

/* ===================================
   FLEX UTILITIES
   =================================== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-gap-8 { gap: 8px; }
.flex-gap-10 { gap: 10px; }
.flex-1 { flex: 1; }

/* ===================================
   TEXT UTILITIES
   =================================== */
.text-center { text-align: center; }
.text-gray { color: #666; }
.text-muted { color: #999; }
.text-success { color: #10b981; }
.text-error { color: #dc2626; }

/* ===================================
   BANK CHIPS & SELECTION
   =================================== */
.bank-chip {
    background: #e0f2fe;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
}

.bank-chip-remove {
    cursor: pointer;
    color: #dc2626;
    font-weight: bold;
    margin-left: 8px;
}

.bank-chip-remove:hover {
    color: #991b1b;
}

.selected-banks-container {
    min-height: 60px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

/* ===================================
   CUSTOM PEER GROUP SEARCH ITEMS
   =================================== */
.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-result-item:hover {
    background-color: #f0f0f0;
}

.search-result-item.disabled {
    cursor: default;
    background: #f5f5f5;
    color: #999;
}

.search-result-badge {
    float: right;
    color: #10b981;
}

/* ===================================
   SUCCESS BANNER
   =================================== */
.success-banner {
    background: #d4edda;
    color: #155724;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* ===================================
   PAGINATION
   =================================== */
.pagination-wrapper {
    margin-top: 15px;
    text-align: center;
}

.pagination-info-text {
    margin-right: 15px;
}

/* ===================================
   FORM TEXTAREA
   =================================== */
.form-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    resize: vertical;
}

/* ===================================
   CHECKBOX LABEL
   =================================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-input {
    width: auto;
    margin: 0;
}

/* ===================================
   BUTTON GROUP
   =================================== */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group .btn {
    flex: 1;
    margin: 0;
}

/* ===================================
   TENANT BANK SETUP MODAL
   =================================== */
.tenant-bank-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tenant-bank-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.tenant-bank-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

.tenant-bank-modal-content p {
    color: #555;
    margin-bottom: 8px;
}

.tenant-bank-modal-content p:last-of-type {
    margin-bottom: 25px;
}

.tenant-bank-search-group {
    margin-bottom: 20px;
}

.tenant-bank-search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.tenant-bank-search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.tenant-bank-results {
    margin-top: 10px;
}

.tenant-bank-selected {
    margin: 20px 0;
    min-height: 40px;
}

.tenant-bank-save-btn {
    width: 100%;
    padding: 12px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer !important;
    opacity: 1;
    transition: opacity 0.2s, background 0.2s;
}

.tenant-bank-save-btn:not(:disabled) {
    opacity: 1 !important;
    cursor: pointer !important;
    background: #2980b9;
}

.tenant-bank-save-btn:not(:disabled):hover {
    background: #1f6a99;
}

.tenant-bank-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #95a5a6;
}

.tenant-bank-save-btn.success {
    background: #27ae60 !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ===================================
   MODAL MESSAGES
   =================================== */
.modal-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.modal-message-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.modal-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.modal-message-warning {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.modal-selected-bank {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border: 2px solid #c3e6cb;
}

.modal-selected-bank strong {
    font-size: 18px;
}

/* ===================================
   SEARCH RESULT ITEMS IN MODAL
   =================================== */
.modal-search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.modal-search-result-item:hover {
    background: #f5f5f5;
}

/* ===================================
   SAVED BLR CALCULATIONS PAGE STYLES
   =================================== */
.saved-calculations-grid {
    display: grid;
    gap: 8px;
}

.calculation-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.calculation-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Icon action buttons on the summary line */
.card-icon-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
}

.icon-action-btn {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78em;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.icon-action-btn .icon-label {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 0.72em;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    letter-spacing: 0.01em;
}

.icon-action-btn .icon-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
}

.icon-action-btn:hover .icon-label {
    opacity: 1;
}

.icon-action-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.icon-action-btn.danger:hover {
    background: #fff5f5;
    border-color: #fca5a5;
    color: #dc2626;
    box-shadow: 0 2px 4px rgba(220,38,38,0.12);
}

.calculation-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.calculation-summary:hover {
    background: #f8fafc;
}

.summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.expand-icon {
    color: #64748b;
    font-size: 0.9em;
    transition: transform 0.2s;
    width: 16px;
}

.calc-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.05em;
}

.summary-right {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.summary-meta {
    font-size: 0.82em;
    color: #64748b;
    white-space: nowrap;
}

.summary-meta i {
    opacity: 0.6;
    margin-right: 3px;
}

.summary-meta strong {
    color: #475569;
    font-weight: 600;
    margin-right: 4px;
}

.calculation-expanded {
    padding: 12px 16px 12px 44px;
    border-top: 1px solid #f1f5f9;
}

.weights-summary {
    margin: 0 0 15px 0;
}

.hybrid-weights-summary {
    margin: 0 0 15px 0;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}

.hybrid-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.hybrid-section-label {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hybrid-section-label.peer  { color: #059669; }
.hybrid-section-label.bank  { color: #059669; }

.hybrid-blend-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 700;
}

.hybrid-blend-badge.peer {
    background: #d1fae5;
    color: #065f46;
}

.hybrid-blend-badge.bank {
    background: #d1fae5;
    color: #065f46;
}

.hybrid-sb-badge {
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
}

.calculation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.action-btn {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.84em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.action-btn.view {
    background: #2563eb;
    color: white;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.action-btn.view:hover {
    background: #1d4ed8;
    border-color: #1e40af;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.action-btn.view:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}

.action-btn.download {
    background: white;
    color: #0369a1;
    border: 1px solid #bae6fd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.action-btn.download:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0284c7;
    box-shadow: 0 2px 6px rgba(3, 105, 161, 0.15);
    transform: translateY(-1px);
}

.action-btn.download:active {
    transform: translateY(0);
}

.action-btn.delete {
    background: white;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.action-btn.delete:hover {
    background: #fff5f5;
    color: #dc2626;
    border-color: #fca5a5;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
    transform: translateY(-1px);
}

.action-btn.delete:active {
    transform: translateY(0);
}

.method-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.peer-group {
    background: #dbeafe;
    color: #1e40af;
}

.method-badge.single-bank {
    background: #dbeafe;
    color: #1e40af;
}

.method-badge.hybrid {
    background: #ede9fe;
    color: #5b21b6;
}

/* ── Balance basis badges ─────────────────────────────────────────────────── */

/* Inline banner at top of peer-analysis results content */
.basis-results-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.88em;
    margin-bottom: 16px;
}
.basis-results-banner--ending {
    background: #d1fae5;
    color: #065f46;
    border-left: 3px solid #10b981;
}
.basis-results-banner--beginning {
    background: #fef9c3;
    color: #854d0e;
    border-left: 3px solid #f59e0b;
}
.basis-results-note {
    opacity: 0.75;
    font-size: 0.92em;
}

/* Inline badge on saved-calc cards (.basis-tag) */
.basis-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.4px;
}
.basis-tag--ending {
    background: #d1fae5;
    color: #065f46;
}
.basis-tag--beginning {
    background: #fef9c3;
    color: #854d0e;
}

/* Treatment tags for negative loss rate treatment */
.treatment-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.4px;
}
.treatment-tag--include {
    background: #e0e7ff;
    color: #3730a3;
}
.treatment-tag--floor_at_zero {
    background: #fef3c7;
    color: #92400e;
}
.treatment-tag--exclude {
    background: #fee2e2;
    color: #991b1b;
}

/* Global header indicator (.basis-badge inside #user-info) */
.basis-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    cursor: default;
    transition: opacity 0.2s;
}
.basis-badge--hidden {
    opacity: 0;
    pointer-events: none;
}
.basis-badge--ending {
    background: #d1fae5;
    color: #065f46;
}
.basis-badge--beginning {
    background: #fef9c3;
    color: #854d0e;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #374151;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.empty-state i {
    font-size: 4em;
    color: #94a3b8;
    margin-bottom: 20px;
}

.empty-state h2 { color: #1e293b; margin-bottom: 8px; }
.empty-state p  { color: #64748b; margin: 0; font-size: 1em; }

.weights-label {
    font-size: 0.8em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.weights-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weight-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

.weight-bank-name {
    margin-right: 6px;
    font-weight: 600;
}

.weight-cert {
    color: #64748b;
    font-size: 0.9em;
    margin-right: 6px;
}

.weight-value {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    font-size: 0.9em;
}

.delete-modal-content {
    max-width: 450px;
}

.delete-modal-content h2 {
    color: #dc2626;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-modal-content h2 i {
    color: #dc2626;
}

.delete-modal-content p {
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.5;
}

.delete-calc-name {
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 10px 0;
}

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

.delete-modal-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

.btn-cancel:hover {
    background: #cbd5e1;
}

.btn-delete {
    background: #dc2626;
    color: white;
}

.btn-delete:hover {
    background: #b91c1c;
}

.search-filter-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-filter-grid {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 12px;
    align-items: stretch;
}

.filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input-wrapper i {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
    font-size: 14px;
}

.filter-input-wrapper input {
    padding-left: 42px !important;
    width: 100%;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#filter-period {
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

#filter-period:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-filter-card .btn-secondary {
    height: 42px;
    padding: 0 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter-card .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
