:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --panel-soft-2: #243041;
    --border: #374151;
    --border-soft: #465469;
    --text: #f9fafb;
    --muted: #9ca3af;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.14);
    --accent-contrast: #ffffff;

    --link-color: var(--accent);
    --link-hover: var(--accent-hover);

    --button-bg: var(--accent);
    --button-hover: pink;
    --button-text: var(--accent-contrast);

    --interactive-text: var(--link-color);
    --interactive-text-hover: var(--link-hover);

    --input-bg: var(--bg);
    --input-border: var(--border-soft);

    --success-bg: #14532d;
    --success-border: #22c55e;
    --success-text: #bbf7d0;

    --warning-bg: #78350f;
    --warning-border: #f59e0b;
    --warning-text: #fde68a;

    --error-bg: #7f1d1d;
    --error-border: #ef4444;
    --error-text: #fecaca;

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);

    /* THEME: dark */
    --theme-dark-bg: #0f172a;
    --theme-dark-panel: #111827;
    --theme-dark-panel-soft: #1f2937;
    --theme-dark-panel-soft-2: #243041;
    --theme-dark-border: #374151;
    --theme-dark-border-soft: #465469;
    --theme-dark-text: #f9fafb;
    --theme-dark-muted: #9ca3af;
    --theme-dark-input-bg: #111827;
    --theme-dark-input-border: #4b5563;
    --theme-dark-link-color: #60a5fa;
    --theme-dark-link-hover: #93c5fd;
    --theme-dark-success-bg: #14532d;
    --theme-dark-success-border: #22c55e;
    --theme-dark-success-text: #bbf7d0;
    --theme-dark-warning-bg: #78350f;
    --theme-dark-warning-border: #f59e0b;
    --theme-dark-warning-text: #fde68a;
    --theme-dark-error-bg: #7f1d1d;
    --theme-dark-error-border: #ef4444;
    --theme-dark-error-text: #fecaca;
    --theme-dark-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);

    /* THEME: light */
    --theme-light-bg: #f6f7f9;
    --theme-light-panel: #ffffff;
    --theme-light-panel-soft: #f9fafb;
    --theme-light-panel-soft-2: #f1f3f6;
    --theme-light-border: #e5e7eb;
    --theme-light-border-soft: #d1d5db;
    --theme-light-text: #111827;
    --theme-light-muted: #6b7280;
    --theme-light-input-bg: #ffffff;
    --theme-light-input-border: #d1d5db;
    --theme-light-link-color: #1d4ed8;
    --theme-light-link-hover: #1e40af;
    --theme-light-success-bg: #dcfce7;
    --theme-light-success-border: #22c55e;
    --theme-light-success-text: #166534;
    --theme-light-warning-bg: #fef3c7;
    --theme-light-warning-border: #f59e0b;
    --theme-light-warning-text: #92400e;
    --theme-light-error-bg: #fee2e2;
    --theme-light-error-border: #ef4444;
    --theme-light-error-text: #991b1b;
    --theme-light-shadow-soft: 0 6px 16px rgba(0, 0, 0, 0.06);

    /* THEME: blue */
    --theme-blue-bg: #eaf3ff;
    --theme-blue-panel: #d8e8ff;
    --theme-blue-panel-soft: #edf5ff;
    --theme-blue-panel-soft-2: #c7dcfb;
    --theme-blue-border: #9fc0ee;
    --theme-blue-border-soft: #78a6df;
    --theme-blue-text: #10233d;
    --theme-blue-muted: #5a6b7f;
    --theme-blue-input-bg: #f7fbff;
    --theme-blue-input-border: #8eb3e6;
    --theme-blue-link-color: #163a63;
    --theme-blue-link-hover: #102b49;
    --theme-blue-success-bg: #dcfce7;
    --theme-blue-success-border: #22c55e;
    --theme-blue-success-text: #166534;
    --theme-blue-warning-bg: #fef3c7;
    --theme-blue-warning-border: #f59e0b;
    --theme-blue-warning-text: #92400e;
    --theme-blue-error-bg: #fee2e2;
    --theme-blue-error-border: #ef4444;
    --theme-blue-error-text: #991b1b;
    --theme-blue-shadow-soft: 0 8px 24px rgba(80, 128, 201, 0.12);

    /* THEME: light_blue */
    --theme-light-blue-bg: #f8fbff;
    --theme-light-blue-panel: #eef6ff;
    --theme-light-blue-panel-soft: #f4f8ff;
    --theme-light-blue-panel-soft-2: #dbe9fb;
    --theme-light-blue-border: #bdd2ee;
    --theme-light-blue-border-soft: #96b7e0;
    --theme-light-blue-text: #12263f;
    --theme-light-blue-muted: #617286;
    --theme-light-blue-input-bg: #ffffff;
    --theme-light-blue-input-border: #aac4e6;
    --theme-light-blue-link-color: #17385f;
    --theme-light-blue-link-hover: #102947;
    --theme-light-blue-success-bg: #dcfce7;
    --theme-light-blue-success-border: #22c55e;
    --theme-light-blue-success-text: #166534;
    --theme-light-blue-warning-bg: #fef3c7;
    --theme-light-blue-warning-border: #f59e0b;
    --theme-light-blue-warning-text: #92400e;
    --theme-light-blue-error-bg: #fee2e2;
    --theme-light-blue-error-border: #ef4444;
    --theme-light-blue-error-text: #991b1b;
    --theme-light-blue-shadow-soft: 0 8px 24px rgba(126, 174, 230, 0.12);

    /* THEME: turquoise */
    --theme-turquoise-bg: #effcfb;
    --theme-turquoise-panel: #ddf7f3;
    --theme-turquoise-panel-soft: #f2fcfb;
    --theme-turquoise-panel-soft-2: #c8efe9;
    --theme-turquoise-border: #97ddd2;
    --theme-turquoise-border-soft: #63c7b8;
    --theme-turquoise-text: #123134;
    --theme-turquoise-muted: #587073;
    --theme-turquoise-input-bg: #fcffff;
    --theme-turquoise-input-border: #7ed0c4;
    --theme-turquoise-link-color: #0f4f56;
    --theme-turquoise-link-hover: #0b3c42;
    --theme-turquoise-success-bg: #dcfce7;
    --theme-turquoise-success-border: #22c55e;
    --theme-turquoise-success-text: #166534;
    --theme-turquoise-warning-bg: #fef3c7;
    --theme-turquoise-warning-border: #f59e0b;
    --theme-turquoise-warning-text: #92400e;
    --theme-turquoise-error-bg: #fee2e2;
    --theme-turquoise-error-border: #ef4444;
    --theme-turquoise-error-text: #991b1b;
    --theme-turquoise-shadow-soft: 0 8px 24px rgba(45, 160, 150, 0.12);

    /* THEME: green */
    --theme-green-bg: #f1fbf4;
    --theme-green-panel: #e0f5e5;
    --theme-green-panel-soft: #f4fcf6;
    --theme-green-panel-soft-2: #ccebd4;
    --theme-green-border: #a8ddb5;
    --theme-green-border-soft: #73c589;
    --theme-green-text: #173524;
    --theme-green-muted: #5b6f63;
    --theme-green-input-bg: #fcfffd;
    --theme-green-input-border: #86c89a;
    --theme-green-link-color: #1a5a33;
    --theme-green-link-hover: #144628;
    --theme-green-success-bg: #dcfce7;
    --theme-green-success-border: #22c55e;
    --theme-green-success-text: #166534;
    --theme-green-warning-bg: #fef3c7;
    --theme-green-warning-border: #f59e0b;
    --theme-green-warning-text: #92400e;
    --theme-green-error-bg: #fee2e2;
    --theme-green-error-border: #ef4444;
    --theme-green-error-text: #991b1b;
    --theme-green-shadow-soft: 0 8px 24px rgba(74, 160, 110, 0.12);

    /* THEME: violet */
    --theme-violet-bg: #f7f3ff;
    --theme-violet-panel: #ede4ff;
    --theme-violet-panel-soft: #f8f4ff;
    --theme-violet-panel-soft-2: #ddd1fb;
    --theme-violet-border: #c9b8f1;
    --theme-violet-border-soft: #a991e0;
    --theme-violet-text: #31175f;
    --theme-violet-muted: #6a6180;
    --theme-violet-input-bg: #fdfbff;
    --theme-violet-input-border: #b8a0ea;
    --theme-violet-link-color: #47227f;
    --theme-violet-link-hover: #35195f;
    --theme-violet-success-bg: #dcfce7;
    --theme-violet-success-border: #22c55e;
    --theme-violet-success-text: #166534;
    --theme-violet-warning-bg: #fef3c7;
    --theme-violet-warning-border: #f59e0b;
    --theme-violet-warning-text: #92400e;
    --theme-violet-error-bg: #fee2e2;
    --theme-violet-error-border: #ef4444;
    --theme-violet-error-text: #991b1b;
    --theme-violet-shadow-soft: 0 8px 24px rgba(140, 110, 210, 0.12);
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
}


a {
    color: var(--interactive-text);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
}

.card,
.stat-card,
.chart-card {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

input,
textarea,
select {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--input-border);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    outline: none;
}


button,
.btn,
.apply-btn,
.new-doc-btn,
.topnav-btn,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    padding: 10px 14px;
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--button-bg);
    border-radius: 6px;
    font: inherit;
    /* unified transition for background/color/border/transform/opacity */
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, opacity .15s ease;
}

button:hover,
.btn:hover,
.apply-btn:hover,
.new-doc-btn:hover,
.topnav-btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
    background: white;
    border: 1px solid var(--button-hover);
    color: var(--button-hover);
}


.hint,
.muted,
.stat-label,
.page-head p,
.section-head p {
    color: var(--muted);
}

.success-box {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.error-box {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
}

.warning-box {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
}