/**
 * Acai Procurement System - Dashboard Styles
 * Modern, elegant design with improved visual hierarchy
 * Supports Light/Dark themes
 */

/* ============================================
   THEME VARIABLES - Light Mode (Default)
   ============================================ */
:root {
    /* Primary Colors - Modern Blue */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-soft: #eff6ff;
    
    /* Secondary Colors */
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    
    /* Neutral Colors - Light Theme */
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    
    /* Theme-specific */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    /* Primary Colors - Adjusted for dark */
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #93c5fd;
    --primary-soft: rgba(59, 130, 246, 0.2);
    
    /* Semantic Colors - Dark */
    --success: #34d399;
    --success-light: rgba(16, 185, 129, 0.2);
    --warning: #fbbf24;
    --warning-light: rgba(245, 158, 11, 0.2);
    --danger: #f87171;
    --danger-light: rgba(239, 68, 68, 0.2);
    --info: #22d3ee;
    --info-light: rgba(6, 182, 212, 0.2);
    
    /* Neutral Colors - Dark Theme */
    --dark: #f8fafc;
    --gray-900: #ffffff;
    --gray-800: #f1f5f9;
    --gray-700: #e2e8f0;
    --gray-600: #cbd5e1;
    --gray-500: #94a3b8;
    --gray-400: #64748b;
    --gray-300: #475569;
    --gray-200: #334155;
    --gray-100: #1e293b;
    --gray-50: #0f172a;
    --white: #1e293b;
    
    /* Theme-specific - Dark */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    
    /* Shadows - Dark */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   SIDEBAR - Modern Glass Effect
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
}

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    transform: translateX(4px);
}

.nav-item:hover::before {
    transform: scaleY(0.5);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--primary-light);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item .icon {
    margin-right: 14px;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--gray-50);
}

/* ============================================
   HEADER - Clean & Modern
   ============================================ */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 32px;
    display: none;
    max-width: 1600px;
    margin: 0 auto;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.5px;
}

/* ============================================
   CARDS - Modern Shadow & Hover Effects
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
}

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

.card-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 18px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
}

.card-body {
    padding: 28px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

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

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

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

/* ============================================
   FORMS - Modern Input Styling
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--gray-800);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

/* ============================================
   BUTTONS - Modern & Interactive
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

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

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(6, 182, 212, 0.4);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
}

/* ============================================
   TABLES - Clean & Modern
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: var(--white);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;  /* 行间距 */
    font-size: 14px;
    padding: 0 16px 16px 16px;
}

.table th,
.table td {
    padding: 16px 12px 16px 20px;
    text-align: left;
}

.table th {
    background: var(--gray-50);
    font-weight: 700;
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    border-top: none;
}

/* 最后一列 th 右侧增加间距 */
.table th:last-child {
    padding-right: 32px;
}

.table td {
    border: none;
    color: var(--gray-700);
    background: var(--white);
    border-radius: 0;
}

/* 斑马纹效果 - 奇数行和偶数行不同颜色 */
.table tbody tr:nth-child(odd) td {
    background: var(--white);
}

.table tbody tr:nth-child(even) td {
    background: var(--gray-50);
}

/* 第一行（奇数行）样式 */
.table tbody tr:nth-child(odd) td:first-child {
    border-radius: 8px 0 0 8px;
}

.table tbody tr:nth-child(odd) td:last-child {
    border-radius: 0 8px 8px 0;
}

/* 第三行（奇数行）样式 - 与第一行一致 */
.table tbody tr:nth-child(3) td {
    background: var(--white);
}

/* 偶数行圆角 */
.table tbody tr:nth-child(even) td:first-child {
    border-radius: 8px 0 0 8px;
}

.table tbody tr:nth-child(even) td:last-child {
    border-radius: 0 8px 8px 0;
}

.table tbody tr:hover td {
    background: var(--primary-soft) !important;
    transition: background 0.2s ease;
}

/* Compact table styles for orders */
#orders-table {
    font-size: 13px;
    min-width: 900px;
}

#orders-table th,
#orders-table td {
    padding: 10px 8px;
    white-space: nowrap;
}

#orders-table th:first-child,
#orders-table td:first-child {
    padding-left: 12px;
}

#orders-table th:last-child,
#orders-table td:last-child {
    padding-right: 12px;
}

/* Responsive table container */
.table-container:has(#orders-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Badge compact style */
#orders-table .badge {
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table tbody tr:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #155e75;
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   MODALS - Enhanced Styling
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

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

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

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-large .modal-content {
    max-width: 1000px;
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

.toast-info {
    background: var(--info);
    color: var(--white);
}

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

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    width: 300px;
    transition: all 0.2s ease;
}

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

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    font-size: 16px;
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-500);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
    color: var(--gray-500);
}

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

.text-right {
    text-align: right;
}

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

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

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .section {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile select/dropdown optimizations */
    select.form-input,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure dropdown options are visible */
    select option {
        font-size: 14px;
        padding: 8px;
        white-space: nowrap;
    }

    .header {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .search-box input {
        width: 200px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .header,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .section {
        display: block !important;
    }
}
