/**
 * CodeIQ - Main Stylesheet
 * Modern, responsive design system for multi-session interface
 */

/* ==================== CSS RESET & BASE ==================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* ==================== CSS CUSTOM PROPERTIES ==================== */

:root {
    /* CodeIQ Editorial Rose Palette */
    --primary-50: #fdf5f7;
    --primary-100: #fae8ec;
    --primary-200: #f5d0d9;
    --primary-300: #e8a8b8;
    --primary-400: #d4899a;
    --primary-500: #c4576a;
    --primary-600: #9a4054;
    --primary-700: #7a3345;
    --primary-800: #5a2535;
    --primary-900: #3a1825;

    /* Rose Accent Colors - Editorial */
    --magenta-50: #fdf5f7;
    --magenta-100: #fae8ec;
    --magenta-200: #f5d0d9;
    --magenta-300: #e8a8b8;
    --magenta-400: #d4899a;
    --magenta-500: #c4576a;
    --magenta-600: #c4576a;
    --magenta-700: #9a4054;
    --magenta-800: #7a3345;
    --magenta-900: #5a2535;

    --gray-50: #faf8f5;
    --gray-100: #f5f2ed;
    --gray-200: #e8e4de;
    --gray-300: #d4d0c8;
    --gray-400: #999999;
    --gray-500: #6b6b6b;
    --gray-600: #3d3d3d;
    --gray-700: #3d3d3d;
    --gray-800: #1a1a1a;
    --gray-900: #1a1a1a;

    --success-50: #e8f9f0; /* New light success */
    --success-100: #cfeede;
    --success-200: #98e0b9;
    --success-400: #2ea46f; /* Muted green */
    --success-500: #258c5c;
    --success-600: #1d724a;
    --success-700: #165b3c;

    --warning-50: #fffdf0; /* New light warning */
    --warning-100: #fefad0;
    --warning-400: #f5b74f; /* Softer amber */
    --warning-500: #e09f2d;

    --error-50: #fff0f0; /* New light error */
    --error-100: #fde7e7;
    --error-400: #e05f63; /* Muted red */
    --error-500: #c83d40;
    --error-700: #9f2a2e;

    /* Semantic Colors - Editorial Warm Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #faf8f5;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #faf8f5 100%);
    --bg-hero: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-900) 100%);

    --text-primary: #1a1a1a;
    --text-secondary: #3d3d3d;
    --text-tertiary: #999999;
    --text-inverse: #ffffff;

    --border-light: #e8e4de;
    --border-medium: #d4d0c8;
    --border-dark: #c4c0b8;

    /* Platform Colors - Updated for better visibility */
    --pandle-primary: #7C3AED;      /* Vibrant purple for Pandle */
    --pandle-secondary: #6D28D9;
    --quickbooks-primary: #2CA01C;   /* QuickBooks green */
    --quickbooks-secondary: #16A34A;
    --xero-primary: #00B7E3;        /* Xero's official bright blue */
    --xero-secondary: #0891B2;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border Radius - Editorial tight */
    --radius-sm: 4px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-2xl: 8px;

    /* Shadows - Editorial minimal */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-tooltip: 1070;

    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ==================== LAYOUT COMPONENTS ==================== */

.codeiq-dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-gradient);
    position: relative;
}

.codeiq-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(154, 64, 84, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(154, 64, 84, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.codeiq-dashboard > * {
    position: relative;
    z-index: 1;
}

/* Tab Bar */
.tab-bar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    display: flex;
    align-items: center;
    min-height: 6rem;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: 0 2px 20px rgba(154, 64, 84, 0.1);
}

.codeiq-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-6);
    border-right: 1px solid var(--border-light);
    min-width: 320px;
    flex-shrink: 0;
}

.codeiq-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    max-width: 250px;
}

.codeiq-title {
    display: none; /* Hide text since logo includes "CodeIQ" text */
}

.tabs-container {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-right: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 200px;
    max-width: 280px;
    background-color: var(--bg-tertiary);
    position: relative;
}

/* Hidden tabs in overflow - MUST use !important to override display:flex */
.tab.overflow-hidden {
    display: none !important;
}

.tab:hover {
    background-color: var(--bg-secondary);
}

.tab.active {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--magenta-500);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--magenta-500);
}

/* Tab Overflow Menu - Shows when more than 5 tabs */
.tab-overflow-menu {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.tab-overflow-menu .overflow-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.tab-overflow-menu .overflow-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-300);
}

.tab-overflow-menu .overflow-toggle .overflow-count {
    color: var(--primary-600);
    font-weight: 600;
}

/* Overflow menu - uses tab structure, add specific overrides */
.tab.tab-overflow-menu {
    cursor: pointer;
    position: relative;
}

.tab.tab-overflow-menu .tab-title.overflow-count {
    color: var(--primary-600, #9a4054) !important;
    font-weight: 600 !important;
}

.tab.tab-overflow-menu .tab-subtitle {
    color: var(--text-secondary, #6b6b6b);
}

/* Arrow inside tab-status for overflow menu */
.tab-overflow-menu .overflow-arrow {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform 0.15s ease;
}

.tab-overflow-menu.open .overflow-arrow {
    transform: rotate(180deg);
}

.tab-overflow-menu .overflow-dropdown {
    position: fixed;
    top: auto;
    right: auto;
    min-width: 220px;
    max-width: 280px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 99999 !important;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.tab-overflow-menu.open .overflow-dropdown {
    display: block;
}

.tab-overflow-menu .overflow-tab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-light);
}

.tab-overflow-menu .overflow-tab-item:last-child {
    border-bottom: none;
}

.tab-overflow-menu .overflow-tab-item:hover {
    background: var(--primary-50);
}

.tab-overflow-menu .overflow-tab-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.tab-overflow-menu .overflow-tab-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-overflow-menu .overflow-tab-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tab-overflow-menu .overflow-tab-status.status-reviewing {
    background: var(--primary-500);
}

.tab-overflow-menu .overflow-tab-status.status-processing {
    background: var(--warning-400);
}

.tab-overflow-menu .overflow-tab-status.status-completed {
    background: var(--success-500);
}

.tab-overflow-menu .overflow-tab-status.status-error {
    background: var(--danger-500);
}

.tab-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.tab-info {
    flex: 1;
    min-width: 0;
}

.tab-title {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    truncate;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.tab-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.connecting {
    background-color: var(--warning-400);
    animation: pulse 2s infinite;
}

.status-indicator.processing {
    background-color: var(--primary-500);
    animation: pulse 2s infinite;
}

.status-indicator.ready {
    background-color: var(--success-400);
}

.status-indicator.error {
    background-color: var(--error-400);
    animation: pulse 2s infinite;
}

.progress-ring {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-500) 0deg, var(--gray-200) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.tab-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0;
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background-color: var(--error-100);
    color: var(--error-500);
}

/* Tab Overflow Menu - visibility controlled by JS */
.tab-overflow-menu {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: var(--space-2);
    margin-left: auto;
}

/* Overflow toggle styled to match .tab appearance */
.overflow-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    padding: var(--space-3, 12px) var(--space-4, 16px);
    background: var(--bg-tertiary, #faf8f5);
    border: none;
    border-right: 1px solid var(--border-light, #d4d0c8);
    border-radius: 0;
    color: var(--text-primary, #1e293b);
    font-size: var(--font-size-sm, 13px);
    font-weight: var(--font-weight-medium, 500);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    min-width: 80px;
    height: 100%;
}

.overflow-toggle:hover {
    background: var(--bg-secondary, #f5f2ed);
}

.overflow-toggle .overflow-count {
    color: var(--magenta-500, #9a4054);
    font-weight: 600;
}

.overflow-toggle .overflow-arrow {
    font-size: 10px;
    color: var(--text-tertiary, #94a3b8);
    transition: transform 0.15s ease;
}

/* When overflow menu is open - highlight tab */
.tab-overflow-menu.open {
    background: var(--bg-secondary, #f5f2ed) !important;
}

/* Arrow rotation when open - already handled above, but with fallback */
.tab-overflow-menu.open .tab-status .overflow-arrow {
    transform: rotate(180deg);
}

/* Dropdown uses fixed positioning to escape overflow:hidden parents */
.overflow-dropdown {
    position: fixed;
    min-width: 220px;
    max-width: 300px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-light, #d4d0c8);
    border-radius: var(--radius-lg, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 99999 !important;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

/* Dropdown shows when parent has .open class */
.tab-overflow-menu.open .overflow-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.overflow-tab-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

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

.overflow-tab-item:hover {
    background-color: var(--bg-secondary);
}

.overflow-tab-icon {
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.overflow-tab-name {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overflow-tab-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.overflow-tab-status.ready {
    background-color: var(--success-500);
}

.overflow-tab-status.processing {
    background-color: var(--warning-400);
    animation: pulse 2s infinite;
}

.overflow-tab-status.error {
    background-color: var(--error-500);
}

/* Close button for overflow dropdown items */
.overflow-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.overflow-tab-close:hover {
    background: var(--error-100);
    color: var(--error-600);
    opacity: 1;
}

.overflow-tab-close svg {
    width: 12px;
    height: 12px;
}

/* Tab Controls */
.tab-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    border-left: 1px solid var(--border-light);
}

.add-tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background-color: var(--primary-500);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-tab-btn:hover {
    background-color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.add-tab-btn .icon {
    font-size: var(--font-size-lg);
}

.back-to-dashboard-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: white;
    color: var(--primary-600);
    border: 1.5px solid var(--primary-600);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.back-to-dashboard-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-700);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(154, 64, 84, 0.12);
}

.back-to-dashboard-btn .icon {
    font-size: var(--font-size-lg);
}

/* Tour Button */
.codeiq-tour-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--magenta-500), var(--primary-500));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.codeiq-tour-btn:hover {
    background: linear-gradient(135deg, var(--magenta-600), var(--primary-600));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 87, 106, 0.3);
}

.codeiq-tour-btn svg {
    width: 14px;
    height: 14px;
}

/* CodeIQ Version Badge */
.codeiq-version {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-600);
    background: var(--primary-100);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--primary-200);
}

/* User Menu in Tab Bar */
.user-menu {
    position: relative;
    margin-left: var(--space-3);
}

.user-menu-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
    min-width: 120px;
}

.user-menu-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform var(--transition-fast);
}

.user-menu-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    z-index: 1000;
    margin-top: var(--space-2);
}

.user-menu-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.user-email {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.menu-divider {
    height: 1px;
    background: var(--border-light);
}

.menu-item {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: background-color var(--transition-fast);
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.menu-item:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

/* Tab Container - Full Width */
#tab-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

/* Tab System Wrapper - Created by TabManager.js */
.codeiq-tab-system {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    min-height: 0; /* Allow flex shrinking */
}

/* Tab Content */
.tab-content {
    flex: 1;
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background-color: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
}

/* ==================== SESSION CONTENT LAYOUTS ==================== */

.session-content {
    width: 100%;
    padding: 0 var(--space-4);
}

.session-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.session-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.platform-badge.pandle {
    background: linear-gradient(135deg, var(--pandle-primary) 0%, var(--pandle-secondary) 100%);
}

.platform-badge.quickbooks {
    background: linear-gradient(135deg, var(--quickbooks-primary) 0%, var(--quickbooks-secondary) 100%);
}

.platform-badge.xero {
    background: linear-gradient(135deg, var(--xero-primary) 0%, var(--xero-secondary) 100%);
}

.session-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.session-status.ready {
    background-color: var(--success-100);
    color: var(--success-700);
}

.session-status.error {
    background-color: var(--error-100);
    color: var(--error-700);
}

/* Session Stats */
.session-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #FCE4EC 100%);
    padding: var(--space-6) var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 15px rgba(196, 87, 106, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(196, 87, 106, 0.15);
    position: relative;
    overflow: hidden;
    min-width: 160px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #c4576a, #9a4054);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(196, 87, 106, 0.2);
    border-color: rgba(196, 87, 106, 0.3);
}

.stat-card.clickable-stat-card:hover {
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c4576a, #9a4054);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: #9a4054;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Session Actions */
.session-actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
    letter-spacing: -0.01em;
}

.action-btn.primary {
    background-color: var(--primary-600);
    color: white;
    box-shadow: 0 1px 3px rgba(154, 64, 84, 0.15);
}

.action-btn.primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(154, 64, 84, 0.25);
}

.action-btn.secondary {
    background-color: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn.secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Not all accounts ready state - subtle visual indicator */
.action-btn.primary.not-all-ready {
    background-color: var(--gray-400);
    box-shadow: none;
}

.action-btn.primary.not-all-ready:hover {
    background-color: var(--gray-500);
    transform: none;
    box-shadow: none;
}

.action-btn.success {
    background: white;
    color: #8b5cf6;
    border: 1.5px solid #8b5cf6;
    position: relative;
    z-index: 1;
    animation: post-button-glow-pulse 2s ease-in-out infinite;
}

.action-btn.success:hover {
    background: #fdf5f7;
    border-color: #7c3aed;
    color: #7c3aed;
    transform: translateY(-1px);
    animation: post-button-glow-pulse 1.5s ease-in-out infinite;
}

.action-btn.large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    min-width: 240px;
}

.action-btn .icon {
    font-size: var(--font-size-xl);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
    .tab-bar {
        min-height: 3rem;
    }
    
    .tab {
        min-width: 160px;
        max-width: 200px;
        padding: var(--space-2) var(--space-3);
    }
    
    .tab-title {
        font-size: var(--font-size-xs);
    }
    
    .add-tab-btn .text,
    .back-to-dashboard-btn .text,
    .codeiq-tour-btn span {
        display: none;
    }
    
    .tab-content {
        padding: var(--space-4);
    }
    
    .session-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .session-header h2 {
        font-size: var(--font-size-xl);
    }
    
    .session-stats {
        grid-template-columns: 1fr;
    }
    
    .session-actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tab {
        min-width: 120px;
        max-width: 150px;
    }
    
    .tab-subtitle {
        display: none;
    }
    
    .tab-content {
        padding: var(--space-3);
    }
}

/* ==================== ANIMATION KEYFRAMES ==================== */

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==================== UTILITY CLASSES ==================== */

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.slide-in {
    animation: slideIn var(--transition-normal) ease-out;
}

/* Focus styles for accessibility */
.tab:focus,
.action-btn:focus,
.add-tab-btn:focus,
.back-to-dashboard-btn:focus,
.codeiq-tour-btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ==================== COMPANY SELECTION ==================== */

.company-selection {
    max-width: 800px;
    margin: 0 auto;
}

.company-selection h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.company-selection p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.company-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-card:hover {
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.company-info {
    flex: 1;
}

.company-info h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.company-details {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.company-id,
.company-platform {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.company-action {
    color: var(--primary-500);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.no-companies {
    text-align: center;
    padding: var(--space-8);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--border-medium);
}

.no-companies p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* Loading Simple */
.loading-simple {
    text-align: center;
    padding: var(--space-10);
}

.loading-icon {
    margin-bottom: var(--space-4);
}

.loading-simple h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.loading-simple p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* Setup Actions */
.setup-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    margin-top: var(--space-6);
}

/* ==================== INTEGRATIONS MODAL ==================== */

.platform-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.platform-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.platform-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.platform-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.platform-icon {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.platform-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.platform-card .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* ==================== DASHBOARD SCREEN ==================== */

.dashboard-screen {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-8);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.dashboard-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-title p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-metric {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-metric:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.stat-metric::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    transform: skewX(-20deg) translateX(150%);
    transition: transform 0.5s;
}

.stat-metric:hover::after {
    transform: skewX(-20deg) translateX(-150%);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--primary-50);
    color: var(--primary-600);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* Dashboard Main Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-8);
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.activity-item {
    display: flex;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.quick-action-card:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    transform: translateX(4px);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-600);
    border: 1px solid var(--border-light);
}

.quick-action-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.quick-action-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Getting Started Timeline */
.getting-started-steps {
    position: relative;
    padding-left: 20px;
}

.getting-started-steps::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--border-light);
}

.timeline-step {
    position: relative;
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -20px; /* Adjust based on padding */
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-400);
    z-index: 1;
}

.timeline-step.active .timeline-marker {
    background: var(--primary-600);
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

/* ==================== MASTER USER SEARCH ==================== */

.master-user-search {
    max-width: 800px;
    margin: 0 auto;
}

.cache-status-info {
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    text-align: center;
}

.cache-indicator {
    font-weight: var(--font-weight-semibold);
    color: var(--primary-700);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-1);
}

.cache-details {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.search-input-container {
    position: relative;
    margin-bottom: var(--space-2);
}

.search-input {
    width: 100%;
    padding: var(--space-4) var(--space-12) var(--space-4) var(--space-4);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.1);
}

.search-icon {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: var(--font-size-lg);
    pointer-events: none;
}

.search-results-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
}

.search-stats {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.search-result-item {
    padding: var(--space-4);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

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

.search-result-item .company-name {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.search-result-item .company-platform {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.search-loading, .no-results, .search-error {
    padding: var(--space-8);
    text-align: center;
    color: var(--text-secondary);
}

.no-results-text, .error-text {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.no-results-hint, .error-details {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.search-error .error-text {
    color: var(--error-500);
}

/* ==================== UPLOAD SECTION ==================== */

.upload-section {
    margin: var(--space-8) 0;
}

.upload-header {
    margin-bottom: var(--space-6);
}

.upload-header h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.upload-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* Bank Cards Grid */
.banks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.bank-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.bank-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bank-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.bank-info {
    flex: 1;
}

.bank-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.bank-type {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.bank-details {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.bank-balance {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--success-600);
    background-color: var(--success-50);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.account-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.account-number {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-family: monospace;
    font-weight: var(--font-weight-medium);
}

.platform-badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--primary-700);
    background-color: var(--primary-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bank-accounts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
}

.bank-accounts-loading .loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.bank-accounts-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.bank-accounts-loading .loading-text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.bank-accounts-loading .loading-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Upload Areas */
.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.upload-area:hover {
    border-color: var(--primary-500);
    background-color: var(--primary-50);
}

.upload-area.dragover {
    border-color: var(--primary-500);
    background-color: var(--primary-100);
    transform: scale(1.02);
}

.upload-area.has-file {
    border-color: var(--success-400);
    background-color: var(--success-50);
}

.upload-area.uploading {
    pointer-events: none;
    opacity: 0.92;
}

.upload-area.upload-error {
    border-color: var(--error-400);
    background-color: var(--error-50);
}

.upload-area.no-transactions {
    border-color: var(--warning-400);
    background-color: var(--warning-50);
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.upload-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-2);
}

.upload-text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.upload-hint {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.upload-progress {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.upload-progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.upload-progress-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--primary-100);
    border-top-color: var(--primary-500);
    animation: upload-spin 0.9s linear infinite;
}

.upload-progress-icon {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background-color: var(--success-100);
    color: var(--success-700);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
}

.upload-progress-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    text-align: center;
}

.upload-progress-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.upload-progress-subtext {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    min-height: 1em;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    transition: width var(--transition-fast);
}

.upload-progress.success .upload-progress-fill {
    background: linear-gradient(90deg, var(--success-400), var(--success-600));
}

.upload-progress.error .upload-progress-fill {
    background: linear-gradient(90deg, var(--error-400), var(--error-600));
}

.upload-progress.error .upload-progress-icon {
    background-color: var(--error-100);
    color: var(--error-600);
}

@keyframes upload-spin {
    to {
        transform: rotate(360deg);
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    width: 100%;
}

.file-icon {
    font-size: var(--font-size-xl);
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.file-size {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.file-origin-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-left: var(--space-2);
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    background-color: var(--primary-50);
    color: var(--primary-600);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.mapping-status {
    margin-top: var(--space-1);
}

.mapping-indicator {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    gap: var(--space-1);
    background-color: var(--success-100);
    color: var(--success-700);
}

.mapping-indicator.success {
    background-color: var(--success-100);
    color: var(--success-700);
}

.mapping-indicator.pending {
    background-color: var(--warning-100);
    color: var(--warning-700);
}

.mapping-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
}

.remove-file {
    background: none;
    border: none;
    color: var(--error-500);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.remove-file:hover {
    background-color: var(--error-100);
    color: var(--error-600);
}

/* No Transactions Toggle */
.no-transactions-toggle {
    margin-top: var(--space-4);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.toggle-container input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--gray-300);
    border-radius: 24px;
    transition: background-color var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--warning-400);
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-weight: var(--font-weight-medium);
}

/* Upload Summary */
.upload-summary {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.summary-stats {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-stat .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--primary-600);
    margin-bottom: var(--space-1);
}

.summary-stat .stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.process-actions {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

/* Responsive Upload Section */
@media (max-width: 768px) {
    .banks-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-stats {
        justify-content: center;
    }
    
    .process-actions {
        width: 100%;
        justify-content: center;
    }
    
    .action-btn {
        flex: 1;
        min-width: 140px;
    }
}

/* ==================== REVIEWING STATE ==================== */

.reviewing-state {
    width: 100%;
    margin: 0 auto;
}

.review-summary {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin: var(--space-8) 0;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.summary-header {
    margin-bottom: var(--space-6);
}

.summary-header h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.summary-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.review-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.review-stats .stat-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-fast);
}

.review-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.review-stats .stat-card.success {
    border-left: 4px solid var(--success-400);
}

.review-stats .stat-card.warning {
    border-left: 4px solid var(--warning-400);
}

.review-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.review-actions .action-btn.large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    min-width: 240px;
}

/* Responsive Reviewing Section */
@media (max-width: 768px) {
    .review-stats {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .review-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .review-actions .action-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .review-actions .action-btn.large {
        min-width: auto;
    }
}

/* ==================== TRANSACTION REVIEW TABLE ==================== */

.transaction-review-container {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-sm);
}

.transaction-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--space-4);
}

.transaction-review-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.transaction-count-badge {
    background-color: var(--primary-100);
    color: var(--primary-700);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    border: 1px solid var(--primary-200);
}

.transaction-table {
    width: 100%;
    max-width: 1300px; /* Default for Pandle/Sage (11 columns) */
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Xero and QuickBooks tables need more width for platform-specific columns (14 columns vs 11) */
.transaction-table.xero-table,
.review-table-container.xero-platform .transaction-table,
.transaction-table.quickbooks-table,
.review-table-container.quickbooks-platform .transaction-table {
    max-width: 1800px !important;
    min-width: 1600px !important;
}

/* Container must also be wider for Xero/QuickBooks to prevent constraining the table */
.review-table-container.xero-platform,
.review-table-container.quickbooks-platform {
    max-width: 1900px !important;
}

.transaction-table thead {
    background: linear-gradient(to bottom, var(--gray-50), var(--gray-100));
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--gray-200);
}

.transaction-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.transaction-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 14px;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.transaction-table tr:hover td {
    background-color: var(--primary-50);
}

.amount-cell {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: right;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    gap: 6px;
}

.method-badge, .transaction-type-badge {
    border-radius: 50px;
    padding: 4px 12px;
    font-weight: 500;
    font-size: 12px;
}

/* Floating Action Bar */
.floating-action-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: var(--z-sticky);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-action-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fab-count {
    background: var(--primary-600);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.fab-actions {
    display: flex;
    gap: 12px;
}

/* Skeleton Loading */
.skeleton-row td {
    padding: 16px 20px;
}

.skeleton-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

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

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

.transaction-table .col-contact,
.transaction-table .col-tracking,
.transaction-table .vendor-cell,
.transaction-table .customer-cell,
.transaction-table .class-cell {
    min-width: 160px;
}

.contact-dropdown,
.tracking-dropdown,
.vendor-dropdown,
.customer-dropdown,
.class-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 150px;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.contact-dropdown.suggested,
.tracking-dropdown.suggested {
    border-color: var(--warning-400);
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-500);
}

.contact-dropdown.confirmed,
.tracking-dropdown.confirmed {
    border-color: var(--success-400);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-600);
}

/* Auto-created contacts - purple rim styling */
.contact-dropdown.auto-created-contact {
    border: 2px solid var(--magenta-500);
    border-radius: 6px;
    background: rgba(196, 87, 106, 0.08);
    box-shadow: 0 0 0 1px rgba(196, 87, 106, 0.15);
    position: relative;
}

.contact-dropdown.auto-created-contact::after {
    content: '✨ Auto-created';
    position: absolute;
    top: -8px;
    right: 4px;
    font-size: 9px;
    background: var(--magenta-500);
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Auto-created contacts within dropdown list - purple highlight */
.dropdown-option.auto-created-contact-option {
    background: rgba(196, 87, 106, 0.12);
    border-left: 3px solid var(--magenta-500);
    position: relative;
}

.dropdown-option.auto-created-contact-option::after {
    content: '✨';
    margin-left: 6px;
    font-size: 10px;
    opacity: 0.8;
}

.dropdown-option.auto-created-contact-option:hover {
    background: rgba(196, 87, 106, 0.20);
}

/* Auto-created contacts in native select dropdowns (TabManager) */
option.auto-created-option {
    background: rgba(139, 92, 246, 0.15);  /* Works in Firefox */
    color: #7c3aed;  /* Purple text - works in all browsers */
    font-weight: 600;
}

.tracking-placeholder {
    font-size: 11px;
    color: var(--gray-500);
}

/* All select dropdowns in transaction table should be compact */
.transaction-table td select,
select.account-select,
select.vat-select,
select.contact-select,
select.tracking1-select,
select.tracking2-select {
    font-size: 11px !important;
    padding: 3px 5px !important;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    width: 100%;
    max-width: 160px;
    line-height: 1.3 !important;
}

.transaction-table td select option,
select.account-select option,
select.vat-select option,
select.contact-select option,
select.tracking1-select option,
select.tracking2-select option {
    font-size: 11px !important;
    padding: 3px;
    line-height: 1.3 !important;
}

.transaction-row {
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--gray-150);
}

/* Zebra striping for better row scanning */
.transaction-table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

/* Enhanced hover state */
.transaction-row:hover {
    background-color: var(--primary-50) !important;
    box-shadow: inset 3px 0 0 var(--primary-500);
    transform: translateX(2px);
}

.transaction-row.processing {
    background-color: var(--primary-50);
    animation: pulse 2s ease-in-out infinite;
}

.transaction-row.matched {
    background-color: rgba(16, 185, 129, 0.05);
}

.transaction-row.unmatched {
    background-color: rgba(239, 68, 68, 0.05);
}

.transaction-date {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
}

.transaction-description {
    color: var(--text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-amount {
    font-weight: var(--font-weight-semibold);
    text-align: right;
    white-space: nowrap;
}

.transaction-amount.credit {
    color: var(--success-500);
}

.transaction-amount.debit {
    color: var(--error-500);
}

.transaction-status {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transaction-status.processing {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.transaction-status.matched {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-700);
}

.transaction-status.unmatched {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-700);
}

.transaction-status.pending {
    background-color: var(--warning-100);
    color: var(--warning-700);
}

.transaction-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

.transaction-action-btn {
    padding: var(--space-1) var(--space-2);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.transaction-action-btn.view {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.transaction-action-btn.view:hover {
    background-color: var(--gray-200);
}

.transaction-action-btn.edit {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.transaction-action-btn.edit:hover {
    background-color: var(--primary-200);
}

.transaction-summary-row {
    background-color: var(--gray-50);
    border-top: 2px solid var(--border-medium);
}

.transaction-summary-row td {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.empty-transactions {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-secondary);
}

.empty-transactions .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    opacity: 0.5;
}

/* Responsive Transaction Table */
@media (max-width: 768px) {
    .transaction-table {
        font-size: var(--font-size-sm);
    }
    
    .transaction-table th,
    .transaction-table td {
        padding: var(--space-3) var(--space-4);
    }
    
    .transaction-description {
        max-width: 120px;
    }
    
    .transaction-actions {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .transaction-action-btn {
        font-size: var(--font-size-xs);
        padding: var(--space-1);
    }
}

@media (max-width: 480px) {
    .transaction-review-container {
        padding: var(--space-4);
        margin: var(--space-4) 0;
    }
    
    .transaction-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .transaction-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .transaction-table thead,
    .transaction-table tbody,
    .transaction-table th,
    .transaction-table td,
    .transaction-table tr {
        display: block;
    }
    
    .transaction-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .transaction-table tr {
        border: 1px solid var(--border-light);
        margin-bottom: var(--space-2);
        padding: var(--space-3);
        border-radius: var(--radius-md);
        background-color: var(--bg-primary);
    }
    
    .transaction-table td {
        border: none;
        position: relative;
        padding-left: 35%;
        padding-top: var(--space-2);
        padding-bottom: var(--space-2);
    }
    
    .transaction-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: var(--space-3);
        width: 30%;
        padding-right: var(--space-2);
        white-space: nowrap;
        font-weight: var(--font-weight-semibold);
        color: var(--text-secondary);
        font-size: var(--font-size-xs);
    }
}

/* ==================== TRANSACTION REVIEW INTERFACE ==================== */

.review-interface {
    width: 100%;
    padding: var(--space-4) var(--space-6);
}

.review-header {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.review-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
}

.review-title {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--gray-100);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-600);
}

.back-btn:hover {
    background-color: var(--gray-200);
    color: var(--gray-700);
    transform: translateX(-2px);
}

.review-title h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--primary-700);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.review-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: var(--space-1) 0 0 0;
}

.review-actions {
    display: flex;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Summary Cards */
.review-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.summary-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--primary-50) 100%);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(154, 64, 84, 0.15);
    border-color: var(--primary-400);
}

.summary-card.success {
    border-left: 4px solid var(--success-500);
    background-color: rgba(16, 185, 129, 0.02);
}

.summary-card.warning {
    border-left: 4px solid var(--warning-500);
    background-color: rgba(245, 158, 11, 0.02);
}

.summary-card.error {
    border-left: 4px solid var(--error-500);
    background-color: rgba(239, 68, 68, 0.02);
}

.summary-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    line-height: 1.2;
}

.summary-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Filter Tabs */
.review-filters {
    background: linear-gradient(to bottom, var(--gray-50), white);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.filter-tab {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-600);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
    color: var(--primary-600);
    transform: translateY(-1px);
}

.filter-tab.active {
    background: var(--primary-500);
    border-color: var(--primary-600);
    color: white;
    box-shadow: 0 4px 6px rgba(154, 64, 84, 0.2);
}

.filter-tab.active:hover {
    background: var(--primary-600);
    transform: none;
}

/* Simple Summary */
.review-summary-simple {
    margin-bottom: 1.5rem;
    text-align: center;
}

.transaction-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Selection Counter */
.search-and-counter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.selection-counter {
    background: linear-gradient(135deg, #9a4054 0%, #9a4054 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(154, 64, 84, 0.3);
}

.counter-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.counter-value {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Transaction Table */
.review-table-container {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-8);
    width: 100%;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-light);
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.transactions-table thead {
    background-color: var(--gray-50);
}

.transactions-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    height: 48px;
}

.transactions-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Zebra striping for better row scanning */
.transactions-table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

/* Table Cell Styling */
.date-cell {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-family: monospace;
    white-space: nowrap;
    font-size: 11px !important;
    padding: 6px 8px !important;
}

.description-cell {
    max-width: 200px;
    color: var(--gray-800);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px !important;
    padding: 6px 8px !important;
}

.description-cell .description-text {
    font-size: 11px !important;
    line-height: 1.3;
}

.description-cell .description-meta {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 2px;
}

.amount-cell {
    text-align: right;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    white-space: nowrap;
    font-size: 11px !important;
    padding: 6px 8px !important;
}

.amount-cell.positive {
    color: #16a34a;
}

.amount-cell.negative {
    color: #dc2626;
}

/* Compact table cell styling for review table */
.account-code-cell,
.vat-code-cell,
.method-cell,
.conversion-rate-cell,
.transaction-type-cell {
    font-size: 11px !important;
    padding: 6px 8px !important;
}

.account-code-cell select,
.vat-code-cell select,
.transaction-type-cell select {
    font-size: 11px !important;
    padding: 3px 5px !important;
    max-width: 140px;
    border-radius: 4px;
    width: 100%;
    line-height: 1.3 !important;
}

.account-code-cell select option,
.vat-code-cell select option,
.transaction-type-cell select option {
    font-size: 11px !important;
    padding: 3px;
    line-height: 1.3 !important;
}

.method-cell .method-badge {
    font-size: 9px !important;
    padding: 2px 6px;
    letter-spacing: 0.02em;
}

.conversion-rate-cell {
    font-family: monospace;
    font-size: 10px;
    text-align: center;
}

.checkbox-cell {
    padding: 6px 8px !important;
    width: 30px;
}

/* Confidence Badges */
.confidence-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    text-align: center;
    min-width: 45px;
    justify-content: center;
}

.confidence-high {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
    border: 1px solid #22c55e;
}

.confidence-medium {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    color: #d97706;
    border: 1px solid #f59e0b;
}

.confidence-low {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    border: 1px solid #ef4444;
}

/* Method Badge */
.method-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    background-color: var(--gray-100);
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Transaction Type Badge */
.transaction-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-transform: capitalize;
    min-width: 65px;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.transaction-type-badge.clickable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.transaction-type-badge.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    filter: brightness(1.05);
}

.transaction-type-badge.clickable:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Transaction Type Modal */
.transaction-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.transaction-type-modal.active {
    opacity: 1;
    visibility: visible;
}

.transaction-type-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    padding: var(--space-6);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.transaction-type-modal.active .transaction-type-modal-content {
    transform: scale(1);
}

.transaction-type-modal-header {
    text-align: center;
    margin-bottom: var(--space-4);
}

.transaction-type-modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.transaction-type-modal-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.transaction-type-options {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.transaction-type-option {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.transaction-type-option:hover {
    border-color: var(--blue-300);
    background: var(--blue-50);
}

.transaction-type-option.selected {
    border-color: var(--blue-500);
    background: var(--blue-100);
}

.transaction-type-option-badge {
    margin-right: var(--space-3);
    flex-shrink: 0;
}

.transaction-type-option-info {
    flex: 1;
}

.transaction-type-option-name {
    font-weight: var(--font-weight-medium);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.transaction-type-option-description {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
}

.transaction-type-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

.transaction-type-modal-button {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: var(--font-size-sm);
}

.transaction-type-modal-button-cancel {
    background: var(--gray-100);
    color: var(--gray-700);
}

.transaction-type-modal-button-cancel:hover {
    background: var(--gray-200);
}

.transaction-type-modal-button-confirm {
    background: var(--blue-600);
    color: white;
}

.transaction-type-modal-button-confirm:hover {
    background: var(--blue-700);
}

.transaction-type-modal-button-confirm:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Invoice Dropdown Styling */
.invoice-dropdown-header, .coa-dropdown-header {
    padding: var(--space-3);
    background: var(--blue-50);
    border-bottom: 1px solid var(--blue-200);
    text-align: center;
}

.invoice-dropdown-title, .coa-dropdown-title {
    font-weight: var(--font-weight-semibold);
    color: var(--blue-800);
    margin-bottom: var(--space-1);
}

.invoice-dropdown-count, .coa-dropdown-count {
    font-size: var(--font-size-xs);
    color: var(--blue-600);
}

.invoice-dropdown-group {
    margin-bottom: var(--space-2);
}

.invoice-dropdown-group-header, .coa-dropdown-group-header {
    padding: var(--space-2) var(--space-3);
    background: var(--gray-50);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.invoice-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.invoice-option:hover {
    background: var(--blue-50);
    border-left: 3px solid var(--blue-500);
}

.invoice-option.overdue {
    background: var(--red-50);
    border-left: 3px solid var(--red-500);
}

.invoice-option.overdue:hover {
    background: var(--red-100);
}

.invoice-option-info {
    flex: 1;
}

.invoice-option-number {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.invoice-option-details {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.4;
}

.invoice-option-amount {
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    font-size: var(--font-size-lg);
}

.overdue-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    background: var(--red-100);
    color: var(--red-800);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-sm);
    margin-top: var(--space-1);
}

.coa-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.coa-option:hover {
    background: var(--gray-50);
    border-left: 3px solid var(--blue-500);
}

/* No Invoices Available State */
.no-invoices-available, .invoice-error-state, .coa-error-state {
    padding: var(--space-6);
    text-align: center;
    background: var(--yellow-50);
    border: 1px solid var(--yellow-200);
    border-radius: var(--radius-md);
}

.no-invoices-icon, .invoice-error-icon, .coa-error-icon {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.no-invoices-title, .invoice-error-title, .coa-error-title {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.no-invoices-description, .invoice-error-description, .coa-error-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.5;
}

.loading-state {
    padding: var(--space-4);
    text-align: center;
    color: var(--blue-600);
    font-style: italic;
}

.transaction-type-badge.type-money-in {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.transaction-type-badge.type-money-out {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.transaction-type-badge.type-customer-receipt {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.transaction-type-badge.type-supplier-payment {
    background-color: #fae8ec;
    color: #9a4054;
    border: 1px solid #d8b4fe;
}

.transaction-type-badge.type-unknown {
    background-color: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

/* Transaction Type Dropdown */
.transaction-type-dropdown {
    padding: 4px 8px;
    border: 1px solid #c4c0b8;
    border-radius: 4px;
    background: white;
    font-size: 12px;
    color: var(--gray-700);
    cursor: pointer;
    min-width: 120px;
}

.transaction-type-dropdown:hover {
    border-color: var(--blue-400);
}

.transaction-type-dropdown:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.transaction-type-cell {
    min-width: 140px;
}

/* Invoice Info Display */
.invoice-info-container {
    max-width: 300px;
    padding: 8px;
    background: #faf8f5;
    border: 1px solid #d4d0c8;
    border-radius: 6px;
    font-size: 12px;
}

.invoice-header {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.invoice-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-badge.sales {
    background: #dcfdf4;
    color: #065f46;
}

.invoice-badge.purchase {
    background: #fef3c7;
    color: #92400e;
}

.overdue-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.invoice-details > div {
    margin-bottom: 4px;
}

.invoice-note {
    margin-top: 6px;
    padding: 4px;
    background: #eff6ff;
    color: #1e40af;
    font-style: italic;
    font-size: 11px;
    border-radius: 3px;
}

.no-invoice-container {
    max-width: 300px;
    padding: 8px;
    background: #fef9c3;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 12px;
}

.no-invoice-message {
    display: flex;
    gap: 8px;
}

.warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.message-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 2px;
}

.message-text {
    color: #78350f;
    margin-bottom: 4px;
}

.message-suggestion {
    color: #78350f;
    font-style: italic;
    font-size: 11px;
}

/* Transaction Processing Header */
.transaction-processing-header {
    background: #ffffff;
    border-left: 4px solid var(--magenta-500);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.processing-icon {
    color: var(--magenta-500);
    margin-bottom: 1rem;
}

.processing-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-700);
    margin-bottom: 0.5rem;
    font-style: normal;
}

.processing-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-700);
    margin: 0;
    font-style: normal;
}

/* Conversion Rate Display */
.conversion-rate {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    padding: var(--space-1) var(--space-2);
    background-color: #fefce8;
    border-radius: var(--radius-sm);
    border: 1px solid #fde68a;
}

.no-conversion {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    text-align: center;
}

/* Transaction Search */
/* Neon Cyberpunk Metric Pills */
.metrics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 32px;
    max-width: 1400px; /* Match table width for Pandle/Sage */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Platform-specific widths for Xero/QuickBooks */
.review-interface.xero-platform .metrics-container,
.review-interface.quickbooks-platform .metrics-container {
    max-width: 1880px; /* Match table width for Xero/QB */
}

/* Transaction Stats - Minimal Inline Display */
.transaction-stats-inline {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-600);
    padding: 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.transaction-stats-inline strong {
    font-weight: 600;
    color: var(--primary-600);
}

.transaction-stats-inline .stats-separator {
    color: var(--gray-300);
    margin: 0 8px;
    font-weight: 300;
}

/* RiQ Flag Star - Permanent indicator for flagged transactions */
.riq-flag-star {
    display: inline-block !important;
    margin-left: 8px;
    color: #3b82f6 !important;
    font-size: 18px;
    line-height: 1;
    cursor: help;
    animation: riq-flag-pulse 2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    position: relative;
    z-index: 100;
    vertical-align: middle;
}

@keyframes riq-flag-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Temporary highlight effect when flagged transactions are shown */
.transaction-row.riq-flagged {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    animation: riq-highlight-fade 3s ease-out;
}

@keyframes riq-highlight-fade {
    0% {
        background: rgba(59, 130, 246, 0.25);
    }
    100% {
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    }
}

/* Controls Container - Aligned with table */
.review-controls-wrapper {
    max-width: 1400px; /* Match table width for Pandle/Sage */
    margin: 0 auto 20px auto;
}

/* Platform-specific widths for Xero/QuickBooks */
.review-interface.xero-platform .review-controls-wrapper,
.review-interface.quickbooks-platform .review-controls-wrapper {
    max-width: 1880px; /* Match table width for Xero/QB */
}

/* Bank Account Tabs Container */
.bank-account-tabs {
    max-width: 1400px; /* Match table width for Pandle/Sage */
    margin: 0 auto 24px auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px;
}

/* Platform-specific widths for Xero/QuickBooks */
.review-interface.xero-platform .bank-account-tabs,
.review-interface.quickbooks-platform .bank-account-tabs {
    max-width: 1880px; /* Match table width for Xero/QB */
}

.bank-tab {
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(196, 87, 106, 0.1) 0%, rgba(255, 64, 129, 0.05) 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bank-tab:hover {
    background: linear-gradient(135deg, rgba(196, 87, 106, 0.15) 0%, rgba(255, 64, 129, 0.1) 100%);
    border-color: rgba(196, 87, 106, 0.3);
    transform: translateY(-1px);
}

.bank-tab.active {
    background: linear-gradient(135deg, #c4576a 0%, #d4899a 100%);
    color: white;
    border-color: #c4576a;
    box-shadow: 0 4px 12px rgba(196, 87, 106, 0.3);
}

.transaction-search-container {
    position: relative;
    margin-bottom: var(--space-3);
    max-width: 400px;
}

.transaction-search-input {
    width: 100%;
    padding: var(--space-2) var(--space-8) var(--space-2) var(--space-2);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.transaction-search-input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.1);
    background: white;
}

.transaction-search-container .search-icon {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-200);
    color: var(--gray-500);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--gray-400);
    color: white;
}

/* Transaction Filter Dropdown */
.transaction-filter-container {
    position: relative;
    margin-left: var(--space-3);
}

.transaction-filter-select {
    min-width: 160px;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.transaction-filter-select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.1);
}

.transaction-filter-select:hover {
    border-color: var(--gray-400);
}

.transaction-filter-select option {
    padding: var(--space-1);
    color: var(--gray-700);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background-color: var(--gray-50);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-light);
}


/* Transaction Row States */
.transaction-row.selected {
    background-color: var(--primary-100) !important;
    box-shadow: inset 4px 0 0 var(--primary-600);
}

/* Invoice Match Styling */
.account-dropdown.invoice-match {
    border: 2px solid #9a4054 !important; /* Purple border for invoice matches */
    background: linear-gradient(135deg, #fdf5f7, #fae8ec);
    cursor: default !important;
}

.account-dropdown.invoice-match:hover {
    border-color: #9a4054 !important; /* Keep purple on hover */
}

.invoice-ref-display {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fdf5f7, #fae8ec);
    border: 1px solid #9a4054;
    border-radius: 6px;
}

.invoice-ref-badge {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #6b21a8;
}

/* Bulk Edit Confirmation Modal */
.bulk-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.bulk-edit-modal.show {
    display: flex;
}

.bulk-edit-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bulk-edit-modal h3 {
    margin: 0 0 var(--space-4) 0;
    color: var(--gray-900);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

.bulk-edit-modal p {
    margin: 0 0 var(--space-6) 0;
    color: var(--gray-600);
    line-height: 1.5;
}

.bulk-edit-modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

.modal-btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-cancel {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-btn-cancel:hover {
    background: var(--gray-200);
}

.modal-btn-confirm {
    background: var(--primary-500);
    color: white;
}

.modal-btn-confirm:hover {
    background: var(--primary-600);
}

/* Form Controls */
.txn-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

.account-select {
    position: relative;
    min-width: 140px;
    max-width: 160px;
}

.account-dropdown {
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.account-dropdown option {
    font-size: 11px;
    padding: 4px;
}

.account-dropdown:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.account-dropdown:focus {
    outline: none;
    border-color: var(--primary-500);
}

.account-current {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.account-code {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 9px;
    white-space: nowrap;
    flex-shrink: 0;
}

.account-name {
    color: var(--gray-600);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--gray-500);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 2px;
}

.dropdown-menu.active,
.dropdown-menu.show {
    display: block;
}

/* VAT select styling - Compact for review table */
.vat-select {
    position: relative;
    min-width: 110px;
    max-width: 140px;
}

.vat-dropdown {
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.vat-dropdown option {
    font-size: 11px;
    padding: 4px;
}

.vat-dropdown:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.vat-dropdown:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* Invoice match display - Compact for review table */
.invoice-match-display {
    padding: 4px 8px !important;
    background: linear-gradient(135deg, #fdf5f7, #fae8ec) !important;
    border: 1px solid #9a4054 !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    color: #6b21a8 !important;
    font-size: 9px !important;
    max-width: 160px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

/* Pagination */
.review-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px; /* Default for Pandle/Sage */
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-6);
    box-shadow: var(--shadow-sm);
}

/* Platform-specific widths for Xero/QuickBooks */
.review-interface.xero-platform .review-pagination,
.review-interface.quickbooks-platform .review-pagination {
    max-width: 1800px;
}

.pagination-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

/* Selected count display - shown on left side of pagination bar */
.selected-count-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(154, 64, 84, 0.1);
    border: 1px solid rgba(154, 64, 84, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #9a4054;
    margin-right: auto;
}

.selected-count-display .selected-count-number {
    font-weight: 700;
    color: #9a4054;
}

.pagination-pages {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-50);
    border-color: var(--primary-400);
    color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--gray-50);
}

.pagination-current {
    padding: 6px 12px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

/* Action Buttons */
.action-btn.small {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
    min-width: auto;
}

/* Search Input Styling */
.search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.search-input:hover {
    border-color: var(--border-medium);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* General Form Input Styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
textarea:hover,
select:hover {
    border-color: var(--border-medium);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.1);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--gray-100);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* File Input Styling */
.file-input {
    padding: var(--space-3);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-input:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

/* Checkbox and Radio Styling */
input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

/* Focus styles for all interactive elements */
button:focus,
.tab:focus,
.action-btn:focus,
.add-tab-btn:focus,
.back-to-dashboard-btn:focus,
.codeiq-tour-btn:focus,
.back-btn:focus,
.filter-tab:focus,
.pagination-btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Responsive Design for Review Interface */
@media (max-width: 1024px) {
    .review-interface {
        padding: var(--space-4);
    }
    
    .review-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }
    
    .review-actions {
        justify-content: stretch;
    }
    
    .review-actions .action-btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .review-interface {
        padding: var(--space-3);
    }
    
    .review-header,
    .review-filters,
    .review-table-container,
    .review-pagination {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
    }
    
    .review-summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .filter-tabs {
        flex-wrap: wrap;
        gap: var(--space-1);
    }
    
    .filter-tab {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }
    
    /* Hide less critical columns on mobile */
    .transactions-table th:nth-child(6), /* Confidence */
    .transactions-table td:nth-child(6),
    .transactions-table th:nth-child(7), /* Method */
    .transactions-table td:nth-child(7) {
        display: none;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: var(--space-2) var(--space-3);
    }
    
    .description-cell {
        max-width: 150px;
    }
    
    .account-select {
        width: 150px;
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .review-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .review-title {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .review-title h2 {
        font-size: var(--font-size-xl);
    }
    
    .back-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Stack table horizontally scrollable */
    .review-table-container {
        padding: var(--space-2);
    }
    
    .transactions-table {
        width: 100%;
        font-size: var(--font-size-xs);
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: var(--space-1) var(--space-2);
    }
    
    .description-cell {
        max-width: 120px;
    }
    
    .account-select {
        width: 120px;
        padding: var(--space-1) var(--space-2);
    }
    
    .action-btn.small {
        padding: var(--space-1) var(--space-2);
        font-size: 10px;
    }
    
    .pagination-info {
        font-size: var(--font-size-xs);
    }
    
    .pagination-btn {
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-size-xs);
    }
}

/* ==================== SUCCESS MESSAGE STYLES ==================== */

.session-content.completed .success-message {
    padding: var(--space-8);
    text-align: center;
}

.session-status.success {
    background-color: var(--success-100);
    color: var(--success-700);
    border-left: 4px solid var(--success-500);
}

.success-content {
    margin-bottom: var(--space-6);
}

.success-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.success-content h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--success-700);
    margin-bottom: var(--space-2);
}

.success-content p {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    margin-bottom: var(--space-6);
}

.completion-stats {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.completion-stats .stat-card {
    background: white;
    border: 1px solid var(--success-200);
    border-left: 4px solid var(--success-500);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
}

.completion-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.completion-stats .stat-card .stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--success-600);
    margin-bottom: var(--space-1);
}

.completion-stats .stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: var(--font-weight-medium);
}

.review-actions .review-btn {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulse-success 2s infinite;
}

.review-actions .review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, var(--success-600) 0%, var(--success-700) 100%);
}

.review-actions .review-btn:active {
    transform: translateY(0);
}

@keyframes pulse-success {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
    }
}

/* Transaction Type Modal Styles */
.transaction-type-modal {
    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: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.transaction-type-modal.active {
    opacity: 1;
    visibility: visible;
}

.transaction-type-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.transaction-type-modal-header {
    padding: var(--space-6) var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.transaction-type-modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin: 0 0 var(--space-2);
}

.transaction-type-modal-description {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin: 0;
}

.transaction-type-options {
    padding: var(--space-4) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.transaction-type-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.transaction-type-option:hover {
    border-color: var(--blue-300);
    background: var(--blue-50);
}

.transaction-type-option.selected {
    border-color: var(--blue-500);
    background: var(--blue-50);
}

.transaction-type-option.selected::after {
    content: '✓';
    position: absolute;
    top: var(--space-2);
    right: var(--space-3);
    color: var(--blue-600);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.transaction-type-option-badge .transaction-type-badge {
    pointer-events: none;
}

.transaction-type-option-info {
    flex: 1;
}

.transaction-type-option-name {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.transaction-type-option-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.4;
}

.transaction-type-modal-actions {
    padding: var(--space-4) var(--space-6) var(--space-6);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    border-top: 1px solid var(--gray-200);
}

.transaction-type-modal-button {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-size-sm);
}

.transaction-type-modal-button-cancel {
    background: var(--gray-100);
    color: var(--gray-700);
}

.transaction-type-modal-button-cancel:hover {
    background: var(--gray-200);
}

.transaction-type-modal-button-confirm {
    background: var(--blue-600);
    color: white;
}

.transaction-type-modal-button-confirm:hover:not(:disabled) {
    background: var(--blue-700);
}

.transaction-type-modal-button-confirm:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Print styles */
@media print {
    .tab-bar,
    .session-actions,
    .action-btn {
        display: none;
    }
    
    .tab-content {
        padding: 0;
    }
}

/* ==================== INVOICE MATCH HIGHLIGHT ==================== */
.account-select.invoice-mode {
    border: 2px solid var(--primary-300); /* stronger purple border */
    box-shadow: 0 0 0 3px rgba(154, 64, 84, 0.12);
    border-radius: 6px;
}

/* ==================== TAB PROGRESS INDICATOR ==================== */

.tab-progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
    margin-left: 8px;
}

.progress-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    box-shadow: inset 0 0 0 1px var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-height: 100%;
    max-width: 100%;
}

.circle-bg {
    stroke: var(--gray-200);
    stroke-width: 3;
    fill: none;
}

.circle {
    stroke: url(#progressGradient);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dasharray .3s ease;
    transform: rotate(-90deg);
    transform-origin: center;
}

.progress-text-percent {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    pointer-events: none;
    user-select: none;
}

/* ==================== WIZARD MODAL STYLES (Pandle Init) ==================== */

.codeiq-wizard-modal {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wizard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    text-align: center;
}

.wizard-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}

.pandle-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    position: relative;
    padding: 0 10px;
}

.pandle-steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
    transform: translateY(-50%);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid var(--gray-300);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.step-item.active .step-label {
    color: var(--primary-600);
    font-weight: 600;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: transparent; /* Actual connector is in ::before of parent */
    margin: 0 -4px; /* Adjust to cover space between step numbers */
    position: relative;
    z-index: 1;
}

.wizard-body-content {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.text-input,
.select-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.2s ease;
    margin-bottom: 12px; /* Consistent spacing */
}

.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.select-input[size] {
    /* Override default size styling for better appearance */
    height: auto;
    min-height: 120px;
    padding: 8px;
}

.select-input option {
    padding: 8px 12px;
}

.recent-selection {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px; /* Adjust for select-input margin-bottom */
}

.recent-selection .linklike {
    background: none;
    border: none;
    color: var(--primary-600);
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.recent-selection .linklike:hover {
    color: var(--primary-700);
}

.info-card.primary {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-icon {
    color: var(--primary-500);
    font-size: 24px;
    flex-shrink: 0;
}

.info-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--primary-800);
}

.info-message {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    margin-top: 20px;
}

/* ==================== PROGRESS BAR & SPINNER ==================== */

.codeiq-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 30px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.codeiq-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.codeiq-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--magenta-500) 100%);
    border-radius: 5px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(154, 64, 84, 0.4);
}

.codeiq-progress-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 12px;
    text-align: center;
}

.codeiq-spinner-small {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 10px;
}

/* Already defined spin in main.css, but just in case */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* General progress text */
.progress-detail-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 20px;
}

/* ==================== TAB PROGRESS INDICATOR ==================== */

.tab-progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
    margin-left: 8px; /* Space from status indicator */
}

.progress-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    box-shadow: inset 0 0 0 1px var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-height: 100%;
    max-width: 100%;
}

.circle-bg {
    stroke: var(--gray-200);
    stroke-width: 3;
    fill: none;
}

.circle {
    stroke: url(#progressGradient);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dasharray .3s ease;
    transform: rotate(-90deg);
    transform-origin: center;
}

/* Define gradient for the progress circle */
svg.circular-chart {
    overflow: visible;
}

svg.circular-chart defs {
    overflow: visible;
}

.progress-text-percent {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    pointer-events: none;
    user-select: none;
}

/* ==================== INVOICE UPLOAD TAB SYSTEM ==================== */

/* Tab Navigation */
.upload-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--gray-200);
    margin: 0 auto 16px auto;
    width: fit-content;
}

.upload-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-tab:hover {
    color: var(--primary-500);
    background: rgba(154, 64, 84, 0.05);
}

.upload-tab.active {
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(196, 87, 106, 0.3);
}

.upload-tab.active svg {
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.5));
}

.upload-tab svg {
    flex-shrink: 0;
}

/* Invoice count badge */
.invoice-count-badge {
    background: #c4576a;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    min-width: 20px;
    text-align: center;
}

.invoice-count-badge:not([style*="display: none"]) {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Tab Content Areas */
.upload-tab-content {
    display: none;
    padding: 24px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.upload-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Invoice Upload Section */
.invoice-upload-section {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.invoice-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.invoice-header-text {
    text-align: left;
}

.invoice-upload-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.invoice-upload-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Client Inbox Button - CodeIQ Purple/Magenta Theme */
.client-inbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(196, 87, 106, 0.25);
}

.client-inbox-btn:hover {
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 87, 106, 0.4);
}

.client-inbox-btn svg {
    flex-shrink: 0;
}

/* Client Upload to Accountant Section */
.client-accountant-upload-section {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.client-upload-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.client-upload-icon {
    width: 48px;
    height: 48px;
    background: #10b981;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.client-upload-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 2px 0;
}

.client-upload-title p {
    font-size: 0.85rem;
    color: #047857;
    margin: 0;
}

.client-pending-badge {
    margin-left: auto;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.client-upload-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-type-selector {
    display: flex;
    gap: 8px;
}

.client-type-option {
    flex: 1;
    cursor: pointer;
}

.client-type-option input {
    display: none;
}

.client-type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: white;
    border: 2px solid #c4c0b8;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b6b6b;
    transition: all 0.2s;
}

.client-type-option input:checked + .client-type-label {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.client-drop-zone {
    background: white;
    border: 2px dashed #a7f3d0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.client-drop-zone:hover,
.client-drop-zone.dragover {
    border-color: #10b981;
    background: #f0fdf4;
}

.client-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #059669;
}

.client-browse {
    color: #10b981;
    text-decoration: underline;
    font-weight: 600;
}

.client-drop-hint {
    font-size: 0.75rem;
    color: #6b6b6b;
}

.client-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
}

.client-file-name {
    flex: 1;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-file-size {
    color: #6b6b6b;
    font-size: 0.75rem;
}

.client-file-remove {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 4px;
}

.client-file-remove:hover {
    color: #ef4444;
}

.client-notes-input {
    padding: 10px 12px;
    border: 1px solid #c4c0b8;
    border-radius: 8px;
    font-size: 0.85rem;
    resize: none;
    min-height: 60px;
}

.client-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.client-upload-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.client-upload-btn:disabled {
    background: #999999;
    cursor: not-allowed;
}

.client-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.client-recent-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #a7f3d0;
}

.client-recent-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #065f46;
    margin: 0 0 8px 0;
}

.client-recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
}

.client-recent-name {
    color: #3d3d3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.client-recent-status {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
}

.client-recent-status.status-pending { background: #fef3c7; color: #92400e; }
.client-recent-status.status-pulled { background: #dbeafe; color: #1e40af; }
.client-recent-status.status-processed { background: #dcfce7; color: #166534; }
.client-recent-status.status-rejected { background: #fee2e2; color: #991b1b; }

/* Invoice Type Toggle */
.invoice-type-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.invoice-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.invoice-type-btn svg {
    margin-bottom: 2px;
}

.invoice-type-btn .type-hint {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

.invoice-type-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.invoice-type-btn.sales.active {
    color: #2ea46f;
}

.invoice-type-btn.purchase.active {
    color: #e05f63;
}

.invoice-type-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Invoice Upload Drop Zone */
.invoice-upload-area {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    background: linear-gradient(180deg, white 0%, var(--gray-50) 100%);
    transition: all 0.3s ease;
    overflow: hidden;
}

.invoice-upload-area::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, #9a4054, #c4576a, #9a4054);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.invoice-upload-area:hover::before,
.invoice-upload-area.dragover::before {
    opacity: 1;
    animation: gradient-rotate 3s linear infinite;
}

.invoice-upload-area:hover,
.invoice-upload-area.dragover {
    border-color: transparent;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(154, 64, 84, 0.15);
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.upload-icon-large {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--magenta-100) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-500);
}

.upload-text-primary {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-link {
    color: var(--primary-500);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-link:hover {
    color: var(--magenta-600);
}

.upload-text-secondary {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 0.85rem;
}

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

.upload-divider span {
    padding: 0 16px;
}

.manual-entry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manual-entry-btn:hover {
    border-color: var(--primary-400);
    color: var(--primary-500);
    background: var(--primary-50);
}

/* Uploaded Invoices Container */
.uploaded-invoices-container {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.uploaded-invoices-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.uploaded-invoices-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-list-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.uploaded-invoices-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empty State for Ready Invoices */
.uploaded-invoices-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    text-align: center;
}

.uploaded-invoices-empty .empty-state-icon {
    width: 48px;
    height: 48px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.uploaded-invoices-empty .empty-state-icon svg {
    stroke: var(--gray-400);
}

.uploaded-invoices-empty .empty-state-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 14px 0;
}

.uploaded-invoices-empty .empty-state-instructions {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 2;
    margin: 0;
}

.uploaded-invoices-empty .empty-state-instructions .step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--gray-200);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    margin-right: 6px;
}

.uploaded-invoices-empty .empty-state-instructions strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Invoice Card */
.invoice-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    min-height: 72px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.invoice-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.invoice-card.sales::before {
    background: #2ea46f;
}

.invoice-card.purchase::before {
    background: #e05f63;
}

.invoice-card:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.invoice-card .invoice-icon {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 18px;
    flex-shrink: 0;
}

.invoice-card .invoice-details {
    flex: 1;
    min-width: 0;
}

.invoice-card .invoice-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.invoice-card .invoice-contact {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-card .invoice-amount {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 16px;
    flex-shrink: 0;
}

.invoice-card .invoice-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.invoice-card .invoice-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.invoice-card .invoice-action-btn:hover {
    background: var(--primary-100);
    color: var(--primary-500);
}

.invoice-card .invoice-action-btn.delete:hover {
    background: var(--error-100);
    color: var(--error-500);
}

/* Invoice Processing State */
.invoice-card.processing {
    opacity: 0.6;
    pointer-events: none;
}

.invoice-card.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-400);
    animation: processing-bar 1.2s ease-in-out infinite;
}

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

/* Invoice Added Stat in Summary */
.stat-item.invoices-stat .stat-value {
    color: var(--primary-600);
}

/* ==================== SIDE-BY-SIDE INVOICE UPLOAD ==================== */

/* Grid layout for two columns */
.invoice-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

/* Single column layout for Pandle (no purchase invoice support) */
.invoice-upload-grid.single-column {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 900px) {
    .invoice-upload-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Invoice column container */
.invoice-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Column header */
.column-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-150, var(--gray-200));
}

.column-header.sales {
    background: rgba(46, 164, 111, 0.06);
    border-color: rgba(46, 164, 111, 0.18);
}

.column-header.purchase {
    background: rgba(224, 95, 99, 0.06);
    border-color: rgba(224, 95, 99, 0.18);
}

.column-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.column-header.sales .column-icon {
    background: #2ea46f;
    color: white;
}

.column-header.purchase .column-icon {
    background: #e05f63;
    color: white;
}

.column-title {
    flex: 1;
}

.column-title h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.column-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.column-count {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    display: none;
}

.column-header.sales .column-count {
    background: #2ea46f;
}

.column-header.purchase .column-count {
    background: #e05f63;
}

/* Drop zone for each column */
.invoice-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 28px 20px;
    min-height: 160px;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.invoice-column.sales .invoice-drop-zone {
    border-color: rgba(46, 164, 111, 0.35);
}

.invoice-column.purchase .invoice-drop-zone {
    border-color: rgba(224, 95, 99, 0.35);
}

.invoice-drop-zone:hover,
.invoice-drop-zone.dragover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.invoice-column.sales .invoice-drop-zone:hover,
.invoice-column.sales .invoice-drop-zone.dragover {
    border-color: #2ea46f;
    border-style: solid;
}

.invoice-column.purchase .invoice-drop-zone:hover,
.invoice-column.purchase .invoice-drop-zone.dragover {
    border-color: #e05f63;
    border-style: solid;
}

.invoice-drop-zone.has-queue {
    padding: 14px;
    border-style: solid;
    border-color: var(--gray-200);
    background: white;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-icon {
    color: var(--gray-400);
    margin-bottom: 4px;
}

.invoice-column.sales .drop-icon {
    color: #2ea46f;
}

.invoice-column.purchase .drop-icon {
    color: #e05f63;
}

.drop-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.browse-link {
    color: var(--primary-500);
    text-decoration: underline;
    cursor: pointer;
}

.drop-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Mini queue for each column */
.invoice-mini-queue {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.mini-queue-list {
    max-height: 220px;
    overflow-y: auto;
}

.mini-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    gap: 10px;
    transition: background 0.15s ease;
}

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

.mini-queue-item.extracting {
    background: var(--primary-50);
}

.mini-queue-item.extracted {
    background: rgba(46, 164, 111, 0.05);
}

.mini-queue-item.error {
    background: rgba(239, 68, 68, 0.05);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.item-error {
    font-size: 0.75rem;
    color: var(--error-500);
    margin-top: 4px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.item-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-status.pending {
    background: var(--gray-100);
    color: var(--text-tertiary);
}

.item-status.extracting {
    background: rgba(154, 64, 84, 0.1);
    color: var(--primary-600);
}

.item-status.extracted {
    background: rgba(46, 164, 111, 0.1);
    color: #2ea46f;
}

.item-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-500);
}

.item-action {
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-action.remove {
    background: transparent;
    color: var(--gray-400);
    padding: 4px;
}

.item-action.remove:hover {
    background: var(--error-100);
    color: var(--error-500);
}

.item-action.review {
    background: var(--primary-50);
    color: var(--primary-600);
}

.item-action.review:hover {
    background: var(--primary-100);
}

.item-action.retry {
    background: var(--warning-50);
    color: var(--warning-600);
}

.item-action.retry:hover {
    background: var(--warning-100);
}

/* Mini queue footer */
.mini-queue-footer {
    padding: 10px 14px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.mini-extract-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.invoice-column.sales .mini-extract-btn {
    background: #2ea46f;
    color: white;
}

.invoice-column.sales .mini-extract-btn:hover:not(:disabled) {
    background: #258c5c;
}

.invoice-column.purchase .mini-extract-btn {
    background: #e05f63;
    color: white;
}

.invoice-column.purchase .mini-extract-btn:hover:not(:disabled) {
    background: #c83d40;
}

.mini-extract-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Confirm All button */
.mini-confirm-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.invoice-column.sales .mini-confirm-btn {
    background: #2ea46f;
    color: white;
}

.invoice-column.sales .mini-confirm-btn:hover:not(:disabled) {
    background: #258c5c;
}

.invoice-column.purchase .mini-confirm-btn {
    background: #e05f63;
    color: white;
}

.invoice-column.purchase .mini-confirm-btn:hover:not(:disabled) {
    background: #c83d40;
}

.mini-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Manual entry inline button */
.manual-entry-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manual-entry-inline:hover {
    border-color: var(--primary-400);
    color: var(--primary-500);
    background: var(--primary-50);
}

/* ==================== INVOICE PROCESSING QUEUE (Legacy) ==================== */

/* Collapsed drop zone when queue is active */
.invoice-upload-area.collapsed {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.invoice-upload-area.collapsed .upload-icon-large {
    width: 40px;
    height: 40px;
    margin: 0;
}

.invoice-upload-area.collapsed .upload-icon-large svg {
    width: 20px;
    height: 20px;
}

.invoice-upload-area.collapsed .upload-text-primary {
    margin: 0;
    font-size: 0.9rem;
}

.invoice-upload-area.collapsed .upload-text-secondary,
.invoice-upload-area.collapsed .upload-divider,
.invoice-upload-area.collapsed .manual-entry-btn {
    display: none;
}

/* Queue Container */
.invoice-queue-container {
    margin-top: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    background: white;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Queue Header */
.invoice-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.queue-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.queue-header-left svg {
    color: var(--primary-500);
}

.queue-header-left h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.queue-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-100);
    padding: 3px 10px;
    border-radius: 20px;
}

.queue-header-right {
    display: flex;
    gap: 8px;
}

.queue-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.queue-action-btn:hover {
    border-color: var(--primary-300);
    color: var(--primary-500);
}

.queue-action-btn.clear-queue:hover {
    border-color: var(--error-300);
    color: var(--error-500);
}

/* Queue List */
.invoice-queue-list {
    max-height: 320px;
    overflow-y: auto;
}

/* Queue Item */
.queue-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

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

.queue-item:hover {
    background: var(--gray-50);
}

.queue-item.extracting {
    background: var(--primary-50);
}

.queue-item.extracted {
    background: rgba(46, 164, 111, 0.04);
}

.queue-item.error {
    background: rgba(239, 68, 68, 0.04);
}

/* Queue Item Icon */
.queue-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.queue-item-icon.sales {
    background: rgba(46, 164, 111, 0.1);
    color: #2ea46f;
}

.queue-item-icon.purchase {
    background: rgba(224, 95, 99, 0.1);
    color: #e05f63;
}

/* Queue Item Info */
.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.queue-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-item-size {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.queue-item-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.queue-item-type.sales {
    background: rgba(46, 164, 111, 0.1);
    color: #2ea46f;
}

.queue-item-type.purchase {
    background: rgba(224, 95, 99, 0.1);
    color: #e05f63;
}

/* Queue Item Error */
.queue-item-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--error-600);
}

.queue-item-error svg {
    flex-shrink: 0;
}

/* Queue Item Right */
.queue-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

/* Queue Item Status */
.queue-item-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.queue-item-status.pending {
    background: var(--gray-100);
    color: var(--text-secondary);
}

.queue-item-status.extracting {
    background: var(--primary-100);
    color: var(--primary-600);
}

.queue-item-status.extracted {
    background: rgba(46, 164, 111, 0.1);
    color: #2ea46f;
}

.queue-item-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-500);
}

/* Mini Spinner */
.mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Queue Item Actions */
.queue-item-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.queue-item-action.remove {
    background: transparent;
    color: var(--gray-400);
    padding: 6px;
}

.queue-item-action.remove:hover {
    background: var(--error-100);
    color: var(--error-500);
}

.queue-item-action.review {
    background: var(--primary-50);
    color: var(--primary-600);
}

.queue-item-action.review:hover {
    background: var(--primary-100);
}

.queue-item-action.retry {
    background: var(--warning-50);
    color: var(--warning-600);
}

.queue-item-action.retry:hover {
    background: var(--warning-100);
}

/* Queue Footer */
.invoice-queue-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(0deg, var(--gray-50) 0%, white 100%);
    border-top: 1px solid var(--gray-100);
}

.queue-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.queue-status .status-text.success {
    color: #2ea46f;
}

.queue-status .status-text.error {
    color: var(--error-500);
}

/* Status Spinner */
.status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Process Queue Button */
.queue-process-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 87, 106, 0.25);
}

.queue-process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 87, 106, 0.35);
}

.queue-process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== INVOICE OCR MODAL - FULL OVERRIDE ==================== */
/*
 * IMPORTANT: CodeIQModal.css has generic .codeiq-modal styles that conflict.
 * This section uses high-specificity selectors to override them completely.
 */

/* Invoice modal - full screen overlay with flexbox centering */
.codeiq-modal.invoice-ocr-modal {
    /* Reset ALL properties from CodeIQModal.css */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;

    /* Flexbox centering */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Visibility */
    z-index: 10000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.codeiq-modal.invoice-ocr-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal backdrop - dark overlay behind content */
.codeiq-modal.invoice-ocr-modal .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 0;
}

/* Modal container - the actual white card, centered */
.codeiq-modal.invoice-ocr-modal .invoice-entry-container {
    position: relative;
    z-index: 1;
    width: 580px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}

/* OCR review mode - wider for side-by-side preview */
.codeiq-modal.invoice-ocr-modal .invoice-entry-container.ocr-review {
    width: 1000px;
    max-width: 95vw;
}

/* Manual entry - single column */
.codeiq-modal.invoice-ocr-modal .invoice-entry-container.manual-entry {
    width: 580px;
}

/* Header with invoice type indicator */
.invoice-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
}

.invoice-modal-header .header-left {
    flex: 1;
}

.invoice-modal-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Invoice type indicator - visual money direction */
.invoice-type-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invoice-type-indicator .type-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.invoice-type-indicator.sales .type-icon {
    background: linear-gradient(135deg, #d4f5e4, #a7e9c3);
    color: #16a34a;
}

.invoice-type-indicator.purchase .type-icon {
    background: linear-gradient(135deg, #fee4e5, #fdc6c8);
    color: #dc2626;
}

.invoice-type-indicator .type-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-type-indicator .type-subtext {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Platform badge with logo */
.platform-badge {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.platform-badge .platform-logo {
    height: 24px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

/* Close button */
.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* Content area */
.invoice-modal-content {
    display: flex;
    padding: 0;
}

/* Document preview panel */
.document-preview-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--gray-900);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.document-preview-panel .preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.document-preview-panel .preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

.document-preview-panel .preview-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

/* PDF canvas preview */
.document-preview-panel .pdf-canvas {
    max-width: 100%;
    max-height: 500px;
    display: none; /* Hidden until rendered */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* PDF loading state */
.document-preview-panel .pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    padding: 40px;
}

.document-preview-panel .pdf-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-600);
    border-top-color: var(--primary-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.document-preview-panel .pdf-loading span {
    font-size: 0.85rem;
}

/* Invoice form panel */
.invoice-form-panel {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
}

.invoice-form-panel.full-width {
    max-width: 600px;
    margin: 0 auto;
}

/* Form sections */
.form-section {
    margin-bottom: 24px;
}

.form-section .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section .section-number {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-500), var(--magenta-600));
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form grid layouts */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-grid.two-col {
    grid-template-columns: 1fr 1fr;
}

/* Form field */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-field label .required {
    color: var(--error-500);
}

/* Contact status indicator on label */
.form-field label .contact-status {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.form-field label .contact-status.existing {
    background: var(--success-50);
    color: var(--success-700);
}

.form-field label .contact-status.new {
    background: var(--warning-50);
    color: var(--warning-700);
}

/* Category dropdown styling */
.category-field .category-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.category-field .category-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(154, 64, 84, 0.1);
}

.category-field .category-select optgroup {
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 0 4px 0;
}

.category-field .category-select option {
    padding: 8px 12px;
    font-weight: 400;
}

/* Field hint text */
.form-field .field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Input wrapper with icon */
.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px;
    padding-right: 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(154, 64, 84, 0.1);
}

.input-wrapper .input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

/* Currency input */
.currency-input {
    position: relative;
    display: flex;
}

.currency-input .currency-symbol {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
}

.currency-input input {
    width: 100%;
    padding: 12px 14px 12px 34px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.currency-input input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(154, 64, 84, 0.1);
}

.currency-input.small input,
.invoice-form .currency-input.small input,
.invoice-form .currency-input.small input[type="number"] {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 11px 14px 11px 28px !important; /* Ensure space for £ symbol */
}

.currency-input.small .currency-symbol {
    left: 10px;
    font-size: 0.9rem;
}

/* Standard inputs */
.invoice-form input[type="text"],
.invoice-form input[type="number"],
.invoice-form input[type="date"],
.invoice-form select {
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    width: 100%;
}

.invoice-form input:focus,
.invoice-form select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(154, 64, 84, 0.1);
}

.invoice-form textarea {
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    transition: all 0.2s ease;
    width: 100%;
}

.invoice-form textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(154, 64, 84, 0.1);
}

/* Amount field emphasis */
.form-field.amount-field .currency-input input {
    font-size: 1.3rem;
    padding: 14px 14px 14px 38px;
    background: linear-gradient(180deg, white 0%, var(--gray-50) 100%);
    border-width: 2px;
}

.form-field.amount-field .currency-input input:focus {
    background: white;
}

.form-field.amount-field .currency-symbol {
    font-size: 1.1rem;
}

/* Currency select field */
.form-field.currency-field {
    max-width: 200px;
}

.form-field.currency-field .currency-select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.form-field.currency-field .currency-select:hover {
    border-color: var(--gray-300);
}

.form-field.currency-field .currency-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Calculated field (read-only style) */
.calculated-value {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 14px;
    background: var(--gray-100);
    border-radius: 10px;
    border: 1.5px solid var(--gray-200);
}

.calculated-value .currency-symbol {
    color: var(--text-secondary);
    font-weight: 600;
}

.calculated-value span:last-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Auto-calculate button */
.auto-calc-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(154, 64, 84, 0.08);
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-500);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auto-calc-btn:hover {
    background: rgba(154, 64, 84, 0.15);
}

.auto-calc-btn.calculated {
    background: var(--success-100);
    color: var(--success-600);
}

/* OCR confidence indicators */
.ocr-confidence {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.ocr-confidence.high {
    background: var(--success-100);
    color: var(--success-600);
}

.ocr-confidence.medium {
    background: var(--warning-100);
    color: var(--warning-600);
}

.ocr-confidence.low {
    background: var(--error-100);
    color: var(--error-500);
}

/* Optional section toggle */
.optional-section .section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.optional-section .section-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--text-primary);
}

.optional-section .section-toggle svg {
    transition: transform 0.2s ease;
}

.optional-section .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.optional-section:not(.collapsed) .collapsible-content {
    max-height: 200px;
    margin-top: 12px;
}

/* Footer */
.invoice-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.invoice-modal-footer .btn-cancel {
    padding: 12px 20px;
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoice-modal-footer .btn-cancel:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.invoice-modal-footer .btn-save-invoice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoice-modal-footer .btn-save-invoice.sales {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

.invoice-modal-footer .btn-save-invoice.sales:hover {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

.invoice-modal-footer .btn-save-invoice.purchase {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.invoice-modal-footer .btn-save-invoice.purchase:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

/* Spinner */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 900px) {
    .invoice-modal-content {
        flex-direction: column;
    }

    .document-preview-panel {
        width: 100%;
        max-height: 200px;
    }

    .invoice-ocr-modal .invoice-entry-container.ocr-review {
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .invoice-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .invoice-modal-header .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .form-grid,
    .form-grid.two-col,
    .form-grid.three-col {
        grid-template-columns: 1fr;
    }

    .invoice-form-panel {
        padding: 16px;
    }

    .invoice-modal-footer {
        flex-direction: column;
    }

    .invoice-modal-footer .btn-cancel,
    .invoice-modal-footer .btn-save-invoice {
        width: 100%;
        justify-content: center;
    }
}

/* Legacy confidence badge support */
.confidence-badge.high {
    background: var(--success-100);
    color: var(--success-600);
}

.confidence-badge.medium {
    background: var(--warning-100);
    color: var(--warning-500);
}

.confidence-badge.low {
    background: var(--error-100);
    color: var(--error-500);
}

/* ==================== INVOICE SYNC MODAL ==================== */

/* Override CodeIQModal.css - invoice-sync-modal is a fullscreen overlay, not a modal content box */
.invoice-sync-modal.codeiq-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.invoice-sync-modal .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.invoice-sync-modal .invoice-sync-container {
    position: relative;
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.sync-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s ease;
    z-index: 10;
}

.sync-close-btn:hover {
    background: white;
    color: var(--gray-700);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sync-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--magenta-50) 100%);
    border-bottom: 1px solid var(--gray-100);
}

.sync-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-500), var(--magenta-600));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sync-title {
    flex: 1;
}

.sync-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.sync-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.sync-platform-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.sync-progress-section {
    padding: 20px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.sync-progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sync-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--magenta-600));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.sync-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sync-invoice-list {
    flex: 1;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

.sync-invoice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s ease;
}

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

.sync-invoice-item[data-status="synced"] {
    background: var(--success-50);
}

.sync-invoice-item[data-status="failed"] {
    background: var(--error-50);
}

.sync-invoice-status {
    width: 24px;
    flex-shrink: 0;
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.pending {
    color: var(--gray-400);
}

.status-icon.success {
    color: var(--success-500);
}

.status-icon.error {
    color: var(--error-500);
}

.sync-invoice-info {
    flex: 1;
    min-width: 0;
}

.sync-invoice-number {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.sync-invoice-contact {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-invoice-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.sync-invoice-type.sales {
    background: var(--success-100);
    color: var(--success-600);
}

.sync-invoice-type.purchase {
    background: var(--error-100);
    color: var(--error-600);
}

.sync-invoice-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.sync-actions,
.sync-complete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    background: white;
    border-top: 1px solid var(--gray-100);
}

.btn-cancel-sync {
    padding: 12px 24px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--text-secondary);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-sync:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-start-sync,
.btn-continue {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-500), var(--magenta-600));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-start-sync:hover,
.btn-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(154, 64, 84, 0.3);
}

.btn-start-sync:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sync-summary {
    flex: 1;
}

.summary-success,
.summary-warning,
.summary-error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.summary-success {
    color: var(--success-600);
}

.summary-warning {
    color: var(--warning-500);
}

.summary-error {
    color: var(--error-500);
}

/* ==================== CLIENT INVOICE INBOX MODAL ==================== */

/* Modal Container Override - Large modal for data tables
   MUST use !important to override base .codeiq-modal styles in CodeIQModal.css */
.codeiq-modal.inbox-modal {
    width: 95% !important;
    max-width: 1500px !important;
    min-width: 900px !important;
    height: 90vh !important;
    max-height: 1000px !important;
    min-height: 600px !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 80px -12px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
}

/* Header - CodeIQ Gradient Theme */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px;
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    border: none;
}

.inbox-title-section {
    flex: 1;
}

.inbox-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.inbox-title svg {
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.inbox-subtitle {
    margin: 6px 0 0 38px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.inbox-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.inbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(1.05);
}

/* Toolbar Section */
.inbox-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: linear-gradient(180deg, #fdf5f7 0%, #faf8f5 100%);
    border-bottom: 1px solid #e9d5ff;
    flex-wrap: wrap;
    gap: 14px;
}

.inbox-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.inbox-filter-select {
    padding: 10px 14px;
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    min-width: 130px;
    color: #9a4054;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inbox-filter-select:hover {
    border-color: #d8b4fe;
}

.inbox-filter-select:focus {
    outline: none;
    border-color: #c4576a;
    box-shadow: 0 0 0 3px rgba(196, 87, 106, 0.1);
}

.inbox-client-filter {
    min-width: 220px;
    max-width: 300px;
}

.inbox-actions {
    display: flex;
    gap: 10px;
}

.inbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inbox-btn-primary {
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(196, 87, 106, 0.25);
}

.inbox-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 87, 106, 0.35);
}

.inbox-btn-primary:disabled {
    background: linear-gradient(135deg, #999999 0%, #6b6b6b 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.inbox-btn-secondary {
    background: #ffffff;
    border: 2px solid #e9d5ff;
    color: #9a4054;
}

.inbox-btn-secondary:hover {
    background: #fdf5f7;
    border-color: #d8b4fe;
}

/* Body Section */
.inbox-body {
    flex: 1;
    overflow: auto;
    position: relative;
    min-height: 320px;
    background: #ffffff;
}

/* Loading State */
.inbox-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    gap: 14px;
}

.inbox-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #fae8ec;
    border-top-color: #c4576a;
    border-radius: 50%;
    animation: inbox-spin 0.8s linear infinite;
}

@keyframes inbox-spin {
    to { transform: rotate(360deg); }
}

#inbox-loading-text {
    color: #9a4054;
    font-weight: 500;
    font-size: 14px;
}

/* Table Styles */
.inbox-table {
    width: 100%;
    border-collapse: collapse;
}

.inbox-table th,
.inbox-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #fae8ec;
}

.inbox-table th {
    background: linear-gradient(180deg, #fdf5f7 0%, #fae8ec 100%);
    font-weight: 700;
    color: #9a4054;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
    z-index: 5;
}

.inbox-th-checkbox {
    width: 44px;
}

/* Table Rows */
.inbox-row {
    transition: all 0.2s ease;
}

.inbox-row:hover {
    background: linear-gradient(90deg, #fdf5f7 0%, #ffffff 100%);
}

.inbox-row.selected {
    background: linear-gradient(90deg, #fae8ec 0%, #fdf5f7 100%);
    border-left: 3px solid #c4576a;
}

/* File Info Cell */
.inbox-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inbox-file-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.inbox-icon-pdf {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
}

.inbox-icon-image {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #5b6eae;
}

.inbox-filename {
    font-weight: 600;
    color: #1a1a1a;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-filesize {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 2px;
}

/* Client Cell */
.inbox-client-name {
    font-weight: 600;
    color: #9a4054;
}

.inbox-client-email {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 2px;
}

/* Badges */
.inbox-type-badge,
.inbox-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.inbox-type-purchase {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #1e40af;
}

.inbox-type-sales {
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
    color: #166534;
}

.inbox-type-unknown {
    background: linear-gradient(135deg, #f5f2ed, #faf8f5);
    color: #3d3d3d;
}

.inbox-status-pending {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #92400e;
}

.inbox-status-pulled {
    background: linear-gradient(135deg, #fae8ec, #fdf5f7);
    color: #9a4054;
}

.inbox-status-processed {
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
    color: #166534;
}

.inbox-status-rejected {
    background: linear-gradient(135deg, #fee2e2, #fef2f2);
    color: #991b1b;
}

/* Action Buttons */
.inbox-cell-actions {
    display: flex;
    gap: 6px;
}

.inbox-action-btn {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    color: #6b6b6b;
    transition: all 0.2s ease;
}

.inbox-action-btn:hover {
    background: #f5f2ed;
    transform: scale(1.1);
}

.inbox-preview-btn:hover {
    color: #5b6eae;
    background: #eff6ff;
}

.inbox-pull-single-btn:hover {
    color: #c4576a;
    background: #fdf2f8;
}

.inbox-reject-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Empty State */
.inbox-empty-state {
    text-align: center;
    padding: 60px 24px !important;
    color: #6b6b6b;
}

.inbox-empty-icon {
    margin-bottom: 20px;
    color: #d8b4fe;
}

.inbox-empty-icon svg {
    stroke-width: 1.2;
}

.inbox-empty-state p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #9a4054;
}

.inbox-empty-hint {
    font-size: 14px;
    color: #999999;
    margin-top: 8px;
    font-weight: 400;
}

/* Toast Notifications */
.inbox-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.inbox-toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.inbox-toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}

.inbox-toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}

/* Checkboxes */
.inbox-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c4576a;
}

.inbox-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

#inbox-select-all {
    accent-color: #9a4054;
}

/* Selected Count Badge */
#inbox-selected-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 4px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .inbox-modal {
        background: #1a1a1a;
        box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    }

    .inbox-toolbar {
        background: linear-gradient(180deg, #2d1b3d 0%, #1a1a1a 100%);
        border-bottom-color: #9a4054;
    }

    .inbox-filter-select {
        background: #3d3d3d;
        border-color: #9a4054;
        color: #fae8ec;
    }

    .inbox-filter-select:focus {
        border-color: #c4576a;
    }

    .inbox-btn-secondary {
        background: #3d3d3d;
        border-color: #9a4054;
        color: #fae8ec;
    }

    .inbox-btn-secondary:hover {
        background: #6b6b6b;
    }

    .inbox-body {
        background: #1a1a1a;
    }

    .inbox-loading {
        background: rgba(31, 41, 55, 0.95);
    }

    #inbox-loading-text {
        color: #fae8ec;
    }

    .inbox-table th {
        background: linear-gradient(180deg, #2d1b3d 0%, #1a1a1a 100%);
        color: #fae8ec;
    }

    .inbox-table td {
        border-bottom-color: #3d3d3d;
    }

    .inbox-row:hover {
        background: linear-gradient(90deg, #2d1b3d 0%, #1a1a1a 100%);
    }

    .inbox-row.selected {
        background: linear-gradient(90deg, #3d1b4d 0%, #2d1b3d 100%);
    }

    .inbox-filename {
        color: #faf8f5;
    }

    .inbox-client-name {
        color: #fae8ec;
    }

    .inbox-client-email,
    .inbox-filesize {
        color: #999999;
    }

    .inbox-empty-state p {
        color: #fae8ec;
    }

    .inbox-action-btn:hover {
        background: #3d3d3d;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .codeiq-modal.inbox-modal {
        max-width: 95% !important;
        min-width: 800px !important;
    }
}

@media (max-width: 992px) {
    .codeiq-modal.inbox-modal {
        max-width: 98% !important;
        min-width: 600px !important;
        max-height: 92vh !important;
    }

    .inbox-header {
        padding: 20px 24px;
    }

    .inbox-title {
        font-size: 20px;
    }

    .inbox-toolbar {
        padding: 14px 24px;
    }

    .inbox-filters {
        width: 100%;
    }

    .inbox-filter-select {
        flex: 1;
        min-width: 100px;
    }

    .inbox-client-filter {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .codeiq-modal.inbox-modal {
        width: 100% !important;
        min-width: unset !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    .inbox-header {
        padding: 18px 20px;
    }

    .inbox-title {
        font-size: 18px;
        gap: 10px;
    }

    .inbox-title svg {
        width: 20px;
        height: 20px;
    }

    .inbox-subtitle {
        font-size: 13px;
        margin-left: 30px;
    }

    .inbox-toolbar {
        padding: 12px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .inbox-filters {
        flex-direction: column;
    }

    .inbox-filter-select {
        width: 100%;
    }

    .inbox-actions {
        justify-content: stretch;
    }

    .inbox-btn {
        flex: 1;
        justify-content: center;
    }

    .inbox-table th,
    .inbox-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .inbox-filename {
        max-width: 120px;
    }

    .inbox-file-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 576px) {
    .inbox-header {
        padding: 16px;
    }

    .inbox-title {
        font-size: 16px;
    }

    .inbox-toolbar {
        padding: 10px 16px;
    }

    .inbox-table th:nth-child(4),
    .inbox-table td:nth-child(4),
    .inbox-table th:nth-child(6),
    .inbox-table td:nth-child(6) {
        display: none;
    }

    .inbox-cell-actions {
        flex-direction: column;
        gap: 4px;
    }

    .inbox-action-btn {
        padding: 6px;
    }
}

/* ==================== CLIENT UPLOAD TO ACCOUNTANT SECTION ==================== */

.client-accountant-upload-section {
    background: linear-gradient(135deg, #fdf5f7 0%, #fdf2f8 100%);
    border: 2px solid #e9d5ff;
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
}

.client-upload-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.client-upload-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.client-upload-title {
    flex: 1;
}

.client-upload-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #9a4054;
}

.client-upload-title p {
    margin: 0;
    font-size: 14px;
    color: #6b6b6b;
}

.client-upload-title strong {
    color: #c4576a;
}

.client-pending-badge {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.client-upload-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.client-type-selector {
    display: flex;
    gap: 12px;
}

.client-type-option {
    cursor: pointer;
}

.client-type-option input {
    display: none;
}

.client-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    font-weight: 600;
    color: #6b6b6b;
    transition: all 0.2s ease;
}

.client-type-option input:checked + .client-type-label {
    background: linear-gradient(135deg, #fae8ec, #fdf2f8);
    border-color: #c4576a;
    color: #9a4054;
}

.client-type-label:hover {
    border-color: #d8b4fe;
}

.client-drop-zone {
    border: 2px dashed #d8b4fe;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-drop-zone:hover,
.client-drop-zone.dragover {
    border-color: #c4576a;
    background: #fdf2f8;
}

.client-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6b6b6b;
}

.client-drop-content svg {
    color: #d8b4fe;
}

.client-browse {
    color: #c4576a;
    font-weight: 600;
    cursor: pointer;
}

.client-drop-hint {
    font-size: 12px;
    color: #999999;
}

.client-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
}

.client-file-name {
    flex: 1;
    font-weight: 500;
    color: #9a4054;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-file-size {
    font-size: 12px;
    color: #999999;
}

.client-file-remove {
    width: 24px;
    height: 24px;
    background: #fee2e2;
    border: none;
    border-radius: 6px;
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.client-file-remove:hover {
    background: #fecaca;
}

.client-notes-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.client-notes-input:focus {
    outline: none;
    border-color: #c4576a;
}

.client-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #9a4054 0%, #c4576a 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-upload-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 87, 106, 0.35);
}

.client-upload-btn:disabled {
    background: linear-gradient(135deg, #999999 0%, #6b6b6b 100%);
    cursor: not-allowed;
}

.client-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: inbox-spin 0.8s linear infinite;
}

.client-recent-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9d5ff;
}

.client-recent-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #9a4054;
}

.client-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 8px;
}

.client-recent-name {
    font-size: 13px;
    color: #3d3d3d;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-recent-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

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

.client-recent-status.status-pulled {
    background: #fae8ec;
    color: #9a4054;
}

.client-recent-status.status-processed {
    background: #dcfce7;
    color: #166534;
}

.client-recent-status.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== DASHBOARD CLIENT UPLOAD CARD ==================== */

/* Highlighted command button for client upload */
.cc-command-btn-highlight {
    background: linear-gradient(135deg, rgba(196, 87, 106, 0.08) 0%, rgba(154, 64, 84, 0.08) 100%) !important;
    border: 2px solid rgba(196, 87, 106, 0.3) !important;
}

.cc-command-btn-highlight:hover {
    background: linear-gradient(135deg, rgba(196, 87, 106, 0.15) 0%, rgba(154, 64, 84, 0.12) 100%) !important;
    border-color: rgba(196, 87, 106, 0.5) !important;
}

/* Magenta icon for client upload */
.cc-command-icon.magenta {
    background: linear-gradient(135deg, #c4576a 0%, #9a4054 100%);
    color: #ffffff;
}

/* Badge for pending count */
.cc-command-badge {
    background: linear-gradient(135deg, #c4576a, #c4576a);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 8px;
    box-shadow: 0 2px 6px rgba(196, 87, 106, 0.3);
}

/* ==================== CLIENT UPLOAD MODAL OVERLAY ==================== */
/* MUST use !important to override base .codeiq-modal styles in CodeIQModal.css */

.codeiq-modal.client-upload-modal {
    width: 90% !important;
    max-width: 700px !important;
    min-width: 500px !important;
    max-height: 85vh !important;
    min-height: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 80px -12px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden !important;
}

.client-upload-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.client-upload-modal-body .client-accountant-upload-section {
    margin: 0;
    border: none;
    border-radius: 0;
    background: #ffffff;
}

.client-upload-modal-body .client-upload-header {
    padding: 24px 28px 0;
}

.client-upload-modal-body .client-upload-body {
    padding: 0 28px 28px;
}

.client-upload-modal-body .client-recent-section {
    padding: 0 28px 28px;
    margin-top: 0;
    border-top: 1px solid #fae8ec;
}
