/* The signed-in app's skin: its typeface and its default button, in one place. Linked after the area sheets, as
   public-skin.css is for the public site.

   The values are tokens in app.css: --ci-font (the public site's thinner face) and --ci-btn-* (the default button:
   neutral ink, light and dark). Each area sheet reads them in its own rules: its font tokens (--tx-font,
   --tx-font-text, --ai-font, --help-font ...) point at --ci-font, and its primary button (mya-btn-primary,
   tx-btn-primary, rp-btn, iv-btn-primary ...) takes --ci-btn-fill / --ci-btn-text / --ci-btn-edge. So a new area gets
   the look by using the tokens, and this file holds only what no area sheet owns: the shell's base face, headings,
   and the Syncfusion and Bootstrap controls.

   html:has(.admin-shell) is any page drawn by AdminLayout, and reaches what Syncfusion and the sheets append to
   <body> (dialogs, pick lists, calendars). The public site (main.page-wrapper) is not touched.

   Buttons that carry a meaning keep their colour: remove and other destructive actions (red), pay (green),
   caution (amber), and the All Access upgrade (gold / violet). */

/* ---- 1. Type ---------------------------------------------------------------------------------------------------- */
/* The theme's own font tokens and Syncfusion's, so a control with no font of its own draws in the same face. */
html:has(.admin-shell) {
    --si-font-sans-serif: var(--ci-font);
    --si-body-font-family: var(--ci-font);
    --bs-font-sans-serif: var(--ci-font);
    --bs-body-font-family: var(--ci-font);
    --e-font-name: var(--ci-font);
    --e-font-family: var(--ci-font);
}

/* app.css sets html and body to Helvetica; the shell reads the one face. font-synthesis keeps the browser from
   drawing a false bold over a face whose weight stops at 620. */
html:has(.admin-shell),
html:has(.admin-shell) body {
    font-family: var(--ci-font);
    font-synthesis: style;
}

/* Headings: one weight, set a little tighter, as on the public pages. :where keeps these under an area's own title
   class. */
:where(.admin-shell) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    font-weight: 600;
    letter-spacing: -.012em;
}

:where(.admin-shell) :is(h1, h2, .h1, .h2) {
    letter-spacing: -.022em;
}

/* ---- 2. The default button: Bootstrap and Syncfusion ------------------------------------------------------------ */
/* These take one flat colour (app.css reads the tokens), so they get the ink without its gradient. On a dark page
   the border is drawn over the fill, which gives the same hairline as the area buttons. */
html:has(.admin-shell) {
    --ci-btn-solid: #262a34;
    --ci-btn-solid-hover: #363b48;
    --ci-btn-solid-active: #1b1f28;
    --ci-btn-solid-text: #fcfdfd;
}

html[data-bs-theme="dark"]:has(.admin-shell) {
    --ci-btn-solid: rgba(255, 255, 255, .2);
    --ci-btn-solid-hover: rgba(255, 255, 255, .28);
    --ci-btn-solid-active: rgba(255, 255, 255, .16);
    --ci-btn-solid-text: #fff;
}

/* A Bootstrap primary button in the app is the same button as the area sheets'. */
html:has(.admin-shell) .btn-primary {
    border-color: transparent;
    background: var(--ci-btn-fill) border-box;
    color: var(--ci-btn-text);
    box-shadow: var(--ci-btn-edge);
}

html:has(.admin-shell) .btn-primary:is(:hover, :focus-visible, :active):not(:disabled, .disabled) {
    border-color: transparent;
    background: var(--ci-btn-fill) border-box;
    color: var(--ci-btn-text);
    box-shadow: var(--ci-btn-edge) !important;
    filter: var(--ci-btn-hover);
}

html:has(.admin-shell) .btn-primary:focus-visible {
    outline: 2px solid var(--ci-btn-focus);
    outline-offset: 2px;
}
