:root,
html[data-theme="light"] {
    color-scheme: light;

    --bg: #e7ebf0;
    --surface: #f7f9fb;
    --surface-alt: #edf1f5;

    --text: #18212b;
    --text-muted: #697586;

    --border: #cbd3dc;

    --primary: #1769aa;
    --primary-hover: #12568c;
    --primary-soft: rgba(23, 105, 170, 0.10);

    --success: #238636;
    --success-soft: rgba(35, 134, 54, 0.10);

    --warning: #b7791f;
    --warning-soft: rgba(183, 121, 31, 0.10);

    --danger: #c62828;
    --danger-soft: rgba(198, 40, 40, 0.10);

    --sidebar-bg: #f2f5f8;
    --topbar-bg: rgba(242, 245, 248, 0.96);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #11161d;
    --surface: #1a212b;
    --surface-alt: #202934;

    --text: #f0f3f6;
    --text-muted: #9aa7b5;

    --border: #303b48;

    --primary: #4c9ee8;
    --primary-hover: #69afea;
    --primary-soft: rgba(76, 158, 232, 0.14);

    --success: #4fb96a;
    --success-soft: rgba(79, 185, 106, 0.14);

    --warning: #d8a447;
    --warning-soft: rgba(216, 164, 71, 0.14);

    --danger: #ef6b6b;
    --danger-soft: rgba(239, 107, 107, 0.14);

    --sidebar-bg: #151c24;
    --topbar-bg: rgba(26, 33, 43, 0.94);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.22);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: dark;

        --bg: #11161d;
        --surface: #1a212b;
        --surface-alt: #202934;

        --text: #f0f3f6;
        --text-muted: #9aa7b5;

        --border: #303b48;

        --primary: #4c9ee8;
        --primary-hover: #69afea;
        --primary-soft: rgba(76, 158, 232, 0.14);

        --success: #4fb96a;
        --success-soft: rgba(79, 185, 106, 0.14);

        --warning: #d8a447;
        --warning-soft: rgba(216, 164, 71, 0.14);

        --danger: #ef6b6b;
        --danger-soft: rgba(239, 107, 107, 0.14);

        --sidebar-bg: #151c24;
        --topbar-bg: rgba(26, 33, 43, 0.94);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.22);
    }
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] {
        color-scheme: light;

        --bg: #e7ebf0;
        --surface: #f7f9fb;
        --surface-alt: #edf1f5;

        --text: #18212b;
        --text-muted: #697586;

        --border: #cbd3dc;

        --primary: #1769aa;
        --primary-hover: #12568c;
        --primary-soft: rgba(23, 105, 170, 0.10);

        --success: #238636;
        --success-soft: rgba(35, 134, 54, 0.10);

        --warning: #b7791f;
        --warning-soft: rgba(183, 121, 31, 0.10);

        --danger: #c62828;
        --danger-soft: rgba(198, 40, 40, 0.10);

        --sidebar-bg: #f2f5f8;
        --topbar-bg: rgba(242, 245, 248, 0.96);

        --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
        --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    }
}
