/* Main Color Palette */
:root {
    --primary-color: #0089B2;
    --primary-light: #00A5D6;
    --primary-dark: #006D8F;
    --glass-bg: rgba(0, 137, 178, 0.1);
    --glass-border: rgba(0, 137, 178, 0.2);
    --text-primary: #0089B2;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-dark) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* GLOBAL TEXT COLOR RULES */
/* Default body text = white on blue gradient */
body {
    color: white;
}

/* Dashboard cards and glass containers = BLUE text */
/* EXCLUDE .program-card and all its children from these rules */
.dashboard-card:not(.program-card), .dashboard-card:not(.program-card) *,
.glass-card:not(.program-card), .glass-card:not(.program-card) *,
.glass-sidebar, .glass-sidebar *,
.card:not(.program-card), .card:not(.program-card) *:not(.bg-primary):not(.bg-primary *),
.modal-content:not(.program-card *), .modal-content:not(.program-card *) *,
.modal-title:not(.program-card *), .modal-header:not(.program-card *),
.alert:not(.program-card *), .alert:not(.program-card *) *,
.bg-white:not(.program-card *), .bg-white:not(.program-card *) * {
    color: #0089b2 !important;
}

/* Sidebar text = BLUE (original styling) */
.glass-sidebar {
    /* Remove global white text override */
}

/* ESPA Program Cards = WHITE text (override global blue rules) */
.program-card, .program-card *,
.program-card h1, .program-card h2, .program-card h3, .program-card h4, .program-card h5, .program-card h6,
.program-card p, .program-card span, .program-card div, .program-card small,
.program-card .program-title, .program-card .program-description,
.program-card .badge, .program-card .badge *,
.program-card .benefit-tag, .program-card .benefit-tag *,
.program-card .btn-check-eligibility, .program-card .btn-learn-more,
.program-card .btn-check-eligibility *, .program-card .btn-learn-more *,
.program-card .program-icon, .program-card .program-icon *,
.program-card .program-title-section, .program-card .program-title-section *,
.program-card .program-benefits, .program-card .program-benefits *,
.program-card .program-actions, .program-card .program-actions * {
    color: white !important;
}

/* ULTRA HIGH SPECIFICITY for ESPA cards to override everything including Bootstrap */
body .container .program-card *,
body .program-card *,
.program-card-header *,
.program-title-section *,
.program-benefits *,
.program-actions *,
.program-title,
.program-description,
.benefit-tag,
.benefit-tag *,
.benefit-tag span,
.btn-check-eligibility,
.btn-check-eligibility *,
.btn-learn-more,
.btn-learn-more * {
    color: white !important;
}

/* Override Bootstrap badge and button colors inside program cards */
.program-card .badge,
.program-card .badge.bg-success,
.program-card .badge.bg-primary,
.program-card .badge.bg-warning,
.program-card .badge.bg-secondary,
.program-card .badge.bg-info,
.program-card .badge.bg-danger,
.program-card .badge.bg-dark,
.program-card button,
.program-card .btn-check-eligibility,
.program-card .btn-learn-more {
    color: white !important;
}

/* ESPA Program Cards ONLY - force white text with higher specificity than global blue rule */
.main-content:has(#programsContainer) .program-card,
.main-content:has(#programsContainer) .program-card *,
.main-content:has(#programsContainer) .program-card *:not(.bg-primary):not(.bg-primary *) {
    color: white !important;
}

/* Specific white text areas (forms, tables on blue background) */
.main-content > h1, .main-content > h2, .main-content > h3,
.main-content > p:not(.dashboard-card p):not(.glass-card p):not(.card p) {
    color: white !important;
}

/* Buttons should keep their intended colors */
.btn, .btn *, 
button, button *,
.btn-check-eligibility, .btn-check-eligibility *,
.btn-learn-more, .btn-learn-more *,
.btn-primary, .btn-primary *,
.btn-success, .btn-success *,
.btn-danger, .btn-danger *,
.badge, .badge * {
    color: white !important;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Glass Sidebar - Enhanced Glassmorphism */
.glass-sidebar {
    width: 300px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.glass-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: -1;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    width: 250px;
    height: 150px;
    object-fit: contain;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.2));
}

.sidebar-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.user-details h6 {
    font-weight: 600;
}

/* Navigation - Enhanced Glassmorphism */
.nav-pills .nav-link {
    color: var(--primary-color);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 137, 178, 0.15);
    backdrop-filter: blur(15px);
}

.nav-pills .nav-link.active {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(0, 137, 178, 0.2);
    font-weight: 600;
    backdrop-filter: blur(20px);
}

.nav-pills .nav-link i {
    font-size: 1.1rem;
}

/* Sidebar Heading for Accountant Tools */
.sidebar-heading {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 137, 178, 0.2);
}

/* Social Media Icons - Premium Design */
.social-media-section {
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(0, 137, 178, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0 0.5rem;
}

.social-section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.social-heading {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-heading i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.social-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 0 auto;
    border-radius: 2px;
}

.social-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    max-width: 100%;
}

.social-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 137, 178, 0.2);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow: hidden;
    min-height: 70px;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon i {
    font-size: 1.4rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 
        0 12px 30px rgba(0, 137, 178, 0.3),
        0 6px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(0, 137, 178, 0.4);
}

.social-icon:hover i {
    transform: scale(1.3);
}

/* Brand-specific hover effects */
.social-icon.instagram:hover {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(225, 48, 108, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.tiktok:hover {
    background: linear-gradient(135deg, #000000 0%, #ff0050 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(255, 0, 80, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.3);
}

.social-icon.spotify:hover {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(29, 185, 84, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.facebook:hover {
    background: linear-gradient(135deg, #1877F2 0%, #42A5F5 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(24, 119, 242, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.youtube:hover {
    background: linear-gradient(135deg, #FF0000 0%, #ff4444 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(255, 0, 0, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.email:hover {
    background: linear-gradient(135deg, #EA4335 0%, #ff6b6b 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(234, 67, 53, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.phone:hover {
    background: linear-gradient(135deg, #25D366 0%, #4ade80 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(37, 211, 102, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.location:hover {
    background: linear-gradient(135deg, #EA4335 0%, #ff6b6b 100%);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 12px 30px rgba(234, 67, 53, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.full-width {
    margin-left: 0;
}

/* Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    pointer-events: none;
    z-index: -1;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 137, 178, 0.1);
    border-color: rgba(0, 137, 178, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
}

.glass-card:hover::before {
    background: rgba(255, 255, 255, 0.15);
}

.glass-card h3, .glass-card h4, .glass-card h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.glass-card p {
    color: var(--primary-color);
    line-height: 1.6;
    opacity: 0.9;
}

.glass-card .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.glass-card .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Invoice Cards */
.invoice-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.invoice-card:hover {
    transform: translateY(-3px);
}

.invoice-stats-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 137, 178, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.invoice-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    pointer-events: none;
    z-index: -1;
}

.invoice-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 137, 178, 0.15);
    border-color: rgba(0, 137, 178, 0.3);
}

.invoice-stats-card:hover::before {
    background: rgba(255, 255, 255, 0.15);
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 137, 178, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.dashboard-card:hover::before {
    background: rgba(255, 255, 255, 0.15);
}

.dashboard-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 137, 178, 0.15);
    border-color: rgba(0, 137, 178, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
}

.dashboard-card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.dashboard-card h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.dashboard-card p {
    color: var(--primary-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Mobile Styles */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 137, 178, 0.2);
    z-index: 999;
    align-items: center;
    justify-content: space-between;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 0;
}

.mobile-topbar .btn-link {
    font-size: 1.8rem;
    padding: 0.5rem;
    color: #0089b2 !important;
    text-decoration: none;
}

.mobile-topbar .btn-link:hover {
    color: #006a8a !important;
}

/* Specific rule for mobile menu button */
#sidebarToggleMobile, #sidebarToggleMobile * {
    color: #0089b2 !important;
}

#sidebarToggleMobile:hover, #sidebarToggleMobile:hover * {
    color: #006a8a !important;
}

.mobile-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-topbar h5 {
    font-size: 1.1rem;
    color: #0089b2;
    margin: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* do not block clicks unless shown */
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Authentication Forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 30%, var(--primary-dark) 70%, var(--primary-color) 100%);
    opacity: 0.9;
    z-index: -1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.auth-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}


.form-control {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(73, 80, 87, 0.2));
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 15px;
    padding: 1rem 1.25rem;
    color: white;
    margin-bottom: 1rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.form-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 15px 15px 0 0;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.form-control:focus {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.25), rgba(73, 80, 87, 0.3));
    border-color: rgba(108, 117, 125, 0.5);
    box-shadow: 
        0 0 0 0.2rem rgba(108, 117, 125, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
}

/* Readonly/prefilled fields styling */
.form-control[readonly],
.form-control.bg-light {
    background: linear-gradient(135deg, rgba(0, 137, 178, 0.15), rgba(0, 137, 178, 0.25)) !important;
    border: 1px solid rgba(0, 137, 178, 0.4) !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) !important;
}

.form-control[readonly]:focus,
.form-control.bg-light:focus {
    background: linear-gradient(135deg, rgba(0, 137, 178, 0.25), rgba(0, 137, 178, 0.35)) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 
        0 0 0 0.2rem rgba(0, 137, 178, 0.25),
        0 8px 25px rgba(0, 137, 178, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* Ensure placeholder text is also blue in readonly fields */
.form-control[readonly]::placeholder,
.form-control.bg-light::placeholder {
    color: rgba(0, 137, 178, 0.7) !important;
    font-weight: 500 !important;
}

/* Small text and help text styling */
.text-muted {
    color: rgba(0, 137, 178, 0.8) !important;
}

.form-text,
.help-text {
    color: rgba(0, 137, 178, 0.8) !important;
}

.form-label {
    color: white;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.btn-auth {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.8), rgba(73, 80, 87, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 15px;
    padding: 1rem 2rem;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-auth:hover::before {
    left: 100%;
}

.btn-auth:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.9), rgba(73, 80, 87, 1));
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-3px);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-auth:active {
    transform: translateY(-1px);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-check-input {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(73, 80, 87, 0.2));
    border: 1px solid rgba(108, 117, 125, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-check-input:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-color);
    box-shadow: 
        0 2px 8px rgba(0, 137, 178, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.form-check-input:focus {
    border-color: rgba(108, 117, 125, 0.6);
    box-shadow: 
        0 0 0 0.2rem rgba(108, 117, 125, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-check-label {
    color: white;
    font-size: 0.9rem;
}

.language-selector {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
}

.language-selector-inline {
    display: inline-block;
    margin-bottom: 1rem;
}

.language-selector-inline .form-select {
    min-width: 160px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2), rgba(73, 80, 87, 0.25));
    border: 1px solid rgba(108, 117, 125, 0.4);
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.language-selector-inline .form-select:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.3), rgba(73, 80, 87, 0.35));
    border-color: rgba(108, 117, 125, 0.5);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.language-selector-inline .form-select:focus {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.25), rgba(73, 80, 87, 0.3));
    border-color: rgba(108, 117, 125, 0.6);
    box-shadow: 
        0 0 0 0.2rem rgba(108, 117, 125, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: white;
}

.auth-logo {
    animation: float 3s ease-in-out infinite;
    max-width: 100%;
    display: inline-block;
}

.logo-image {
    width: auto;
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ALL Dashboard Logos - Standardized Size 250px × 150px */
.logo-image.invoice-logo,
.logo-image.charts-logo,
.logo-image.espa-logo,
.logo-image.syntaxi-logo,
.logo-image.ofeiles-logo,
.logo-image.pension-logo,
.logo-image.proslipsi-logo {
    max-width: 250px !important;
    max-height: 150px !important;
    min-width: 250px !important;
    width: 250px !important;
    height: auto !important;
    background: rgba(255, 255, 255, 0.75) !important;
    opacity: 1 !important;
    border-radius: 16px !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.logo-image.invoice-logo:hover,
.logo-image.charts-logo:hover,
.logo-image.espa-logo:hover,
.logo-image.syntaxi-logo:hover,
.logo-image.ofeiles-logo:hover,
.logo-image.pension-logo:hover,
.logo-image.proslipsi-logo:hover {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.05) !important;
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.4));
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.auth-card h2 {
    color: white;
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.form-select {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(73, 80, 87, 0.2));
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 12px;
    color: white;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-select:focus {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.25), rgba(73, 80, 87, 0.3));
    border-color: rgba(108, 117, 125, 0.5);
    box-shadow: 
        0 0 0 0.2rem rgba(108, 117, 125, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: white;
}

.form-select option {
    background: var(--primary-dark);
    color: white;
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .glass-sidebar {
        transform: translateX(-100%);
    }
    
    .glass-sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .mobile-topbar {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .language-selector {
        position: static;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .logo-image {
        padding: 6px;
    }
    
    /* Social icons responsive adjustments */
    .social-media-section {
        padding: 1rem 0.5rem;
        margin: 0 0.25rem;
    }
    
    .social-icons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .social-icon {
        min-height: 60px;
        padding: 0.6rem 0.3rem;
    }
    
    .social-icon i {
        font-size: 1.2rem;
    }
    
    .social-heading {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .dashboard-card-icon {
        font-size: 2.5rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .invoice-stats-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .invoice-card {
        margin-bottom: 1rem;
    }
    
    /* Mobile table responsive */
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    .table th, .table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Hide less important columns on mobile */
    @media (max-width: 768px) {
        .table .d-none-mobile {
            display: none !important;
        }
        
        .btn-group-sm .btn {
            padding: 0.25rem 0.5rem;
            font-size: 0.75rem;
        }
        
        .display-6 {
            font-size: 1.5rem;
        }
    }
    
    .logo-image {
        padding: 5px;
    }
}

/* Validation Hints */
.validation-hint {
    margin-top: 0.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.validation-hint.show {
    opacity: 1;
    transform: translateY(0);
}

.password-requirements {
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.requirement-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.requirement.valid {
    color: #00ff88;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.requirement.valid .requirement-icon {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.requirement.invalid {
    color: #ff4757;
    font-weight: 600;
}

.requirement.invalid .requirement-icon {
    color: #ff4757;
}

.requirement-icon {
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.requirement.valid .requirement-icon:before {
    content: "\F26A"; /* bi-check-circle-fill */
}

.requirement.invalid .requirement-icon:before {
    content: "\F659"; /* bi-x-circle-fill */
}

/* Form validation states */
.form-control.is-valid {
    border-color: rgba(40, 167, 69, 0.6);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(40, 167, 69, 0.1));
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(40, 167, 69, 0.2);
}

.form-control.is-invalid {
    border-color: rgba(220, 53, 69, 0.6);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(220, 53, 69, 0.1));
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(220, 53, 69, 0.2);
}

.form-control:focus.is-valid {
    border-color: rgba(40, 167, 69, 0.8);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2), rgba(40, 167, 69, 0.15));
    box-shadow: 
        0 0 0 0.2rem rgba(40, 167, 69, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(40, 167, 69, 0.25);
}

.form-control:focus.is-invalid {
    border-color: rgba(220, 53, 69, 0.8);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2), rgba(220, 53, 69, 0.15));
    box-shadow: 
        0 0 0 0.2rem rgba(220, 53, 69, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(220, 53, 69, 0.25);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================================================
   COMPREHENSIVE MOBILE FIXES - VIEWPORT AND ZOOM ISSUES
   ======================================================================== */

/* Mobile Devices (Portrait phones, less than 768px) */
@media only screen and (max-width: 767px) {
    
    /* Prevent horizontal scroll and zoom issues */
    html {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Dashboard logos - smaller on mobile */
    .logo-image.invoice-logo,
    .logo-image.charts-logo,
    .logo-image.espa-logo,
    .logo-image.syntaxi-logo,
    .logo-image.ofeiles-logo,
    .logo-image.pension-logo,
    .logo-image.proslipsi-logo {
        max-width: 180px !important;
        max-height: 110px !important;
        min-width: 180px !important;
        width: 180px !important;
        padding: 8px !important;
    }
    
    /* Extra space from navbar on mobile */
    .main-content {
        padding-top: 5rem !important;
    }
    
    /* Extra space for home page top card */
    .container-fluid .glass-card:first-child {
        margin-top: 2rem !important;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Main content adjustments */
    .main-content {
        padding: 1rem 0.75rem !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Container fixes */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: 100%;
    }
    
    /* Glass card mobile optimization */
    .glass-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 15px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Typography adjustments for readability */
    h1, .h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h2, .h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    h3, .h3 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }
    
    h4, .h4 {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    
    h5, .h5 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    p, .fs-6, small {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Table responsive improvements */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    .table {
        min-width: 100%;
        font-size: 0.85rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem !important;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    /* Make tables scroll horizontally instead of breaking layout */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Button adjustments for touch */
    .btn {
        min-height: 44px; /* Apple's recommended touch target */
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.375rem 0.75rem !important;
        font-size: 0.85rem !important;
    }
    
    .btn-lg {
        min-height: 50px;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Form inputs - larger for mobile */
    .form-control,
    .form-select {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevent iOS zoom on focus */
        padding: 0.5rem 0.75rem !important;
        border-radius: 10px !important;
    }
    
    textarea.form-control {
        min-height: 80px !important;
        font-size: 16px !important;
    }
    
    .form-label {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Dashboard grid mobile */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 !important;
    }
    
    .dashboard-card {
        padding: 1.25rem !important;
        min-height: auto !important;
    }
    
    .dashboard-card-icon {
        font-size: 2.5rem !important;
    }
    
    .dashboard-card h5 {
        font-size: 1.1rem !important;
        margin-top: 0.75rem !important;
    }
    
    .dashboard-card p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    /* Row and column spacing */
    .row {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    
    .row > * {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Card spacing */
    .card {
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Modal mobile optimization */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-content {
        border-radius: 15px !important;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem !important;
    }
    
    /* Chart containers */
    .chart-container {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
        padding: 0.5rem !important;
    }
    
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Stat cards mobile */
    .stat-card,
    .invoice-stats-card {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .stat-card h3,
    .stat-card h4 {
        font-size: 1.5rem !important;
    }
    
    .stat-card p,
    .stat-card small {
        font-size: 0.85rem !important;
    }
    
    /* Filter sections mobile */
    .filter-section,
    .search-section {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Badge and pill adjustments */
    .badge {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.65rem !important;
    }
    
    /* Alert boxes */
    .alert {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 0.8rem !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Action buttons container */
    .action-buttons,
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .btn-group > .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Dropdown menus mobile */
    .dropdown-menu {
        font-size: 0.9rem !important;
        min-width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
    }
    
    /* Pagination mobile */
    .pagination {
        font-size: 0.85rem !important;
    }
    
    .page-link {
        padding: 0.375rem 0.65rem !important;
    }
    
    /* Progress bars */
    .progress {
        height: 1.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* List group items */
    .list-group-item {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Invoice/document cards */
    .invoice-card,
    .document-card {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* File upload dropzone */
    .dropzone,
    .file-upload-area {
        padding: 1.5rem 1rem !important;
        min-height: 120px !important;
    }
    
    /* Stats display */
    .stats-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .stats-item {
        width: 100% !important;
        text-align: center !important;
        padding: 0.75rem !important;
    }
    
    /* Navigation tabs mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 2px solid rgba(0, 137, 178, 0.2);
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Image and media responsiveness */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix for wide content elements */
    pre, code {
        white-space: pre-wrap !important;
        word-break: break-all !important;
        font-size: 0.75rem !important;
    }
    
    /* Date picker mobile friendly */
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        font-size: 16px !important; /* Prevent iOS zoom */
    }
}

/* Extra Small Devices (Portrait phones, less than 576px) */
@media only screen and (max-width: 575px) {
    
    /* Dashboard logos - even smaller on extra small screens */
    .logo-image.invoice-logo,
    .logo-image.charts-logo,
    .logo-image.espa-logo,
    .logo-image.syntaxi-logo,
    .logo-image.ofeiles-logo,
    .logo-image.pension-logo,
    .logo-image.proslipsi-logo {
        max-width: 150px !important;
        max-height: 90px !important;
        min-width: 150px !important;
        width: 150px !important;
        padding: 6px !important;
    }
    
    /* Even more compact for small phones */
    .main-content {
        padding: 0.5rem !important;
        padding-top: 5rem !important; /* Extra space from navbar on mobile */
    }
    
    .glass-card {
        padding: 0.75rem !important;
        border-radius: 12px !important;
    }
    
    h1, .h1 {
        font-size: 1.5rem !important;
    }
    
    h2, .h2 {
        font-size: 1.3rem !important;
    }
    
    h3, .h3 {
        font-size: 1.15rem !important;
    }
    
    /* Buttons stack vertically */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .d-flex.gap-2 > *,
    .d-flex.gap-3 > * {
        width: 100% !important;
    }
    
    /* Form row stacking */
    .row.g-3 > *,
    .row.g-2 > * {
        margin-bottom: 0.75rem !important;
    }
}

/* Landscape phones and small tablets (576px to 767px) */
@media only screen and (min-width: 576px) and (max-width: 767px) {
    
    .main-content {
        padding: 1.25rem !important;
        padding-top: 5rem !important; /* Extra space from navbar on mobile */
    }
    
    .glass-card {
        padding: 1.25rem !important;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 1rem !important;
    }
}

/* Tablet devices (768px to 991px) - Minimal changes */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .main-content {
        padding: 1.5rem !important;
    }
}

/* Touch device optimizations (all mobile/tablet) */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger touch targets */
    a, button, .btn, .nav-link, .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .dashboard-card:hover {
        transform: none;
    }
    
    /* Active state instead of hover */
    .dashboard-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Fix for iOS Safari zoom on input focus */
@supports (-webkit-touch-callout: none) {
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* Specific mobile fixes for common problem areas */
@media only screen and (max-width: 767px) {
    
    /* Chart.js responsive fixes */
    .chartjs-render-monitor,
    .chartjs-size-monitor {
        max-width: 100% !important;
    }
    
    /* Table horizontal scroll with visual indicator */
    .table-responsive {
        position: relative;
    }
    
    .table-responsive::after {
        content: '→';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        padding: 0.5rem;
        pointer-events: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        opacity: 0.5;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(0, 137, 178, 0.1);
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(0, 137, 178, 0.3);
        border-radius: 4px;
    }
    
    /* Fix long words and URLs from breaking layout */
    .break-word {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Email and URL wrapping */
    a[href^="mailto:"],
    a[href^="http://"],
    a[href^="https://"] {
        word-break: break-all;
    }
    
    /* Sidebar mobile behavior */
    .glass-sidebar {
        transform: translateX(-100%);
    }
    
    .glass-sidebar.show {
        transform: translateX(0);
    }
    
    /* Prevent body scroll when sidebar open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Mobile topbar */
    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(60px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 137, 178, 0.2);
        z-index: 999;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Mobile logo size controlled by main .mobile-logo rule above */
    
    /* Fix overflow on specific elements */
    .invoice-list,
    .document-list,
    .folder-list {
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Date range pickers mobile */
    .date-range-container {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .date-range-container > * {
        width: 100% !important;
    }
    
    /* Stats counter mobile */
    .counter-value {
        font-size: 1.75rem !important;
    }
    
    .counter-label {
        font-size: 0.8rem !important;
    }
    
    /* Fix for client selector dropdowns */
    select.form-control,
    select.form-select {
        font-size: 16px !important; /* Prevent iOS zoom */
        background-position: right 0.5rem center !important;
        padding-right: 2rem !important;
    }
    
    /* Upload area mobile */
    .upload-area {
        padding: 1rem !important;
        min-height: 100px !important;
    }
    
    /* ESPA program cards mobile */
    .program-card,
    .espa-card {
        width: 100% !important;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    /* Debt table mobile */
    .debt-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Chart filter section mobile */
    .chart-filters {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .chart-filters > * {
        width: 100% !important;
    }
    
    /* Pension calculator mobile */
    .calculator-form {
        padding: 1rem !important;
    }
    
    .calculator-result {
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Calendar mobile (MyRandevou) */
    .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-view {
        min-width: 100%;
    }
    
    /* Fix for appointment modal */
    .appointment-form {
        padding: 0.75rem !important;
    }
    
    /* Document viewer mobile */
    .document-viewer {
        max-width: 100% !important;
        overflow-x: auto;
    }
    
    iframe,
    embed,
    object {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Status indicators */
    .status-badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Info cards grid */
    .info-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Prevent specific wide elements */
    .wide-element,
    .no-wrap {
        white-space: normal !important;
        overflow-wrap: break-word !important;
    }
}

/* iPhone SE and very small screens (max-width: 375px) */
@media only screen and (max-width: 375px) {
    
    .main-content {
        padding: 0.5rem 0.5rem !important;
        padding-top: 5rem !important; /* Extra space from navbar on mobile */
    }
    
    .glass-card {
        padding: 0.65rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    h1, .h1 {
        font-size: 1.4rem !important;
    }
    
    h2, .h2 {
        font-size: 1.25rem !important;
    }
    
    .btn {
        font-size: 0.85rem !important;
        padding: 0.45rem 0.85rem !important;
    }
    
    .table {
        font-size: 0.75rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.35rem 0.2rem !important;
    }
}

/* Landscape orientation fixes */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
    
    .main-content {
        padding-top: 1rem !important;
    }
    
    .mobile-topbar {
        height: 50px !important;
    }
}
