/* GUI Foundation Patch 1: dark/light theme variables */
:root,
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #06101d;
    --bg-2: #081728;
    --panel: rgba(15, 28, 46, 0.78);
    --panel-strong: rgba(17, 31, 51, 0.94);
    --input: rgba(255, 255, 255, 0.065);
    --input-strong: #132238;
    --text: #eef6ff;
    --muted: #9eb2cc;
    --muted-2: #6f829d;
    --line: rgba(255, 255, 255, 0.095);
    --line-strong: rgba(255, 255, 255, 0.16);
    --danger: #ff6b6b;
    --success: #4ee28a;
    --warning: #ffd166;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
    --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.20);
    --sidebar-bg: rgba(5, 16, 29, 0.90);
    --topbar-bg: rgba(9, 20, 35, 0.70);
    --table-row: rgba(255, 255, 255, 0.018);
    --table-head: rgba(255, 255, 255, 0.035);
    --soft-fill: rgba(255, 255, 255, 0.04);
    --soft-fill-strong: rgba(255, 255, 255, 0.07);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #edf3fb;
    --bg-2: #f8fbff;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --input: rgba(13, 28, 47, 0.045);
    --input-strong: #ffffff;
    --text: #102033;
    --muted: #5f7188;
    --muted-2: #8493a5;
    --line: rgba(15, 35, 60, 0.10);
    --line-strong: rgba(15, 35, 60, 0.18);
    --danger: #d83b4f;
    --success: #168a55;
    --warning: #a36d00;
    --shadow: 0 24px 60px rgba(15, 35, 60, 0.12);
    --shadow-soft: 0 16px 38px rgba(15, 35, 60, 0.10);
    --sidebar-bg: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.76);
    --table-row: rgba(15, 35, 60, 0.012);
    --table-head: rgba(15, 35, 60, 0.045);
    --soft-fill: rgba(15, 35, 60, 0.035);
    --soft-fill-strong: rgba(15, 35, 60, 0.06);
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 10% 10%, rgba(var(--accent-rgb), 0.12), transparent 34%),
        radial-gradient(circle at 88% 2%, rgba(92, 139, 216, 0.16), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-2));
}

html[data-theme="light"] select option {
    color: #102033;
    background: #ffffff;
}

html[data-theme="light"] .btn.primary,
html[data-theme="light"] button:not(.link-button):not(.danger-button):not(.theme-toggle) {
    color: #071525;
}

html[data-theme="light"] .signature-preview,
html[data-theme="light"] .email-preview pre {
    color: #102033;
}

html[data-theme="light"] .danger-button {
    color: #b42336;
    background: rgba(216, 59, 79, 0.08);
}
