/* iDocs design tokens — single source of truth for the light + dark themes.
   Light values reproduce the CURRENT appearance (Phase 1 must not change how the
   app looks in light mode). Dark values activate only when <html data-bs-theme="dark">
   is set (wired up in Phase 2). Bootstrap 5.3 already themes its own --bs-* variables
   under [data-bs-theme]; these tokens cover the app-specific surfaces/shadows/shapes
   that Bootstrap does not own. Never hardcode a colour in component CSS — add a token. */

:root,
[data-bs-theme="light"] {
    /* surfaces */
    --idocs-surface: #ffffff;
    --idocs-surface-muted: #eeeeee;        /* dashboard tab strip bg (was #eee) */
    --idocs-border: #dddddd;               /* thin dividers (was #ddd) */
    --idocs-badge-bg: #ededed;             /* role/status badge chip (was #ededed) */

    /* text */
    --idocs-text-muted: #6c757d;
    --idocs-subinfo-text: #6c757d;         /* profile field labels — was lightgray (WCAG fail) */
    --idocs-avatar-bg: #dee2e6;            /* avatar placeholder */

    /* soft status badges — tinted background + readable coloured text (not saturated fills) */
    --idocs-status-warning-bg: #fdf1d9;
    --idocs-status-warning-text: #8a5a00;
    --idocs-status-primary-bg: #e1ecff;
    --idocs-status-primary-text: #0a58ca;
    --idocs-status-success-bg: #d9f2e4;
    --idocs-status-success-text: #0f7b45;
    --idocs-status-danger-bg: #fbe0e2;
    --idocs-status-danger-text: #b02a37;

    /* elevation */
    --idocs-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.16);
    --idocs-shadow-md: 0 2px 10px rgba(0, 0, 0, 0.10);

    /* shape — refined, restrained corners (no bubbly pills). */
    --idocs-radius-sm: 4px;
    --idocs-radius: 8px;
    --idocs-radius-lg: 12px;

    /* Globally tame Bootstrap/Havit component corners (buttons, cards, inputs,
       dropdowns, badges). Bootstrap defaults are 0.375rem / 1rem for xl; the xl
       reduction is what stops rounded-4 badges/pills from looking like capsules. */
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.625rem;
    --bs-border-radius-xl: 0.625rem;
    --bs-border-radius-xxl: 0.75rem;

    /* transient chrome */
    --idocs-warning-bg: #ffee8f;           /* reconnection bar (preserve exactly) */
    --idocs-warning-text: #303030;

    /* browser UI colour that follows the theme (see App.razor head script, Phase 2) */
    --idocs-theme-color: #ffffff;
}

[data-bs-theme="dark"] {
    --idocs-surface: #1e2530;
    --idocs-surface-muted: #273041;
    --idocs-border: #3a4657;
    --idocs-badge-bg: #2b3547;

    --idocs-text-muted: #9aa7b8;
    --idocs-subinfo-text: #8b95a3;
    --idocs-avatar-bg: #3a4657;

    --idocs-status-warning-bg: #3a2e10;
    --idocs-status-warning-text: #e8c473;
    --idocs-status-primary-bg: #17263f;
    --idocs-status-primary-text: #6ea8fe;
    --idocs-status-success-bg: #12301f;
    --idocs-status-success-text: #56c489;
    --idocs-status-danger-bg: #3a171b;
    --idocs-status-danger-text: #ea868f;

    --idocs-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.5);
    --idocs-shadow-md: 0 2px 12px rgba(0, 0, 0, 0.55);

    --idocs-warning-bg: #4a4410;
    --idocs-warning-text: #ffe98a;

    --idocs-theme-color: #1a2029;
}

/* Soft status badge — tinted pill/dot instead of a saturated Bootstrap fill.
   Applied via WorkerRequestState.GetBadgeCssClass(). */
.status-soft {
    background-color: var(--idocs-badge-bg);
    color: var(--bs-body-color);
    font-weight: 600;
}

.status-warning { background-color: var(--idocs-status-warning-bg); color: var(--idocs-status-warning-text); }
.status-primary { background-color: var(--idocs-status-primary-bg); color: var(--idocs-status-primary-text); }
.status-success { background-color: var(--idocs-status-success-bg); color: var(--idocs-status-success-text); }
.status-danger  { background-color: var(--idocs-status-danger-bg);  color: var(--idocs-status-danger-text); }

/* Accent-tinted form controls instead of default grey squares. */
.form-check-input,
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--bs-primary);
}
