:root {
    --primary: #007AFF;
    --primary-hover: #0056CC;
    --primary-light: rgba(0, 122, 255, 0.08);
    --primary-dark: #003D99;
    
    --success: #34C759;
    --success-light: rgba(52, 199, 89, 0.1);
    --warning: #FF9500;
    --warning-light: rgba(255, 149, 0, 0.1);
    --danger: #FF3B30;
    --danger-light: rgba(255, 59, 48, 0.1);
    
    --gray-50: #F9FAFB;
    --gray-100: #F2F2F7;
    --gray-200: #E5E5EA;
    --gray-300: #D1D1D6;
    --gray-400: #C7C7CC;
    --gray-500: #8E8E93;
    --gray-600: #636366;
    --gray-700: #48484A;
    --gray-800: #3A3A3C;
    --gray-900: #1C1C1E;
    
    --text-primary: #1C1C1E;
    --text-secondary: #636366;
    --text-tertiary: #8E8E93;
    --text-quaternary: #C7C7CC;
    
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-tertiary: #E5E5EA;
    
    --border-color: rgba(0, 0, 0, 0.04);
    --border-strong: rgba(0, 0, 0, 0.08);
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    
    --sidebar-width: 280px;
    --header-height: 72px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #8E8E93;
    --text-quaternary: #636366;
    
    --bg-primary: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --bg-tertiary: #3A3A3C;
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24), 0 1px 2px rgba(0, 0, 0, 0.16);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.28), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.32), 0 4px 8px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .sidebar {
    background: rgba(28, 28, 30, 0.72);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.16), 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .main-header {
    background: rgba(28, 28, 30, 0.72);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .card {
    background: #3A3A3C;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .card:hover {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.16),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .card::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        transparent 100%);
}

[data-theme="dark"] .stat-card {
    background: #3A3A3C;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.16),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .stat-card::after {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
}

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

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

html,
html *,
html *::before,
html *::after {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                box-shadow 0.3s ease,
                color 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { 
    font-size: 2rem; 
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 { 
    font-size: 1.5rem;
    font-weight: 600;
}

h3 { 
    font-size: 1.25rem;
    font-weight: 600;
}

h4 { 
    font-size: 1.125rem;
    font-weight: 600;
}

h5 { 
    font-size: 1rem;
    font-weight: 600;
}

h6 { 
    font-size: 0.875rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

@media print {
    .sidebar,
    .header,
    .btn,
    .modal-overlay,
    .page-header button {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
    
    .page-container {
        padding: 20px !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #E5E5EA !important;
        break-inside: avoid;
    }
    
    .chart-container {
        break-inside: avoid;
    }
    
    .report-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

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

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

.icon svg {
    width: 100%;
    height: 100%;
}
