:root {
    --brand: #4f46e5;
    --brand-2: #6366f1;
    --ok: #059669;
    --danger: #dc2626;
    --warn: #d97706;
    --page-bg: #eef1f8;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-label: #475569;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #1e293b;
    --tile-bg: #f8fafc;
    --row-alt-bg: #f8fafc;
    --hover-bg: #eef2ff;
    --hover-border: #c7d2fe;
    --hover-text: #4338ca;
}
html[data-theme="emerald"] {
    --brand: #059669;
    --brand-2: #10b981;
    --hover-bg: #ecfdf5;
    --hover-border: #a7f3d0;
    --hover-text: #047857;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --brand: #6366f1;
    --brand-2: #818cf8;
    --page-bg: #0b1220;
    --card-bg: #111827;
    --card-border: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #94a3b8;
    --text-label: #cbd5e1;
    --input-bg: #1f2937;
    --input-border: #374151;
    --input-text: #f1f5f9;
    --tile-bg: #1e293b;
    --row-alt-bg: #0f172a;
    --hover-bg: #1e293b;
    --hover-border: #334155;
    --hover-text: #93c5fd;
}
html[data-theme="dark"] body,
html[data-theme="emerald"] body {
    background: var(--page-bg) !important;
}
html[data-theme="dark"] body { color: var(--text-main); }
.app-theme-switcher {
    position: fixed; bottom: 16px; left: 16px; z-index: 99999;
    display: flex; align-items: center; gap: 6px;
    background: rgba(15,23,42,.75); backdrop-filter: blur(6px);
    padding: 7px 9px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.app-theme-swatch {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5);
    cursor: pointer; padding: 0; transition: transform .15s ease;
}
.app-theme-swatch:hover { transform: scale(1.15); }
.app-theme-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.app-theme-swatch[data-theme-choice="default"] { background: linear-gradient(135deg,#3730a3,#6366f1); }
.app-theme-swatch[data-theme-choice="emerald"] { background: linear-gradient(135deg,#065f46,#10b981); }
.app-theme-swatch[data-theme-choice="dark"] { background: linear-gradient(135deg,#000000,#334155); }
