:root {
    --primary-color: #203a5d;
    --accent-color: #42c4dd;
    --highlighted-text-color: #0d70fd;
    
    /* Dynamic container width variable - updated by JavaScript */
    --dynamic-container-width: calc(100vw - 200px);
    
    /* Stripe-inspired design tokens */
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Status colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #06b6d4;
    
    /* UI Theme colors */
    --ui-primary-purple: #592783;
    --ui-primary-purple-hover: #4a1f6b;
    --ui-secondary-purple: #1e4164;
    --ui-purple-gradient: linear-gradient(135deg, #1e4164 0%, #592783 100%);
    
    /* Button colors */
    --ui-button-cyan: #42c4dd;
    --ui-button-cyan-hover: #3aa9c2;
    --ui-button-cyan-active: #2d8ca7;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Typography */
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Animation */
    --transition-fast: 150ms ease-out;
    --transition-normal: 250ms ease-out;
    --transition-slow: 350ms ease-out;
}

/* ==========================================================================
   MODERN COMPACT NAVIGATION BAR
   ========================================================================== */
.navbar.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.3rem 0; /* Reduced from 0.4rem */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    min-height: 50px; /* Ensure minimum height */
}

/* Navbar container with tighter margins */
.navbar .container-fluid {
    padding-left: 0.5rem; /* Reduced from var(--spacing-xs) */
    padding-right: 0.5rem;
}

/* Main brand styling - more compact */
.navbar-brand {
    color: var(--accent-color) !important;
    font-weight: var(--font-weight-semibold);
    font-size: 1.1rem; /* Reduced from 1.25rem */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reduced from var(--spacing-sm) */
    transition: all var(--transition-normal);
    padding-right: 1rem; /* Add some spacing from nav items */
}

.navbar-brand:hover {
    color: white !important;
    transform: translateY(-1px);
}

/* Navigation links styling - more compact */
.navbar-dark .navbar-nav {
    align-items: center;
    gap: 0.5rem; /* Reduced from var(--spacing-sm) */
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: var(--font-weight-medium);
    font-size: 0.9rem; /* Add smaller font size */
    padding: 0.4rem 0.8rem; /* Reduced from var(--spacing-xs) var(--spacing-lg) */
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    margin: 0 0.2rem; /* Reduced from var(--spacing-xs) */
    white-space: nowrap; /* Prevent text wrapping */
}

.navbar-dark .navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--accent-color) !important;
    transform: translateY(-1px);
}

.navbar-dark .navbar-nav .nav-link:hover::before {
    opacity: 1;
}

/* Active navbar link */
.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .show > .nav-link {
    color: var(--accent-color) !important;
    background: rgba(66, 196, 221, 0.15);
    font-weight: var(--font-weight-semibold);
}

.navbar-dark .navbar-nav .nav-link.active::before,
.navbar-dark .navbar-nav .show > .nav-link::before {
    opacity: 1;
    background: rgba(66, 196, 221, 0.2);
}

/* Dropdown styling */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color);
    color: white;
}

/* Navbar text and badges - more compact */
.navbar-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: var(--font-weight-medium);
    font-size: 0.85rem; /* Smaller font size */
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reduced from var(--spacing-sm) */
}

.navbar .badge {
    font-size: 0.7rem; /* Reduced from 0.75rem */
    padding: 0.15rem 0.4rem; /* Reduced padding */
    border-radius: var(--radius-md);
}

/* Logout button styling */
.navbar .btn-light {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.navbar .btn-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
}

/* Mobile responsiveness - compact design */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(32, 58, 93, 0.95);
        backdrop-filter: blur(20px);
        border-radius: var(--radius-lg);
        margin-top: 0.5rem; /* Reduced from var(--spacing-md) */
        padding: 1rem; /* Reduced from var(--spacing-lg) */
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-dark .navbar-nav .nav-link {
        margin: 0.2rem 0; /* Reduced from var(--spacing-xs) */
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1rem; /* Even smaller on mobile */
    }
}

/* Additional compact responsive breakpoints */
@media (max-width: 1200px) {
    .navbar-brand {
        font-size: 1rem; /* Smaller for medium screens */
    }
    
    .navbar-dark .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .user-dropdown-button {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.6rem !important;
    }
}

@media (max-width: 768px) {
    .navbar.bg-primary {
        padding: 0.2rem 0; /* Even more compact on mobile */
    }
    
    .navbar .container-fluid {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }
    
    .navbar-logo {
        height: 35px; /* Smaller logo on tablets */
    }
}

/* Custom button matching navbar color */
.btn-navy {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-navy:hover, 
.btn-navy:focus, 
.btn-navy:active {
    background-color: #17294a; /* Slightly darker shade for hover */
    border-color: #17294a;
    color: var(--accent-color);
}

/* Outline version */
.btn-outline-navy {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-navy {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-outline-navy:hover {
    background-color: var(--primary-color);
    color: white;
}
.btn-outline-navy:active {
    background-color: var(--primary-color);
    color: white;
}

.bg-navy {
    background-color: var(--primary-color);
    color: white;
}

/* Logo styling - more compact */
.navbar-logo {
    height: 45px; /* Reduced from 60px */
    width: auto;
}

/* For smaller screens */
@media (max-width: 576px) {
    .navbar-logo {
        height: 32px; /* Increased from 24px for better visibility */
    }
}

.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.text-navy {
    color: var(--highlighted-text-color) !important;
}

/* Override Bootstrap's btn-primary with our navy color */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Filter button styling */
.filter-button.text-primary {
    color: var(--primary-color) !important;
}

/* Toast header styling */
.toast-header.bg-navy {
    background-color: var(--primary-color) !important;
}

/* UI Cyan button variants (for all buttons) */
.btn-ui-cyan {
    background-color: var(--ui-button-cyan);
    border-color: var(--ui-button-cyan);
    color: black;
    box-shadow: 0 2px 4px rgba(66, 196, 221, 0.2);
    transition: all 0.3s ease;
}

.btn-ui-cyan:hover,
.btn-ui-cyan:focus,
.btn-ui-cyan:active {
    background-color: var(--ui-button-cyan-hover);
    border-color: var(--ui-button-cyan-hover);
    color: black;
    box-shadow: 0 4px 8px rgba(58, 169, 194, 0.3);
    transform: translateY(-1px);
}

.btn-outline-ui-cyan {
    color: var(--ui-button-cyan);
    border-color: var(--ui-button-cyan);
    background-color: transparent;
}

.btn-outline-ui-cyan:hover,
.btn-outline-ui-cyan:focus,
.btn-outline-ui-cyan:active {
    background-color: var(--ui-button-cyan);
    border-color: var(--ui-button-cyan);
    color: black;
}

/* UI Purple button variants (for modal headers only) */
.btn-ui-purple {
    background: var(--ui-purple-gradient);
    border-color: var(--ui-primary-purple);
    color: white;
    box-shadow: 0 2px 4px rgba(89, 39, 131, 0.2);
    transition: all 0.3s ease;
}

.btn-ui-purple:hover,
.btn-ui-purple:focus,
.btn-ui-purple:active {
    background: linear-gradient(135deg, var(--ui-secondary-purple) 0%, var(--ui-primary-purple-hover) 100%);
    border-color: var(--ui-primary-purple-hover);
    color: white;
    box-shadow: 0 4px 8px rgba(74, 31, 107, 0.3);
    transform: translateY(-1px);
}

/* UI Purple background variants */
.bg-ui-purple {
    background: var(--ui-purple-gradient) !important;
    color: white !important;
}

.bg-ui-purple-solid {
    background-color: var(--ui-primary-purple) !important;
    color: white !important;
}

/* Legacy purple styles (keep for existing usage) */
.btn-purple {
    background: linear-gradient(135deg, #805ad5 0%, #9f7aea 100%);
    border-color: #805ad5;
    color: white;
    box-shadow: 0 2px 4px rgba(128, 90, 213, 0.2);
    transition: all 0.3s ease;
}

.btn-purple:hover,
.btn-purple:focus,
.btn-purple:active {
    background: linear-gradient(135deg, #6b46c1 0%, #805ad5 100%);
    border-color: #6b46c1;
    color: white;
    box-shadow: 0 4px 8px rgba(107, 70, 193, 0.3);
    transform: translateY(-1px);
}

.btn-outline-purple {
    color: #805ad5;
    border-color: #805ad5;
    background-color: transparent;
}

.btn-outline-purple:hover,
.btn-outline-purple:focus,
.btn-outline-purple:active {
    background-color: #805ad5;
    border-color: #805ad5;
    color: white;
}

/* Purple badge variant */
.bg-purple {
    background-color: #805ad5 !important;
    color: white !important;
}

.badge.bg-orange {
    background-color: #ff6b35 !important;
    color: white !important;
}

/* ==========================================================================
   TREASURY DASHBOARD STYLES - STRIPE-INSPIRED DESIGN
   ========================================================================== */

/* General body and layout improvements */
body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    padding-top: 55px; /* Reduced from 65px for compact navbar */
}

/* Treasury Dashboard Container */
.treasury-dashboard {
    padding: var(--spacing-xl) 0;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-3xl) var(--spacing-xl);
    margin-bottom: var(--spacing-3xl);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-subtitle {
    display: block;
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-sm);
}

.hero-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
}

/* Hero Status */
.hero-status {
    margin-top: var(--spacing-xl);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.status-dot.status-success {
    background-color: var(--success-color);
}

.status-dot.status-warning {
    background-color: var(--warning-color);
}

.status-dot.status-success::before,
.status-dot.status-warning::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.status-success::before {
    background-color: var(--success-color);
}

.status-dot.status-warning::before {
    background-color: var(--warning-color);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.status-text {
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.95);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    z-index: 2;
}

.dashboard-preview {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.preview-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.preview-dots span:first-child {
    background: #ff5f57;
}

.preview-dots span:nth-child(2) {
    background: #ffbd2e;
}

.preview-dots span:last-child {
    background: #28ca42;
}

.preview-chart {
    margin-bottom: var(--spacing-lg);
}

.chart-svg {
    width: 100%;
    height: 60px;
}

.preview-stats {
    display: flex;
    justify-content: space-between;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: var(--font-weight-bold);
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   SERVICES SECTION
   ========================================================================== */
.services-section {
    margin-bottom: var(--spacing-3xl);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-title {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-xl);
}

/* Service Cards */
.service-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-color);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.service-card.payment-scheduling .service-icon {
    background: linear-gradient(135deg, #6b46c1, #553c9a);
    color: white;
}

.service-card.cxp-authorization .service-icon {
    background: linear-gradient(135deg, #203a5d, #1a2e47);
    color: white;
}

.service-card.cp-generation .service-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.service-card.balance-update .service-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-content {
    margin-bottom: var(--spacing-xl);
}

.service-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.service-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.service-features li:last-child {
    margin-bottom: 0;
}

.service-features li i {
    color: var(--success-color);
    font-size: 0.875rem;
    width: 16px;
}

.service-action {
    margin-top: auto;
}

.btn-service {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-service::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-service:hover::before {
    left: 100%;
}

.btn-service i {
    transition: transform var(--transition-normal);
}

.btn-service:hover i {
    transform: translateX(4px);
}

/* ==========================================================================
   QUICK ACTIONS SECTION
   ========================================================================== */
.quick-actions-section {
    margin-bottom: var(--spacing-3xl);
}

.quick-actions-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
}

.quick-actions-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    background: var(--surface-color);
}

.quick-action-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
    color: var(--text-primary);
    text-decoration: none;
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.quick-action-content {
    display: flex;
    flex-direction: column;
}

.quick-action-label {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.quick-action-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* System Status Card */
.system-status-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    height: 100%;
}

.status-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.status-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.status-indicator-small {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator-small.status-success {
    background-color: var(--success-color);
}

.status-indicator-small.status-warning {
    background-color: var(--warning-color);
}

.status-indicator-small.status-error {
    background-color: var(--error-color);
}

.status-item span:nth-child(2) {
    flex: 1;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.status-value {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
}

/* ==========================================================================
   MODAL IMPROVEMENTS
   ========================================================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--spacing-xl);
}

.modal-body {
    padding: var(--spacing-xl);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: var(--spacing-xl);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Loading animation for buttons */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS STYLING
   ========================================================================== */
.toast {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.toast-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.toast-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   HELP MODAL SPECIFIC STYLES
   ========================================================================== */
.help-content {
    padding: var(--spacing-md) 0;
}

.help-section {
    margin-bottom: var(--spacing-xl);
}

.help-section-title {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
}

.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-list li::before {
    content: '•';
    position: absolute;
    left: var(--spacing-sm);
    color: var(--accent-color);
    font-weight: bold;
}

.help-footer {
    background: var(--background-color);
    margin: 0 calc(-1 * var(--spacing-xl));
    padding: var(--spacing-lg) var(--spacing-xl) 0;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ==========================================================================
   ENHANCED BUTTON STYLES - CYAN BY DEFAULT
   ========================================================================== */
.btn {
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Make all standard buttons cyan by default with black text */
.btn-primary,
.btn-success {
    background-color: var(--ui-button-cyan) !important;
    border-color: var(--ui-button-cyan) !important;
    color: black !important;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-success:hover:not(:disabled),
.btn-success:focus:not(:disabled),
.btn-success:active:not(:disabled) {
    background-color: var(--ui-button-cyan-hover) !important;
    border-color: var(--ui-button-cyan-hover) !important;
    color: black !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Make outline buttons cyan too */
.btn-outline-primary,
.btn-outline-success {
    color: var(--ui-button-cyan) !important;
    border-color: var(--ui-button-cyan) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover:not(:disabled),
.btn-outline-primary:focus:not(:disabled),
.btn-outline-primary:active:not(:disabled),
.btn-outline-success:hover:not(:disabled),
.btn-outline-success:focus:not(:disabled),
.btn-outline-success:active:not(:disabled) {
    background-color: var(--ui-button-cyan) !important;
    border-color: var(--ui-button-cyan) !important;
    color: black !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* These styles are now handled by the unified cyan button styles above */

.btn-secondary {
    background: var(--border-color);
    border: none;
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--text-muted);
    color: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   DYNAMIC CONTAINER WIDTH CALCULATION
   ========================================================================== */
/* Default responsive container width */
.container-fluid, .container {
    max-width: var(--dynamic-container-width);
    margin-left: auto;
    margin-right: auto;
}

/* Override navbar container to span full width */
.navbar .container-fluid {
    max-width: none !important;
    margin-left: 0;
    margin-right: 0;
}

/* Responsive fallbacks for when JavaScript is disabled */
@media (max-width: 768px) {
    .container-fluid, .container {
        max-width: calc(100vw - 40px); /* Fallback: 20px margin each side on mobile */
    }
}

@media (max-width: 480px) {
    .container-fluid, .container {
        max-width: calc(100vw - 20px); /* Fallback: 10px margin each side on very small screens */
    }
}

/* ============================================
   RESULT TABLE COMPONENTS - STANDARDIZED
   ============================================ */

/* Result Table Container - Scrollable with fixed height */
.result-table-container {
    /* max-height: 500px; */
    min-height: 300px;
    overflow: auto; /* Both horizontal and vertical scrolling */
    position: relative;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: var(--radius-md, 0.5rem);
    background-color: var(--surface-color, #ffffff);
    box-shadow: var(--shadow-sm, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1));
}

/* Base Result Table */
.result-table {
    margin-bottom: 0 !important; /* Remove default Bootstrap margin */
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: max-content; /* Ensure table doesn't shrink smaller than content */
}

/* Sticky Table Headers */
.result-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.result-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--border-color, #dee2e6);
    border-right: 1px solid var(--border-color-light, #f1f5f9); /* Vertical borders */
    border-top: none;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #1e293b);
    padding: 12px 16px;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);    position: relative; /* For resize handle */
    overflow: hidden;
    user-select: none; /* Prevent text selection during resize */
}

/* Column resize handle */
.result-table thead th::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background-color: transparent;
    cursor: col-resize;
    border-right: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.result-table thead th:hover::after {
    border-right-color: var(--primary-color, #203a5d);
}

/* Clean table body styling - NO STRIPES */
.result-table tbody tr {
    background-color: transparent;
    border: none;
    transition: background-color 0.15s ease;
}

.result-table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.result-table tbody td {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color-light, #f1f5f9);
    border-right: 1px solid var(--border-color-light, #f1f5f9); /* Vertical borders */
    border-bottom: none;    vertical-align: middle;
    position: relative;
    
    /* Text truncation with ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover tooltip for truncated text */
.result-table tbody td[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: normal;
    max-width: 300px;
    word-wrap: break-word;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

/* Tooltip arrow */
.result-table tbody td[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Enhanced column resizing */
.result-table thead th {
    user-select: none; /* Prevent text selection during resize */
}

.result-table.resizing {
    cursor: col-resize;
}

.result-table.resizing * {
    cursor: col-resize !important;
}

/* Improved border visibility */
.result-table thead th:last-child,
.result-table tbody td:last-child {
    border-right: none; /* Remove border from last column */
}

.result-table thead th:first-child,
.result-table tbody td:first-child {
    border-left: none; /* Remove border from first column */
}

/* Text selection and truncation improvements */
.result-table tbody td {
    text-align: left;
    line-height: 1.4;
}

.result-table tbody td.number {
    text-align: right; /* Right-align numbers */
}

.result-table tbody td.center {
    text-align: center; /* Center-align specific content */
}

/* Enhanced tooltip positioning for edge cases */
.result-table tbody td[title]:hover::before {
    /* Adjust tooltip position for right edge columns */
    margin-bottom: 8px;
}

.result-table-container:first-child .result-table tbody td[title]:hover::before {
    left: 25%; /* Adjust for leftmost columns */
}

.result-table tbody td:last-child[title]:hover::before {
    left: 25%; /* Adjust for rightmost columns */
    transform: translateX(-25%);
}

.result-table tbody td:last-child[title]:hover::after {
    left: 25%;
    transform: translateX(-25%) translateY(2px);
}

/* Selected row styling */
.result-table tbody tr.row-selected {
    background-color: #d1e7dd !important;
    border-left: 4px solid var(--success-color, #10b981);
}

/* Table specific classes for special rows */
.result-table .table-subtotal {
    background-color: #e3f2fd !important;
    font-weight: var(--font-weight-semibold, 600);
    border-top: 2px solid var(--info-color, #06b6d4);
}

.result-table .table-spacer {
    background-color: #f5f5f5 !important;
    height: 20px;
}

.result-table .table-spacer td {
    padding: 0;
    border: none;
}

/* Loading State */
.result-table-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.result-table-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color, #203a5d);
}

/* Empty State */
.result-table-empty td {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted, #94a3b8);
}

.result-table-empty .fa-table {
    opacity: 0.3;
}

/* Filter Integration */
.filter-button {
    background: none;
    border: none;
    color: var(--text-secondary, #64748b);
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: var(--radius-sm, 0.375rem);
    transition: all 0.15s ease;
}

.filter-button:hover {
    background-color: var(--border-color-light, #f1f5f9);
    color: var(--text-primary, #1e293b);
}

.filter-menu {
    min-width: 280px;
    max-width: 320px;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1));
}

.filter-values {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color-light, #f1f5f9);
    border-radius: var(--radius-sm, 0.375rem);
    background-color: var(--background-color, #f8fafc);
}

/* Responsive Table Behavior */
@media (max-width: 768px) {
    .result-table-container {
        max-height: 400px;
        min-height: 250px;
    }
      .result-table thead th,
    .result-table tbody td {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    
    /* Disable column resizing on mobile */
    .result-table thead th::after {
        display: none;
    }
    
    .result-table thead th {
        cursor: default;
        resize: none;
    }
    
    /* Adjust tooltip for mobile */
    .result-table tbody td[title]:hover::before {
        max-width: 200px;
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    /* Allow horizontal scrolling on mobile */
    .result-table {
        min-width: 600px; /* Ensure minimum width for proper scrolling */
    }
}

@media (max-width: 480px) {
    .result-table-container {
        max-height: 350px;
        min-height: 200px;
    }
      .result-table thead th,
    .result-table tbody td {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* Simplified tooltips for very small screens */
    .result-table tbody td[title]:hover::before {
        max-width: 150px;
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    
    .result-table tbody td[title]:hover::after {
        border-width: 4px;
    }
    
    .result-table {
        min-width: 500px;
    }
}

/* Print styles for tables */
@media print {
    .result-table-container {
        max-height: none;
        min-height: auto;
        overflow: visible;
        border: 1px solid #000;
    }
    
    .result-table thead th::after {
        display: none; /* Hide resize handles in print */
    }
    
    .result-table tbody td[title]:hover::before,
    .result-table tbody td[title]:hover::after {
        display: none; /* Hide tooltips in print */
    }
    
    .result-table {
        font-size: 0.8rem;
    }
    
    .result-table thead th,
    .result-table tbody td {
        padding: 4px 6px;
        border: 1px solid #000 !important;
    }
}

/* ==========================================================================
   MODERN USER DROPDOWN BUTTON STYLING
   ========================================================================== */
.user-dropdown-button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--radius-lg) !important;
    color: white !important;
    font-weight: var(--font-weight-medium) !important;
    font-size: 0.85rem !important; /* Smaller font size */
    padding: 0.4rem 0.8rem !important; /* Reduced from var(--spacing-sm) var(--spacing-lg) */
    transition: all var(--transition-normal) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    white-space: nowrap; /* Prevent text wrapping */
}

.user-dropdown-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.user-dropdown-button:hover,
.user-dropdown-button:focus,
.user-dropdown-button.active {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-dropdown-button:hover::before {
    left: 100%;
}

.user-dropdown-button .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-left: var(--spacing-sm);
    transition: all var(--transition-normal);
}

.user-dropdown-button:hover .badge {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Admin badge specific styling */
.user-dropdown-button .badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: rgba(220, 38, 38, 0.3);
    color: white;
}

/* Gerente badge specific styling */
.user-dropdown-button .badge.bg-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    border-color: rgba(8, 145, 178, 0.3);
    color: white;
}

/* User dropdown icon styling */
.user-dropdown-button .fas.fa-user {
    margin-right: var(--spacing-sm);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Enhanced dropdown arrow */
.user-dropdown-button::after {
    margin-left: var(--spacing-sm) !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Responsive adjustments for user dropdown */
@media (max-width: 991.98px) {
    .user-dropdown-button {
        background: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        margin: var(--spacing-xs) 0;
    }
}