/* Advanced Invoice Processing System - Light Mode Premium UI */

:root {
    /* Anchor-Inspired Color Palette */
    --primary: #6c63ff;        /* Anchor Purple */
    --primary-hover: #5a52d5;  /* Darker Purple */
    --primary-light: #8b7fff;  /* Light Purple */
    --primary-dark: #4c44d1;   /* Deep Purple */
    --secondary: #2d3748;      /* Dark Blue Gray */
    --accent: #00d4aa;         /* Teal Accent */
    --accent-hover: #00b894;   /* Darker Teal */
    --warning: #f59e0b;        /* Amber */
    --danger: #e53e3e;         /* Red */
    --success: #38a169;        /* Green */
    
    /* Anchor Color Scheme */
    --white: #ffffff;
    --gray-25: #fdfdfd;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;
    
    /* Sidebar Colors */
    --sidebar-bg: #2d3748;     /* Dark sidebar like Anchor */
    --sidebar-text: #e2e8f0;   /* Light text */
    --sidebar-text-muted: #a0aec0;
    --sidebar-hover: #4a5568;  /* Hover state */
    --sidebar-active: #6c63ff; /* Active item */
    
    /* Advanced Spacing & Effects */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --backdrop-blur: blur(20px);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-surface: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-left: 240px; /* Always show sidebar like Anchor */
    transition: padding-left 0.3s ease;
}

@media (max-width: 768px) {
    body {
        padding-left: 0;
    }
    
    body.sidebar-open {
        padding-left: 0;
    }
}

/* Advanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.display-1 { font-size: 4rem; font-weight: 800; }
.display-2 { font-size: 3.5rem; font-weight: 800; }

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--gray-600) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }

/* Advanced Cards */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: var(--backdrop-blur);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.card-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

.card-body {
    padding: 2.5rem;
}

.card-premium {
    background: var(--gradient-surface);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

/* Advanced Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 1rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

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

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    color: white;
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: var(--gray-900);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    color: var(--gray-900);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: var(--white);
    position: relative;
    z-index: 1;
}

.btn-outline-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-outline-primary:hover {
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary:hover::after {
    width: 100%;
}

.btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-lg);
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    border-radius: 12px;
}

/* Premium Forms */
.form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    background: var(--white);
    position: relative;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
    background: var(--white);
    transform: translateY(-2px);
}

.form-control:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.form-label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-floating .form-control {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
}

.form-floating .form-control:focus {
    background: var(--white);
}

/* Anchor-Style Top Navigation */
.navbar-top #pageTitle {
    display: none;
}


.navbar-top {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.5rem 2rem; /* Reduced padding */
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease;
    height: 40px; /* Set explicit height */
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar-top {
        left: 0;
        padding: 0.5rem 1rem;
    }
    
    .main-content {
        padding: 1rem;
        margin-top: 50px;
    }
}

.navbar-brand-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--gray-900);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Mobile Hamburger Menu */
.sidebar-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    display: none; /* Hidden on desktop */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
}

.sidebar-toggle:hover {
    background: var(--gray-100);
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background: var(--gray-600);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.sidebar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Remove old user menu styles since we moved it to sidebar */

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
}

.user-dropdown {
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: var(--border-radius);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    background: var(--glass-bg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.user-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.user-dropdown .dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: translateX(4px);
}

/* Anchor-Style Action Cards */
.action-card {
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-card.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.action-card-content {
    flex: 1;
    z-index: 2;
}

.action-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: inherit;
}

.action-card-text {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

.action-card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

/* Metric Cards */
.metric-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.metric-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Setup Progress */
.setup-progress {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.progress {
    background-color: var(--gray-200);
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Premium Status Badges */
.badge {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.badge:hover::before {
    left: 100%;
}

.badge-success {
    background: var(--gradient-success);
    color: var(--gray-900);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-success:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.badge-warning {
    background: var(--gradient-warning);
    color: var(--gray-900);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-warning:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.badge-danger {
    background: var(--gradient-secondary);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-danger:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.badge-info {
    background: var(--gradient-primary);
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-info:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.badge-secondary {
    background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
    color: white;
    border: 1px solid var(--gray-300);
}

.badge-secondary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
}

.table thead th {
    background: var(--gray-50);
    border: none;
    color: var(--gray-700);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1.5rem 1rem;
}

.table tbody td {
    padding: 1.5rem 1rem;
    border-color: var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Premium Login Page */
.login-container {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 4rem 3rem;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-accent);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.login-logo {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.login-logo::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: var(--gradient-accent);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.login-subtitle {
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Icons */
.icon {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-xl {
    width: 32px;
    height: 32px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-left: 4px solid var(--success);
    color: #065f46;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-left: 4px solid var(--primary);
    color: #1e40af;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--gray-50);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.02);
}

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

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

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.1;
    }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-up {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-stagger > * {
    opacity: 0;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .login-card {
        padding: 2rem;
        margin: 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Utility Classes */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

.border-radius-custom {
    border-radius: var(--border-radius);
}

/* Advanced Loading States */
.loading {
    position: relative;
    pointer-events: none;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: loading-shimmer 1.5s infinite;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary);
    border-right: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Premium Utility Classes */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
}

.gradient-primary { background: var(--gradient-primary); }
.gradient-secondary { background: var(--gradient-secondary); }
.gradient-accent { background: var(--gradient-accent); }
.gradient-success { background: var(--gradient-success); }
.gradient-warning { background: var(--gradient-warning); }

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-premium { box-shadow: var(--shadow-2xl); }
.shadow-glow { animation: glow 2s ease-in-out infinite alternate; }

.border-gradient {
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.border-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

/* Page Transitions */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Anchor-Style Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0; /* Always visible on desktop */
    width: 240px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1050;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .sidebar {
        left: -240px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        left: 0;
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--sidebar-bg);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon-sidebar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6c63ff 0%, #8b7fff 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-info {
    flex: 1;
}

.brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--sidebar-text);
    margin: 0;
    line-height: 1.3;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    font-weight: 400;
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

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

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

.nav-item {
    margin-bottom: 0;
}

.nav-link-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.nav-link-sidebar:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-left-color: var(--primary);
    text-decoration: none;
}

.nav-link-sidebar.active {
    background: var(--sidebar-hover);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-text {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

/* Dropdown Submenu Styles */
.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    background: rgba(255, 255, 255, 0.05);
    margin: 0;
    padding: 0;
}

.nav-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.nav-submenu-link {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.nav-submenu-link:hover {
    color: var(--sidebar-text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-icon-end {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.user-profile-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.875rem;
}

.user-avatar-sidebar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.user-name-sidebar {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    text-transform: capitalize;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text-muted);
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
}

.user-dropdown-sidebar {
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.user-dropdown-sidebar .dropdown-item {
    color: var(--sidebar-text);
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.user-dropdown-sidebar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* Clean up button styles */
.btn-purple {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Hide empty state icon sizing */
.empty-state-icon {
    width: 64px;
    height: 64px;
    opacity: 0.4;
}

/* Anchor-Style Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bill-client-section {
    width: 100%;
}

.btn-bill-client {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-bill-client:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    text-decoration: none;
}

.bill-client-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content Area */
.main-content {
    padding: 1rem 2rem 2rem;
    transition: all 0.3s ease;
    min-height: calc(100vh - 40px);
    margin-top: 40px; /* Reduced from 70px since no title in nav */
}

/* Enhance main content area */
.main-content {
    padding-top: 2.5rem; /* More breathing room */
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 280px; /* Slightly wider on mobile */
    }
    
    .user-name-sidebar {
        font-size: 0.8rem;
    }
    
    .user-role {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-left: 0 !important;
    }
    
    .navbar-brand-top .brand-text {
        display: none;
    }
    
    .user-menu-btn .user-name {
        display: none;
    }
    
    .sidebar {
        width: 100vw;
        left: -100vw;
    }
    
    .sidebar.open {
        left: 0;
    }
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced Notification System */
.notification-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    margin-bottom: 1rem;
    overflow: hidden;
    pointer-events: auto;
    position: relative;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-success .notification-icon {
    background: var(--gradient-success);
    color: white;
}

.notification-error .notification-icon {
    background: var(--gradient-secondary);
    color: white;
}

.notification-warning .notification-icon {
    background: var(--gradient-warning);
    color: var(--gray-900);
}

.notification-info .notification-icon {
    background: var(--gradient-primary);
    color: white;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    transform: scale(1.1);
}

.notification-progress {
    height: 3px;
    background: var(--gradient-primary);
    animation: progress-bar linear forwards;
}

.notification-success .notification-progress {
    background: var(--gradient-success);
}

.notification-error .notification-progress {
    background: var(--gradient-secondary);
}

.notification-warning .notification-progress {
    background: var(--gradient-warning);
}

@keyframes progress-bar {
    from { width: 100%; }
    to { width: 0%; }
}

.slide-out-right {
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }