/* ========================================
   Base - Variables, Reset, Typography
   ======================================== */

:root {
    /* Layout */
    --content-max-width: 1100px;
    --sidebar-width: 260px;

    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #10b981;
    --accent-dark: #059669;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --success: #10b981;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --radius: 8px;
    --radius-sm: 4px;
}

/* Dark theme */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: #334155;
    --border-light: #334155;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px 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);
    color-scheme: dark;
}

/* Number input spinners in dark mode */
[data-theme="dark"] input[type="number"] {
    color-scheme: dark;
}

/* Theme toggle - show moon in light mode, sun in dark mode */
#theme-toggle { background: none; border: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
#theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

h1, h2, h3 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}

/* Utilities */
.text-muted {
    color: var(--text-muted);
}

.text-small {
    font-size: 13px;
}

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

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

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.inline {
    display: inline;
}

.inline-form {
    display: inline;
}
