@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Light Mode */
    --bg-main: #f9fafb; /* gray-50 */
    --bg-surface: #ffffff;
    --bg-surface-hover: #f3f4f6; /* gray-100 */
    --text-primary: #111827; /* gray-900 */
    --text-secondary: #4b5563; /* gray-600 */
    --text-muted: #9ca3af; /* gray-400 */
    --border-color: #e5e7eb; /* gray-200 */
    
    --primary: #1e3a8a; /* blue-900 */
    --primary-hover: #1e40af; /* blue-800 */
    --primary-light: #eff6ff; /* blue-50 */
    --primary-text: #1d4ed8;
    
    --success: #10b981; /* emerald-500 */
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    
    --warning: #f59e0b; /* amber-500 */
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    
    --danger: #ef4444; /* red-500 */
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --info-text: #1e40af;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    
    --sidebar-width: 260px;
    --header-height: 64px;
}

[data-theme="dark"] {
    --bg-main: #0f172a; /* slate-900 */
    --bg-surface: #1e293b; /* slate-800 */
    --bg-surface-hover: #334155; /* slate-700 */
    --text-primary: #f8fafc; /* slate-50 */
    --text-secondary: #94a3b8; /* slate-400 */
    --text-muted: #64748b; /* slate-500 */
    --border-color: #334155; /* slate-700 */
    
    --primary: #3b82f6; /* blue-500 */
    --primary-hover: #60a5fa; /* blue-400 */
    --primary-light: #1e3a8a;
    --primary-text: #bfdbfe;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-text: #34d399;
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #fbbf24;
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #f87171;
    
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-text: #93c5fd;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-theme-primary { color: var(--primary); }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-column { flex-direction: column; }
.w-100 { width: 100%; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Base Inputs */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control:disabled, .form-select:disabled {
    background-color: var(--bg-main);
    color: var(--text-muted);
    cursor: not-allowed;
}
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--danger);
}
.is-invalid {
    border-color: var(--danger) !important;
}
.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
