/* Whitlock Warm Corporate Theme - Commission Reconciliation Portal */
/* Professional design with warm undertones for internal financial tools */

/* Critical CSS - Prevent FOUC */
body {
    visibility: visible !important;
    opacity: 1 !important;
}

body:not(.loaded) {
    visibility: visible !important;
    opacity: 1 !important;
}

.warm-layout,
.page-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Loading skeleton (optional) */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(200, 20%, 80%);
    }
    100% {
        background-color: hsl(200, 20%, 95%);
    }
}

:root {
    /* Warm Corporate Color Palette */
    /* Primary Rust Red from Brand Guidelines */
    --warm-rust-primary: #8B2C1D;           /* Primary rust red */
    --warm-rust-dark: #6B221A;             /* Darker rust for emphasis */
    --warm-rust-light: #A03A2A;            /* Lighter rust for highlights */
    --warm-rust-pale: #D4988E;             /* Very light rust for backgrounds */
    
    /* Warm Grey Spectrum - Professional with Warmth */
    --warm-grey-900: #2D2926;              /* Near black with warm undertone */
    --warm-grey-800: #3D3834;              /* Dark charcoal */
    --warm-grey-700: #4D4743;              /* Medium dark grey */
    --warm-grey-600: #666666;              /* Standard grey from brand */
    --warm-grey-500: #807A74;              /* Medium grey with warmth */
    --warm-grey-400: #999590;              /* Light grey */
    --warm-grey-300: #B3AFA9;              /* Lighter grey */
    --warm-grey-200: #CCC9C4;              /* Very light grey */
    --warm-grey-100: #E6E3DF;              /* Near white grey */
    --warm-grey-50: #F7F7F5;               /* Off-white background */
    
    /* Warm Beige Accents */
    --warm-beige-light: #FAF6F2;           /* Very light beige for backgrounds */
    --warm-beige-soft: #F4EDE5;            /* Soft beige for hover states */
    --warm-beige-medium: #E8DED4;          /* Medium beige for accents */
    --warm-beige-tint: #FFF9F5;            /* Subtle beige tint */
    
    /* Functional Colors - Warm Variants */
    --warm-success: #2E7D32;               /* Forest green */
    --warm-warning: #ED6C02;               /* Warm orange */
    --warm-danger: #C62828;                /* Deep red */
    --warm-info: #0288D1;                  /* Professional blue */
    
    /* Layout Colors */
    --warm-bg-primary: #FFFFFF;            /* Main background */
    --warm-bg-secondary: var(--warm-grey-50); /* Secondary areas */
    --warm-bg-tertiary: var(--warm-beige-light); /* Tertiary/alternate */
    --warm-bg-hover: var(--warm-beige-soft); /* Hover states */
    --warm-bg-row-alt: #FDFCFB;            /* Alternating table rows */
    
    /* Text Colors */
    --warm-text-primary: var(--warm-grey-900);    /* Primary text */
    --warm-text-secondary: var(--warm-grey-600);  /* Secondary text */
    --warm-text-muted: var(--warm-grey-500);      /* Muted text */
    --warm-text-light: var(--warm-grey-400);      /* Light text */
    
    /* Border Colors */
    --warm-border-light: var(--warm-grey-200);    /* Light borders */
    --warm-border-medium: var(--warm-grey-300);   /* Medium borders */
    --warm-border-strong: var(--warm-grey-400);   /* Strong borders */
    
    /* Component Specific */
    --warm-header-bg: linear-gradient(135deg, var(--warm-rust-dark) 0%, var(--warm-rust-primary) 50%, var(--warm-rust-light) 100%);
    --warm-nav-bg: var(--warm-bg-secondary);
    --warm-sidebar-bg: #FAFAF8;
    --warm-table-header-bg: var(--warm-grey-100);
    --warm-table-hover: var(--warm-beige-soft);
    
    /* Shadows - Subtle and Warm */
    --warm-shadow-xs: 0 1px 2px rgba(45, 41, 38, 0.04);
    --warm-shadow-sm: 0 2px 4px rgba(45, 41, 38, 0.06);
    --warm-shadow-md: 0 4px 8px rgba(45, 41, 38, 0.08);
    --warm-shadow-lg: 0 8px 16px rgba(45, 41, 38, 0.10);
    --warm-shadow-xl: 0 12px 24px rgba(45, 41, 38, 0.12);
    
    /* Typography */
    --warm-font-primary: 'Source Sans Pro', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --warm-font-mono: 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    
    /* Spacing & Layout */
    --warm-header-height: 64px;
    --warm-footer-height: 40px;
    --warm-sidebar-width: 260px;
    --warm-content-max-width: 1440px;
    
    /* Border Radius */
    --warm-radius-sm: 3px;
    --warm-radius-base: 4px;
    --warm-radius-md: 6px;
    --warm-radius-lg: 8px;
    
    /* Transitions */
    --warm-transition-fast: 150ms ease-in-out;
    --warm-transition-base: 250ms ease-in-out;
    --warm-transition-slow: 350ms ease-in-out;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--warm-font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--warm-text-primary);
    background-color: var(--warm-bg-secondary);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 44, 29, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 44, 29, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(230, 222, 214, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    position: relative;
    /* Prevent flash of unstyled content */
    visibility: hidden;
    opacity: 0;
}

body.loaded {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.warm-layout {
    min-height: 100vh;
}

/* Page content padding */
.page-content {
    padding: 1rem;
    padding-bottom: 120px;
    min-height: calc(100vh - 200px);
}

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

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

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
}

.loading-overlay.show {
    display: block;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 200px,
            rgba(139, 44, 29, 0.01) 200px,
            rgba(139, 44, 29, 0.01) 201px
        );
    pointer-events: none;
    z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--warm-text-primary);
}

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

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

a:hover {
    color: var(--warm-rust-dark);
    text-decoration: underline;
}

/* Layout Structure */
.warm-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Navigation */
.warm-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--warm-header-height);
    background: var(--warm-bg-primary);
    border-bottom: 1px solid var(--warm-border-light);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(45, 41, 38, 0.08), 0 1px 3px rgba(45, 41, 38, 0.06);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: all var(--warm-transition-base);
}

.warm-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 44, 29, 0.2) 20%, 
        rgba(139, 44, 29, 0.3) 50%, 
        rgba(139, 44, 29, 0.2) 80%, 
        transparent 100%);
}

.warm-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--warm-content-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.warm-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: var(--warm-bg-primary);
    border: 1px solid var(--warm-border-light);
    color: var(--warm-rust-primary);
    font-size: 1.5rem;
    padding: 8px;
    margin-right: 8px;
    border-radius: var(--warm-radius-base);
    cursor: pointer;
    transition: all var(--warm-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle:hover {
    background-color: var(--warm-rust-primary);
    color: white;
    border-color: var(--warm-rust-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:focus {
    outline: 2px solid var(--warm-rust-primary);
    outline-offset: 2px;
}

.sidebar-toggle i {
    font-size: 1.25rem;
    line-height: 1;
}

.warm-logo img {
    height: 40px;
    width: auto;
}

.warm-logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--warm-text-primary);
}

.warm-nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.warm-nav-link {
    color: var(--warm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--warm-radius-base);
    transition: all var(--warm-transition-fast);
}

.warm-nav-link:hover {
    color: var(--warm-rust-primary);
    background-color: var(--warm-bg-hover);
    text-decoration: none;
}

/* Main Content Area */
.warm-main {
    flex: 1;
    margin-top: var(--warm-header-height);
    background-color: var(--warm-bg-secondary);
}

.warm-container {
    max-width: var(--warm-content-max-width);
    margin: 0 auto;
    padding: 24px;
}

/* Workspace Header */
.warm-workspace-header {
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border-radius: var(--warm-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 
        0 4px 12px rgba(45, 41, 38, 0.06),
        0 2px 4px rgba(45, 41, 38, 0.04),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(139, 44, 29, 0.08);
}

.warm-workspace-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 44, 29, 0.03) 0%, transparent 70%);
    animation: subtle-rotate 30s linear infinite;
}

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

.warm-workspace-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.warm-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--warm-text-primary);
    margin: 0;
}

.warm-sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--warm-text-muted);
}

.warm-sync-icon {
    width: 16px;
    height: 16px;
}

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

.warm-sync-icon.error {
    color: var(--warm-danger);
}

/* Filter Bar */
.warm-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.warm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warm-filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--warm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warm-filter-control {
    padding: 8px 12px;
    border: 1px solid var(--warm-border-light);
    border-radius: var(--warm-radius-base);
    background-color: var(--warm-bg-primary);
    font-size: 0.875rem;
    color: var(--warm-text-primary);
    transition: all var(--warm-transition-fast);
}

.warm-filter-control:hover {
    border-color: var(--warm-border-medium);
}

.warm-filter-control:focus {
    outline: none;
    border-color: var(--warm-rust-primary);
    box-shadow: 0 0 0 2px rgba(139, 44, 29, 0.1);
}

/* Data Table */
.warm-table-container {
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border-radius: var(--warm-radius-lg);
    overflow: hidden;
    box-shadow: 
        0 8px 24px rgba(45, 41, 38, 0.08),
        0 2px 8px rgba(45, 41, 38, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(139, 44, 29, 0.06);
}

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

.warm-table thead {
    background: linear-gradient(135deg, var(--warm-grey-100) 0%, rgba(230, 227, 223, 0.5) 100%);
    border-bottom: 2px solid rgba(139, 44, 29, 0.1);
    position: relative;
}

.warm-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 44, 29, 0.2) 20%, 
        rgba(139, 44, 29, 0.3) 50%, 
        rgba(139, 44, 29, 0.2) 80%, 
        transparent 100%);
}

.warm-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--warm-text-secondary);
    white-space: nowrap;
    position: relative;
}

.warm-table th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 24px;
}

.warm-table th.sortable:hover {
    color: var(--warm-rust-primary);
}

.warm-table th.sorted {
    color: var(--warm-rust-primary);
}

.warm-table th.sorted::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.warm-table th.sorted.asc::after {
    border-bottom: 4px solid var(--warm-rust-primary);
}

.warm-table th.sorted.desc::after {
    border-top: 4px solid var(--warm-rust-primary);
}

.warm-table tbody tr {
    border-bottom: 1px solid var(--warm-border-light);
    transition: background-color var(--warm-transition-fast);
}

.warm-table tbody tr:nth-child(even) {
    background-color: var(--warm-bg-row-alt);
}

.warm-table tbody tr:hover {
    background-color: var(--warm-table-hover);
}

.warm-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--warm-text-primary);
}

/* Table Cell Types */
.warm-table .cell-numeric {
    text-align: right;
    font-family: var(--warm-font-mono);
}

.warm-table .cell-status {
    font-weight: 500;
}

.warm-table .cell-actions {
    text-align: center;
}

/* Status Badges */
.warm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--warm-radius-sm);
    white-space: nowrap;
}

.warm-badge.success {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--warm-success);
}

.warm-badge.warning {
    background-color: rgba(237, 108, 2, 0.1);
    color: var(--warm-warning);
}

.warm-badge.danger {
    background-color: rgba(198, 40, 40, 0.1);
    color: var(--warm-danger);
}

.warm-badge.info {
    background-color: rgba(2, 136, 209, 0.1);
    color: var(--warm-info);
}

/* Discrepancy Highlights */
.warm-discrepancy-row {
    background-color: rgba(198, 40, 40, 0.03) !important;
}

.warm-discrepancy-row:hover {
    background-color: rgba(198, 40, 40, 0.06) !important;
}

.warm-discrepancy-amount {
    color: var(--warm-danger);
    font-weight: 600;
}

/* Buttons */
.warm-btn, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--warm-radius-base);
    cursor: pointer;
    transition: all var(--warm-transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
}

.warm-btn::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.warm-btn:active::before, .btn:active::before {
    width: 300px;
    height: 300px;
}

.warm-btn:focus, .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 44, 29, 0.2);
}

.warm-btn-primary, .btn-primary {
    background: linear-gradient(135deg, var(--warm-rust-primary) 0%, var(--warm-rust-light) 100%);
    color: white;
    border-color: var(--warm-rust-primary);
    box-shadow: 
        0 4px 12px rgba(139, 44, 29, 0.2),
        0 2px 4px rgba(139, 44, 29, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.warm-btn-primary:hover, .btn-primary:hover {
    background: linear-gradient(135deg, var(--warm-rust-dark) 0%, var(--warm-rust-primary) 100%);
    border-color: var(--warm-rust-dark);
    text-decoration: none;
    color: white;
    box-shadow: 
        0 6px 16px rgba(139, 44, 29, 0.25),
        0 3px 6px rgba(139, 44, 29, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.warm-btn-primary:active, .btn-primary:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 4px rgba(139, 44, 29, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.warm-btn-secondary, .btn-secondary {
    background-color: var(--warm-grey-100);
    color: var(--warm-text-secondary);
    border-color: var(--warm-border-medium);
    box-shadow: var(--warm-shadow-xs);
}

.warm-btn-secondary:hover, .btn-secondary:hover {
    background-color: var(--warm-bg-hover);
    color: var(--warm-text-primary);
    border-color: var(--warm-border-strong);
    text-decoration: none;
    box-shadow: var(--warm-shadow-sm);
}

.warm-btn-success, .btn-success {
    background-color: var(--warm-success);
    color: white;
    border-color: var(--warm-success);
    box-shadow: var(--warm-shadow-sm);
}

.warm-btn-success:hover, .btn-success:hover {
    background-color: #247029;
    border-color: #247029;
    color: white;
    box-shadow: var(--warm-shadow-md);
    transform: translateY(-1px);
}

.warm-btn-danger, .btn-danger {
    background-color: var(--warm-danger);
    color: white;
    border-color: var(--warm-danger);
    box-shadow: var(--warm-shadow-sm);
}

.warm-btn-danger:hover, .btn-danger:hover {
    background-color: #a21f1f;
    border-color: #a21f1f;
    color: white;
    box-shadow: var(--warm-shadow-md);
    transform: translateY(-1px);
}

.warm-btn-warning, .btn-warning {
    background-color: var(--warm-warning);
    color: white;
    border-color: var(--warm-warning);
    box-shadow: var(--warm-shadow-sm);
}

.warm-btn-warning:hover, .btn-warning:hover {
    background-color: #d15b00;
    border-color: #d15b00;
    color: white;
    box-shadow: var(--warm-shadow-md);
    transform: translateY(-1px);
}

.warm-btn-info, .btn-info {
    background-color: var(--warm-info);
    color: white;
    border-color: var(--warm-info);
    box-shadow: var(--warm-shadow-sm);
}

.warm-btn-info:hover, .btn-info:hover {
    background-color: #0277BD;
    border-color: #0277BD;
    color: white;
    box-shadow: var(--warm-shadow-md);
    transform: translateY(-1px);
}

.warm-btn-sm, .btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.warm-btn-lg, .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.warm-btn-icon, .btn-icon {
    padding: 8px;
    min-width: 36px;
}

/* Button with icon styling */
.btn i, .warm-btn i {
    font-size: 0.875em;
}

/* Form action buttons group */
.form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--warm-border-light);
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Disabled state */
.btn:disabled, .warm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:disabled:hover, .warm-btn:disabled:hover {
    transform: none;
}

/* Footer */
.warm-footer {
    background-color: var(--warm-bg-primary);
    border-top: 1px solid var(--warm-border-light);
    height: var(--warm-footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Cards & Panels */
.warm-card {
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border: 1px solid rgba(139, 44, 29, 0.08);
    border-radius: var(--warm-radius-lg);
    box-shadow: 
        0 8px 24px rgba(45, 41, 38, 0.08),
        0 2px 8px rgba(45, 41, 38, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: all var(--warm-transition-base);
    position: relative;
}

.warm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--warm-rust-light) 0%, 
        var(--warm-rust-primary) 50%, 
        var(--warm-rust-light) 100%);
    opacity: 0;
    transition: opacity var(--warm-transition-base);
}

.warm-card:hover {
    box-shadow: 
        0 12px 32px rgba(45, 41, 38, 0.12),
        0 4px 12px rgba(45, 41, 38, 0.06);
    transform: translateY(-2px);
}

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

.warm-card-header {
    background: linear-gradient(135deg, var(--warm-bg-tertiary) 0%, rgba(250, 246, 242, 0.5) 100%);
    border-bottom: 1px solid rgba(139, 44, 29, 0.06);
    padding: 16px 20px;
    position: relative;
}

.warm-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 44, 29, 0.1) 50%, 
        transparent 100%);
}

.warm-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--warm-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.warm-card-body {
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Form Elements */
.warm-form-group {
    margin-bottom: 20px;
}

.warm-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--warm-text-secondary);
    letter-spacing: 0.01em;
    transition: color var(--warm-transition-fast);
}

.warm-form-group:focus-within .warm-form-label {
    color: var(--warm-rust-primary);
}

.warm-form-control, .form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--warm-text-primary);
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border: 1px solid var(--warm-border-medium);
    border-radius: var(--warm-radius-base);
    transition: all var(--warm-transition-fast);
    box-shadow: inset 0 1px 3px rgba(45, 41, 38, 0.05);
}

.warm-form-control:hover, .form-control:hover {
    border-color: var(--warm-border-strong);
    background: #FFFFFF;
}

.warm-form-control:focus, .form-control:focus {
    outline: none;
    border-color: var(--warm-rust-primary);
    box-shadow: 
        0 0 0 3px rgba(139, 44, 29, 0.1),
        inset 0 1px 3px rgba(45, 41, 38, 0.05);
    background: #FFFFFF;
}

/* Add subtle animation for required fields */
.warm-form-control:required:valid, .form-control:required:valid {
    border-color: var(--warm-success);
    background-image: 
        linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%),
        linear-gradient(0deg, rgba(46, 125, 50, 0.05) 0%, transparent 100%);
}

/* Textarea specific styling */
textarea.warm-form-control, textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Select enhancements */
select.warm-form-control, select.form-control {
    cursor: pointer;
}

/* Dropdown Select */
.warm-select-wrapper {
    position: relative;
}

.warm-select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

/* Loading States */
.warm-skeleton {
    background: linear-gradient(90deg, 
        var(--warm-grey-100) 25%, 
        var(--warm-grey-50) 50%, 
        var(--warm-grey-100) 75%
    );
    background-size: 200% 100%;
    animation: warm-skeleton-loading 1.5s ease-in-out infinite;
}

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

.warm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--warm-grey-200);
    border-top-color: var(--warm-rust-primary);
    border-radius: 50%;
    animation: warm-spin 0.8s linear infinite;
}

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

/* Progress Indicators */
.warm-progress {
    height: 4px;
    background-color: var(--warm-grey-200);
    border-radius: 2px;
    overflow: hidden;
}

.warm-progress-bar {
    height: 100%;
    background-color: var(--warm-rust-primary);
    transition: width var(--warm-transition-slow) ease;
}

/* Tooltips */
.warm-tooltip {
    position: relative;
}

.warm-tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 12px;
    background-color: var(--warm-grey-900);
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: var(--warm-radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: all var(--warm-transition-fast);
}

.warm-tooltip:hover .warm-tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Utility Classes */
.warm-text-muted { color: var(--warm-text-muted) !important; }
.warm-text-secondary { color: var(--warm-text-secondary) !important; }
.warm-text-danger { color: var(--warm-danger) !important; }
.warm-text-success { color: var(--warm-success) !important; }
.warm-text-right { text-align: right !important; }
.warm-text-center { text-align: center !important; }

.warm-mt-1 { margin-top: 8px !important; }
.warm-mt-2 { margin-top: 16px !important; }
.warm-mt-3 { margin-top: 24px !important; }
.warm-mb-1 { margin-bottom: 8px !important; }
.warm-mb-2 { margin-bottom: 16px !important; }
.warm-mb-3 { margin-bottom: 24px !important; }

.warm-p-1 { padding: 8px !important; }
.warm-p-2 { padding: 16px !important; }
.warm-p-3 { padding: 24px !important; }

/* Responsive Design */
@media (max-width: 1200px) {
    .warm-container {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .warm-header-content {
        padding: 0 16px;
    }
    
    .warm-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .warm-filter-group {
        width: 100%;
    }
    
    .warm-table-container {
        overflow-x: auto;
    }
    
    .warm-table {
        min-width: 600px;
    }
    
    /* Mobile sidebar behavior */
    .warm-sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    
    .warm-sidebar.show {
        transform: translateX(0);
    }
    
    .warm-main {
        margin-left: 0;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
}

@media (max-width: 480px) {
    .warm-workspace-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .warm-nav-right {
        gap: 12px;
    }
    
    .warm-btn {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
}

/* Print Styles */
@media print {
    .warm-header,
    .warm-footer,
    .warm-filters,
    .warm-btn,
    .no-print {
        display: none !important;
    }
    
    .warm-main {
        margin-top: 0;
    }
    
    body {
        background: white;
    }
    
    .warm-table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Enhanced Sidebar Styles */
.warm-sidebar {
    position: fixed;
    left: 0;
    top: var(--warm-header-height);
    bottom: 0;
    width: var(--warm-sidebar-width);
    background: linear-gradient(180deg, #FAFAF8 0%, #F7F7F5 100%);
    border-right: 1px solid rgba(139, 44, 29, 0.08);
    box-shadow: 2px 0 8px rgba(45, 41, 38, 0.05);
    transition: all var(--warm-transition-base);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
}

.warm-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(139, 44, 29, 0.01) 100px,
            rgba(139, 44, 29, 0.01) 101px
        );
    pointer-events: none;
}

.warm-sidebar.collapsed {
    width: 60px;
}

.warm-sidebar-nav {
    padding: 8px 0;
}

/* Remove list styles */
.warm-sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

/* Navigation Sections */
.warm-nav-section {
    margin-bottom: 16px;
    padding: 0 8px;
}

.warm-nav-section:last-child {
    margin-bottom: 8px;
}

/* Collapsible sections */
.warm-nav-section.collapsible .warm-nav-section-title {
    cursor: pointer;
    user-select: none;
    padding-right: 28px;
}

.warm-nav-section.collapsible .warm-nav-section-title::after {
    content: '\F282';
    font-family: 'Bootstrap Icons';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform var(--warm-transition-fast);
    font-size: 0.75rem;
    opacity: 0.6;
}

.warm-nav-section.collapsed .warm-nav-section-title::after {
    transform: translateY(-50%) rotate(-90deg);
}

.warm-nav-section.collapsed ul {
    display: none;
}

/* Company Selector */
.company-selector {
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(139, 44, 29, 0.02);
    border-bottom: 1px solid rgba(139, 44, 29, 0.08);
}

.company-selector .selector-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--warm-text-muted);
    margin-bottom: 8px;
}

.company-selector .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid rgba(139, 44, 29, 0.15);
    border-radius: var(--warm-radius-base);
    background: white;
    color: var(--warm-text-primary);
    transition: all var(--warm-transition-fast);
}

.company-selector .form-select:hover {
    border-color: var(--warm-rust-primary);
}

.company-selector .form-select:focus {
    outline: none;
    border-color: var(--warm-rust-primary);
    box-shadow: 0 0 0 2px rgba(139, 44, 29, 0.1);
}

/* Section Title */
.warm-nav-section-title {
    padding: 8px 12px 6px 16px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--warm-rust-primary);
    opacity: 0.7;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: center;
}

.warm-nav-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--warm-rust-primary);
    border-radius: 0 2px 2px 0;
}

/* Section divider between sections */
.warm-nav-section + .warm-nav-section::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 44, 29, 0.1) 20%, 
        rgba(139, 44, 29, 0.1) 80%, 
        transparent 100%);
    margin: 0 16px 12px 16px;
}

.warm-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    margin: 1px 4px;
    color: var(--warm-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--warm-radius-md);
    transition: all var(--warm-transition-fast);
    position: relative;
    overflow: hidden;
}

.warm-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--warm-rust-primary);
    border-radius: 0 3px 3px 0;
    transition: height var(--warm-transition-fast);
}

.warm-nav-link:hover {
    background: linear-gradient(135deg, rgba(139, 44, 29, 0.06) 0%, rgba(139, 44, 29, 0.03) 100%);
    color: var(--warm-rust-primary);
    text-decoration: none;
    padding-left: 22px;
    transform: translateX(2px);
}

.warm-nav-link:hover::before {
    height: 60%;
}

.warm-nav-link.active {
    background: linear-gradient(135deg, rgba(139, 44, 29, 0.12) 0%, rgba(139, 44, 29, 0.06) 100%);
    color: var(--warm-rust-primary);
    font-weight: 600;
    box-shadow: 
        inset 0 1px 3px rgba(139, 44, 29, 0.08),
        0 1px 2px rgba(139, 44, 29, 0.04);
}

.warm-nav-link.active::before {
    height: 100%;
    width: 4px;
}

/* Badge inside nav link */
.warm-nav-link .warm-badge {
    margin-left: auto;
    font-size: 0.625rem;
    padding: 2px 6px;
    line-height: 1;
}

.warm-nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.warm-nav-icon i {
    font-size: 1rem;
    line-height: 1;
}

.warm-nav-text {
    transition: opacity var(--warm-transition-fast);
}

/* Collapsed sidebar styles */
.warm-sidebar.collapsed .warm-nav-text {
    opacity: 0;
    display: none;
}

.warm-sidebar.collapsed .warm-nav-link {
    justify-content: center;
    padding: 10px;
}

.warm-sidebar.collapsed .warm-nav-section-title {
    font-size: 0;
    padding: 8px 0;
    margin: 0;
}

.warm-sidebar.collapsed .warm-nav-section-title::before {
    display: none;
}

.warm-sidebar.collapsed .warm-nav-section {
    margin-bottom: 16px;
}

/* Main content adjustment */
.warm-main {
    margin-left: var(--warm-sidebar-width);
    transition: margin-left var(--warm-transition-base);
}

.warm-main.expanded {
    margin-left: 60px;
}

/* User Avatar Enhancement */
.warm-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm-rust-light) 0%, var(--warm-rust-primary) 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 4px rgba(139, 44, 29, 0.2);
    transition: all var(--warm-transition-fast);
}

.warm-user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(139, 44, 29, 0.3);
}

/* Loading Animation Enhancement */
.warm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.warm-loading-spinner {
    width: 48px;
    height: 48px;
    position: relative;
}

.warm-loading-spinner::before,
.warm-loading-spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--warm-rust-primary);
    animation: warm-spin 1.2s linear infinite;
}

.warm-loading-spinner::after {
    border-top-color: var(--warm-rust-light);
    animation-delay: -0.4s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

/* Smooth Page Transitions */
.warm-page-transition {
    animation: warm-fade-in 0.3s ease-out;
}

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

/* Enhanced Focus States */
:focus-visible {
    outline: 2px solid var(--warm-rust-primary);
    outline-offset: 2px;
    border-radius: var(--warm-radius-sm);
}

/* Font Awesome Icon Fixes */
.fa, .fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Quick Actions Button Icons */
.btn i, .warm-btn i {
    margin-right: 6px;
    font-size: 0.875em;
    vertical-align: middle;
}

.btn-primary i, .warm-btn-primary i {
    opacity: 0.9;
}

/* Dashboard Widget Styles */
.dashboard-widget {
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border: 1px solid rgba(139, 44, 29, 0.08);
    border-radius: var(--warm-radius-lg);
    padding: 20px;
    box-shadow: 
        0 4px 12px rgba(45, 41, 38, 0.04),
        0 2px 4px rgba(45, 41, 38, 0.02);
    transition: all var(--warm-transition-base);
}

.dashboard-widget:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(45, 41, 38, 0.08),
        0 4px 8px rgba(45, 41, 38, 0.04);
}

.widget-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--warm-text-muted);
    margin-bottom: 8px;
}

.widget-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--warm-text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.widget-change {
    font-size: 0.8125rem;
    color: var(--warm-success);
}

.widget-change.negative {
    color: var(--warm-danger);
}

/* Card Enhancements for Dashboard */
.card {
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFCFB 100%);
    border: 1px solid rgba(139, 44, 29, 0.08);
    border-radius: var(--warm-radius-lg);
    box-shadow: 
        0 4px 12px rgba(45, 41, 38, 0.06),
        0 2px 4px rgba(45, 41, 38, 0.03);
    overflow: hidden;
}

.card-header {
    background: rgba(250, 246, 242, 0.5);
    border-bottom: 1px solid rgba(139, 44, 29, 0.08);
    padding: 16px 20px;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--warm-text-primary);
}

.card-body {
    padding: 20px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--warm-radius-sm);
    text-align: center;
    white-space: nowrap;
}

.badge-success {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--warm-success);
}

.badge-warning {
    background-color: rgba(237, 108, 2, 0.1);
    color: var(--warm-warning);
}

.badge-primary {
    background-color: rgba(139, 44, 29, 0.1);
    color: var(--warm-rust-primary);
}

/* Quick Actions Button Group */
.btn-outline {
    background-color: transparent;
    color: var(--warm-text-secondary);
    border: 1px solid var(--warm-border-medium);
}

.btn-outline:hover {
    background-color: var(--warm-bg-hover);
    color: var(--warm-rust-primary);
    border-color: var(--warm-rust-primary);
}

/* Highlight Accent Box */
.highlight-accent {
    background: linear-gradient(135deg, rgba(139, 44, 29, 0.05) 0%, rgba(139, 44, 29, 0.02) 100%);
    border: 1px solid rgba(139, 44, 29, 0.1);
    border-radius: var(--warm-radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.highlight-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--warm-rust-primary);
}

/* Data Focus Section */
.data-focus {
    background: var(--warm-bg-primary);
    border-radius: var(--warm-radius-lg);
    padding: 24px;
    box-shadow: var(--warm-shadow-sm);
}

/* ===== Role Indicator Styles ===== */
.warm-role-indicator {
    padding: 12px 16px;
    margin: 0 8px 16px 8px;
    background: linear-gradient(135deg, rgba(139, 44, 29, 0.08) 0%, rgba(139, 44, 29, 0.04) 100%);
    border-radius: var(--warm-radius-md);
    border: 1px solid rgba(139, 44, 29, 0.12);
    position: relative;
    overflow: hidden;
}

.warm-role-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

/* Role-specific color bands */
.warm-role-indicator.role-purple::before {
    background: linear-gradient(180deg, #7B5FB2 0%, #6B4F9F 100%);
}

.warm-role-indicator.role-blue::before {
    background: linear-gradient(180deg, #1976D2 0%, #1565C0 100%);
}

.warm-role-indicator.role-green::before {
    background: linear-gradient(180deg, #388E3C 0%, #2E7D32 100%);
}

.warm-role-indicator.role-orange::before {
    background: linear-gradient(180deg, #F57C00 0%, #E65100 100%);
}

.warm-role-indicator.role-gray::before {
    background: linear-gradient(180deg, #616161 0%, #424242 100%);
}

.warm-role-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--warm-text-primary);
}

.warm-role-badge i {
    font-size: 1.125rem;
    color: var(--warm-rust-primary);
}

.warm-impersonation-note {
    display: block;
    font-size: 0.625rem;
    color: var(--warm-warning);
    margin-top: 4px;
    font-weight: 500;
}