:root {
  --tblr-primary: #48a884;
  --tblr-primary-rgb: 72, 168, 132;
  --tblr-primary-lt: rgba(72, 168, 132, 0.1);
  --tblr-primary-darken: #3a8f6f;
} 

/* Modal Title Styling */
h5.modal-title {
  color: white !important;
}

/* SMXI CRM Color Palette and Standardized Button Sizing */

/* ===== BUTTON SIZE STANDARDIZATION ===== */
/* Ensure all buttons have consistent sizing across the application */
.btn {
    height: 38px; /* Standard button height */
    padding: 0.5rem 1rem; /* Standard padding */
    font-size: 0.875rem; /* Standard font size */
    line-height: 1.25;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
    font-weight: 500;
    letter-spacing: 0.025em;
    border-width: 1px;
}

/* Small buttons - consistent sizing */
.btn-sm {
    height: 32px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8125rem !important;
}

/* Large buttons - consistent sizing */
.btn-lg {
    height: 48px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
}

/* Icon buttons should maintain square aspect ratio */
.btn-icon {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
}

.btn-icon.btn-sm {
    width: 32px !important;
    height: 32px !important;
}

.btn-icon.btn-lg {
    width: 48px !important;
    height: 48px !important;
}

/* Navigation buttons standardization */
.navbar .btn {
    height: 36px;
    padding: 0.375rem 0.75rem;
}

/* Modal and card action buttons */
.modal-footer .btn,
.card-actions .btn,
.btn-list .btn {
    height: 38px;
    padding: 0.5rem 1rem;
}

/* Quick action buttons in dashboard */
.btn.w-100 {
    min-height: 38px;
    padding: 0.5rem 1rem;
}

/* Map control buttons */
.map-controls .btn,
.btn-map-control {
    height: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ===== GOOGLE MAPS INTEGRATION STYLES ===== */
/* Google Maps container standardization */
.google-maps-container {
    width: 100%;
    height: 250px;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

/* Map loading states */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    min-height: 200px;
    color: #6c757d;
}

/* Map error states */
.map-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 0.375rem;
    text-align: center;
}

/* Google Maps controls overlay */
.gm-style-cc {
    display: none !important;
}

.gm-style .gm-style-cc,
.gm-style .gm-style-mtc {
    display: none !important;
}

/* Custom map controls */
.custom-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.custom-map-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== RESPONSIVE BUTTON ADJUSTMENTS ===== */
@media (max-width: 768px) {
    /* Slightly smaller buttons on mobile */
    .btn:not(.btn-sm):not(.btn-lg) {
        height: 36px;
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Stack buttons vertically on mobile when needed */
    .btn-list {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-list .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile-specific map controls */
    .custom-map-controls {
        top: 5px;
        right: 5px;
    }
    
    .custom-map-controls .btn {
        width: 28px;
        height: 28px;
    }
}

/* ===== BUTTON GROUP SPACING ===== */
.btn-group .btn,
.btn-toolbar .btn {
    height: 38px; /* Maintain consistency in groups */
}

/* Ensure buttons in input groups match */
.input-group .btn {
    height: auto; /* Let input group handle height */
    border-radius: 0;
}

.input-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.input-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

/* ===== FLOATING ACTION BUTTONS ===== */
.btn-floating {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* ===== COLOR PALETTE ===== */
/* SMXI Brand Colors */
:root {
    --smxi-primary: #0066cc;
    --smxi-secondary: #6c757d;
    --smxi-success: #28a745;
    --smxi-info: #17a2b8;
    --smxi-warning: #ffc107;
    --smxi-danger: #dc3545;
    --smxi-light: #f8f9fa;
    --smxi-dark: #343a40;
    
    /* Map specific colors */
    --map-border: #dee2e6;
    --map-background: #f8f9fa;
    --map-control-bg: #ffffff;
    --map-control-border: #cccccc;
    --map-control-shadow: rgba(0,0,0,0.1);
}

/* Apply consistent theming */
.btn-primary {
    background-color: #325d7f;
    border-color: #325d7f;
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #2a4f6b;
    border-color: #2a4f6b;
    box-shadow: 0 2px 4px rgba(50, 93, 127, 0.25);
}

.btn-outline-primary {
    color: #325d7f;
    border-color: #325d7f;
    background-color: transparent;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: #325d7f;
    border-color: #325d7f;
    color: #fff;
}

.btn-outline-secondary {
    color: #667382;
    border-color: #bcc4ce;
    background-color: transparent;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #667382;
    border-color: #667382;
    color: #fff;
}

.btn-outline-danger {
    color: #d63384;
    border-color: #d63384;
    background-color: transparent;
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: #d63384;
    border-color: #d63384;
    color: #fff;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
/* Ensure buttons meet accessibility standards */
.btn:focus {
    box-shadow: 0 0 0 2px rgba(0,102,204,0.25);
    outline: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
}

/* ===== ANIMATION CONSISTENCY ===== */
/* Consistent hover and active states */
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: btn-loading-spin 1s linear infinite;
}

@keyframes btn-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PRINT STYLES ===== */
@media print {
    .btn {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    
    .btn-floating,
    .custom-map-controls {
        display: none !important;
    }
}

/* ===== IMPROVED TABLE STYLING ===== */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table thead th {
    background: var(--tblr-bg-surface);
    border-bottom: 2px solid var(--tblr-border-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--tblr-body-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--tblr-border-color-light);
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--tblr-hover-bg);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Striped tables */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--tblr-bg-surface-secondary);
}

.table-striped tbody tr:nth-of-type(odd):hover {
    background-color: var(--tblr-hover-bg);
}

/* Compact tables */
.table-sm thead th,
.table-sm tbody td {
    padding: 0.5rem;
    font-size: 0.8125rem;
}

/* Action buttons in tables */
.table .btn-group .btn,
.table .btn-list .btn {
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Status badges in tables */
.table .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Table loading states */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ===== ENHANCED SEARCH BOX STYLING ===== */
.navbar .input-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 0.375rem;
    overflow: hidden;
}

.navbar .input-group .form-control {
    border: none;
    background: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.navbar .input-group .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(72, 168, 132, 0.25);
    border-color: var(--tblr-primary);
}

.navbar .input-group .btn {
    border: none;
    background: var(--tblr-primary);
    color: white;
    padding: 0.5rem;
}

.navbar .input-group .btn:hover {
    background: var(--tblr-primary-darken);
}

/* Search results dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--tblr-border-color);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results-dropdown .dropdown-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--tblr-border-color-light);
}

.search-results-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* ===== GOOGLE MAPS ONLY STYLING ===== */
/* Enhanced Google Maps container */
.google-maps-container {
    width: 100%;
    height: 300px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Remove Google Maps controls and branding */
.gm-style-cc,
.gm-style .gm-style-cc,
.gm-style .gm-style-mtc,
.gm-style .gm-style-mtc div,
.gm-style .gm-style-cc span {
    display: none !important;
}

/* Custom map controls styling */
.custom-map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.custom-map-controls .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.custom-map-controls .btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Map action buttons */
.map-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.map-actions .btn {
    flex: 1;
    font-size: 0.8125rem;
}

/* Map loading and error states */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    min-height: 250px;
    color: #6c757d;
    flex-direction: column;
    gap: 0.75rem;
}

.map-error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Enhanced map info window styling */
.gm-style .gm-style-iw-c {
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

/* Location marker styling */
.map-marker {
    background: var(--tblr-primary);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== STATUS COLOR CODING SYSTEM ===== */
/* Status badges for various entities - Updated with paler, more readable colors */
.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid transparent;
}

/* Person Status Colors - Paler, more readable like dashboard */
.status-active { 
    background-color: #d1e7dd; 
    color: #0a3622; 
    border-color: #a3cfbb;
}
.status-inactive { 
    background-color: #e9ecef; 
    color: #495057; 
    border-color: #adb5bd;
}
.status-deceased { 
    background-color: #f8f9fa; 
    color: #212529; 
    border-color: #6c757d;
}
.status-gone-away { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-pending { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-suspended { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}

/* Membership Status Colors - Paler versions */
.status-current { 
    background-color: #d1e7dd; 
    color: #0a3622; 
    border-color: #a3cfbb;
}
.status-expired { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}
.status-grace { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-cancelled { 
    background-color: #e9ecef; 
    color: #495057; 
    border-color: #adb5bd;
}
.status-trial { 
    background-color: #cff4fc; 
    color: #055160; 
    border-color: #9eeaf9;
}

/* Location Status Colors - Paler versions */
.status-operational { 
    background-color: #d1e7dd; 
    color: #0a3622; 
    border-color: #a3cfbb;
}
.status-closed { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}
.status-maintenance { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-planned { 
    background-color: #e7d9f4; 
    color: #59359a; 
    border-color: #c89fec;
}

/* Digital Card Status Colors - Paler versions */
.status-issued { 
    background-color: #d1e7dd; 
    color: #0a3622; 
    border-color: #a3cfbb;
}
.status-revoked { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}
.status-lost { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-damaged { 
    background-color: #e9ecef; 
    color: #495057; 
    border-color: #adb5bd;
}

/* Payment Status Colors - Paler versions */
.status-paid { 
    background-color: #d1e7dd; 
    color: #0a3622; 
    border-color: #a3cfbb;
}
.status-unpaid { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}
.status-partial { 
    background-color: #fff3cd; 
    color: #664d03; 
    border-color: #ffda6a;
}
.status-refunded { 
    background-color: #e7d9f4; 
    color: #59359a; 
    border-color: #c89fec;
}
.status-overdue { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f1aeb5;
}

/* Icon buttons with text labels */
.btn-with-text {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

.btn-with-text .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Mobile responsive button text */
@media (max-width: 768px) {
    .btn-with-text {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    
    .btn-with-text .icon {
        width: 12px;
        height: 12px;
    }
    
    /* Hide text on very small screens, keep icons */
    @media (max-width: 576px) {
        .btn-with-text .btn-text {
            display: none;
        }
        
        .btn-with-text {
            padding: 0.25rem 0.5rem;
        }
    }
}

/* Badge variations - lighter, cleaner colors with darker text */
.bg-green-lt { background-color: #d1e7dd !important; color: #0f5132 !important; }
.bg-red-lt { background-color: #f8d7da !important; color: #b02a37 !important; }
.bg-orange-lt { background-color: #fff3cd !important; color: #997404 !important; }
.bg-gray-lt { background-color: #e9ecef !important; color: #6c757d !important; }
.bg-yellow-lt { background-color: #fff3cd !important; color: #997404 !important; }
.bg-purple-lt { background-color: #e7d9f4 !important; color: #6f42c1 !important; }
.bg-cyan-lt { background-color: #cff4fc !important; color: #055160 !important; }
.bg-dark-lt { background-color: #f8f9fa !important; color: #495057 !important; }
.bg-info-lt { background-color: #d1ecf1 !important; color: #0c5460 !important; }
.bg-success-lt { background-color: #d4edda !important; color: #155724 !important; }

/* Original darker badge colors for important items */
.bg-green { background-color: #3a8f6f !important; }
.bg-red { background-color: #d63384 !important; }
.bg-orange { background-color: #fd7e14 !important; }
.bg-gray { background-color: #6c757d !important; }
.bg-yellow { background-color: #ffc107 !important; color: #000 !important; }
.bg-purple { background-color: #6f42c1 !important; }
.bg-cyan { background-color: #0dcaf0 !important; color: #000 !important; }
.bg-dark { background-color: #343a40 !important; }

/* Status indicators with dots */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active { background-color: #3a8f6f; }
.status-dot.inactive { background-color: #dc3545; }
.status-dot.deceased { background-color: #343a40; }
.status-dot.gone-away { background-color: #6c757d; }
.status-dot.pending { background-color: #ffc107; }
.status-dot.suspended { background-color: #d63384; }
.status-dot.current { background-color: #3a8f6f; }
.status-dot.expired { background-color: #d63384; }
.status-dot.grace { background-color: #fd7e14; }
.status-dot.cancelled { background-color: #6c757d; }
.status-dot.trial { background-color: #0dcaf0; }

/* Status tooltips */
.status-tooltip {
    position: relative;
    cursor: help;
}

.status-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    font-size: 0.75rem;
    z-index: 1000;
    margin-bottom: 0.25rem;
}

.status-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #000;
    z-index: 1000;
    margin-bottom: -4px;
}

/* Status summary cards */
.status-summary {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.status-summary-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.status-summary-count {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.status-summary-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .status-legend-grid {
        grid-template-columns: 1fr;
    }
    
    .status-summary {
        flex-direction: column;
    }
    
    .status-badge {
        font-size: 0.6875rem;
        padding: 0.2rem 0.4rem;
    }
    
    .error-report-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ===== IMPROVED BUTTON AND TEXT STYLING ===== */
/* Clean, consistent button styling with lighter colors */
.btn {
    font-weight: 500;
    letter-spacing: 0.025em;
    border-width: 1px;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #325d7f;
    border-color: #325d7f;
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #2a4f6b;
    border-color: #2a4f6b;
    box-shadow: 0 2px 4px rgba(50, 93, 127, 0.25);
}

.btn-outline-primary {
    color: #325d7f;
    border-color: #325d7f;
    background-color: transparent;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: #325d7f;
    border-color: #325d7f;
    color: #fff;
}

.btn-outline-secondary {
    color: #667382;
    border-color: #bcc4ce;
    background-color: transparent;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #667382;
    border-color: #667382;
    color: #fff;
}

.btn-outline-danger {
    color: #d63384;
    border-color: #d63384;
    background-color: transparent;
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: #d63384;
    border-color: #d63384;
    color: #fff;
}

/* Lighter text colors */
.text-muted {
    color: #667382 !important;
}

.text-secondary {
    color: #667382 !important;
}

/* Improved form styling */
.form-control, .form-select {
    border-color: #bcc4ce;
    color: #495057;
}

.form-control:focus, .form-select:focus {
    border-color: #325d7f;
    box-shadow: 0 0 0 0.2rem rgba(50, 93, 127, 0.15);
}

/* ===== COMPACT PERSON TABLE STYLING ===== */
/* Person name cell - compact but readable */
.person-name-cell {
    line-height: 1.3;
}

.person-name-cell .fw-medium {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 2px;
}

.person-name-cell .small {
    font-size: 0.75rem;
    line-height: 1.2;
    margin-bottom: 1px;
}

/* Person address cell - small and muted */
.person-address-cell {
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 300px;
}

/* Compact table styling */
.table-compact {
    font-size: 0.875rem;
}

.table-compact td {
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.table-compact .btn-list {
    gap: 0.25rem;
}

.table-compact .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ===== NEAT SEARCH BOX STYLING ===== */
/* Compact global search styling */
#globalSearchInput {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem 0 0 0.375rem;
}

.input-group .btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

.input-group .btn svg {
    width: 16px;
    height: 16px;
}

/* ===== STATUS LEGEND IN SEPARATE PANEL ===== */
/* Status legend panel - separate from table */
.status-legend-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.8125rem;
    color: #6c757d;
}

.status-legend-panel-title {
    font-weight: 600;
    font-size: 0.75rem;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-legend-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.375rem;
}

.status-legend-panel-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    font-size: 0.75rem;
}

.status-legend-panel-item span:not(.badge) {
    color: #6c757d;
}

.status-legend-panel .badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

/* ===== DISCRETE STATUS LEGEND STYLING ===== */
/* Status legend - more discrete, positioned under tables */
.status-legend {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
    color: #6c757d;
}

.status-legend-title {
    font-weight: 600;
    font-size: 0.75rem;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.375rem;
}

.status-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    font-size: 0.75rem;
}

.status-legend-item span:not(.badge) {
    color: #6c757d;
}

/* Make status legend discrete and smaller */
.status-legend.discrete {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    margin: 0.5rem 0 0 0;
    border-top: 1px solid #e9ecef;
}

.status-legend.discrete .status-legend-title {
    font-size: 0.6875rem;
    margin-bottom: 0.375rem;
    opacity: 0.8;
}

.status-legend.discrete .status-legend-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.25rem;
}

.status-legend.discrete .status-legend-item {
    font-size: 0.6875rem;
    padding: 0.0625rem 0;
}

.status-legend.discrete .badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

/* ===== ERROR REPORTING SYSTEM ===== */
/* Error reporting box for developers */
.error-report-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    max-width: 400px;
}

.error-report-box {
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

.error-report-header {
    background: #e74c3c;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-report-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.error-report-copy {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.error-report-copy:hover {
    background: rgba(255, 255, 255, 0.1);
}

.error-report-body {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.error-report-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.error-details-text, .error-json-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: #495057;
}

.error-report-json {
    background: #f1f3f4;
    border: 1px solid #d1ecf1;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.error-report-json strong {
    color: #0c5460;
    font-size: 0.8125rem;
    display: block;
    margin-bottom: 0.5rem;
}

.error-message {
    font-weight: 500;
    color: #721c24;
    margin-bottom: 0.5rem;
}

.error-report-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.copy-hint {
    font-style: italic;
    color: #6c757d !important;
}

/* ============================================================================
   GLOBAL SEARCH IMPROVEMENTS
   ============================================================================ */

.search-results-dropdown {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white;
    z-index: 1050;
}

.search-results-dropdown .dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 1rem 0.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
}

.search-results-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease;
}

.search-results-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.search-results-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.search-results-dropdown .dropdown-divider {
    margin: 0;
    border-color: #dee2e6;
}

.search-results-dropdown .app-function-item {
    background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
}

.search-results-dropdown .search-result-item:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 100%);
}

.search-results-dropdown .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

.search-results-dropdown .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ============================================================================
   STATUS ICONS FOR TABLES
   ============================================================================ */

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: help;
    transition: all 0.15s ease;
}

.status-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Table-specific status icon styles */
.table .status-icon {
    margin: 0 auto;
}

td .status-icon {
    display: block;
    margin: 0 auto;
}

/* Ensure status icons are centered in table cells */
.table td:has(.status-icon) {
    text-align: center;
    vertical-align: middle;
}

.error-report-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Page loader styling for XHR errors */
.xhr-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xhr-loader-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.xhr-loader-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #206bc4;
}

.xhr-loader-text {
    color: #667382;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.xhr-loader-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.xhr-loader-progress-bar {
    height: 100%;
    background: #206bc4;
    width: 0%;
    animation: xhr-progress 2s ease-in-out infinite;
}

@keyframes xhr-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===== DASHBOARD CHART HEIGHT FIXES ===== */
/* Fix for charts growing too tall on dashboard */
.card canvas {
    max-height: 300px !important;
    height: auto !important;
}

/* Specific chart containers with fixed heights */
#dashPersonStatusChart {
    max-height: 250px !important;
    height: 250px !important;
}

#activityChart {
    max-height: 300px !important;
    height: 300px !important;
}

/* Chart container styling */
.chart-container {
    position: relative;
    height: 300px;
    max-height: 300px;
    overflow: hidden;
}

.chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: 300px !important;
}

/* Dashboard card body height constraints */
.card .card-body canvas {
    max-height: 350px !important;
}

/* Dashboard row and card consistency */
.row-deck .card {
    height: auto;
    min-height: unset;
}

.row-deck .card .card-body {
    overflow: hidden;
}

/* Mobile responsive chart heights */
@media (max-width: 768px) {
    .card canvas {
        max-height: 250px !important;
    }
    
    #dashPersonStatusChart {
        max-height: 200px !important;
        height: 200px !important;
    }
    
    #activityChart {
        max-height: 250px !important;
        height: 250px !important;
    }
    
    .chart-container {
        height: 250px;
        max-height: 250px;
    }
    
    .chart-container canvas {
        max-height: 250px !important;
    }
    
    .card .card-body canvas {
        max-height: 250px !important;
    }
} 