/* Revenue Automation - Design System
   Inspired by modern SaaS dashboards with refined aesthetics
   ========================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Instrument+Serif:ital@0;1&display=swap');

/* CSS Variables - Design Tokens */
:root {
    /* Brand Colors */
    --aqua-haze: #EBF2F3;
    --viking: #6BCBDD;
    --hippie-blue: #4E9BB6;
    --pale-sky: #686E7E;
    --big-stone: #1A2B4C;

    /* Semantic Colors (mapped from brand) */
    --primary: var(--viking);
    --primary-hover: var(--hippie-blue);
    --primary-light: #D4F1F7;
    --primary-subtle: var(--aqua-haze);

    --success: #059669;
    --success-light: #D1FAE5;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --error: #DC2626;
    --error-light: #FEE2E2;

    --surface: #FFFFFF;
    --surface-secondary: var(--aqua-haze);
    --surface-tertiary: #E5EDEF;

    --text-primary: var(--big-stone);
    --text-secondary: var(--pale-sky);
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    --border: #D1D9DC;
    --border-light: #E5EDEF;

    /* Processor Accent Colors */
    --accent-revenue: var(--viking);
    --accent-payroll: var(--hippie-blue);
    --accent-adp: var(--pale-sky);
    --accent-mso: #D97706;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.02);

    /* Typography */
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, monospace;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface-secondary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

p {
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
}

.container-wide {
    max-width: 1400px;
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
}

.nav-link {
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

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

/* Page Header */
.page-header {
    padding: var(--space-8) 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

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

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: var(--space-2);
}

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

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.page-header .breadcrumb a {
    color: var(--text-muted);
}

.page-header .breadcrumb a:hover {
    color: var(--primary);
}

/* Main Content */
.main {
    padding: var(--space-8) 0;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1rem;
    font-weight: 600;
}

.card-title .icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

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

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--surface-secondary);
}

.card + .card {
    margin-top: var(--space-6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-tertiary);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
    background: #047857;
}

.btn-danger {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid transparent;
}

.btn-danger:hover:not(:disabled) {
    background: #FED7D7;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: var(--space-3);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.mono {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-weight: 500;
    cursor: pointer;
}

.checkbox-hint {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dropzone */
.dropzone {
    position: relative;
    padding: var(--space-12) var(--space-8);
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    border-style: solid;
}

.dropzone.has-file {
    border-color: var(--success);
    background: var(--success-light);
    border-style: solid;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    background: var(--surface-tertiary);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.dropzone-icon svg {
    width: 28px;
    height: 28px;
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

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

.dropzone-hint a {
    color: var(--primary);
    font-weight: 500;
}

/* Secondary dropzone (smaller) */
.dropzone-secondary {
    padding: var(--space-6) var(--space-5);
    margin-top: var(--space-4);
}

.dropzone-secondary .dropzone-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-3);
}

.dropzone-secondary .dropzone-icon svg {
    width: 20px;
    height: 20px;
}

.dropzone-secondary .dropzone-text {
    font-size: 0.9rem;
}

.dropzone-secondary .dropzone-hint {
    font-size: 0.85rem;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

.file-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--success);
    border-radius: var(--radius-md);
    color: white;
}

.file-preview-icon svg {
    width: 22px;
    height: 22px;
}

.file-preview-info {
    text-align: left;
}

.file-preview-name {
    font-weight: 600;
    color: var(--text-primary);
}

.file-preview-size {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-preview-remove {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.file-preview-remove:hover {
    background: var(--error-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-muted {
    background: var(--surface-tertiary);
    color: var(--text-muted);
}

/* Status indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.status-completed {
    background: var(--success-light);
    color: var(--success);
}

.status-processing {
    background: var(--warning-light);
    color: var(--warning);
}

.status-failed {
    background: var(--error-light);
    color: var(--error);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.exists { background: var(--success); }
.status-dot.missing { background: var(--warning); }

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

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

.table tr:hover td {
    background: var(--surface-secondary);
}

.table .amount {
    font-family: var(--font-mono);
    text-align: right;
}

.table th.right,
.table td.right {
    text-align: right;
}

.table tfoot tr {
    background: var(--surface-secondary);
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--surface-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.tab.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    margin-left: var(--space-2);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface-tertiary);
    border-radius: var(--radius-full);
}

.tab.active .tab-count {
    background: var(--primary-light);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Pill Tabs (alternate style) */
.pill-tabs {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.pill-tab {
    padding: var(--space-2) var(--space-5);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pill-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

/* Flash Messages */
.flash {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: 0.9rem;
}

.flash svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.flash.success {
    background: var(--success-light);
    color: var(--success);
}

.flash.error {
    background: var(--error-light);
    color: var(--error);
}

.flash.warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.stat-card {
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

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

.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.primary { color: var(--primary); }

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

/* Bar Charts (CSS-based) */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.bar-label {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.bar-container {
    flex: 1;
    height: 28px;
    background: var(--surface-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-2);
    min-width: 50px;
    transition: width var(--transition-slow);
}

.bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.bar-pct {
    width: 50px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* Payer colors */
.bar-fill.medicaid { background: #059669; }
.bar-fill.medicare { background: #2563EB; }
.bar-fill.private { background: #7C3AED; }
.bar-fill.selfpay { background: #D97706; }
.bar-fill.unknown { background: #64748B; }

/* Validation List */
.validation-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.validation-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
}

.validation-status {
    font-size: 0.8rem;
    font-weight: 600;
    width: 50px;
}

.validation-status.pass { color: var(--success); }
.validation-status.fail { color: var(--error); }
.validation-status.warn { color: var(--warning); }

.validation-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* File List */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    transition: all var(--transition-fast);
}

.file-item:hover {
    border-color: var(--border);
    background: var(--surface-secondary);
}

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

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.file-icon svg {
    width: 22px;
    height: 22px;
}

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

.file-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: var(--space-2);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: var(--space-6);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--surface-secondary);
}

/* Progress Bar */
.progress-container {
    height: 8px;
    background: var(--surface-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.success { background: var(--success); }
.progress-bar.error { background: var(--error); }

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .bar-label {
        width: 70px;
        font-size: 0.75rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-primary { color: var(--primary); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Variables hint box */
.hint-box {
    padding: var(--space-4) var(--space-5);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.hint-box strong {
    color: var(--text-primary);
}

.variable-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: var(--primary-light);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Info notes */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--primary);
}

.info-note svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Warning banner */
.warning-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--warning-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--warning);
    margin-bottom: var(--space-5);
}

.warning-banner svg {
    width: 24px;
    height: 24px;
    color: var(--warning);
    flex-shrink: 0;
}

.warning-title {
    font-weight: 600;
    color: var(--warning);
    margin-bottom: var(--space-1);
}

.warning-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Test mode banner */
.test-mode-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--warning-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
}

.test-mode-banner svg {
    width: 20px;
    height: 20px;
    color: var(--warning);
}

.test-mode-banner span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--warning);
}

.test-mode-banner a {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--warning);
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Search box */
.search-box {
    position: relative;
    margin-bottom: var(--space-4);
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: 40px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* Processing page specific */
.processing-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: var(--space-10) 0;
}

.processing-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-6);
    color: var(--primary);
}

.processing-icon.spinning {
    animation: spin 2s linear infinite;
}

.processing-icon.success {
    color: var(--success);
}

.processing-icon.error {
    color: var(--error);
}

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

.processing-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--space-6);
}

.processing-progress {
    margin: var(--space-8) 0;
}

.processing-percent {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
}

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

.steps-list {
    text-align: left;
    margin-top: var(--space-8);
    padding: var(--space-5);
    background: var(--surface-secondary);
    border-radius: var(--radius-lg);
}

.steps-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.step-item.completed {
    color: var(--success);
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fadeIn {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease-out;
}

/* Processor Accent Colors */
.accent-revenue { --accent: var(--accent-revenue); }
.accent-payroll { --accent: var(--accent-payroll); }
.accent-adp { --accent: var(--accent-adp); }
.accent-mso { --accent: var(--accent-mso); }

.accent-revenue .btn-primary,
.accent-revenue .progress-bar,
.accent-revenue .tab.active { background: var(--accent-revenue); }

.accent-payroll .btn-primary,
.accent-payroll .progress-bar,
.accent-payroll .tab.active { background: var(--accent-payroll); }

.accent-adp .btn-primary,
.accent-adp .progress-bar,
.accent-adp .tab.active { background: var(--accent-adp); }

.accent-mso .btn-primary,
.accent-mso .progress-bar,
.accent-mso .tab.active { background: var(--accent-mso); }

/* Test Mode Bar */
.nav.test-mode {
    border-bottom-color: var(--warning);
}

.test-mode-bar {
    background: var(--warning);
    color: white;
    text-align: center;
    padding: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Home Page */
.home-header {
    text-align: center;
    padding: var(--space-8) 0;
}

.home-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
}

.home-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Processor Cards */
.processor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.processor-card {
    display: block;
    padding: var(--space-6);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-base);
}

.processor-card:hover {
    border-color: var(--accent, var(--primary));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.processor-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent, var(--primary));
    border-radius: var(--radius-lg);
    color: white;
}

.processor-icon svg {
    width: 24px;
    height: 24px;
}

.processor-card h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.processor-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.processor-last-run {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.processor-last-run .label {
    color: var(--text-muted);
}

.processor-last-run .value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Recent Activity */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.activity-icon.revenue { background: var(--accent-revenue); }
.activity-icon.payroll { background: var(--accent-payroll); }
.activity-icon.adp { background: var(--accent-adp); }

.activity-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

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

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.alert-banner.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-banner span {
    flex: 1;
    font-weight: 500;
}

.alert-banner a {
    font-size: 0.9rem;
    color: inherit;
    text-decoration: underline;
}

/* Page Header Simple */
.page-header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.page-header-simple h1 {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

/* Checkbox inline */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-inline input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Inactive row styling */
tr.inactive {
    opacity: 0.5;
}

/* =============================================================================
   WIZARD COMPONENT
   ============================================================================= */

.wizard {
    --wizard-accent: var(--accent, var(--primary));
}

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--space-6) 0;
    margin-bottom: var(--space-6);
}

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

.wizard-step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.wizard-step-indicator svg {
    width: 20px;
    height: 20px;
}

.wizard-step.active .wizard-step-indicator {
    background: var(--wizard-accent);
    color: white;
}

.wizard-step.completed .wizard-step-indicator {
    background: var(--success);
    color: white;
}

.wizard-step-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.wizard-step.active .wizard-step-label {
    color: var(--text-primary);
}

.wizard-step.completed .wizard-step-label {
    color: var(--success);
}

.wizard-step-connector {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 var(--space-2);
    margin-bottom: 24px;
}

.wizard-step-connector.completed {
    background: var(--success);
}

.wizard-content {
    max-width: 700px;
    margin: 0 auto;
}

/* Wizard specific dropzone */
.wizard .dropzone {
    margin-bottom: var(--space-6);
}

/* Wizard validation summary */
.wizard-validation {
    margin-bottom: var(--space-6);
}

.wizard-validation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.wizard-validation-item.error {
    background: var(--error-light);
    color: var(--error);
}

.wizard-validation-item.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.wizard-validation-item.success {
    background: var(--success-light);
    color: var(--success);
}

.wizard-validation-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Processor accent overrides for wizard */
.wizard.accent-revenue {
    --wizard-accent: var(--accent-revenue);
}

.wizard.accent-payroll {
    --wizard-accent: var(--accent-payroll);
}

.wizard.accent-adp {
    --wizard-accent: var(--accent-adp);
}

.wizard.accent-mso {
    --wizard-accent: #D97706;
}

.wizard.accent-mso .wizard-step.active .wizard-step-indicator,
.wizard.accent-mso .wizard-step.completed .wizard-step-indicator {
    background: #D97706;
    border-color: #D97706;
}

.wizard.accent-mso .wizard-step-connector.completed {
    background: #D97706;
}
