/* UniTrack Main Stylesheet - Light & Dark Theme Support */

/* ==================== LIGHT THEME (DEFAULT) ==================== */
:root {
    /* Color Palette - Light Theme */
    --color-primary: #1e3a5f;
    --color-primary-light: #2d5a8a;
    --color-primary-dark: #0f2744;
    
    --color-accent: #0ea5e9;
    --color-accent-light: #38bdf8;
    --color-accent-dark: #0284c7;
    
    --color-secondary: #7c3aed;
    --color-secondary-light: #a78bfa;
    
    /* Flat purple for buttons/highlights */
    --color-purple: #7568f6;
    --color-purple-hover: #6358e0;
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    
    --color-bg: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-tertiary: #f1f5f9;
    --color-bg-card: #ffffff;
    --color-bg-input: #ffffff;
    
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1e3a5f 0%, #2d5a8a 100%);
    --gradient-accent: linear-gradient(135deg, #0ea5e9 0%, #7c3aed 100%);
    --gradient-hero: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f5f3ff 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.2);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.04);
    
    /* Typography */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==================== DARK THEME ==================== */
[data-theme="dark"] {
    --color-primary: #e2e8f0;
    --color-primary-light: #f1f5f9;
    --color-primary-dark: #cbd5e1;
    
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-light: #64748b;
    
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-bg-card: #1e293b;
    --color-bg-input: #334155;
    
    --color-border: #334155;
    --color-border-light: #475569;
    
    /* Dark theme gradients */
    --gradient-primary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1a1a2e 100%);
    --gradient-card: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    
    /* Dark theme shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.3);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
}

/* ==================== BASE STYLES ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}


h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--color-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-light);
}

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text);
}

.theme-toggle:hover {
    background: var(--color-border);
    transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Small theme toggle for navbar */
.theme-toggle-sm {
    width: 36px;
    height: 36px;
}

.theme-toggle-sm .icon-sun,
.theme-toggle-sm .icon-moon {
    font-size: 1rem;
}

/* Page Header Padding for Fixed Navbar */
.page-header-padding {
    padding-top: 8rem !important;
}

/* ==================== HOMEPAGE STYLES ==================== */

/* Navbar */
.navbar-home {
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar-home {
    background: transparent;
}

.navbar-home.scrolled {
    background: var(--color-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.navbar-brand-home {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-purple);
}

.nav-link-home {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color var(--transition-fast);
}

.nav-link-home:hover {
    color: var(--color-accent);
}

/* Mobile Navbar Toggle */
.navbar-mobile-toggle {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.navbar-mobile-toggle:hover {
    background: var(--color-bg-tertiary);
}

/* Mobile Menu */
.navbar-mobile-menu {
    display: none;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-md);
}

.navbar-mobile-menu.show {
    display: block;
}

.navbar-mobile-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.navbar-mobile-links .nav-link-home {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.navbar-mobile-actions {
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero-section {
    background: transparent;
    padding: 10rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    display: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.hero-title span {
    color: var(--color-purple);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
}

.hero-dashboard-preview {
    background: var(--color-bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform var(--transition-slow);
}

.hero-dashboard-preview:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.hero-dashboard-inner {
    background: var(--color-bg-secondary);
}

.hero-floating-card {
    position: absolute;
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    animation: float 6s ease-in-out infinite;
}

.hero-floating-card.card-1 {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.hero-floating-card.card-2 {
    bottom: 20%;
    right: -5%;
    animation-delay: 2s;
}

.hero-floating-card.card-3 {
    bottom: 5%;
    left: 5%;
    animation-delay: 4s;
}

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

/* Stats Bar */
.stats-bar {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 3rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Features Section */
.features-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
}

.section-label {
    display: inline-block;
    background: rgba(124, 58, 237, 0.1);
    color: var(--color-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-purple);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-icon.blue { background: rgba(14, 165, 233, 0.1); color: var(--color-accent); }
.feature-icon.purple { background: rgba(124, 58, 237, 0.1); color: var(--color-secondary); }
.feature-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.feature-icon.orange { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.feature-text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* How It Works */
.how-it-works-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-secondary);
}

.step-card {
    text-align: center;
    position: relative;
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--color-purple);
    color: white;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-lg);
}

.step-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.step-text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.step-connector {
    position: absolute;
    top: 32px;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    height: 2px;
    background: var(--color-purple);
    opacity: 0.3;
}

/* Modules Section */
.modules-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
}

.module-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 0.5rem 0.5rem;
    height: 100%;
    transition: all var(--transition-normal);
}

.module-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.module-icon {
    width: 48px;
    height: 48px;
    background: var(--color-purple);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.module-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.module-text {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Testimonials */
.testimonials-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-secondary);
}

.testimonial-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-card);
}

.testimonial-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.testimonial-name {
    font-weight: 600;
    color: var(--color-primary);
}

.testimonial-role {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Comparison Section */
.comparison-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
}

.comparison-table-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-card);
}

.comparison-table thead th {
    background: var(--color-primary-dark);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    border: none;
}

.comparison-table thead th:last-child {
    background: var(--color-purple);
}

.comparison-table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:nth-child(even) {
    background: var(--color-bg-secondary);
}

.comparison-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.04);
}

.comparison-table tbody td:first-child {
    font-weight: 500;
    color: var(--color-primary);
}

[data-theme="dark"] .comparison-table thead th {
    background: #1e293b;
}

[data-theme="dark"] .comparison-table thead th:last-child {
    background: var(--color-purple);
}

/* Feature Showcase Section */
.feature-showcase-section {
    padding: var(--space-4xl) 0;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.feature-preview-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Board Preview (Kanban mockup in feature showcase) */
.board-preview {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
}

.board-column {
    flex: 1;
    min-width: 160px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}

.column-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
}

.task-card.active {
    border-left: 3px solid var(--color-accent);
}

.task-card.completed {
    border-left: 3px solid var(--color-success);
    opacity: 0.85;
}

.task-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
}

.task-type.epic { background: rgba(124, 58, 237, 0.1); color: var(--color-secondary); }
.task-type.story { background: rgba(14, 165, 233, 0.1); color: var(--color-accent); }
.task-type.task { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.task-type.bug { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

.task-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Chat Preview (mockup in team chat showcase) */
.chat-preview {
    padding: 1.25rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.chat-bubble {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    max-width: 85%;
}

.chat-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.chat-text {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.5;
}

.chat-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Responsive for comparison tables and showcase */
@media (max-width: 767px) {
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-lg);
    }
    .comparison-table {
        min-width: 480px;
    }
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    .comparison-section .section-title,
    .feature-showcase-section .section-title {
        font-size: 1.75rem;
    }
}

/* CTA Section */
.cta-section {
    padding: var(--space-4xl) 0;
    background: var(--color-purple);
    color: white;
    text-align: center;
}

[data-theme="dark"] .cta-section {
    background: var(--color-purple);
}

.cta-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
}

.cta-text {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem;
}

[data-theme="dark"] .footer {
    background: #020617;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ==================== APP STYLES ==================== */

/* Cards */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card-header {
    padding: 0.75rem var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

/* Fix border radius overflow for first child card-header */
.card > .card-header:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    /* Clip background to rounded corners */
    overflow: hidden;
    /* Ensure buttons and other interactive elements can still function */
    position: relative;
}
/* ==================== MODAL STYLES ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--color-border);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--color-bg-secondary);
}

.btn-modal-cancel {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.15s;
}

.btn-modal-cancel:hover {
    background: var(--color-bg-input);
    color: var(--color-text);
}

.btn-modal-save {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

/* ==================== INVOICE LIST STYLES ==================== */

/* Page Header */
.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sales-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sales-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.sales-title .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-settings {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-settings:hover {
    background: var(--color-bg-input);
    border-color: var(--color-text-muted);
}

.btn-create {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-create:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg-card);
    padding: 0.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    width: fit-content;
}

.tab-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-item:hover {
    color: var(--color-text);
    background: var(--color-bg-input);
}

.tab-item.active {
    background: var(--color-text);
    color: var(--color-bg-card);
    font-weight: 500;
}

.tab-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Filter Bar */
.filter-bar {
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    padding: 1rem .25rem;
    margin-bottom: 0;
    flex-wrap: wrap;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.filter-bar form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.filter-bar .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 0.875rem;
}

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

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.date-select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.btn-actions {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Data Table */
.data-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-bg-input);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

.data-table th .sort-icon {
    margin-left: 0.25rem;
    opacity: 0.5;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--color-bg-input);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Amount Cell */
.amount-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #f3f4f6;
    color: #4b5563;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.overdue-days {
    font-size: 0.65rem;
    display: block;
    margin-top: 2px;
    color: #dc2626;
}

/* Invoice Number */
.invoice-number {
    font-weight: 500;
    color: var(--color-text);
}

/* Customer Cell */
.customer-name {
    font-weight: 500;
    color: var(--color-text);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Date Cell */
.date-primary {
    font-size: 0.875rem;
    color: var(--color-text);
}

.date-secondary {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Row Actions */
.row-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    padding: 0.375rem 0.75rem;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: transparent;
    color: #3b82f6;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s;
}

.btn-view:hover {
    background: #3b82f6;
    color: white;
}

.btn-send {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s;
}

.btn-send:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.btn-more {
    padding: 0.375rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 4px;
}

.btn-more:hover {
    background: var(--color-bg-input);
}

/* Summary Footer */
.summary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--color-bg-input);
    border-top: 1px solid var(--color-border);
}

.summary-stats {
    display: flex;
    gap: 2rem;
}

.summary-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.stat-value.paid {
    color: #059669;
}

.stat-value.pending {
    color: #dc2626;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-size {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 2rem;
    color: #9ca3af;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* ==================== INVOICE DETAIL STYLES ==================== */

/* Invoice Header */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
}

.back-link:hover {
    background: var(--color-bg-input);
}

.invoice-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.invoice-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Invoice Layout */
.invoice-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .invoice-grid {
        grid-template-columns: 1fr;
    }
}

/* Main Card */
.invoice-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}

.card-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.card-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

/* Customer Info */
.customer-info {
    display: flex;
    gap: 1rem;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.customer-details .name {
    font-weight: 600;
    font-size: 1rem;
}

.customer-details .meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Invoice Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-weight: 500;
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    background: var(--color-bg-input);
}

.items-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.items-table tbody tr:last-child td {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
}

.item-hsn {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Totals */
.totals-section {
    background: var(--color-bg-input);
    padding: 1.25rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.total-row.grand {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--color-border);
}

/* Sidebar */
.sidebar-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Payment Summary */
.amount-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.amount-box {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.amount-box.paid {
    background: #d1fae5;
}

.amount-box.due {
    background: #fee2e2;
}

.amount-box .label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.amount-box .value {
    font-size: 1rem;
    font-weight: 700;
}

.amount-box.paid .value {
    color: #059669;
}

.amount-box.due .value {
    color: #dc2626;
}

/* Payments List */
.payments-list {
    margin-top: 1rem;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-info .date {
    font-weight: 500;
}

.payment-info .mode {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.payment-amount {
    font-weight: 600;
    color: #059669;
}

/* Action buttons */
.btn-action {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-add-payment {
    background: #3b82f6;
    border: none;
    color: white;
}

.btn-add-payment:hover {
    background: #2563eb;
}

.btn-mark-paid {
    background: #22c55e;
    border: none;
    color: white;
    margin-bottom: 0;
}

.btn-mark-paid:hover {
    background: #16a34a;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #dc2626;
    color: #dc2626;
}

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

/* Notes section */
.notes-content {
    background: var(--color-bg-input);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--color-bg-card);
    color: var(--color-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.card-header > * {
    flex-shrink: 0;
}

.card-header > h5,
.card-header > h6 {
    margin-bottom: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
}

/* Consistent button group styling in card headers */
.card-header .btn-group,
.card-header > .btn,
.card-header > .badge {
    margin-left: auto;
    flex-shrink: 0;
}

.card-header .btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* When card-header has d-flex, ensure proper alignment */
.card-header.d-flex {
    align-items: center;
}

/* Button container in card header */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    margin-left: auto;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

/* Form Styles */
.form-control, .form-select {
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background-color: var(--color-bg-input);
    border-color: var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-text-light);
}

.form-label {
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.form-text {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn-primary {
    background: var(--color-purple);
    border: none;
    color: white;
    font-weight: 600;
}

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

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-purple);
    color: var(--color-purple);
}

.btn-outline-primary:hover {
    background: var(--color-purple);
    color: white;
}

.btn-secondary {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-border);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-light {
    background: white;
    border: none;
    color: var(--color-primary);
}

.btn-light:hover {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.btn-social {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    width: 100%;
    padding: 0.875rem;
}

.btn-social:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-social img {
    width: 20px;
    height: 20px;
    margin-right: var(--space-sm);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--gradient-hero);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-purple);
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    padding: 0 var(--space-md);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* OTP Input */
.otp-input-container {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.otp-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-wrapper {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    position: fixed;
    height: 100vh;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-purple);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo img {
    flex-shrink: 0;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.sidebar-close:hover {
    color: var(--color-text);
}

/* Sidebar Collapse Button (Desktop) */
.sidebar-collapse-btn {
    position: absolute;
    top: 60px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 1060;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-collapse-btn:hover {
    background: var(--color-purple);
    color: white;
    border-color: var(--color-purple);
}

.sidebar-collapse-btn i {
    transition: transform var(--transition-fast);
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed .sidebar-collapse-btn {
    right: -42px;
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Adjust main content when sidebar is collapsed */
.main-wrapper {
    transition: margin-left var(--transition-normal);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Board Maximize Mode */
body.board-maximized .sidebar {
    transform: translateX(-100%);
}

body.board-maximized .sidebar .sidebar-collapse-btn {
    display: none !important;
}

body.board-maximized .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.board-maximized .topbar {
    display: none !important;
}

body.board-maximized .main-content {
    /* padding: 0 !important; */
}

.board-maximize-btn {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    color: var(--color-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.board-maximize-btn:hover {
    background: var(--color-purple);
    color: white;
    border-color: var(--color-purple);
}

/* Exit fullscreen button (shown only in maximize mode) */
.board-exit-fullscreen {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--color-text);
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast);
}

body.board-maximized .board-exit-fullscreen {
    display: flex;
}

.board-exit-fullscreen:hover {
    background: var(--color-text);
    color: var(--color-bg-card);
}

.sidebar-org-selector {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-org-selector .btn {
    font-size: 0.9rem;
    padding: 0.625rem 0.875rem;
}

.sidebar-org-selector .org-name {
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-nav-container {
    flex: 1;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0;
}

.sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav-container::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 4px;
}

.sidebar-nav-container:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .sidebar-nav-container:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.sidebar-nav-section {
    padding: var(--space-md) var(--space-sm) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.sidebar-nav-item {
    margin-bottom: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.625rem var(--space-md);
    border-radius: 0px;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.sidebar-nav-link.active {
    background: var(--color-purple);
    color: white;
    font-weight: 500;
}

.sidebar-nav-link i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Submenu */
.sidebar-nav-toggle {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.sidebar-nav-item.open .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background: rgba(0, 0, 0, 0.02);
}

.sidebar-nav-item.open .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 8px 0.5rem 24px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.sidebar-submenu li a:hover {
    color: var(--color-text);
    background: var(--color-bg-tertiary);
}

.sidebar-submenu li a.active {
    color: var(--color-purple);
    font-weight: 500;
}

.sidebar-submenu li a i {
    font-size: 0.875rem;
    width: 20px;
    text-align: center;
}

[data-theme="dark"] .sidebar-submenu {
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.sidebar-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Wrapper (contains topbar + content) */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    width: calc(100vw - 260px);
    max-width: calc(100vw - 260px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-normal), width var(--transition-normal), max-width var(--transition-normal);
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem var(--space-xl);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    min-height: 64px;
    transition: background-color var(--transition-normal);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-toggle {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    min-width: 40px;
    min-height: 40px;
}

.topbar-toggle:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.topbar-toggle:active {
    transform: scale(0.95);
}

.topbar-breadcrumb .breadcrumb {
    font-size: 0.875rem;
}

.topbar-breadcrumb .breadcrumb-item a {
    color: var(--color-text-muted);
}

.topbar-breadcrumb .breadcrumb-item.active {
    color: var(--color-text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-search {
    width: 280px;
}

.topbar-search .input-group {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.topbar-search .input-group-text {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding-left: 1rem;
}

.topbar-search .form-control {
    background: transparent;
    border: none;
    padding-left: 0;
    font-size: 0.9rem;
}

.topbar-search .form-control:focus {
    box-shadow: none;
}

.topbar-item {
    position: relative;
}

.topbar-icon-btn {
    background: var(--color-bg-secondary);
    border: none;
    color: var(--color-text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-icon-btn:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--color-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
}

.notification-item.unread {
    background: var(--color-bg-secondary);
    border-left-color: var(--color-accent);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.topbar-user-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.topbar-user-btn:hover {
    background: var(--color-bg-secondary);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-purple);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-user-info {
    text-align: left;
}

.topbar-user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.2;
}

.topbar-user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.topbar-user-btn i {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem;
    background: var(--color-bg-secondary);
    transition: background-color var(--transition-normal);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
}

.page-subtitle {
    color: var(--color-text-muted);
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Large screens (desktops) */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* Medium screens (tablets) */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%) !important;
    }
    
    .sidebar.open {
        transform: translateX(0) !important;
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .topbar {
        padding: 0.75rem var(--space-lg);
    }
    
    .main-content {
        padding: var(--space-lg);
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Small screens (mobile) */
@media (max-width: 767.98px) {
    .sidebar {
        width: 280px;
    }
    
    .topbar {
        padding: 0.75rem var(--space-md);
    }
    
    .topbar-search {
        display: none !important;
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Responsive tables */
    .table-responsive-card {
        display: block;
    }
    
    .table-responsive-card thead {
        display: none;
    }
    
    .table-responsive-card tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
    }
    
    .table-responsive-card tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
    }
    
    .table-responsive-card tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--color-text-muted);
    }
}

/* Extra small screens */
@media (max-width: 575.98px) {
    .topbar-right {
        gap: 0.25rem;
    }
    
    .topbar-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .notification-dropdown {
        width: calc(100vw - 2rem);
        left: 50%;
        transform: translateX(-50%);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 6rem 0 3rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stats-bar .stat-number {
        font-size: 1.75rem;
    }
}

/* Alerts & Toasts */
.alert {
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    border: 1px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    z-index: 9999;
}

.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
}

.toast-header {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.toast-body {
    color: var(--color-text);
}

/* Tables */
.table {
    color: var(--color-text);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--color-border);
    padding: var(--space-md) var(--space-lg);
}

.table > thead {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-bg-secondary);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--color-bg-secondary);
}

/* Loading Spinner */
.spinner-border {
    color: var(--color-accent);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.9);
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* Dropdown styling */
.dropdown-menu {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
}

.dropdown-toggle[aria-expanded="true"] + .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.dropdown-item {
    color: var(--color-text);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.dropdown-divider {
    border-color: var(--color-border);
}

/* Close button for dark theme */
[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ==================== DARK THEME OVERRIDES ==================== */
/* Ensure all text is readable in dark mode */

[data-theme="dark"] body {
    color: #f1f5f9;
}

[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .fw-medium,
[data-theme="dark"] .fw-bold {
    color: inherit;
}

/* Form controls in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #334155;
    border-color: var(--color-accent);
    color: #f1f5f9;
}

[data-theme="dark"] .form-text {
    color: #94a3b8;
}

[data-theme="dark"] .form-label {
    color: #e2e8f0;
}

/* Modals in dark mode */
[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .modal-title {
    color: #f1f5f9;
}

/* Dropdowns in dark mode */
[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .dropdown-header {
    color: #94a3b8;
}

[data-theme="dark"] .dropdown-divider {
    border-color: #334155;
}

/* Tables in dark mode */
[data-theme="dark"] .table {
    color: #e2e8f0;
}

[data-theme="dark"] .table > :not(caption) > * > * {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .table > thead {
    color: #94a3b8;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: #334155;
    color: #f1f5f9;
}

/* Badges - ensure text is readable */
[data-theme="dark"] .badge.bg-secondary {
    background-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .badge.bg-info {
    color: #ffffff !important;
}

/* Cards in dark mode */
[data-theme="dark"] .card {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .card-header {
    background-color: #0f172a;
    border-bottom-color: #334155;
}

/* Ensure dark theme card-header also respects border radius */
[data-theme="dark"] .card > .card-header:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .card-footer {
    background-color: #0f172a;
    border-top-color: #334155;
}

/* Avatar backgrounds in dark mode */
[data-theme="dark"] .rounded-circle[style*="gradient-accent"] span,
[data-theme="dark"] .topbar-avatar {
    color: #ffffff;
}

/* Input group in dark mode */
[data-theme="dark"] .input-group-text {
    background-color: #334155;
    border-color: #475569;
    color: #94a3b8;
}

/* Page header text */
[data-theme="dark"] .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .page-subtitle {
    color: #94a3b8;
}

/* Breadcrumb */
[data-theme="dark"] .breadcrumb-item a {
    color: #94a3b8;
}

[data-theme="dark"] .breadcrumb-item.active {
    color: #f1f5f9;
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #64748b;
}

/* Alert text */
[data-theme="dark"] .alert {
    color: inherit;
}

/* Small text */
[data-theme="dark"] small,
[data-theme="dark"] .small {
    color: #94a3b8;
}

/* Sidebar text fixes */
[data-theme="dark"] .sidebar-footer .small {
    color: #94a3b8 !important;
}

/* Organization selector */
[data-theme="dark"] .sidebar-org-selector .btn {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar-org-selector .btn:hover {
    background-color: #475569;
}

/* Notification dropdown */
[data-theme="dark"] .notification-dropdown {
    background-color: #1e293b;
}

[data-theme="dark"] .notification-text {
    color: #f1f5f9;
}

[data-theme="dark"] .notification-time {
    color: #94a3b8;
}

[data-theme="dark"] .notification-item.unread {
    background-color: #0f172a;
}

/* User dropdown header */
[data-theme="dark"] .dropdown-header strong {
    color: #f1f5f9;
}

/* Ensure readable text in table cells with avatars */
[data-theme="dark"] .table td .fw-medium {
    color: #f1f5f9;
}

/* Info text in forms */
[data-theme="dark"] .auth-subtitle {
    color: #94a3b8;
}

/* Links in cards */
[data-theme="dark"] .card a:not(.btn) {
    color: var(--color-accent-light);
}

/* Select dropdown options */
[data-theme="dark"] .form-select option {
    background-color: #1e293b;
    color: #f1f5f9;
}

/* ==================== DARK MODE: PUBLIC PAGE OVERRIDES ==================== */
/* Buttons */
[data-theme="dark"] .btn-light {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}
[data-theme="dark"] .btn-light:hover {
    background: #475569;
    color: #fff;
}
[data-theme="dark"] .btn-outline-dark {
    color: #e2e8f0;
    border-color: #64748b;
}
[data-theme="dark"] .btn-outline-dark:hover {
    background: #334155;
    color: #fff;
    border-color: #94a3b8;
}
[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background: #334155;
    color: #fff;
    border-color: #64748b;
}

/* Navbar dropdown (Solutions mega-menu) */
[data-theme="dark"] .nav-dropdown-content {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .nav-dropdown-item {
    color: #e2e8f0;
}
[data-theme="dark"] .nav-dropdown-item:hover {
    background: #334155;
    color: #fff;
}
[data-theme="dark"] .nav-dropdown-title {
    color: #f1f5f9;
}
[data-theme="dark"] .nav-dropdown-desc {
    color: #94a3b8;
}
[data-theme="dark"] .nav-dropdown-category {
    color: #64748b;
}
[data-theme="dark"] .nav-dropdown-footer .btn {
    color: #e2e8f0;
}
[data-theme="dark"] .nav-tool-link {
    color: #cbd5e1;
}
[data-theme="dark"] .nav-tool-link:hover {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

/* Background utility overrides */
[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}
[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}
[data-theme="dark"] .border-bottom {
    border-bottom-color: #334155 !important;
}

/* Tools public container */
[data-theme="dark"] .tools-public-container .card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tools-public-container .card-header {
    background: #1a2332;
    border-bottom-color: #334155;
}
[data-theme="dark"] .tools-public-container h5,
[data-theme="dark"] .tools-public-container h4,
[data-theme="dark"] .tools-public-container h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .tools-public-container .text-muted {
    color: #94a3b8 !important;
}

/* Alert boxes in dark mode */
[data-theme="dark"] .alert-info {
    background-color: #1e3a5f;
    border-color: #2563eb;
    color: #93c5fd;
}
[data-theme="dark"] .alert-warning {
    background-color: #3d2e0a;
    border-color: #d97706;
    color: #fcd34d;
}
[data-theme="dark"] .alert-success {
    background-color: #0a3d1f;
    border-color: #16a34a;
    color: #86efac;
}
[data-theme="dark"] .alert-danger {
    background-color: #3d0a0a;
    border-color: #dc2626;
    color: #fca5a5;
}

/* Pricing page fixes */
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .price-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .pricing-card h3,
[data-theme="dark"] .pricing-card h4,
[data-theme="dark"] .price-card h3,
[data-theme="dark"] .price-card h4 {
    color: #f1f5f9;
}
[data-theme="dark"] .pricing-card .price,
[data-theme="dark"] .price-card .price {
    color: #e2e8f0;
}
[data-theme="dark"] .pricing-card li,
[data-theme="dark"] .price-card li {
    color: #cbd5e1;
}

/* Hero section text in dark mode */
[data-theme="dark"] .hero-title {
    color: #f1f5f9;
}
[data-theme="dark"] .hero-subtitle,
[data-theme="dark"] .hero-description {
    color: #94a3b8;
}

/* Section titles — need high specificity to beat homepage inline styles */
[data-theme="dark"] .section-title,
[data-theme="dark"] .tools-replaced-section .section-title,
[data-theme="dark"] .feature-showcase-section .section-title,
[data-theme="dark"] .modules-section .section-title,
[data-theme="dark"] .security-section .section-title,
[data-theme="dark"] .comparison-section .section-title,
[data-theme="dark"] .testimonials-section .section-title,
[data-theme="dark"] .faq-section .section-title,
[data-theme="dark"] .how-it-works-section .section-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .section-subtitle,
[data-theme="dark"] .tools-replaced-section .section-subtitle,
[data-theme="dark"] .feature-showcase-section .section-subtitle,
[data-theme="dark"] .modules-section .section-subtitle,
[data-theme="dark"] .security-section .section-subtitle,
[data-theme="dark"] .comparison-section .section-subtitle,
[data-theme="dark"] .testimonials-section .section-subtitle,
[data-theme="dark"] .faq-section .section-subtitle,
[data-theme="dark"] .how-it-works-section .section-subtitle {
    color: #94a3b8 !important;
}
[data-theme="dark"] .section-label {
    background: rgba(124, 58, 237, 0.25) !important;
    color: #a78bfa !important;
}

/* Bootstrap text color overrides for icon visibility */
[data-theme="dark"] .text-primary {
    color: #60a5fa !important;
}
[data-theme="dark"] .text-success {
    color: #4ade80 !important;
}
[data-theme="dark"] .text-info {
    color: #38bdf8 !important;
}
[data-theme="dark"] .text-warning {
    color: #fbbf24 !important;
}
[data-theme="dark"] .text-danger {
    color: #f87171 !important;
}
[data-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

/* Feature cards */
[data-theme="dark"] .feature-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .feature-card h4,
[data-theme="dark"] .feature-card h5 {
    color: #f1f5f9;
}
[data-theme="dark"] .feature-card p {
    color: #94a3b8;
}

/* List group items */
[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* ==================== DARK MODE: HOMEPAGE SECTIONS ==================== */
/* Tools replaced section */
[data-theme="dark"] .tools-replaced-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
[data-theme="dark"] .tool-card {
    background: #1e293b !important;
    border: 1px solid #334155;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .tool-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .tool-name {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .tool-price {
    color: #64748b !important;
}
[data-theme="dark"] .tool-feature span {
    color: #94a3b8;
}
[data-theme="dark"] .tool-feature strong {
    color: #e2e8f0;
}
[data-theme="dark"] .tool-replaced {
    border-bottom-color: #334155;
}
[data-theme="dark"] .savings-banner {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
    border-color: #10b981 !important;
}
[data-theme="dark"] .savings-banner h3,
[data-theme="dark"] .savings-banner p,
[data-theme="dark"] .savings-banner span {
    color: #d1fae5 !important;
}

/* Homepage how-it-works section */
[data-theme="dark"] .how-it-works-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
[data-theme="dark"] .step-card {
    background: #1e293b !important;
    border-color: #334155;
}
[data-theme="dark"] .step-card h4 {
    color: #f1f5f9;
}
[data-theme="dark"] .step-card p {
    color: #94a3b8;
}

/* Homepage why-unitrack section */
[data-theme="dark"] .why-unitrack-section {
    background: #0f172a !important;
}
[data-theme="dark"] .why-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .why-card h4 {
    color: #f1f5f9;
}
[data-theme="dark"] .why-card p {
    color: #94a3b8;
}

/* Section backgrounds used across pages */
[data-theme="dark"] .features-section {
    background: #0f172a !important;
}
[data-theme="dark"] .features-section.bg-light {
    background: #1e293b !important;
}
[data-theme="dark"] .privacy-banner-section {
    background: #0f172a !important;
}

/* ==================== DARK MODE: PRICING PAGE ==================== */
[data-theme="dark"] .pricing-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
[data-theme="dark"] .pricing-card-modern {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .pricing-card-modern:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .pricing-card-featured {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25) !important;
}
[data-theme="dark"] .pricing-card-modern .display-3,
[data-theme="dark"] .pricing-card-modern h3,
[data-theme="dark"] .pricing-card-modern h4 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .pricing-card-modern span,
[data-theme="dark"] .pricing-card-modern li span {
    color: #cbd5e1;
}
[data-theme="dark"] .pricing-card-modern li strong {
    color: #e2e8f0;
}
[data-theme="dark"] .pricing-card-modern hr {
    border-color: #334155;
}

/* ==================== DARK MODE: ACCORDION / FAQ ==================== */
[data-theme="dark"] .accordion-item {
    background-color: #1e293b;
    border-color: #334155 !important;
}
[data-theme="dark"] .accordion-button {
    background-color: #1e293b;
    color: #e2e8f0;
}
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}
[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(2);
}
[data-theme="dark"] .accordion-body {
    color: #94a3b8 !important;
    background-color: #1e293b;
}
[data-theme="dark"] .accordion-button.bg-white {
    background-color: #1e293b !important;
}
[data-theme="dark"] .accordion-body.bg-white {
    background-color: #1e293b !important;
}

/* ==================== DARK MODE: TOOLS PUBLIC PAGE ==================== */
[data-theme="dark"] .tool-public-card {
    background: #1e293b !important;
    border-color: #334155;
}
[data-theme="dark"] .tool-public-card:hover {
    border-color: #475569;
}
[data-theme="dark"] .tool-public-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .tool-public-desc {
    color: #94a3b8 !important;
}
[data-theme="dark"] .tools-category-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .tools-category-desc {
    color: #94a3b8 !important;
}

/* ==================== DARK MODE: MODULE LANDING PAGES ==================== */
/* Shared classes used in crm.html, task_management.html, team_chat.html, etc. */
[data-theme="dark"] .landing-feature-card {
    background: #1e293b !important;
    border-color: #334155;
}
[data-theme="dark"] .landing-feature-card h4,
[data-theme="dark"] .landing-feature-card h5 {
    color: #f1f5f9;
}
[data-theme="dark"] .landing-feature-card p {
    color: #94a3b8;
}
[data-theme="dark"] .feature-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .feature-text {
    color: #94a3b8 !important;
}

/* Comparison tables on landing pages */
[data-theme="dark"] .comparison-table {
    background: #1e293b;
}
[data-theme="dark"] .comparison-table td {
    color: #cbd5e1;
    border-color: #334155;
}
[data-theme="dark"] .comparison-table th {
    color: #e2e8f0;
    border-color: #334155;
}

/* Inline style overrides for sections with hardcoded light backgrounds */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #f8fafc"],
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #f1f5f9"],
[data-theme="dark"] section[style*="background: #f8fafc"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #e2e8f0"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

/* Hero dashboard preview card */
[data-theme="dark"] .hero-dashboard-preview {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .hero-dashboard-preview h4,
[data-theme="dark"] .hero-dashboard-preview .fw-bold {
    color: #f1f5f9;
}
[data-theme="dark"] .hero-dashboard-preview .small {
    color: #cbd5e1;
}

/* General text color fixes for dark backgrounds */
[data-theme="dark"] .display-3,
[data-theme="dark"] .display-4,
[data-theme="dark"] .display-5,
[data-theme="dark"] .display-6 {
    color: #f1f5f9;
}
[data-theme="dark"] .lead {
    color: #94a3b8;
}
[data-theme="dark"] .fw-semibold {
    color: inherit;
}
[data-theme="dark"] p {
    color: inherit;
}
[data-theme="dark"] span {
    color: inherit;
}
[data-theme="dark"] strong {
    color: inherit;
}

/* ==================== DARK MODE: CTA SECTION ==================== */
[data-theme="dark"] .cta-section .btn-light {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}
[data-theme="dark"] .cta-section .btn-light:hover {
    background: #475569;
    color: #fff;
}

/* ==================== DARK MODE: FOOTER ==================== */
[data-theme="dark"] .footer a {
    color: #94a3b8;
}
[data-theme="dark"] .footer a:hover {
    color: #e2e8f0;
}
[data-theme="dark"] .footer h6 {
    color: #e2e8f0;
}

/* ==================== DARK MODE: TOOL LANDING BASE ==================== */
[data-theme="dark"] .feature-icon {
    opacity: 0.9;
}
[data-theme="dark"] .tool-landing-icon {
    opacity: 0.9;
}

/* ==================== DARK MODE: STORY / FOUNDERS SECTION ==================== */
[data-theme="dark"] .story-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
[data-theme="dark"] .story-section .section-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .story-highlight-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .story-benefits {
    background: #1e293b;
}
[data-theme="dark"] .story-benefits li {
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .story-benefits li i {
    color: #4ade80 !important;
}

/* ==================== DARK MODE: TOOLS PUBLIC PAGE (FREE TOOLS) ==================== */
[data-theme="dark"] .tools-public-section {
    background: #0f172a !important;
}
[data-theme="dark"] .tools-public-section.bg-light {
    background: #1e293b !important;
}
[data-theme="dark"] .tools-public-section .section-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .tools-public-section .section-subtitle {
    color: #94a3b8 !important;
}
[data-theme="dark"] .tools-public-section .section-label {
    background: rgba(124, 58, 237, 0.25) !important;
    color: #a78bfa !important;
}
[data-theme="dark"] .tool-public-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .tool-public-card:hover {
    border-color: #7c3aed !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .tool-public-card h5 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .tool-public-card p {
    color: #94a3b8 !important;
}
[data-theme="dark"] .tool-link {
    color: #a78bfa !important;
}
[data-theme="dark"] .bg-light .tool-public-card {
    background: #1e293b !important;
}

/* ==================== DARK MODE: HOMEPAGE GENERAL SECTIONS ==================== */
/* All homepage sections with hardcoded light backgrounds */
[data-theme="dark"] .feature-showcase-section {
    background: #0f172a !important;
}
[data-theme="dark"] .feature-showcase-section.bg-light {
    background: #1e293b !important;
}
[data-theme="dark"] .modules-section {
    background: #0f172a !important;
}
[data-theme="dark"] .security-section {
    background: #0f172a !important;
}
[data-theme="dark"] .comparison-section {
    background: #0f172a !important;
}
[data-theme="dark"] .testimonials-section {
    background: #0f172a !important;
}
[data-theme="dark"] .faq-section {
    background: #0f172a !important;
}

/* Cards used inside homepage sections */
[data-theme="dark"] .security-card,
[data-theme="dark"] .module-card,
[data-theme="dark"] .feature-detail-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .security-card h4,
[data-theme="dark"] .module-card h4,
[data-theme="dark"] .feature-detail-card h4 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .security-card p,
[data-theme="dark"] .module-card p,
[data-theme="dark"] .feature-detail-card p {
    color: #94a3b8 !important;
}

/* ==================== DARK MODE: FEATURE SHOWCASE SECTIONS ==================== */
/* Feature item titles (Intuitive Interface, Connected to Everything, etc.) */
[data-theme="dark"] .feature-item h5 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .feature-item p {
    color: #94a3b8 !important;
}
[data-theme="dark"] .feature-showcase-section .lead {
    color: #94a3b8 !important;
}

/* Feature preview cards (white cards on the left showing demos) */
[data-theme="dark"] .feature-preview-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3) !important;
}

/* Chat preview inside feature cards */
[data-theme="dark"] .chat-preview {
    background: #0f172a !important;
}
[data-theme="dark"] .chat-header {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .channel-name {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .channel-members {
    color: #94a3b8 !important;
}
[data-theme="dark"] .message-author {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .message-content p {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .reaction {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* Board/task preview */
[data-theme="dark"] .board-preview {
    background: #0f172a !important;
}
[data-theme="dark"] .column-header {
    color: #94a3b8 !important;
}
[data-theme="dark"] .task-card {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .task-card * {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .count-badge {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* Invoice preview */
[data-theme="dark"] .invoice-preview,
[data-theme="dark"] .invoice-card,
[data-theme="dark"] .invoice-mini {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .invoice-preview *,
[data-theme="dark"] .invoice-card *,
[data-theme="dark"] .invoice-mini * {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .invoice-preview .text-muted,
[data-theme="dark"] .invoice-card .text-muted,
[data-theme="dark"] .invoice-mini .text-muted {
    color: #94a3b8 !important;
}

/* Activity/screenshots preview */
[data-theme="dark"] .activity-card,
[data-theme="dark"] .screenshot-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .activity-card *,
[data-theme="dark"] .screenshot-card * {
    color: #e2e8f0 !important;
}

/* Document preview */
[data-theme="dark"] .doc-card,
[data-theme="dark"] .doc-preview,
[data-theme="dark"] .signature-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .doc-card *,
[data-theme="dark"] .doc-preview *,
[data-theme="dark"] .signature-card * {
    color: #e2e8f0 !important;
}

/* Expense/asset previews */
[data-theme="dark"] .expense-card,
[data-theme="dark"] .asset-card,
[data-theme="dark"] .expense-row {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .expense-card *,
[data-theme="dark"] .asset-card *,
[data-theme="dark"] .expense-row * {
    color: #e2e8f0 !important;
}

/* Form preview */
[data-theme="dark"] .form-card,
[data-theme="dark"] .form-preview {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .form-card *,
[data-theme="dark"] .form-preview * {
    color: #e2e8f0 !important;
}

/* Generic preview elements that have light backgrounds */
[data-theme="dark"] .preview-header,
[data-theme="dark"] .preview-body,
[data-theme="dark"] .preview-stat {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Stats bars and metrics used across sections */
[data-theme="dark"] .stat-item {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .stat-number {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .stat-label {
    color: #94a3b8 !important;
}

/* Privacy section on Free Tools page */
[data-theme="dark"] .privacy-banner-section {
    background: #0f172a !important;
}

/* ==================== DARK MODE: ALL PREVIEW CARD INTERNALS ==================== */
/* Activity preview */
[data-theme="dark"] .activity-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .activity-header span {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .productivity-score.high {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #4ade80 !important;
}
[data-theme="dark"] .timeline-item.productive {
    background: rgba(34, 197, 94, 0.1) !important;
}
[data-theme="dark"] .timeline-item.neutral {
    background: rgba(234, 179, 8, 0.1) !important;
}
[data-theme="dark"] .timeline-item .time,
[data-theme="dark"] .timeline-item .duration {
    color: #94a3b8 !important;
}
[data-theme="dark"] .timeline-item .app {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .activity-summary {
    border-top-color: #334155 !important;
}
[data-theme="dark"] .summary-item .label {
    color: #94a3b8 !important;
}
[data-theme="dark"] .summary-item .value {
    color: #f1f5f9 !important;
}

/* Invoice preview */
[data-theme="dark"] .invoice-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .invoice-header {
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .company-info strong,
[data-theme="dark"] .invoice-number strong {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .company-info small,
[data-theme="dark"] .invoice-number small {
    color: #94a3b8 !important;
}
[data-theme="dark"] .item-row {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .invoice-taxes {
    border-top-color: #334155 !important;
}
[data-theme="dark"] .tax-row {
    color: #94a3b8 !important;
}
[data-theme="dark"] .invoice-total {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}

/* Document preview */
[data-theme="dark"] .document-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .doc-header {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .signer {
    background: #0f172a !important;
}
[data-theme="dark"] .signer-name {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .signer-email {
    color: #94a3b8 !important;
}

/* Expense preview */
[data-theme="dark"] .expense-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .expense-header {
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .expense-header span:first-child {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .category-item {
    background: #0f172a !important;
}
[data-theme="dark"] .category-name {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .category-amount {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .expense-alert {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}

/* Asset preview */
[data-theme="dark"] .asset-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .asset-header span {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .asset-stat {
    background: #0f172a !important;
}
[data-theme="dark"] .stat-info .stat-value {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .stat-info .stat-label {
    color: #94a3b8 !important;
}
[data-theme="dark"] .asset-list {
    border-top-color: #334155 !important;
}
[data-theme="dark"] .asset-item {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .asset-item strong {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .asset-item small {
    color: #94a3b8 !important;
}

/* Form preview */
[data-theme="dark"] .form-preview {
    background: #1e293b !important;
}
[data-theme="dark"] .form-preview-header {
    border-bottom-color: #334155 !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .form-field-preview {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ==================== DARK MODE: PRIVACY / TOOLS SECTION ==================== */
[data-theme="dark"] .tools-section {
    background: #0f172a !important;
}
[data-theme="dark"] .privacy-warning-banner {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
[data-theme="dark"] .privacy-warning-banner h4,
[data-theme="dark"] .privacy-warning-banner h5 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .privacy-warning-banner p {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .badge-comparison.badge-danger {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}
[data-theme="dark"] .badge-comparison.badge-success {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #4ade80 !important;
}
[data-theme="dark"] .tools-category-card {
    background: #1e293b !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .tools-category-body {
    background: #1e293b !important;
}
[data-theme="dark"] .tools-list li {
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .tools-list li span:first-of-type {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .tool-badge {
    background: #334155 !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .tool-badge.privacy-badge {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #4ade80 !important;
}
[data-theme="dark"] .privacy-promise-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .privacy-promise-box h4,
[data-theme="dark"] .privacy-promise-box strong {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .privacy-promise-box p {
    color: #94a3b8 !important;
}

/* ==================== DARK MODE: COMPARISON TABLE ==================== */
[data-theme="dark"] .comparison-table {
    background: #1e293b !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .comparison-table td {
    border-bottom-color: #334155 !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .comparison-table .unitrack-cell {
    background: rgba(5, 150, 105, 0.15) !important;
}
[data-theme="dark"] .comparison-table .total-row {
    background: #0f172a !important;
}

/* ==================== DARK MODE: TESTIMONIALS ==================== */
[data-theme="dark"] .testimonial-stat {
    border-top-color: #334155 !important;
}
[data-theme="dark"] .testimonial-stat .stat-label {
    color: #94a3b8 !important;
}

/* ==================== DARK MODE: FAQ / ACCORDION ==================== */
[data-theme="dark"] .accordion-item {
    border-color: #334155 !important;
    background: #1e293b !important;
}
[data-theme="dark"] .accordion-button {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #0f172a !important;
    color: #a78bfa !important;
}
[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}
[data-theme="dark"] .accordion-body {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

/* ==================== DARK MODE: SECURITY SECTION ==================== */
[data-theme="dark"] .security-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .security-card h4 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .security-card p {
    color: #94a3b8 !important;
}
[data-theme="dark"] .security-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%) !important;
}

/* ==================== DARK MODE: GLOBAL BOOTSTRAP OVERRIDES ==================== */
[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}
[data-theme="dark"] .bg-light {
    background-color: #0f172a !important;
}
[data-theme="dark"] .border {
    border-color: #334155 !important;
}
[data-theme="dark"] .border-bottom {
    border-color: #334155 !important;
}
[data-theme="dark"] .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .card-body {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .list-group-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: #f1f5f9;
}
[data-theme="dark"] p {
    color: #cbd5e1;
}
[data-theme="dark"] .lead {
    color: #94a3b8 !important;
}
[data-theme="dark"] strong {
    color: #f1f5f9;
}
[data-theme="dark"] .alert-success {
    background-color: rgba(22, 163, 74, 0.15) !important;
    border-color: rgba(22, 163, 74, 0.3) !important;
    color: #4ade80 !important;
}
[data-theme="dark"] .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #38bdf8 !important;
}
[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

/* Hero section text — always on colored gradient background */
.hero-section .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}
.hero-section .text-muted .text-success {
    color: rgba(255, 255, 255, 0.85) !important;
}
.hero-section small,
.hero-section .small {
    color: rgba(255, 255, 255, 0.7) !important;
}
.hero-section .btn-light {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.hero-section .btn-light:hover {
    color: #fff;
}
.hero-section .btn-light:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* FIX: Ensure text inside hero dashboard preview cards is visible in light mode */
/* The general .hero-section .small rule was forcing white text on white cards */
.hero-section .hero-dashboard-preview .small {
    color: var(--bs-body-color) !important;
}
/* Re-apply light text for dark mode specifically */
[data-theme="dark"] .hero-section .hero-dashboard-preview .small {
    color: #cbd5e1 !important;
}

/* FIX: Improve contrast for CTA subtext on purple background */
.cta-section .text-muted,
.cta-section .small,
.cta-section i {
    color: rgba(255, 255, 255, 0.8) !important;
}


@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 8rem 0 4rem;
    }
    
    .step-connector {
        display: none;
    }
    
    .hero-floating-card {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero-dashboard-preview {
        transform: none;
    }
}

/* ==================== TABLE DROPDOWN FIX ==================== */
/* Fix dropdown being clipped inside table-responsive containers */

/* Allow cards to show dropdowns that overflow */
.card {
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

/* Override Bootstrap's table-responsive overflow hidden */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    position: relative;
}

.table-responsive.dropdown-open {
    overflow: visible !important;
}

/* Ensure dropdowns have very high z-index */
.dropdown-menu {
    z-index: 1055 !important;
}

/* Ensure dropdown positioning inside tables */
.table .dropdown,
.table .btn-group {
    position: relative;
}

.table-responsive .dropdown-menu,
.table-responsive .dropdown-menu.position-fixed {
    z-index: 2000;
}

.table-responsive .dropdown-menu.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Allow table cards to show dropdown overflow */
.data-card {
    overflow: visible;
}

/* Add padding at the bottom of the main content to allow dropdowns space */
.main-content {
    min-height: calc(100vh - 100px);
    padding-bottom: 2rem;
}

/* For the last few rows in table, use dropup to prevent clipping at bottom */
.table tbody tr:last-child .dropdown .dropdown-menu,
.table tbody tr:nth-last-child(2) .dropdown .dropdown-menu,
.table tbody tr:nth-last-child(3) .dropdown .dropdown-menu {
    bottom: 100% !important;
    top: auto !important;
    margin-bottom: 0.25rem !important;
    margin-top: 0 !important;
    transform: none !important;
}

/* Dropdown menu positioning when using dropup */
.table tbody tr:last-child .dropdown .dropdown-menu.dropdown-menu-end,
.table tbody tr:nth-last-child(2) .dropdown .dropdown-menu.dropdown-menu-end,
.table tbody tr:nth-last-child(3) .dropdown .dropdown-menu.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* ==================== ICON CIRCLE UTILITY ==================== */
/* Ensures icon circles render as perfect circles, not ellipses */
.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}

.icon-circle-sm {
    width: 32px;
    height: 32px;
}

.icon-circle-md {
    width: 40px;
    height: 40px;
}

.icon-circle-lg {
    width: 48px;
    height: 48px;
}

/* ==================== INVOICING MODULE STYLES ==================== */

/* Helper Classes */
.table-compact td, .table-compact th { padding: 0.75rem 1rem; font-size: 0.9rem; vertical-align: middle; }
.table-compact th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); font-weight: 600; }
.avatar-sm { width: 36px; height: 36px; font-size: 0.85rem; }

/* Slide-out Panel Overlay */
.slide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}
.slide-panel-overlay.show { display: block; }

/* Slide-out Panel */
.slide-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background-color: var(--color-bg-card);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 1050;
    transition: right 0.3s ease;
    overflow-y: auto;
}

[data-theme="dark"] .slide-panel {
    background-color: var(--color-bg-primary);
}

.slide-panel.open { right: 0; }

.slide-panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: inherit;
    z-index: 10;
}

.slide-panel-body { 
    padding: 1.5rem;
    background-color: inherit;
}

.slide-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    position: sticky;
    bottom: 0;
    background-color: var(--color-bg-card);
}

[data-theme="dark"] .slide-panel-footer {
    background-color: var(--color-bg-primary);
}

/* Collapsible sections in panels */
.section-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-primary);
    font-weight: 500;
}
.section-toggle i { transition: transform 0.2s; }
.section-toggle.collapsed i { transform: rotate(-90deg); }
.section-content { padding: 1rem 0; }

/* Custom Tab Styling */
.nav-tabs-custom {
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    padding: 0.75rem 1rem;
    font-weight: 500;
}
.nav-tabs-custom .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: none;
}

/* Sales Header */
.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sales-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sales-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg-card);
    padding: 0.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    width: fit-content;
}

.tab-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-item:hover {
    color: var(--color-text);
    background: var(--color-bg-input);
}

.tab-item.active {
    background: var(--color-text);
    color: var(--color-bg-card);
    font-weight: 500;
}

/* Invoice Specifics */
.amount-value, .invoice-number, .customer-name, .date-primary {
    color: var(--color-text);
    font-weight: 500;
}

.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.back-link {
    color: var(--color-text);
    font-weight: 600;
}

.back-link:hover { color: var(--color-accent); }

/* ==================== INVOICE CREATE PAGE STYLES ==================== */

/* Invoice Creation Header */
.invoice-header .back-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    justify-content: flex-start;
}

.invoice-header .back-link:hover {
    color: var(--color-accent);
}

.invoice-header .back-link > i {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-input);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

.invoice-header .back-link > div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.invoice-header .org-name {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.invoice-number-section {
    display: flex;
    align-items: center;
    gap: 0;
}

.prefix-select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 8px 0 0 8px;
    background: var(--color-bg-card);
    color: var(--color-text);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
}

.invoice-num-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-weight: 500;
    width: 80px;
    font-size: 0.875rem;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-draft, .btn-save-print, .btn-save {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-draft {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.btn-draft:hover {
    background: var(--color-bg-input);
    color: var(--color-text);
}

.btn-save-print {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-save-print:hover {
    background: var(--color-bg-input);
}

.btn-save {
    background: #3b82f6;
    color: white;
}

.btn-save:hover {
    background: #2563eb;
}

/* Invoice Form */
.invoice-form {
    margin-top: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.section-title i {
    color: var(--color-text-muted);
}

/* Customer Search */
.customer-search {
    position: relative;
}

.customer-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-size: 0.875rem;
}

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

.customer-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.customer-search-results.show {
    display: block;
}

.customer-result {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s;
}

.customer-result:last-child {
    border-bottom: none;
}

.customer-result:hover {
    background: var(--color-bg-input);
}

.customer-result .name {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.customer-result .customer-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.customer-result .gstin-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.customer-result .contact-text {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.customer-result .address-line {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.add-customer-link {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid var(--color-border);
}

.add-customer-link:hover {
    background: var(--color-bg-input);
}

/* Selected Customer */
.selected-customer {
    display: none;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.selected-customer.show {
    display: block;
}

.selected-customer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.customer-name-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.customer-name-row strong {
    font-size: 1rem;
    color: var(--color-text);
}

.change-btn {
    color: #3b82f6;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.change-btn:hover {
    text-decoration: underline;
}

.selected-customer-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.detail-row i {
    width: 16px;
    text-align: center;
}

/* Date Inputs */
.date-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.date-inputs .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.date-inputs .form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-size: 0.875rem;
}

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

/* Products Section */
.products-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

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

.products-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-product-btn {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
}

.add-product-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Product Search Row */
.product-search-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-size: 0.875rem;
}

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

.product-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.product-search-results.show {
    display: block;
}

.product-result {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.product-result:last-child {
    border-bottom: none;
}

.product-result:hover {
    background: var(--color-bg-input);
}

.product-result .product-info .name {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.product-result .product-info .sku {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.product-result .product-price {
    text-align: right;
}

.product-result .product-price .amount {
    font-weight: 600;
    color: var(--color-text);
}

.product-result .product-price .tax {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.qty-input {
    width: 80px;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-size: 0.875rem;
    text-align: center;
}

.btn-add-to-bill {
    padding: 0.75rem 1.25rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-add-to-bill:hover {
    background: #2563eb;
}

/* Products Table */
.products-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    table-layout: fixed;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    width: 200px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-table thead {
    background: var(--color-bg-input);
}

.products-table th {
    padding: 0.75rem 0.875rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-border);
}

.products-table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.products-table tbody tr:hover {
    background: var(--color-bg-input);
}

.item-name {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.item-hsn {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.item-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg-input);
    color: var(--color-text);
    font-size: 0.875rem;
}

.item-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.item-input.description {
    font-size: 0.8rem;
    color: #6b7280;
}

.item-input.price {
    text-align: right;
}

.item-total {
    text-align: right;
    font-weight: 600;
    color: var(--color-text);
}

.item-tax-info {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.products-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.products-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.products-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Totals Section */
.totals-section-new {
    background: var(--color-bg-input);
    padding: 1.25rem;
    border-radius: 8px;
}

/* Invoice Footer */
.invoice-footer {
    position: sticky;
    bottom: 0;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .invoice-footer {
        flex-direction: column;
    }
    
    .invoice-footer button {
        width: 100%;
    }
}

/* ==================== GLOBAL BOOTSTRAP MODAL OVERRIDES ==================== */
/* User requested: blur effect + clean square UI for ALL modals */

.modal-backdrop.show {
    opacity: 1 !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.modal-content {
    border: none;
    border-radius: 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    background-color: var(--color-bg-card);
}

.modal.fade .modal-dialog {
    transform: scale(0.95) !important;
    opacity: 0 !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease-out !important;
}

.modal.show .modal-dialog {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    background-color: var(--color-bg-card);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.modal-title {
    font-weight: 600;
    color: var(--color-text);
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.5rem;
    color: var(--color-text);
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    background-color: var(--color-bg-card);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Ensure close buttons look clean */
.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.btn-close:hover {
    opacity: 0.8;
}

/* Dark theme overrides for modals */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background-color: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
