/* Omni-CRM Design System 2025 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #3B86D1;
    --primary-hover: #2d6ba8;
    --success: #21BF06;
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral: #6C7293;
    
    /* Neutral Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Spacing (40-50% increase) */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --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: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1f2937;
        --surface: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
}

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

.status-badge.processing {
    background: #fed7aa;
    color: #9a3412;
}

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

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

.status-badge.refunded {
    background: #e0e7ff;
    color: #3730a3;
}

/* Status Badge Icons */
.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge.pending::before {
    content: '⏰';
    width: auto;
    height: auto;
}

.status-badge.processing::before {
    content: '⚙️';
    width: auto;
    height: auto;
}

.status-badge.completed::before {
    content: '✓';
    width: auto;
    height: auto;
}

.status-badge.cancelled::before,
.status-badge.failed::before {
    content: '⚠️';
    width: auto;
    height: auto;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

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

.metric-card.large {
    padding: var(--spacing-xl);
}

.metric-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: var(--spacing-sm) 0;
    line-height: 1.2;
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--neutral);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-top: var(--spacing-xs);
}

.metric-trend.up {
    color: var(--success);
}

.metric-trend.down {
    color: var(--error);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

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

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Table Improvements */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th {
    background: var(--gray-50);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--neutral);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

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

/* Inline Filters */
.filter-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.filter-input {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    width: 150px;
}

/* Quick View Panel */
.quick-view-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.quick-view-panel.open {
    transform: translateX(0);
}

/* Notification Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: var(--error);
    color: white;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Workbench Tabs */
.workbench-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
}

.workbench-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--neutral);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    bottom: -2px;
}

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

.workbench-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.workbench-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    margin-left: 0.5rem;
}

.workbench-tab.active .workbench-tab-badge {
    background: var(--primary);
    color: white;
}

/* Stock Status Colors */
.stock-high {
    color: var(--success);
    font-weight: 600;
}

.stock-medium {
    color: var(--warning);
    font-weight: 600;
}

.stock-low {
    color: var(--error);
    font-weight: 600;
}

/* Product Thumbnail */
.product-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    object-fit: cover;
    border: 1px solid var(--gray-200);
}

/* Utility Classes */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-neutral { color: var(--neutral); }

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-error { background: var(--error); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* Sidebar Toggle Support */
/* Body & Layout */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background: var(--gray-50);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Brand Section */
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .brand-icon {
    font-size: 2rem;
    line-height: 1;
}

.sidebar .brand-text {
    flex: 1;
}

.sidebar .brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.sidebar .brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.125rem;
}

/* Navigation */
.sidebar .nav {
    padding: 0.5rem 0 1rem 0;
}

/* Navigation Sections */
.sidebar .nav-section {
    margin-bottom: 0.5rem;
}

.sidebar .nav-section-title {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
}

/* Navigation Items */
.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 0.125rem 0;
}

.sidebar .nav-icon {
    font-size: 20px;
    line-height: 1;
    width: 1.5rem;
    text-align: center;
}

.sidebar .nav-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left-color: rgba(255,255,255,0.3);
}

.sidebar .nav-item.active {
    background: rgba(59, 134, 209, 0.15);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

.sidebar .nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* Special Item Styles */
.sidebar .nav-item-highlight {
    position: relative;
}

.sidebar .nav-item-highlight::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.sidebar .nav-item-danger {
    color: rgba(239, 68, 68, 0.8);
}

.sidebar .nav-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left-color: #ef4444;
}

/* Bottom Section */
.sidebar .nav-section-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Area */
.main-content,
.main {
    margin-left: 260px;
    min-height: 100vh;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content,
    .main {
        margin-left: 0;
    }
}

