/* =============================================================================
   crm-login.css — Sign-in screen only (index.php, the `if (!$user)` branch).
   -----------------------------------------------------------------------------
   Loaded AFTER style.css, crm-premium.css, crm-dark.css and crm-glass.css, and
   only on the login document. Every rule is prefixed with the page root id
   (#crm-login) so it out-ranks the shared sheets' generic form-control rules
   (crm-dark's dark-mode `input:not(...)` rule is (0,6,2)) without !important.

   Theme: crm-theme.js sets  <html data-theme="dark">  for dark and REMOVES the
   attribute for light — there is no data-theme="light" value. The tokens on
   #crm-login are the dark (reference) palette; `html:not([data-theme="dark"])`
   swaps them for the light palette. The theme toggle crm-theme.js inserts
   after .login-card (button.theme-toggle.theme-toggle--login) is restyled as a
   fixed glass pill at the top-right of the viewport.

   Fonts: Manrope (body) and Bricolage Grotesque (display) are linked from
   Google Fonts in the login <head> only, with system-ui fallbacks here.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   0. Tokens
   --------------------------------------------------------------------------- */
#crm-login {
    --lg-font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-font-display: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* dark / reference palette — dotted navy-plum field */
    --lg-bg-base: #0e1230;
    --lg-bg: linear-gradient(160deg, #0b1130 0%, #161a3e 48%, #251a40 100%);
    --lg-dot: rgba(255, 255, 255, .11);
    --lg-glow-a: rgba(245, 166, 35, .22);
    --lg-glow-b: rgba(139, 92, 246, .30);

    --lg-card-bg: rgba(24, 26, 56, .55);
    --lg-card-bg-solid: #191c3f;
    --lg-card-border: rgba(255, 255, 255, .16);
    --lg-card-highlight: rgba(255, 255, 255, .22);
    --lg-card-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75), 0 16px 40px -20px rgba(0, 0, 0, .6);

    --lg-text: #f4f6ff;
    --lg-muted: #a7acc8;
    --lg-label: #c3c8e3;
    --lg-foot: #8d93b8;

    --lg-input-bg: rgba(255, 255, 255, .06);
    --lg-input-bg-focus: rgba(255, 255, 255, .09);
    --lg-input-bg-solid: #1c1f45;
    --lg-input-border: rgba(255, 255, 255, .14);
    --lg-input-border-hover: rgba(255, 255, 255, .26);
    --lg-placeholder: #7f85a8;

    --lg-amber: #f5a623;
    --lg-ring: rgba(245, 166, 35, .30);
    --lg-focus-outline: #ffd27a;

    --lg-error: #ff9c8a;
    --lg-error-bg: rgba(255, 156, 138, .10);
    --lg-error-border: rgba(255, 156, 138, .26);

    --lg-toggle-bg: rgba(255, 255, 255, .10);
    --lg-toggle-bg-hover: rgba(255, 255, 255, .17);
    --lg-toggle-border: rgba(255, 255, 255, .18);
    --lg-toggle-text: #ffffff;
    --lg-toggle-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* light palette — crm-theme.js removes data-theme entirely for light mode */
html:not([data-theme="dark"]) #crm-login {
    --lg-bg-base: #f3f4f8;
    --lg-bg: linear-gradient(#f3f4f8, #f3f4f8);
    --lg-dot: rgba(0, 0, 0, .08);
    --lg-glow-a: rgba(245, 166, 35, .20);
    --lg-glow-b: rgba(139, 92, 246, .16);

    --lg-card-bg: rgba(255, 255, 255, .70);
    --lg-card-bg-solid: #ffffff;
    --lg-card-border: rgba(15, 23, 42, .08);
    --lg-card-highlight: rgba(255, 255, 255, .95);
    --lg-card-shadow: 0 30px 70px -30px rgba(15, 23, 42, .28), 0 12px 30px -18px rgba(15, 23, 42, .18);

    --lg-text: #0f172a;
    --lg-muted: #475569;
    --lg-label: #334155;
    --lg-foot: #64748b;

    --lg-input-bg: rgba(255, 255, 255, .85);
    --lg-input-bg-focus: #ffffff;
    --lg-input-bg-solid: #ffffff;
    --lg-input-border: rgba(15, 23, 42, .14);
    --lg-input-border-hover: rgba(15, 23, 42, .26);
    --lg-placeholder: #94a3b8;

    --lg-ring: rgba(245, 166, 35, .32);
    --lg-focus-outline: #b45309;

    /* salmon #ff9c8a fails contrast on white; a deep coral keeps the hue family */
    --lg-error: #b42318;
    --lg-error-bg: rgba(180, 35, 24, .07);
    --lg-error-border: rgba(180, 35, 24, .22);

    --lg-toggle-bg: rgba(255, 255, 255, .65);
    --lg-toggle-bg-hover: rgba(255, 255, 255, .88);
    --lg-toggle-border: rgba(15, 23, 42, .10);
    --lg-toggle-text: #0f172a;
    --lg-toggle-shadow: 0 6px 18px -10px rgba(15, 23, 42, .25), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* ---------------------------------------------------------------------------
   1. Body + full-screen field
   --------------------------------------------------------------------------- */
html body.crm-login-body,
html[data-theme="dark"] body.crm-login-body {
    margin: 0;
    background: #0e1230;
}
html:not([data-theme="dark"]) body.crm-login-body {
    background: #f3f4f8;
}

#crm-login {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 76px 16px 40px;
    font-family: var(--lg-font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--lg-text);
    background-color: var(--lg-bg-base);
    background-image:
        radial-gradient(circle at 2px 2px, var(--lg-dot) 1.15px, transparent 1.9px),
        var(--lg-bg);
    background-size: 22px 22px, 100% 100%;
    background-repeat: repeat, no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* two soft radial glows (no filter: blur — the gradient falloff is the softness) */
#crm-login::before,
#crm-login::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}
#crm-login::before {
    width: 64vmax;
    height: 64vmax;
    left: -24vmax;
    top: -30vmax;
    background: radial-gradient(circle, var(--lg-glow-a) 0%, transparent 62%);
}
#crm-login::after {
    width: 72vmax;
    height: 72vmax;
    right: -28vmax;
    bottom: -36vmax;
    background: radial-gradient(circle, var(--lg-glow-b) 0%, transparent 62%);
}

/* ---------------------------------------------------------------------------
   2. Glass card (.login-card is kept as the crm-theme.js mount hook)
   --------------------------------------------------------------------------- */
#crm-login .login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    width: min(440px, 100%);
    margin: 0;
    padding: 30px;
    border: 1px solid var(--lg-card-border);
    border-radius: 28px;
    background: var(--lg-card-bg);
    color: var(--lg-text);
    box-shadow: inset 0 1px 0 var(--lg-card-highlight), var(--lg-card-shadow);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    animation: lg-card-in .55s cubic-bezier(.22, 1, .36, 1) both;
}
/* crm-premium paints a 44px gradient square (::before) and a "●" (::after)
   on .login-card — repurpose ::before as the inset top highlight line and
   drop ::after. Every property the old rule set is reset here. */
#crm-login .login-card::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    width: auto;
    height: 1px;
    margin: 0;
    border-radius: 1px;
    background: linear-gradient(90deg, transparent, var(--lg-card-highlight), transparent);
    box-shadow: none;
    pointer-events: none;
}
#crm-login .login-card::after { content: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    #crm-login .login-card { background: var(--lg-card-bg-solid); }
}

/* ---------------------------------------------------------------------------
   3. Brand row
   --------------------------------------------------------------------------- */
#crm-login .lg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
}
#crm-login .lg-mark {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(180deg, #ffc85e 0%, #f5a623 55%, #ef8a12 100%);
    color: #231500;
    font-family: var(--lg-font-display);
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    box-shadow: 0 10px 22px -10px rgba(245, 166, 35, .75), inset 0 1px 0 rgba(255, 255, 255, .5);
}
#crm-login .lg-brand-text { min-width: 0; }
#crm-login .lg-brand-name {
    display: block;
    font-family: var(--lg-font-display);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--lg-text);
}
#crm-login .lg-brand-sub {
    display: block;
    margin-top: 3px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lg-muted);
}

/* ---------------------------------------------------------------------------
   4. Heading + lead
   --------------------------------------------------------------------------- */
#crm-login .lg-title {
    margin: 0 0 6px;
    font-family: var(--lg-font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-align: left;
    color: var(--lg-text);
    /* crm-premium's .login-card h1 is a transparent gradient-filled text — undo */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
}
#crm-login .lg-lead {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--lg-muted);
}

/* ---------------------------------------------------------------------------
   5. Error / notice (flash message). Keeps .alert.red so the page's
      auto-dismiss script still treats it as an error and adds its × button.
   --------------------------------------------------------------------------- */
#crm-login .lg-alert {
    display: block;
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid var(--lg-error-border);
    border-radius: 14px;
    background: var(--lg-error-bg);
    color: var(--lg-error);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    animation: lg-alert-in .3s cubic-bezier(.22, 1, .36, 1) both;
}
#crm-login .lg-alert .alert-close {
    padding: 0;
    font-family: inherit;
    font-weight: 400;
    color: inherit;
}
#crm-login .lg-alert .alert-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------------------------------------------------------------------------
   6. Form fields
   --------------------------------------------------------------------------- */
#crm-login .lg-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}
#crm-login .lg-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
#crm-login .lg-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--lg-label);
}
#crm-login .lg-input {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--lg-input-border);
    border-radius: 14px;
    background-color: var(--lg-input-bg);
    color: var(--lg-text);
    font-family: var(--lg-font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: normal;
    outline: none;
    box-shadow: none;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
#crm-login .lg-input::placeholder {
    color: var(--lg-placeholder);
    opacity: 1;
}
#crm-login .lg-input:hover {
    border-color: var(--lg-input-border-hover);
}
#crm-login .lg-input:focus {
    border-color: var(--lg-amber);
    background-color: var(--lg-input-bg-focus);
    box-shadow: 0 0 0 4px var(--lg-ring);
}
/* style.css's global :focus-visible adds an outline + border-radius:4px */
#crm-login .lg-input:focus-visible {
    outline: none;
    border-radius: 14px;
}
/* browser autofill would otherwise paint a pale yellow/white box */
#crm-login .lg-input:-webkit-autofill,
#crm-login .lg-input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px var(--lg-input-bg-solid) inset;
    box-shadow: 0 0 0 1000px var(--lg-input-bg-solid) inset;
    -webkit-text-fill-color: var(--lg-text);
    caret-color: var(--lg-text);
    border-color: var(--lg-input-border);
    transition: background-color 2147483647s ease-out;
}
#crm-login .lg-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--lg-input-bg-solid) inset, 0 0 0 4px var(--lg-ring);
    box-shadow: 0 0 0 1000px var(--lg-input-bg-solid) inset, 0 0 0 4px var(--lg-ring);
    border-color: var(--lg-amber);
}

/* ---------------------------------------------------------------------------
   7. Primary button — amber pill
   --------------------------------------------------------------------------- */
#crm-login .lg-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    margin: 6px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffc85e 0%, #f5a623 55%, #ef8a12 100%);
    color: #231500;
    font-family: var(--lg-font-body);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        0 14px 28px -14px rgba(245, 166, 35, .8),
        inset 0 1px 0 rgba(255, 255, 255, .45),
        inset 0 -1px 0 rgba(0, 0, 0, .08);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
#crm-login .lg-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 18px 34px -14px rgba(245, 166, 35, .9),
        inset 0 1px 0 rgba(255, 255, 255, .5),
        inset 0 -1px 0 rgba(0, 0, 0, .08);
}
#crm-login .lg-btn:active {
    transform: translateY(0) scale(.99);
    filter: brightness(.97);
}
#crm-login .lg-btn:focus-visible {
    outline: 2px solid var(--lg-text);
    outline-offset: 3px;
    border-radius: 999px;
}
#crm-login .lg-btn:disabled {
    cursor: not-allowed;
    opacity: .6;
    transform: none;
    filter: none;
}
#crm-login .lg-btn-ico {
    width: 18px;
    height: 18px;
    flex: none;
    transition: transform .2s ease;
}
#crm-login .lg-btn:hover .lg-btn-ico { transform: translateX(2px); }

/* ---------------------------------------------------------------------------
   8. Footer line
   --------------------------------------------------------------------------- */
#crm-login .lg-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 22px 0 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--lg-foot);
    text-align: center;
}
#crm-login .lg-foot svg {
    width: 14px;
    height: 14px;
    flex: none;
    opacity: .85;
}

/* ---------------------------------------------------------------------------
   9. Theme toggle (inserted by crm-theme.js after .login-card) — fixed glass
      pill, top-right of the viewport. Out-ranks crm-dark's .theme-toggle and
      crm-glass's html .theme-toggle rules.
   --------------------------------------------------------------------------- */
#crm-login .theme-toggle--login {
    position: fixed;
    top: 16px;
    top: max(16px, env(safe-area-inset-top, 16px));
    right: 16px;
    right: max(16px, env(safe-area-inset-right, 16px));
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 7px 13px;
    border: 1px solid var(--lg-toggle-border);
    border-radius: 999px;
    background: var(--lg-toggle-bg);
    color: var(--lg-toggle-text);
    font-family: var(--lg-font-body);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--lg-toggle-shadow);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#crm-login .theme-toggle--login:hover {
    transform: translateY(-1px);
    background: var(--lg-toggle-bg-hover);
}
#crm-login .theme-toggle--login:active { transform: scale(.97); }
#crm-login .theme-toggle--login:focus-visible {
    outline: 2px solid var(--lg-amber);
    outline-offset: 2px;
    border-radius: 999px;
    box-shadow: var(--lg-toggle-shadow);
}
#crm-login .theme-toggle--login .tt-ico { font-size: 13px; line-height: 1; }

/* ---------------------------------------------------------------------------
   10. Motion
   --------------------------------------------------------------------------- */
@keyframes lg-card-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes lg-alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    #crm-login .login-card,
    #crm-login .lg-alert { animation: none; }
    #crm-login .lg-input,
    #crm-login .lg-btn,
    #crm-login .lg-btn-ico,
    #crm-login .theme-toggle--login { transition: none; }
    #crm-login .lg-btn:hover,
    #crm-login .lg-btn:active,
    #crm-login .theme-toggle--login:hover,
    #crm-login .theme-toggle--login:active { transform: none; }
    #crm-login .lg-btn:hover .lg-btn-ico { transform: none; }
}

/* ---------------------------------------------------------------------------
   11. Small screens
   --------------------------------------------------------------------------- */
@media (max-width: 480px) {
    #crm-login { padding: 68px 14px 28px; }
    #crm-login .login-card {
        padding: 24px 22px;
        border-radius: 22px;
    }
    #crm-login .login-card::before { left: 22px; right: 22px; }
    #crm-login .lg-title { font-size: 26px; }
    /* 16px stops iOS Safari zooming the page when a field is focused */
    #crm-login .lg-input { font-size: 16px; }
    #crm-login .theme-toggle--login { top: 12px; right: 12px; }
}

/* =============================================================================
   "Warm Signal" UI theme — login identity. SCOPED: every rule below needs
   body[data-skin="warm"], which index.php sets on the login <body> only while
   the saved UI theme (shell.php crm_ui_theme()) is "warm"; the classic, Ledger
   and Night Ops logins keep the rules above untouched. Specificity: the dark
   token block is (1,1,1) = the light block above, so the light block below
   restates every token at (1,2,2). Paper canvas + forest
   green primary + amber brand dot; dark = warm charcoal. Dark stays the
   default on this screen (bootstrap at index.php ≈4891 unchanged).
   ============================================================================= */
body[data-skin="warm"] #crm-login {
    --lg-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-bg-base: #1b1815;
    --lg-bg: linear-gradient(160deg, #1b1815 0%, #221d18 55%, #2a221a 100%);
    --lg-dot: rgba(255, 255, 255, .09);
    --lg-glow-a: rgba(233, 165, 73, .16);
    --lg-glow-b: rgba(95, 179, 126, .18);
    --lg-card-bg: rgba(36, 32, 25, .72);
    --lg-card-bg-solid: #242019;
    --lg-card-border: rgba(255, 255, 255, .12);
    --lg-card-highlight: rgba(255, 255, 255, .16);
    --lg-text: #f2ece2;
    --lg-muted: #a39a8c;
    --lg-label: #d5cdc0;
    --lg-foot: #8d8477;
    --lg-input-bg: rgba(255, 255, 255, .05);
    --lg-input-bg-focus: rgba(255, 255, 255, .08);
    --lg-input-bg-solid: #2d2721;
    --lg-input-border: rgba(255, 255, 255, .12);
    --lg-input-border-hover: rgba(255, 255, 255, .24);
    --lg-placeholder: #7d7467;
    --lg-amber: #5fb37e;
    --lg-ring: rgba(95, 179, 126, .32);
    --lg-focus-outline: #9ad5b0;
    --lg-error: #f6b0a8;
    --lg-error-bg: rgba(240, 138, 127, .12);
    --lg-error-border: rgba(240, 138, 127, .3);
    --lg-toggle-bg: rgba(255, 255, 255, .08);
    --lg-toggle-bg-hover: rgba(255, 255, 255, .14);
    --lg-toggle-border: rgba(255, 255, 255, .16);
}
html:not([data-theme="dark"]) body[data-skin="warm"] #crm-login {
    --lg-bg-base: #faf7f2;
    --lg-bg: linear-gradient(#faf7f2, #f4efe6);
    --lg-dot: rgba(29, 26, 22, .09);
    --lg-glow-a: rgba(217, 140, 31, .18);
    --lg-glow-b: rgba(31, 95, 58, .14);
    --lg-card-bg: rgba(255, 255, 255, .78);
    --lg-card-bg-solid: #ffffff;
    --lg-card-border: rgba(29, 26, 22, .08);
    --lg-card-highlight: rgba(255, 255, 255, .95);
    --lg-card-shadow: 0 30px 70px -30px rgba(60, 45, 20, .3), 0 12px 30px -18px rgba(60, 45, 20, .18);
    --lg-text: #1d1a16;
    --lg-muted: #7b7366;
    --lg-label: #4b453c;
    --lg-foot: #7b7366;
    --lg-input-bg: #f4efe6;
    --lg-input-bg-focus: #ffffff;
    --lg-input-bg-solid: #ffffff;
    --lg-input-border: rgba(29, 26, 22, .12);
    --lg-input-border-hover: rgba(29, 26, 22, .24);
    --lg-placeholder: #a79d8e;
    --lg-amber: #1f5f3a;
    --lg-ring: rgba(31, 95, 58, .24);
    --lg-focus-outline: #17492c;
    --lg-error: #b3261e;
    --lg-error-bg: rgba(179, 38, 30, .07);
    --lg-error-border: rgba(179, 38, 30, .22);
    --lg-toggle-bg: rgba(255, 255, 255, .8);
    --lg-toggle-bg-hover: #ffffff;
    --lg-toggle-border: rgba(29, 26, 22, .10);
    --lg-toggle-text: #1d1a16;
}
html body.crm-login-body[data-skin="warm"], html[data-theme="dark"] body.crm-login-body[data-skin="warm"] { background: #1b1815; }
html:not([data-theme="dark"]) body.crm-login-body[data-skin="warm"] { background: #faf7f2; }
body[data-skin="warm"] #crm-login .lg-mark {
    position: relative;
    background: linear-gradient(150deg, #2a7a4b 0%, #1f5f3a 55%, #17492c 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px -10px rgba(31, 95, 58, .75), inset 0 1px 0 rgba(255, 255, 255, .28);
}
body[data-skin="warm"] #crm-login .lg-mark::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d98c1f;
    border: 2px solid var(--lg-card-bg-solid);
}
body[data-skin="warm"] #crm-login .lg-btn {
    background: linear-gradient(180deg, #2a7a4b 0%, #1f5f3a 60%, #17492c 100%);
    color: #ffffff;
    box-shadow: 0 12px 26px -12px rgba(31, 95, 58, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
}
body[data-skin="warm"] #crm-login .lg-btn:hover { box-shadow: 0 16px 30px -12px rgba(31, 95, 58, .8), inset 0 1px 0 rgba(255, 255, 255, .22); }
html:not([data-theme="dark"]) body[data-skin="warm"] #crm-login .lg-btn { color: #ffffff; }

/* =============================================================================
   "Ledger" UI theme — login identity. SCOPED: every rule below needs
   body[data-skin="ledger"], which index.php sets on the login <body> only while
   the saved UI theme (shell.php crm_ui_theme()) is "ledger"; the classic login
   keeps the rules above untouched. Dark stays the default on this screen (the
   bootstrap at index.php is unchanged); the light branch is
   html:not([data-theme="dark"]), exactly like the warm block. Graphite dark /
   ivory light, indigo accent, no glow, no blur, 8–12px radii.
   ============================================================================= */
body[data-skin="ledger"] #crm-login {
    --lg-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-bg-base: #141416;
    --lg-bg: linear-gradient(#141416, #141416);
    --lg-dot: rgba(255, 255, 255, .05);
    --lg-glow-a: rgba(139, 140, 248, .18);
    --lg-glow-b: rgba(139, 140, 248, .10);
    --lg-card-bg: #1b1b1e;
    --lg-card-bg-solid: #1b1b1e;
    --lg-card-border: #2c2c31;
    --lg-card-highlight: transparent;
    --lg-card-shadow: 0 12px 36px -12px rgba(0, 0, 0, .7);
    --lg-text: #ececee;
    --lg-muted: #8e8e96;
    --lg-label: #c6c6cb;
    --lg-foot: #8e8e96;
    --lg-input-bg: #141416;
    --lg-input-bg-focus: #141416;
    --lg-input-bg-solid: #141416;
    --lg-input-border: #3b3b41;
    --lg-input-border-hover: #8e8e96;
    --lg-placeholder: #71717a;
    --lg-amber: #8b8cf8;
    --lg-ring: rgba(139, 140, 248, .28);
    --lg-focus-outline: #8b8cf8;
    --lg-error: #f87171;
    --lg-error-bg: rgba(248, 113, 113, .12);
    --lg-error-border: rgba(248, 113, 113, .3);
    --lg-toggle-bg: #1b1b1e;
    --lg-toggle-bg-hover: #27272b;
    --lg-toggle-border: #3b3b41;
    --lg-toggle-text: #ececee;
    --lg-toggle-shadow: none;
}
html:not([data-theme="dark"]) body[data-skin="ledger"] #crm-login {
    --lg-bg-base: #f6f6f3;
    --lg-bg: linear-gradient(#f6f6f3, #f6f6f3);
    --lg-dot: rgba(17, 17, 19, .06);
    --lg-glow-a: rgba(55, 48, 163, .10);
    --lg-glow-b: rgba(55, 48, 163, .05);
    --lg-card-bg: #ffffff;
    --lg-card-bg-solid: #ffffff;
    --lg-card-border: #e6e6e2;
    --lg-card-highlight: transparent;
    --lg-card-shadow: 0 8px 28px -12px rgba(17, 17, 19, .18);
    --lg-text: #111113;
    --lg-muted: #71717a;
    --lg-label: #3f3f46;
    --lg-foot: #71717a;
    --lg-input-bg: #ffffff;
    --lg-input-bg-focus: #ffffff;
    --lg-input-bg-solid: #ffffff;
    --lg-input-border: #d2d2cd;
    --lg-input-border-hover: #71717a;
    --lg-placeholder: #a1a1aa;
    --lg-amber: #3730a3;
    --lg-ring: rgba(55, 48, 163, .18);
    --lg-focus-outline: #3730a3;
    --lg-error: #b42318;
    --lg-error-bg: #fdf0ee;
    --lg-error-border: rgba(180, 35, 24, .25);
    --lg-toggle-bg: #ffffff;
    --lg-toggle-bg-hover: #f2f2ef;
    --lg-toggle-border: #d2d2cd;
    --lg-toggle-text: #111113;
    --lg-toggle-shadow: none;
}
html body.crm-login-body[data-skin="ledger"], html[data-theme="dark"] body.crm-login-body[data-skin="ledger"] { background: #141416; }
html:not([data-theme="dark"]) body.crm-login-body[data-skin="ledger"] { background: #f6f6f3; }
body[data-skin="ledger"] #crm-login .lg-mark { background: #3730a3; color: #fff; border-radius: 8px; box-shadow: none; }
html[data-theme="dark"] body[data-skin="ledger"] #crm-login .lg-mark { background: #8b8cf8; color: #141416; }
body[data-skin="ledger"] #crm-login .lg-mark::after { display: none; content: none; }
body[data-skin="ledger"] #crm-login .lg-btn { background: #3730a3; color: #fff; border-radius: 8px; box-shadow: none; }
body[data-skin="ledger"] #crm-login .lg-btn:hover { background: #2f2a8f; box-shadow: none; transform: none; }
html[data-theme="dark"] body[data-skin="ledger"] #crm-login .lg-btn { background: #8b8cf8; color: #141416; }
html[data-theme="dark"] body[data-skin="ledger"] #crm-login .lg-btn:hover { background: #a2a3fb; }
body[data-skin="ledger"] #crm-login .lg-card, body[data-skin="ledger"] #crm-login .login-card { border-radius: 12px; -webkit-backdrop-filter: none; backdrop-filter: none; }
body[data-skin="ledger"] #crm-login .lg-input { border-radius: 8px; }
body[data-skin="ledger"] #crm-login .lg-title { letter-spacing: -.02em; font-weight: 600; }
body[data-skin="ledger"] #crm-login .theme-toggle--login { background: var(--lg-toggle-bg); color: var(--lg-toggle-text); border-color: var(--lg-toggle-border); box-shadow: none; }

/* =============================================================================
   "Night Ops" UI theme — login identity. SCOPED under body[data-skin="nightops"]
   (set by index.php crmLoginSkinAttr() only while the saved theme is "nightops");
   the classic login keeps the rules above untouched. Ported from concept-b's
   section 5 with its tokens resolved to literals (the skin sheet never loads on
   the login document). Dark stays the default; light branch =
   html:not([data-theme="dark"]). Deep navy canvas, cyan accent.
   ============================================================================= */
body[data-skin="nightops"] #crm-login {
    --lg-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --lg-bg-base: #0b0f16;
    --lg-bg: linear-gradient(#0b0f16, #0b0f16);
    --lg-dot: rgba(255, 255, 255, .07);
    --lg-glow-a: rgba(34, 211, 238, .18);
    --lg-glow-b: rgba(34, 211, 238, .08);
    --lg-card-bg: rgba(20, 26, 36, .72);
    --lg-card-bg-solid: #141a24;
    --lg-card-border: rgba(255, 255, 255, .10);
    --lg-card-highlight: rgba(255, 255, 255, .08);
    --lg-card-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(34, 211, 238, .08);
    --lg-text: #e8edf3;
    --lg-muted: #7f8a99;
    --lg-label: #c0c8d3;
    --lg-foot: #7f8a99;
    --lg-input-bg: rgba(11, 15, 22, .8);
    --lg-input-bg-focus: #0b0f16;
    --lg-input-bg-solid: #0b0f16;
    --lg-input-border: rgba(255, 255, 255, .12);
    --lg-input-border-hover: rgba(255, 255, 255, .22);
    --lg-placeholder: #6b7684;
    --lg-amber: #22d3ee;
    --lg-ring: rgba(34, 211, 238, .32);
    --lg-focus-outline: #67e8f9;
    --lg-error: #fca5a5;
    --lg-error-bg: rgba(248, 113, 113, .12);
    --lg-error-border: rgba(248, 113, 113, .3);
    --lg-toggle-bg: rgba(255, 255, 255, .06);
    --lg-toggle-bg-hover: rgba(255, 255, 255, .12);
    --lg-toggle-border: rgba(255, 255, 255, .12);
    --lg-toggle-text: #e8edf3;
    --lg-toggle-shadow: none;
}
html:not([data-theme="dark"]) body[data-skin="nightops"] #crm-login {
    --lg-bg-base: #eceff3;
    --lg-bg: linear-gradient(#eceff3, #eceff3);
    --lg-dot: rgba(15, 23, 42, .07);
    --lg-glow-a: rgba(6, 182, 212, .16);
    --lg-glow-b: rgba(6, 182, 212, .06);
    --lg-card-bg: rgba(255, 255, 255, .82);
    --lg-card-bg-solid: #ffffff;
    --lg-card-border: rgba(15, 23, 42, .08);
    --lg-card-highlight: #ffffff;
    --lg-card-shadow: 0 30px 70px -30px rgba(15, 23, 42, .25);
    --lg-text: #0f1623;
    --lg-muted: #65717f;
    --lg-label: #3a4452;
    --lg-foot: #65717f;
    --lg-input-bg: #ffffff;
    --lg-input-bg-focus: #ffffff;
    --lg-input-bg-solid: #ffffff;
    --lg-input-border: rgba(15, 23, 42, .15);
    --lg-input-border-hover: rgba(15, 23, 42, .3);
    --lg-placeholder: #94a3b8;
    --lg-amber: #06b6d4;
    --lg-ring: rgba(6, 182, 212, .3);
    --lg-focus-outline: #0891b2;
    --lg-error: #b42318;
    --lg-error-bg: rgba(180, 35, 24, .07);
    --lg-error-border: rgba(180, 35, 24, .22);
    --lg-toggle-bg: #ffffff;
    --lg-toggle-bg-hover: #f1f3f6;
    --lg-toggle-border: rgba(15, 23, 42, .15);
    --lg-toggle-text: #0f1623;
    --lg-toggle-shadow: none;
}
html body.crm-login-body[data-skin="nightops"], html[data-theme="dark"] body.crm-login-body[data-skin="nightops"] { background: #0b0f16; }
html:not([data-theme="dark"]) body.crm-login-body[data-skin="nightops"] { background: #eceff3; }
body[data-skin="nightops"] #crm-login .lg-mark { background: #22d3ee; color: #06202a; font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border-radius: 9px; box-shadow: 0 0 24px -4px rgba(34, 211, 238, .38); }
html:not([data-theme="dark"]) body[data-skin="nightops"] #crm-login .lg-mark { background: #06b6d4; color: #04202a; box-shadow: 0 0 24px -4px rgba(6, 182, 212, .32); }
body[data-skin="nightops"] #crm-login .lg-mark::after { display: none; content: none; }
body[data-skin="nightops"] #crm-login .lg-brand-sub { color: #22d3ee; letter-spacing: .14em; text-transform: uppercase; font-size: 9.5px; font-weight: 650; }
html:not([data-theme="dark"]) body[data-skin="nightops"] #crm-login .lg-brand-sub { color: #0891b2; }
body[data-skin="nightops"] #crm-login .lg-title { letter-spacing: -.02em; font-weight: 650; }
body[data-skin="nightops"] #crm-login .lg-btn { background: #22d3ee; color: #06202a; border-radius: 10px; font-weight: 620; box-shadow: 0 0 28px -6px rgba(34, 211, 238, .38); }
body[data-skin="nightops"] #crm-login .lg-btn:hover { background: #67e8f9; box-shadow: 0 0 32px -6px rgba(34, 211, 238, .5); }
html:not([data-theme="dark"]) body[data-skin="nightops"] #crm-login .lg-btn { background: #06b6d4; color: #04202a; box-shadow: 0 0 28px -6px rgba(6, 182, 212, .32); }
html:not([data-theme="dark"]) body[data-skin="nightops"] #crm-login .lg-btn:hover { background: #22d3ee; }
body[data-skin="nightops"] #crm-login .lg-input { border-radius: 9px; }
body[data-skin="nightops"] #crm-login .theme-toggle--login { box-shadow: none; }
