/* ============================================================
   DanceYourLife Studio — Admin Panel Styles
   ============================================================ */

/* ============================================================
   FocusOnNavigate — kill the page-title focus outline (GLOBAL, every page).
   Routes.razor renders <FocusOnNavigate Selector="h1" /> exactly once, so the
   ONLY element auto-focused after any navigation is the page <h1>. That move is
   a screen-reader nicety, but the visible side effect is the browser drawing a
   focus ring around the title on page load, making the heading look "selected".

   An <h1> is never in the natural tab order (FocusOnNavigate adds tabindex=-1
   only transiently, then removes it), so the only time an <h1> is :focus is this
   programmatic move — dropping its outline is safe and never hides a real
   keyboard focus ring. admin.css is linked in the single root App.razor <head>,
   so this covers every layout (admin, public, platform, embed). The focus move
   itself is preserved, so accessibility is unaffected.
   ============================================================ */
h1:focus { outline: none; }

/* ============================================================
   DESIGN TOKENS — the admin design-system API (7 themes: 6 light + 1 dark).
   :root holds the DEFAULT theme (Sage). The shell, the shared component
   library (.mh- / .ap- classes) and the Bootstrap reskin only ever read
   these tokens — never a raw hex — so writing a theme's token values onto
   <html> (via data-theme + data-mode) reshapes the whole admin. The
   sidebar/accent aliases at the bottom are DERIVED from the --ae-* tokens,
   so a theme only needs to set the --ae-* set (+ --accent-rgb).

   ── HOW TO ADD A THEME ──────────────────────────────────────
   Add ONE block: [data-theme="name"] { … } setting the coordinated set:
     --ae-primary, --ae-accent-ink (text ON the accent), --accent-rgb (the
     R,G,B of --ae-primary, for rgba tints), and the neutrals
     --ae-bg/-bg-soft/-surface/-hover/-text/-text-subtle/-text-muted/-soft/
     -border/-line-soft/-track/-chip. A LIGHT theme may omit any neutral
     equal to Sage's (e.g. --ae-surface stays #fff). A DARK theme also gets
     data-mode="dark" from the picker and should override --ae-shadow.
   Soft accent washes are derived at use-site with color-mix (do NOT store
   them). Status pills + the destructive red are FIXED (semantic), never
   per-theme. Register the key in _themes (AdminLayout.razor). No component
   or Bootstrap CSS edits are ever required.
   ============================================================ */
:root {
    --sidebar-width: 250px;
    --topbar-height: 56px;

    /* ===== Sage (default) — coordinated token set ===== */
    --ae-primary:     #0e9488;
    --ae-accent-ink:  #ffffff;   /* text/icons that sit ON --ae-primary */
    --accent-rgb:     14, 148, 136;  /* R,G,B of --ae-primary (rgba tints) */
    --ae-bg:          #f6f5f2;   /* app background */
    --ae-surface:     #ffffff;   /* card / sidebar / input surface (spec: panel) */
    --ae-bg-soft:     #fcfbf9;   /* raised sub-surface: table head, expanded strip (spec: surface) */
    --ae-hover:       #f4f2ee;   /* neutral hover wash */
    --ae-text:        #23211e;   /* primary text (spec: ink) */
    --ae-text-subtle: #56524c;   /* secondary text / control label (spec: ctl) */
    --ae-text-muted:  #908c85;   /* tertiary text / icon resting (spec: muted) */
    --ae-soft:        #b4afa6;   /* quaternary text / placeholders (spec: soft) */
    --ae-border:      #eceae5;   /* standard border (spec: line) */
    --ae-line-soft:   #f1efeb;   /* hairline divider */
    --ae-track:       #ebe8e2;   /* inactive track: progress bg, scrollbar thumb */
    --ae-chip:        #f1efeb;   /* neutral pill/badge bg: role tags, counts */

    /* shape / type / fixed semantics (theme-independent) */
    --ae-r: 10px;  --ae-r-card: 15px;  --ae-r-pill: 99px;
    --ae-font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ae-shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 8px 24px -12px rgba(20, 18, 14, .10);
    --ae-success: #2e7d5b;  --ae-danger: #c2543f;  --ae-warning: #9a6b00;
    --ae-accent-soft: color-mix(in srgb, var(--ae-primary) 10%, transparent);
    --ae-info: var(--ae-primary);

    /* sidebar/accent aliases — DERIVED from --ae-*, so the shell follows the theme */
    --accent:          var(--ae-primary);
    --accent-light:    var(--ae-accent-soft);
    --accent-text:     var(--ae-primary);
    --accent-shadow:   color-mix(in srgb, var(--ae-primary) 22%, transparent);
    --sidebar-bg:      var(--ae-surface);
    --sidebar-text:    var(--ae-text-subtle);
    --sidebar-active:  var(--ae-primary);
    --sidebar-hover:   color-mix(in srgb, var(--ae-primary) 9%, transparent);
    --sidebar-logo-bg: color-mix(in srgb, var(--ae-primary) 10%, transparent);
    --sidebar-logo-border: color-mix(in srgb, var(--ae-primary) 22%, transparent);
    --sidebar-logo-icon: var(--ae-primary);
    --sidebar-dropdown-bg: var(--ae-surface);

    /* status pill tones (bg / fg / dot) — FIXED across all themes (semantic) */
    --ae-pill-ok-bg: #e4f2ea;     --ae-pill-ok-fg: #2e7d5b;     --ae-pill-ok-dot: #43a06b;
    --ae-pill-warn-bg: #fbf0d9;   --ae-pill-warn-fg: #9a6b00;   --ae-pill-warn-dot: #d29a2e;
    --ae-pill-danger-bg: #fbeae7; --ae-pill-danger-fg: #c2543f; --ae-pill-danger-dot: #d17a66;
    --ae-pill-muted-bg: #efede8;  --ae-pill-muted-fg: #7a766f;  --ae-pill-muted-dot: #b4afa6;
    --ae-pill-noshow-bg: #fce9d8; --ae-pill-noshow-fg: #b5560f; --ae-pill-noshow-dot: #e07b2e;
    --ae-pill-info-bg: #e4f0ef;   --ae-pill-info-fg: #0e7a70;   --ae-pill-info-dot: #0e9488;
}

/* ===== THEMES =====================================================
   Each block sets its coordinated --ae-* token set; the sidebar/accent
   aliases + soft washes derive automatically. Sage is the :root default.
   Picker order: sage · indigo · plum · clay · rose · forest · midnight. */

/* ---- Indigo — confident blue-violet on cool blue-grey (SaaS/pro) ---- */
[data-theme="indigo"] {
    --ae-primary: #5048e5;
    --accent-rgb: 80, 72, 229;
    --ae-bg: #f4f5fb;  --ae-bg-soft: #fafbfe;  --ae-hover: #f1f2fa;
    --ae-text: #1b1d2a;  --ae-text-subtle: #4c4f63;  --ae-text-muted: #797d93;  --ae-soft: #a6aabd;
    --ae-border: #e5e6f0;  --ae-line-soft: #eff0f7;  --ae-track: #e7e8f3;  --ae-chip: #ecedf7;
}

/* ---- Plum — soft purple on lilac neutrals (creative, boutique) ---- */
[data-theme="plum"] {
    --ae-primary: #8a5cb0;
    --accent-rgb: 138, 92, 176;
    --ae-bg: #f7f4f9;  --ae-bg-soft: #fcf9fd;  --ae-hover: #f4eff6;
    --ae-text: #261e2b;  --ae-text-subtle: #564d5c;  --ae-text-muted: #897e90;  --ae-soft: #b5aabb;
    --ae-border: #ebe4ee;  --ae-line-soft: #f2ecf4;  --ae-track: #ece3ef;  --ae-chip: #f1e9f4;
}

/* ---- Clay — warm terracotta on sand (cozy, earthy studio warmth) ---- */
[data-theme="clay"] {
    --ae-primary: #be6440;
    --accent-rgb: 190, 100, 64;
    --ae-bg: #faf5f0;  --ae-bg-soft: #fdfaf5;  --ae-hover: #f6efe7;
    --ae-text: #2a211c;  --ae-text-subtle: #5c4f46;  --ae-text-muted: #998a7e;  --ae-soft: #c0b1a4;
    --ae-border: #eee3d9;  --ae-line-soft: #f4ece3;  --ae-track: #f0e6db;  --ae-chip: #f3eadf;
}

/* ---- Rose — berry pink on blush (energetic, expressive) ---- */
[data-theme="rose"] {
    --ae-primary: #c04e7c;
    --accent-rgb: 192, 78, 124;
    --ae-bg: #faf4f6;  --ae-bg-soft: #fdf9fb;  --ae-hover: #f6eef1;
    --ae-text: #2a1f24;  --ae-text-subtle: #5c4a52;  --ae-text-muted: #978088;  --ae-soft: #c0a8b1;
    --ae-border: #efe2e7;  --ae-line-soft: #f5ecf0;  --ae-track: #f1e3e9;  --ae-chip: #f4e9ee;
}

/* ---- Forest — deep green on pale sage-grey (grounded, natural) ---- */
[data-theme="forest"] {
    --ae-primary: #2f8056;
    --accent-rgb: 47, 128, 86;
    --ae-bg: #f4f7f4;  --ae-bg-soft: #fafcf9;  --ae-hover: #eff4ed;
    --ae-text: #1e261f;  --ae-text-subtle: #4d5a4f;  --ae-text-muted: #828a80;  --ae-soft: #abb4a8;
    --ae-border: #e5ebe3;  --ae-line-soft: #eef3ec;  --ae-track: #e6ece3;  --ae-chip: #ecf1ea;
}

/* ---- Midnight (dark) — mint accent on cool charcoal. Panel lifts above
   bg; borders are LIGHTER than panels (inverse of light mode). ---- */
[data-theme="midnight"] {
    --ae-primary: #3ac9b0;
    --ae-accent-ink: #06231e;   /* near-black green — sits ON the mint accent */
    --accent-rgb: 58, 201, 176;
    --ae-bg: #15171c;  --ae-surface: #1e2128;  --ae-bg-soft: #232730;  --ae-hover: #262b34;
    --ae-text: #eceef2;  --ae-text-subtle: #c3c8d1;  --ae-text-muted: #969ba6;  --ae-soft: #6b7079;
    --ae-border: #2b2f38;  --ae-line-soft: #242831;  --ae-track: #313640;  --ae-chip: #2a2f39;
    --ae-shadow: none;
}

/* Light themes — sidebar chrome on the white panel. Gated to non-dark mode;
   dark mode (Midnight) uses the base shell rules + --sidebar-* tokens. */
html:not([data-mode="dark"]) .admin-sidebar {
    border-right: 1px solid var(--ae-border);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

html:not([data-mode="dark"]) .sidebar-header {
    border-bottom-color: var(--ae-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent);
}

html:not([data-mode="dark"]) .sidebar-brand { color: var(--ae-text); }

html:not([data-mode="dark"]) .sidebar-subbrand { color: var(--ae-text-muted); }

html:not([data-mode="dark"]) .nav-section { color: var(--ae-soft); }

html:not([data-mode="dark"]) .nav-toolbar-btn { color: var(--ae-soft); }
html:not([data-mode="dark"]) .nav-toolbar-btn:hover { color: var(--ae-text-subtle); background: var(--ae-hover); }

html:not([data-mode="dark"]) .nav-item { color: var(--ae-text-subtle); }

html:not([data-mode="dark"]) .nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--accent);
}

html:not([data-mode="dark"]) .nav-item.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-weight: 600;
}

html:not([data-mode="dark"]) .sidebar-footer { border-top-color: var(--ae-border); }

html:not([data-mode="dark"]) .profile-trigger {
    background: var(--ae-hover);
    color: var(--ae-text-subtle);
}

html:not([data-mode="dark"]) .profile-trigger:hover { background: var(--ae-chip); }

html:not([data-mode="dark"]) .profile-trigger-name { color: var(--ae-text); }

html:not([data-mode="dark"]) .profile-trigger-role {
    background: var(--ae-chip);
    color: var(--ae-text-muted);
}

html:not([data-mode="dark"]) .profile-dropdown {
    background: var(--ae-surface);
    border-color: var(--ae-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

html:not([data-mode="dark"]) .profile-dropdown-item { color: var(--ae-text-subtle); }

html:not([data-mode="dark"]) .profile-dropdown-item:hover {
    background: var(--ae-hover);
    color: var(--ae-text);
}

html:not([data-mode="dark"]) .profile-dropdown-item.active {
    background: var(--ae-accent-soft);
    color: var(--accent-text);
}

html:not([data-mode="dark"]) .profile-dropdown-divider { background: var(--ae-border); }

html:not([data-mode="dark"]) .profile-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

/* ---- Studio admin login (/auth/studio) — full viewport, no white gap ---- */
.login-page {
    --login-accent: #38bdf8;
    --login-accent-deep: #0ea5e9;
    --login-ink: #0b1220;

    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(165deg, #070b14 0%, #0f172a 42%, #152238 78%, #162544 100%);
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 55% at 15% -5%, rgba(56, 189, 248, 0.28), transparent 52%),
        radial-gradient(ellipse 70% 45% at 100% 15%, rgba(99, 102, 241, 0.22), transparent 48%),
        radial-gradient(ellipse 55% 40% at 85% 100%, rgba(20, 184, 166, 0.12), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23ffffff' fill-opacity='0.03' d='M32 0h32v32H32V0zm0 32h32v32H32V32zM0 32h32v32H0V32zm0-32h32v32H0V0z'/%3E%3C/svg%3E");
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.login-page > * {
    position: relative;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.06),
        0 28px 64px -12px rgba(0, 0, 0, 0.45),
        0 12px 24px -8px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.login-brand-mark {
    display: inline-block;
    margin: 0 auto 14px;
    text-decoration: none;
    line-height: 0;
}

.login-brand-mark .login-brand-img {
    height: 56px;
    width: auto;
    max-width: none;
    display: block;
}

.login-title {
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--login-ink) !important;
}

.login-sub {
    color: #64748b !important;
}

.login-page .btn-primary {
    background: linear-gradient(135deg, var(--login-accent-deep) 0%, #0284c7 100%);
    border: none;
    font-weight: 700;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.35);
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.login-page .btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(14, 165, 233, 0.42);
}

.login-page .form-control:focus {
    border-color: rgba(14, 165, 233, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.18);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

/* ---- Admin Layout ---- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    font-family: var(--ae-font);
    color: var(--ae-text);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.2s ease;
    overflow: hidden;
}

.admin-sidebar.collapsed {
    width: 64px;
}

.admin-sidebar.collapsed .sidebar-brand,
.admin-sidebar.collapsed .nav-item span,
.admin-sidebar.collapsed .nav-section,
.admin-sidebar.collapsed .user-info span {
    display: none;
}

.admin-sidebar.collapsed .sidebar-brand-wrap {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    color: var(--sidebar-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.sidebar-logo-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--sidebar-logo-bg);
    border: 1px solid var(--sidebar-logo-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sidebar-logo-mark i {
    font-size: 1.25rem;
    color: var(--sidebar-logo-icon);
}

.sidebar-brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    line-height: 1.1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-logo {
    height: 36px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.sidebar-brand {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #ffffff;
    white-space: nowrap;
}

.sidebar-subbrand {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(199, 210, 254, 0.75);
    margin-top: 0.15rem;
}

.admin-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0.9rem 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 210, 254, 0.25) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(199, 210, 254, 0.22);
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background-color: rgba(199, 210, 254, 0.4);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(199, 210, 254, 0.6);
}

/* Sidebar menu search — filters nav items live (see AdminLayout.BuildVisibleSections).
   Uses --ae-* tokens so it follows the active theme (incl. midnight/dark). */
.nav-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0.75rem 0.25rem;
    padding: 0.4rem 0.6rem;
    background: var(--ae-bg-soft);
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-search:focus-within {
    border-color: var(--ae-primary);
    box-shadow: 0 0 0 3px var(--ae-accent-soft);
}

.nav-search-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--ae-soft);
}

.nav-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ae-text);
    font-size: 0.85rem;
}

.nav-search-input::placeholder { color: var(--ae-soft); }

.nav-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ae-soft);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s;
}

.nav-search-clear:hover { color: var(--ae-text); }

/* Icon-rail mode has no room for a text field — hide it like the toolbar. */
.admin-sidebar.collapsed .nav-search { display: none; }

.nav-search-empty {
    padding: 1rem;
    margin: 0 0.5rem;
    font-size: 0.82rem;
    color: var(--ae-text-muted);
    text-align: center;
}

.nav-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.125rem;
    padding: 0.5rem 0.75rem 0;
}

.nav-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: 0;
    border-radius: 4px;
    color: rgba(199, 210, 254, 0.5);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.nav-toolbar-btn:hover {
    color: rgba(199, 210, 254, 0.95);
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar.collapsed .nav-toolbar { display: none; }

.nav-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1rem 0.375rem;
    background: none;
    border: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(199, 210, 254, 0.5);
    text-align: left;
    cursor: pointer;
    transition: color 0.15s;
}

.nav-section:hover { color: rgba(199, 210, 254, 0.85); }

.nav-section-chevron {
    font-size: 0.75rem;
    transition: transform 0.18s ease;
}

.nav-section.is-collapsed .nav-section-chevron {
    transform: rotate(-90deg);
}

.nav-section-items.is-collapsed { display: none; }

/* When the whole sidebar is reduced to icons, ignore per-section collapse
   so users can still reach every nav item from the icon rail. */
.admin-sidebar.collapsed .nav-section-items.is-collapsed { display: block; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    margin: 1px 0.5rem;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

/* ── Shared modal form helpers ──
   Used by the Assign Package, Issue Gift Card and Add Attendee modals to give
   each section a small-caps header and to render the issuance-type / payment-method
   radios as a full-width segmented control. */
.form-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-top: 8px;
    margin-bottom: 10px;
}
.form-section-label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
}
.mode-toggle .btn {
    border-radius: 8px !important;
}
.mode-toggle .btn-check + .btn {
    white-space: normal;
    line-height: 1.3;
}
.mode-toggle .btn-check:disabled + .btn {
    opacity: 0.5;
    cursor: not-allowed;
}
.mode-toggle .btn-check + .btn:not(:first-of-type) {
    margin-left: 8px;
}

.nav-item i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-menu-wrapper { position: relative; }

.profile-trigger {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.5rem 0.6rem; border: none; border-radius: 8px;
    background: rgba(255,255,255,0.06); color: rgba(199,210,254,0.85);
    font-size: 0.8rem; cursor: pointer; transition: background 0.15s;
    text-align: left;
}
.profile-trigger:hover { background: rgba(255,255,255,0.1); }
.profile-trigger .bi-person-circle { font-size: 1.3rem; flex-shrink: 0; }
.profile-trigger-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.profile-trigger-role { font-size: 0.68rem; background: rgba(255,255,255,0.12); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.profile-trigger-arrow { font-size: 0.6rem; transition: transform 0.2s; opacity: 0.6; }
.profile-trigger-arrow.open { transform: rotate(180deg); }

.profile-dropdown {
    position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
    background: var(--sidebar-dropdown-bg); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35); padding: 4px; z-index: 100;
    animation: profileSlideUp 0.15s ease;
}
@keyframes profileSlideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.profile-dropdown-item {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.45rem 0.65rem; border: none; border-radius: 6px;
    background: none; color: rgba(199,210,254,0.8); font-size: 0.8rem;
    cursor: pointer; text-decoration: none; transition: background 0.12s;
}
.profile-dropdown-item:hover { background: rgba(255,255,255,0.08); color: var(--accent-text); }
.profile-dropdown-item.active { background: rgba(99,102,241,0.2); color: #c7d2fe; }
.profile-dropdown-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
.profile-dropdown-logout:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

.profile-dropdown-langform { padding: 6px 8px 4px; }
.profile-dropdown-langlabel {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: rgba(199,210,254,0.6); margin-bottom: 6px;
}
.profile-dropdown-langflags { display: flex; gap: 6px; }
.profile-dropdown-langflag {
    appearance: none; background: transparent; border: 1px solid transparent;
    border-radius: 999px; cursor: pointer; padding: 3px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
    opacity: 0.55;
}
.profile-dropdown-langflag:hover { opacity: 1; transform: scale(1.06); background: rgba(255,255,255,0.06); }
.profile-dropdown-langflag.is-active {
    opacity: 1;
    border-color: rgba(165,180,252,0.7);
    background: rgba(99,102,241,0.18);
}
.profile-dropdown-langflag-img {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

html:not([data-mode="dark"]) .profile-dropdown-langlabel { color: var(--ae-text-muted); }
html:not([data-mode="dark"]) .profile-dropdown-langflag:hover { background: var(--ae-hover); }
html:not([data-mode="dark"]) .profile-dropdown-langflag.is-active {
    border-color: var(--accent); background: rgba(var(--accent-rgb),0.1);
}

.admin-sidebar.collapsed .profile-trigger-name,
.admin-sidebar.collapsed .profile-trigger-role,
.admin-sidebar.collapsed .profile-trigger-arrow { display: none; }
.admin-sidebar.collapsed .profile-dropdown { left: 100%; bottom: 0; width: 200px; margin-left: 6px; }

/* ---- Main Content ---- */
.admin-main {
    flex: 1;
    min-width: 0; /* allow flex child to shrink so inner grids measure real content width */
    margin-left: var(--sidebar-width);
    transition: margin-left 0.2s ease;
    background: var(--ae-bg);
    min-height: 100vh;
}

.admin-sidebar.collapsed ~ .admin-main {
    margin-left: 64px;
}

.admin-topbar {
    height: var(--topbar-height);
    background: color-mix(in srgb, var(--ae-surface) 85%, transparent);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--ae-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.admin-content {
    padding: 1.5rem;
    min-width: 0;
}

/* ---- Dashboard Cards ---- */
.dashboard-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.dashboard-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ---- Tables ---- */
.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* ---- Status Badges (theme-driven via --ae-pill-* tokens) ---- */
.badge-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--ae-r-pill);
    font-weight: 600;
}

.badge-visible  { background: var(--ae-pill-ok-bg);     color: var(--ae-pill-ok-fg); }
.badge-hidden   { background: var(--ae-pill-warn-bg);   color: var(--ae-pill-warn-fg); }
.badge-disabled { background: var(--ae-pill-danger-bg); color: var(--ae-pill-danger-fg); }

.badge-active                { background: var(--ae-pill-ok-bg);     color: var(--ae-pill-ok-fg); }
.badge-pending_first_payment { background: var(--ae-pill-info-bg);   color: var(--ae-pill-info-fg); }
.badge-past_due              { background: var(--ae-pill-danger-bg); color: var(--ae-pill-danger-fg); }
.badge-canceled              { background: var(--ae-pill-muted-bg);  color: var(--ae-pill-muted-fg); }
.badge-expired               { background: var(--ae-pill-warn-bg);   color: var(--ae-pill-warn-fg); }

.badge-paid     { background: var(--ae-pill-ok-bg);     color: var(--ae-pill-ok-fg); }
.badge-pending  { background: var(--ae-pill-info-bg);   color: var(--ae-pill-info-fg); }
.badge-failed   { background: var(--ae-pill-danger-bg); color: var(--ae-pill-danger-fg); }
.badge-refunded { background: var(--ae-pill-muted-bg);  color: var(--ae-pill-muted-fg); }

/* Enrollment programs (draft → publish lifecycle) + roster registration states */
.badge-draft      { background: var(--ae-pill-warn-bg);  color: var(--ae-pill-warn-fg); }
.badge-open       { background: var(--ae-pill-ok-bg);    color: var(--ae-pill-ok-fg); }
.badge-closed     { background: var(--ae-pill-info-bg);  color: var(--ae-pill-info-fg); }
.badge-waitlisted { background: var(--ae-pill-warn-bg);  color: var(--ae-pill-warn-fg); }
.badge-dropped    { background: var(--ae-pill-muted-bg); color: var(--ae-pill-muted-fg); }

/* ---- Deleted rows ---- */
tr.ae-row-deleted td {
    opacity: 0.5;
}
tr.ae-row-deleted {
    background-color: #fffbeb !important;
}

/* ---- Show-deleted toggle ---- */
.show-deleted-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}
.show-deleted-toggle input[type="checkbox"] {
    width: 2rem;
    height: 1.1rem;
    cursor: pointer;
}

/* ---- Studio Selector (topbar) ---- */
.studio-selector {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Studio picker (custom dropdown replacing the native <select>) ────────── */
.studio-picker { position: relative; }

.studio-picker-trigger {
    display: inline-flex; align-items: center; gap: 10px;
    min-width: 220px; max-width: 320px;
    padding: 6px 10px 6px 6px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 0.88rem; font-weight: 500; color: #1e293b;
    cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.studio-picker-trigger:hover { border-color: #cbd5e1; background: #fff; }
.studio-picker-trigger.open {
    border-color: var(--accent, var(--accent));
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-shadow, rgba(99,102,241,0.15));
}
.studio-picker-avatar {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.95rem; flex-shrink: 0;
}
.studio-picker-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: left;
}
.studio-picker-caret {
    font-size: 0.7rem; color: #94a3b8;
    transition: transform 0.18s ease;
}
.studio-picker-trigger.open .studio-picker-caret { transform: rotate(180deg); }

.studio-picker-menu {
    position: absolute; top: calc(100% + 6px); left: 0;
    min-width: 260px; max-width: 360px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 12px 28px -8px rgba(15,23,42,0.18), 0 2px 6px rgba(15,23,42,0.06);
    padding: 6px; z-index: 200;
    animation: studioPickerIn 0.14s ease;
}
@keyframes studioPickerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.studio-picker-search {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; margin-bottom: 4px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    color: #94a3b8;
}
.studio-picker-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 0.85rem; color: #1e293b;
}

.studio-picker-list { max-height: 320px; overflow-y: auto; }
.studio-picker-item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 10px; border: none; border-radius: 8px;
    background: none; color: #334155; font-size: 0.87rem; font-weight: 500;
    text-align: left; cursor: pointer; transition: background 0.12s;
}
.studio-picker-item:hover { background: #f1f5f9; color: #0f172a; }
.studio-picker-item.active { background: var(--accent-light); color: var(--accent-text); }
.studio-picker-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-picker-item-check { font-size: 1rem; color: var(--accent-text); }
.studio-picker-empty { padding: 12px 10px; font-size: 0.82rem; color: #94a3b8; text-align: center; }

/* Dark theme tweaks */
[data-theme="dark"] .studio-picker-trigger { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color: #e2e8f0; }
[data-theme="dark"] .studio-picker-trigger:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }
[data-theme="dark"] .studio-picker-menu { background: #1e1e2e; border-color: rgba(255,255,255,0.1); box-shadow: 0 12px 28px rgba(0,0,0,0.5); }
[data-theme="dark"] .studio-picker-search { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .studio-picker-search input { color: #e2e8f0; }
[data-theme="dark"] .studio-picker-item { color: rgba(226,232,240,0.85); }
[data-theme="dark"] .studio-picker-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
[data-theme="dark"] .studio-picker-item.active { background: rgba(99,102,241,0.2); color: #c7d2fe; }

/* ────────────────────────────────────────────────────────────────────────
   Onboarding Tasks Badge (topbar widget) — surfaces pending setup steps.
   ──────────────────────────────────────────────────────────────────────── */
.onboarding-tasks { position: relative; }

.onboarding-tasks-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--accent-light) 0%, #f5f3ff 100%);
    border: 1px solid #c7d2fe; border-radius: 10px;
    color: var(--accent-text); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.onboarding-tasks-trigger:hover {
    border-color: var(--accent); background: var(--accent-light);
    box-shadow: 0 1px 4px rgba(var(--accent-rgb),0.18);
}
.onboarding-tasks-trigger.open {
    background: var(--accent); border-color: var(--accent-text); color: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.onboarding-tasks-trigger i { font-size: 0.95rem; }
.onboarding-tasks-label { line-height: 1; }
.onboarding-tasks-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--accent); color: #fff; border-radius: 10px;
    font-size: 0.72rem; font-weight: 700;
}
.onboarding-tasks-trigger.open .onboarding-tasks-count { background: #fff; color: var(--accent-text); }

.onboarding-tasks-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 400px; max-width: 90vw;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    box-shadow: 0 16px 36px -10px rgba(15,23,42,0.24), 0 2px 8px rgba(15,23,42,0.06);
    z-index: 240;
    animation: studioPickerIn 0.14s ease;
    overflow: hidden;
}

.onboarding-tasks-header {
    padding: 14px 16px 12px;
    background: linear-gradient(135deg, var(--accent-light) 0%, #fef3f2 100%);
    border-bottom: 1px solid var(--accent-light);
}
.onboarding-tasks-title { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.onboarding-tasks-subtitle { font-size: 0.78rem; color: #64748b; margin-top: 2px; }
.onboarding-tasks-progress {
    height: 6px; background: rgba(255,255,255,0.7); border-radius: 999px;
    margin-top: 10px; overflow: hidden;
}
.onboarding-tasks-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 100%);
    border-radius: 999px; transition: width 0.3s;
}

.onboarding-tasks-list { padding: 6px; max-height: 320px; overflow-y: auto; }
.onboarding-tasks-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px; border-radius: 10px;
    min-height: 62px;
    box-sizing: border-box;
    color: #1e293b; text-decoration: none; text-align: left;
    background: transparent; border: 0; cursor: pointer;
    transition: background 0.12s, transform 0.1s;
}
.onboarding-tasks-item:hover { background: #f1f5f9; color: #0f172a; transform: translateX(2px); }
.onboarding-tasks-item-icon {
    flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--accent-light); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.onboarding-tasks-item-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.onboarding-tasks-item-title { font-size: 0.87rem; font-weight: 600; line-height: 1.2; }
.onboarding-tasks-item-desc { font-size: 0.75rem; color: #64748b; line-height: 1.3; }
.onboarding-tasks-item-arrow { color: #94a3b8; font-size: 0.85rem; flex-shrink: 0; }

.onboarding-tasks-done {
    padding: 8px 6px 10px; border-top: 1px solid var(--accent-light);
    background: #fafafb;
}
.onboarding-tasks-done-header {
    padding: 2px 12px 6px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    color: #94a3b8; text-transform: uppercase;
}
.onboarding-tasks-done-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px;
    font-size: 0.82rem; color: #64748b;
}
.onboarding-tasks-done-item i { color: #10b981; font-size: 0.95rem; }

/* Dark theme */
[data-theme="dark"] .onboarding-tasks-trigger { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.35); color: #c7d2fe; }
[data-theme="dark"] .onboarding-tasks-trigger:hover { background: rgba(99,102,241,0.25); border-color: rgba(99,102,241,0.55); }
[data-theme="dark"] .onboarding-tasks-trigger.open { background: var(--accent); color: #fff; }
[data-theme="dark"] .onboarding-tasks-menu { background: #1e1e2e; border-color: rgba(255,255,255,0.1); box-shadow: 0 16px 36px rgba(0,0,0,0.5); }
[data-theme="dark"] .onboarding-tasks-header { background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(139,92,246,0.15) 100%); border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .onboarding-tasks-title { color: #fff; }
[data-theme="dark"] .onboarding-tasks-subtitle { color: rgba(226,232,240,0.7); }
[data-theme="dark"] .onboarding-tasks-item { color: rgba(226,232,240,0.92); }
[data-theme="dark"] .onboarding-tasks-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
[data-theme="dark"] .onboarding-tasks-item-icon { background: rgba(99,102,241,0.18); color: #c7d2fe; }
[data-theme="dark"] .onboarding-tasks-item-desc { color: rgba(226,232,240,0.55); }
[data-theme="dark"] .onboarding-tasks-done { background: rgba(255,255,255,0.02); border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .onboarding-tasks-done-item { color: rgba(226,232,240,0.6); }

.studio-select {
    width: auto;
    min-width: 180px;
    max-width: 280px;
    font-size: 0.85rem;
    border-color: #e2e8f0;
    border-radius: 6px;
    padding: 4px 28px 4px 8px;
    background-color: #f8fafc;
    cursor: pointer;
}
.studio-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-shadow);
}
.studio-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* ---- Studio Links (topbar: website + client area) ---- */
.studio-links {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.studio-link-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
    line-height: 1.2;
    white-space: nowrap;
}
.studio-link-btn:hover,
.studio-link-btn:focus {
    background: var(--accent-light);
    border-color: #c7d2fe;
    color: var(--accent-text);
}
@media (max-width: 768px) {
    .studio-link-label { display: none; }
    .studio-link-btn { padding: 4px 8px; }
    .studio-link-btn .bi { margin-right: 0 !important; }
}

/* ---- Gallery block admin editor ---- */
.gallery-draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.gallery-draft-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.gallery-draft-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-draft-actions {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    justify-content: space-between;
    padding: 6px;
    background: linear-gradient(to top, rgba(15,23,42,0.7), transparent);
    opacity: 0;
    transition: opacity .15s ease;
}
.gallery-draft-item:hover .gallery-draft-actions {
    opacity: 1;
}
.gallery-draft-actions .btn {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.2;
}

/* ---- HTML Editor (Quill 2.x wrapper) ---- */
.html-editor-wrapper {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.html-editor-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.08);
}
/* Quill applies its own borders — remove them so our wrapper owns the rounded look. */
.html-editor-wrapper .ql-toolbar.ql-snow,
.html-editor-wrapper .ql-container.ql-snow {
    border: none;
}
.html-editor-wrapper .ql-toolbar.ql-snow {
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 6px 8px;
}
.html-editor-wrapper .ql-container.ql-snow {
    font-family: inherit;
    font-size: 14px;
}
.html-editor-wrapper .ql-editor {
    min-height: inherit;
    padding: 12px 16px;
    line-height: 1.6;
}
.html-editor-wrapper .ql-editor.ql-blank::before {
    color: #94a3b8;
    font-style: normal;
}

/* ---- Image Upload Widget ---- */
.image-upload-widget {
    display: inline-block;
}

/* ── Drop-zone (empty state) ── */
.image-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 140px;
    padding: 24px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.image-upload-dropzone:hover,
.image-upload-dropzone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(99,102,241,.08);
}
.image-upload-dropzone.is-uploading {
    pointer-events: none;
    opacity: .7;
}
.image-upload-dropzone-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.image-upload-dropzone-text {
    font-size: 13px;
    color: #475569;
}
.image-upload-dropzone-text strong {
    color: var(--accent);
}
.image-upload-dropzone-hint {
    font-size: 11px;
    color: #94a3b8;
}

/* ── Preview card (has image) ── */
.image-upload-preview {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color .2s;
}
.image-upload-preview:hover {
    border-color: #cbd5e1;
}
.image-upload-preview img {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: cover;
}
.image-upload-preview-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .2s;
}
.image-upload-preview:hover .image-upload-preview-actions {
    opacity: 1;
}
.image-upload-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(4px);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    transition: background .15s, color .15s;
}
.image-upload-action-btn:hover {
    background: #fff;
    color: #1e293b;
}
.image-upload-action-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ── ImageUpload trim/normalise editor (opt-in via <ImageUpload Editor="true" />) ── */
.imgup-editor-backdrop {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}
.imgup-editor {
    position: fixed; z-index: 10001;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(460px, calc(100vw - 32px));
    background: var(--ae-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(15,23,42,.28), 0 0 0 1px rgba(15,23,42,.06);
    display: flex; flex-direction: column; overflow: hidden;
}
.imgup-editor-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--ae-border, #f1f5f9);
}
.imgup-editor-title { font-weight: 700; font-size: 15px; color: var(--ae-text, #0f172a); }
.imgup-editor-x {
    width: 32px; height: 32px; border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--ae-text-muted, #64748b);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.imgup-editor-x:hover { background: var(--ae-border, #f1f5f9); color: var(--ae-text, #0f172a); }
.imgup-editor-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.imgup-editor-stage {
    display: flex; align-items: center; justify-content: center;
    min-height: 180px; max-height: 320px; padding: 14px; border-radius: 12px;
    border: 1px solid var(--ae-border, #e2e8f0);
    /* checkerboard so the transparent padding being trimmed is visible */
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #eef2f7 25%, transparent 25%),
        linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2f7 75%),
        linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.imgup-editor-img { max-width: 100%; max-height: 290px; object-fit: contain; display: block; }
.imgup-editor-toggle {
    display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0;
    font-size: 13px; font-weight: 600; color: var(--ae-text, #374151);
}
.imgup-editor-toggle input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ae-primary, #4f46e5); }
.imgup-editor-dims {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 12px; color: var(--ae-text-muted, #64748b);
}
.imgup-editor-arrow { opacity: .6; }
.imgup-editor-badge {
    font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    background: var(--ae-success-bg, #ecfdf5); color: var(--ae-success, #059669);
}
.imgup-editor-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--ae-border, #f1f5f9);
}

/* ── Table row thumbnail ── */
.table-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.table-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1.5px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- DataTable Grouping (drag-and-drop) ---- */

/* Drop zone — slides in when dragging, stays when grouped */
.dt-group-dropzone {
    margin-bottom: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    animation: dt-dropzone-in 0.15s ease-out;
    overflow: hidden;
}
@keyframes dt-dropzone-in {
    from { opacity: 0; max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
    to   { opacity: 1; max-height: 60px; margin-bottom: 0.5rem; }
}

/* Drag-active state (column being dragged, before hover) */
.dt-group-dropzone.is-dragging {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.03);
}
.dt-group-dropzone-inner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}
.dt-group-dropzone-inner i { font-size: 0.9rem; }
.dt-group-dropzone.is-dragging .dt-group-dropzone-inner {
    color: var(--accent);
}

/* Drag-over state (hovering on the zone) */
.dt-group-dropzone.drag-over {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.07);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}
.dt-group-dropzone.drag-over .dt-group-dropzone-inner {
    color: var(--accent-text);
    font-weight: 600;
}

/* Has active group */
.dt-group-dropzone.has-group {
    border-style: solid;
    border-color: #e2e8f0;
    background: #fff;
    padding: 0.35rem 0.65rem;
    animation: none;
}

/* Chip area */
.dt-group-chip-area {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.dt-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-light) 100%);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--accent-text);
    font-weight: 500;
    white-space: nowrap;
}
.dt-group-chip strong { font-weight: 700; }
.dt-group-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-text);
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    margin-left: 1px;
    transition: background 0.15s;
}
.dt-group-chip-remove:hover { background: rgba(var(--accent-rgb), 0.25); }

/* Expand/Collapse buttons */
.dt-group-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}
.dt-group-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}
.dt-group-btn i { font-size: 0.7rem; }

/* Draggable column headers */
th.dt-draggable-th {
    cursor: grab;
    user-select: none;
}
th.dt-draggable-th:active {
    cursor: grabbing;
    opacity: 0.5;
}
.dt-drag-hint {
    font-size: 0.65rem;
    opacity: 0.3;
    margin-left: 2px;
    vertical-align: middle;
}
th.dt-draggable-th:hover .dt-drag-hint { opacity: 0.65; }

/* Sortable column headers */
th.dt-sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease;
}
th.dt-sortable-th:hover {
    background-color: rgba(var(--accent-rgb), 0.06);
}
th.dt-sortable-th.dt-sorted {
    color: var(--accent);
}
.dt-sort-indicator {
    font-size: 0.75rem;
    margin-left: 4px;
    color: var(--accent);
    font-weight: bold;
}

/* Group header rows */
.dt-group-header-row {
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}
.dt-group-header-row:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4296 100%) !important;
}
.dt-group-header-row td {
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff !important;
    border: none !important;
}
.dt-group-toggle {
    display: inline-block;
    width: 16px;
    margin-right: 0.4rem;
    font-size: 0.65rem;
    text-align: center;
}
.dt-group-name {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dt-group-count {
    margin-left: 0.4rem;
    opacity: 0.85;
    font-weight: 400;
    font-size: 0.75rem;
}

/* ---- Instructor Payment Report ---- */
.ipr-teacher-card { overflow: hidden; }
.ipr-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}
.ipr-teacher-header:hover { background: #f1f5f9; }
.ipr-total-badge {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
}
.ipr-section-header {
    padding: 0.45rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ipr-section-header i { font-size: 0.8rem; color: var(--accent); }
.ipr-table th {
    font-size: 0.68rem !important;
    padding: 0.4rem 0.75rem !important;
}
.ipr-table td { padding: 0.45rem 0.75rem !important; font-size: 0.825rem; }
.ipr-row { transition: background 0.1s; }
.ipr-row:hover { background: #fafbff !important; }
.ipr-expand-btn {
    padding: 0; width: 22px; height: 22px;
    border-radius: 4px; font-size: 0.75rem;
    color: #64748b; border: 1px solid #e2e8f0;
    display: inline-flex; align-items: center; justify-content: center;
}
.ipr-expand-btn:hover { background: #f1f5f9; }
.ipr-bonus-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.25rem;
}
.ipr-detail-row td { padding: 0 !important; background: #f8fafc; }
.ipr-detail-list { padding: 0.4rem 0.75rem 0.4rem 2.5rem; }
.ipr-detail-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    font-size: 0.78rem;
    color: #475569;
}
.ipr-detail-item.filtered { opacity: 0.5; text-decoration: line-through; }
.ipr-detail-item i { font-size: 0.75rem; color: #94a3b8; }
.ipr-summary {
    padding: 0.6rem 1rem;
    border-top: 2px solid #e2e8f0;
    background: #fafbfc;
}
.ipr-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.82rem;
    color: #475569;
}
.ipr-summary-row.bonus { color: #059669; font-weight: 500; }
.ipr-summary-row.total {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e1b4b;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.25rem;
    padding-top: 0.4rem;
}
.ipr-print-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    border-color: #cbd5e1;
    color: #64748b;
}
.ipr-print-btn:hover { color: #1e293b; border-color: #94a3b8; }
.ipr-grand-total {
    border: 2px solid var(--accent);
    border-radius: 10px;
}

/* ---- Notification Templates Filter Panel ---- */
.notif-filter-panel {
    width: 210px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-height) + 1.5rem);
}
.notif-filter-section {
    padding: 0.35rem;
}
.notif-filter-section + .notif-filter-section {
    border-top: 1px solid #f1f5f9;
}
.notif-filter-label {
    padding: 0.5rem 0.65rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.notif-filter-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
}
.notif-filter-item:hover { background: #f1f5f9; }
.notif-filter-item.active {
    background: var(--notif-active-bg, var(--accent-light));
    color: var(--notif-active-color, var(--accent-text));
    font-weight: 600;
}
.notif-filter-item i { font-size: 0.85rem; flex-shrink: 0; width: 1rem; text-align: center; }
.notif-filter-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-filter-count {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.notif-filter-item.active .notif-filter-count {
    background: rgba(0,0,0,0.06);
    color: inherit;
}

/* Channel card headers */
.notif-channel-card { overflow: hidden; }
.notif-channel-header {
    padding: 0.55rem 1rem;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notif-channel-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.78rem;
}

/* Template rows */
.notif-template-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s;
}
.notif-template-row:hover { background: #fafbff; }
.notif-template-row:last-child { border-bottom: none; }
.notif-template-main { flex: 1; min-width: 0; }
.notif-template-key {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}
.notif-template-key code {
    font-size: 0.8rem;
    color: var(--accent-text);
    font-weight: 600;
}
.notif-entity-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.notif-entity-appointment { background: #dbeafe; color: #1e40af; }
.notif-entity-package { background: #fef3c7; color: #92400e; }
.notif-entity-customer { background: #dcfce7; color: #166534; }
.notif-template-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: #94a3b8;
    flex-wrap: wrap;
}
.notif-template-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}
.notif-template-meta i { font-size: 0.7rem; }
.notif-template-subject {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-template-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* ---- Category Side Panel ---- */
.cat-panel {
    width: 220px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-height) + 1.5rem);
}
.cat-panel-header {
    padding: 0.7rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cat-panel-header i { font-size: 0.85rem; color: var(--accent); }
.cat-panel-list {
    max-height: 520px;
    overflow-y: auto;
    padding: 0.35rem;
}
.cat-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
}
/* Make children of category drop targets transparent to pointer events so dragenter/leave
   only fire on the button itself — otherwise the cursor crossing a child span re-fires
   both events and the highlight flickers during a drag. */
.cat-item > * { pointer-events: none; }
.cat-item:hover {
    background: #f1f5f9;
}
.cat-item.active {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-light) 100%);
    color: var(--accent-text);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(var(--accent-rgb),0.08);
}
.cat-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cat-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-item-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.cat-item.active .cat-item-count {
    background: rgba(var(--accent-rgb),0.12);
    color: var(--accent-text);
}

/* ---- Jobs Dashboard ---- */
.job-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem 1rem 0.9rem 1.25rem;
    transition: border-color 0.15s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* fixed height so every card is identical */
    height: 260px;
}
.job-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    border-radius: 12px 0 0 12px;
}
.job-idle::before  { background: #22c55e; }
.job-running::before { background: #3b82f6; }
.job-error::before  { background: #ef4444; }
.job-disabled::before { background: #cbd5e1; }
.job-running { border-color: #93c5fd; }
.job-error   { border-color: #fca5a5; }
.job-disabled { opacity: 0.65; }

.job-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.job-status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.job-idle    .job-status-dot { background: #22c55e; }
.job-running .job-status-dot { background: #3b82f6; animation: job-pulse 1.2s infinite; }
.job-error   .job-status-dot { background: #ef4444; }
.job-disabled .job-status-dot { background: #cbd5e1; }
@keyframes job-pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.job-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    /* truncate long names */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.job-card-desc {
    font-size: 0.74rem;
    color: #64748b;
    margin-bottom: 0.65rem;
    line-height: 1.35;
}
.job-card-stats {
    display: flex;
    gap: 0;
    margin-bottom: 0.65rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}
.job-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.75rem;
    flex: 1;
    border-right: 1px solid #f1f5f9;
}
.job-stat:last-child { border-right: none; }
.job-stat-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.job-stat-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

/* timing rows fill remaining vertical space, pushing footer down */
.job-card-timing {
    flex: 1;
    margin-bottom: 0.35rem;
}
.job-timing-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.71rem;
    color: #64748b;
    padding: 0.15rem 0;
}
.job-timing-row i { font-size: 0.68rem; width: 1rem; text-align: center; color: #94a3b8; }

.job-error-banner {
    font-size: 0.7rem;
    color: #dc2626;
    background: #fef2f2;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    gap: 0.3rem;
    align-items: flex-start;
    border: 1px solid #fecaca;
}
.job-error-banner i { flex-shrink: 0; margin-top: 1px; }

.job-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.5rem;
}
/* Both footer buttons fill equally */
.job-card-footer .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
}

/* ---- Job Execution History ---- */

.job-history-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

.job-history-table td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.job-history-table tr:last-child td {
    border-bottom: none;
}

.job-history-table tr:hover td {
    background: #fafbff;
}

.job-history-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
}

.table-danger-subtle td {
    background: rgba(220, 38, 38, 0.03);
}

/* ---- Settings Page ---- */

/* Overview cards */
.settings-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.settings-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.08);
    transform: translateY(-1px);
}
.settings-card.disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}
.settings-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #1e293b;
    flex-shrink: 0;
}
.settings-card-body { flex: 1; min-width: 0; }
.settings-card-title {
    font-size: 0.85rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.2;
}
.settings-card-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-card-fields {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.settings-card-arrow {
    font-size: 0.75rem;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.settings-card:hover .settings-card-arrow { color: var(--accent); }

/* Category headings above each row of overview cards */
.settings-category-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin: 1.25rem 0 0.5rem;
    padding-left: 0.15rem;
}
.settings-category-label:first-of-type {
    margin-top: 0;
}

/* Settings form table */
.settings-form-table { width: 100%; border-collapse: collapse; }
.settings-form-table tr { border-bottom: 1px solid #f1f5f9; transition: opacity 0.2s; }
.settings-form-table tr:last-child { border-bottom: none; }
.settings-form-table th {
    width: 280px; padding: 14px 16px 14px 0; vertical-align: top;
    text-align: left; font-weight: 600; font-size: 0.85rem; color: #374151;
}
.settings-form-table td { padding: 12px 0; vertical-align: top; }
.settings-field-desc { font-size: 0.76rem; color: #64748b; margin-top: 4px; font-style: italic; }
.hidden-row { display: none !important; }

/* Stack label-above-field on mobile so the input column isn't squeezed by the 280px label.
   Affects all settings-form-table usages, including the User Journey notification modal. */
@media (max-width: 768px) {
    .settings-form-table,
    .settings-form-table tbody,
    .settings-form-table tr,
    .settings-form-table th,
    .settings-form-table td { display: block; width: 100%; }
    .settings-form-table tr { padding: 12px 0; }
    .settings-form-table th {
        width: 100%; padding: 0 0 6px;
        font-size: 0.82rem;
    }
    .settings-form-table td { padding: 0; }
    .settings-input { max-width: 100%; }
}

/* Toggle switch */
.ae-toggle-wrap { position: relative; display: inline-block; width: 44px; height: 24px; }
.ae-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.ae-toggle-slider {
    position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px;
    cursor: pointer; transition: background 0.25s;
}
.ae-toggle-slider::before {
    content: ""; position: absolute; width: 18px; height: 18px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%;
    transition: transform 0.25s;
}
.ae-toggle-wrap input:checked + .ae-toggle-slider { background: var(--accent); }
.ae-toggle-wrap input:checked + .ae-toggle-slider::before { transform: translateX(20px); }

/* Form inputs */
.settings-input {
    border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 7px 11px;
    font-size: 0.85rem; color: #0f172a; width: 100%; max-width: 360px;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); }
.settings-select {
    border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 7px 30px 7px 11px;
    font-size: 0.85rem; color: #0f172a; min-width: 180px; max-width: 360px;
    outline: none; appearance: none; cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 12px, #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); }
.settings-radio-group label {
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 6px; font-size: 0.85rem; color: #374151; cursor: pointer;
}
.settings-radio-group input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; }
.settings-number-input { width: 120px; }

/* Segmented control (card-style toggle group with per-option helper text) */
.settings-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 640px;
}
@media (max-width: 600px) {
    .settings-segmented { grid-template-columns: 1fr; }
}
.settings-segmented-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    background: #fff;
    font-size: 0.85rem; font-weight: 600; color: #374151;
    text-align: left; cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.settings-segmented-option:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}
.settings-segmented-option.is-selected {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}
.settings-segmented-option-label { flex: 1; line-height: 1.3; }
.settings-segmented-option-check {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); color: #fff; flex-shrink: 0;
}
.settings-segmented-desc {
    margin-top: 12px; padding: 12px 14px; max-width: 640px;
    background: #f8fafc; border-left: 3px solid var(--accent); border-radius: 6px;
    font-size: 0.82rem; line-height: 1.55; color: #475569;
}

/* Save footer */
.settings-save-footer {
    margin-top: 20px; padding-top: 14px; border-top: 1px solid #e2e8f0;
    display: flex; align-items: center; gap: 12px;
}

/* Toast */
.settings-toast {
    position: fixed; bottom: 30px; right: 30px; z-index: 99999;
    display: flex; align-items: flex-start; gap: 10px;
    color: #fff; padding: 12px 16px; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 360px; min-width: 200px;
    font-size: 13px; line-height: 1.4; opacity: 0; transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.settings-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.settings-toast.success { background: #059669; }
.settings-toast.error   { background: #dc2626; }
.settings-toast.info    { background: #0284c7; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1100;
    }
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    .admin-sidebar.collapsed {
        transform: translateX(-100%);
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1050;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .admin-main {
        margin-left: 0 !important;
    }
    .admin-content {
        padding: 16px 10px;
    }
    .admin-topbar {
        padding: 8px 10px;
    }
    .studio-select {
        min-width: 100px;
        max-width: 160px;
        font-size: 0.78rem;
    }
    .studio-badge {
        font-size: 0.78rem;
    }

    /* Tables */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table th, .table td { font-size: 0.8rem; padding: 6px 8px; }

    /* Cards */
    .card-body { padding: 12px; }

    /* Modals */
    .modal-dialog { margin: 8px; }
    .modal-dialog.modal-lg { max-width: calc(100vw - 16px); }
    .modal-dialog.modal-sm { max-width: calc(100vw - 16px); }

    /* Page headers */
    h4.fw-bold { font-size: 1.15rem; }

    /* Button groups */
    .btn-group-sm .btn { font-size: 0.75rem; padding: 4px 8px; }

    /* Subscription detail cards */
    .row.g-3 > .col-md-6 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    .admin-content { padding: 10px 6px; }

    /* Stack action bars */
    .d-flex.gap-2 { flex-wrap: wrap; }
    .d-flex.align-items-end { flex-wrap: wrap; }

    /* Day picker grid */
    .day-picker-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .day-picker-cell { font-size: 0.78rem; }

    /* Permission checkbox matrix */
    .perm-group { flex-direction: column; align-items: flex-start; gap: 4px; }
    .perm-group-name { width: auto; }
    .perm-group-actions { gap: 10px; }
}

/* ==========================================================
   Challenge Workflow Canvas
   ========================================================== */
#workflow-container {
    position: relative;
    min-height: 800px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    overflow: auto;
    width: 100%;
}
#workflow-nodes { position: relative !important; min-height: 600px; z-index: 2 !important; }
#workflow-connections { z-index: 1 !important; }

.wf-node {
    position: absolute !important;
    background: #fff;
    border: 3px solid #6f2a81;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    cursor: grab;
    transition: box-shadow .3s ease, border-color .3s ease;
    z-index: 10;
    user-select: none;
}
.wf-node:active { cursor: grabbing; }
.wf-node:hover { box-shadow: 0 6px 20px rgba(111,42,129,.4); border-color: #88308f; z-index: 20; }
.wf-node.wf-dragging { cursor: grabbing !important; z-index: 100 !important; box-shadow: 0 8px 24px rgba(111,42,129,.5); transform: scale(1.05); }
.wf-node.wf-start { border-color: #28a745; background: linear-gradient(135deg, #f0fff4, #e8f5e9); }
.wf-node.wf-end { border-color: #dc3545; background: linear-gradient(135deg, #fff5f5, #ffebee); }
.wf-node.wf-prereq { border-color: #ffc107; background: linear-gradient(135deg, #fffbf0, #fff9e6); }
.wf-node.wf-hidden { display: none !important; }

.wf-node-title {
    font-weight: 700; font-size: 15px; color: #4e2a57;
    margin-bottom: 10px; line-height: 1.4;
    border-bottom: 2px solid #e9ecef; padding-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.wf-node-title-text { flex: 1; }
.wf-node-toggle {
    background: #f1ecf5; border: 1px solid #cfc3d8; border-radius: 6px;
    color: #4e2a57; font-size: 11px; padding: 3px 8px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    transition: background .2s ease, border-color .2s ease;
}
.wf-node-toggle .wf-toggle-icon { font-weight: 700; font-size: 12px; line-height: 1; }
.wf-node-toggle.expanded { background: #e4d4ec; border-color: #a884bc; }
.wf-node-toggle:focus { outline: none; box-shadow: 0 0 0 2px rgba(111,42,129,.25); }

.wf-node-info { font-size: 11px; color: #666; line-height: 1.6; }
.wf-badge {
    display: inline-block; font-size: 10px; padding: 3px 8px;
    border-radius: 4px; margin-top: 4px; margin-right: 6px; font-weight: 600;
}

.wf-conn { stroke-width: 3; fill: none; opacity: .9; pointer-events: stroke; }
.wf-conn:hover { opacity: 1; stroke-width: 4; }

.wf-view-toggle.active { background: #6f2a81 !important; color: #fff !important; border-color: #6f2a81 !important; }

/* ---- GridStack Dashboard ---- */
/* Hide until JS finishes init — avoids squashed/overlapping pre-GridStack paint */
#ae-dashboard-grid:not(.grid-stack--inited) {
    visibility: hidden;
    min-height: 360px;
}
#ae-dashboard-grid.grid-stack--inited {
    visibility: visible;
}
.grid-stack { min-height: 200px; min-width: 0; width: 100%; }
.grid-stack-item-content { overflow: auto; border-radius: 18px; }
.grid-stack-item-content > .card {
    height: 100%;
    border-radius: 18px;
    border: 1px solid #eef1f6;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px -10px rgba(15,23,42,0.10);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    position: relative;
}
.grid-stack-item:hover .grid-stack-item-content > .card {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15,23,42,0.05), 0 16px 36px -12px rgba(15,23,42,0.16);
}

/* Accent top border — colour set per dashlet via data-accent. Kept soft: a thin
   bar that fades to transparent so the colour reads as a tint, not a hard rule. */
.grid-stack-item-content > .card::before {
    content: "";
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--dashlet-accent, var(--accent, var(--accent)));
    background: linear-gradient(90deg,
        var(--dashlet-accent, var(--accent, var(--accent))) 0%,
        color-mix(in srgb, var(--dashlet-accent, var(--accent, var(--accent))) 55%, transparent) 100%);
    opacity: 0.85;
    border-radius: 18px 18px 0 0;
}

.grid-stack-item-content > .card > .card-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem 1.1rem 1rem;
    position: relative; /* anchor for the inline "×" close button */
}

/* Inline close ("×") — hides a dashlet from the dashboard without opening the
   Customize panel. Invisible until the user hovers the card to keep chrome quiet. */
.dashlet-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
    z-index: 2;
}
.grid-stack-item:hover .dashlet-close-btn,
.dashlet-close-btn:focus-visible {
    opacity: 1;
}
.dashlet-close-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
    transform: scale(1.06);
}
.dashlet-close-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.25);
}
[data-theme="dark"] .dashlet-close-btn { color: rgba(226,232,240,0.55); }
[data-theme="dark"] .dashlet-close-btn:hover {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.35);
}
.grid-stack-item-content > .card > .card-body .dashlet-scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* Dashlet header */
.dashlet-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    min-height: 28px;
}
.dashlet-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.dashlet-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.01em;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}
.dashlet-controls { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }

/* Drag handle */
.gs-drag-handle { cursor: grab; user-select: none; }
.gs-drag-handle:active { cursor: grabbing; }
.gs-drag-handle .bi-grip-vertical { opacity: 0.25; transition: opacity 0.15s; font-size: 0.9rem; }
.grid-stack-item:hover .gs-drag-handle .bi-grip-vertical { opacity: 0.55; }

/* Dashlet table styling */
.dashlet-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.dashlet-table thead tr {
    border-bottom: 2px solid #f1f5f9;
}
.dashlet-table thead th {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    white-space: nowrap;
}
.dashlet-table tbody tr {
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s;
}
.dashlet-table tbody tr:hover { background: #f8fafc; }
.dashlet-table tbody tr:last-child { border-bottom: none; }
.dashlet-table td { padding: 0.35rem 0.5rem; color: #334155; }
.dashlet-table tfoot tr { border-top: 2px solid #e2e8f0; }
.dashlet-table tfoot td {
    padding: 0.35rem 0.5rem;
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e293b;
}
.dashlet-value {
    font-weight: 700;
    font-size: 0.85rem;
}
.dashlet-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ---- Quick-stat cards (top row) — soft, modern surfaces ----
   These cards come straight from Bootstrap (.card.border-0.shadow-sm) in
   Dashboard.razor. Soften them to match the dashlet treatment: larger radius,
   a gentle diffuse shadow, and a subtle lift on hover. Scoped to the quick-stats
   row so other admin tables/cards are untouched. */
.row.g-3 > [class*="col-"] > a > .card,
.row.g-3 > [class*="col-"] > .card {
    border-radius: 16px !important;
    border: 1px solid #eef1f6 !important;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px -12px rgba(15,23,42,0.10) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.row.g-3 > [class*="col-"] > a:hover > .card,
.row.g-3 > [class*="col-"] > .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15,23,42,0.05), 0 16px 34px -14px rgba(15,23,42,0.16) !important;
}
/* Rounder icon tiles inside the quick-stat cards (the .rounded-3 .p-2 swatches). */
.row.g-3 > [class*="col-"] .card-body .rounded-3 {
    border-radius: 12px !important;
}

/* ---- Dashboard mobile layout ----
   Below 768px GridStack switches to one column (columnOpts.breakpoints in
   dashboard-grid.js) and each dashlet sizes to its own content. The styles
   below clean up surrounding chrome and the parts of dashlets that only make
   sense in the desktop grid (drag handles, inline close button, internal
   scrollers that would clip a now-fluid card). */
@media (max-width: 768px) {
    /* Layout-management controls only make sense in a multi-column grid —
       there's nothing to drag/resize/customize on a single-column phone view. */
    .dashboard-header-layout-mgmt { display: none !important; }

    .dashboard-header-actions { width: 100%; }
    .dashboard-header-actions .btn { flex: 1 1 auto; }

    /* Quick stats: tighter card padding on mobile. */
    .row.g-3 > [class*="col-"] > a > .card .card-body,
    .row.g-3 > [class*="col-"] > .card .card-body { padding: 0.85rem 1rem; }

    /* Cards now grow to fit their content — drop the inner scroll container
       so tables and chart areas can determine their own height. */
    .grid-stack-item-content > .card > .card-body { padding: 0.9rem 1rem; }
    .grid-stack-item-content > .card > .card-body .dashlet-scroll {
        overflow: visible;
        flex: 0 0 auto;
    }

    /* Charts need an explicit height once their cell sizes to content,
       otherwise Chart.js paints into a 0px box. */
    .grid-stack-item-content > .card > .card-body > div[style*="flex:1"],
    .grid-stack-item-content > .card > .card-body > div[style*="flex: 1"] {
        height: 240px;
        min-height: 240px;
        flex: 0 0 240px;
    }

    /* Drag/close affordances are noise without drag/customize on mobile. */
    .gs-drag-handle { cursor: default; }
    .gs-drag-handle .bi-grip-vertical { display: none; }
    .dashlet-close-btn { display: none !important; }

    .dashlet-table { font-size: 0.78rem; }
    .dashlet-table th,
    .dashlet-table td { padding: 0.4rem 0.45rem; }
}

@media (max-width: 480px) {
    .dashlet-title { font-size: 0.78rem; }
    .dashlet-icon { width: 26px; height: 26px; font-size: 0.78rem; }
}

/* ============================================================
   Setup Wizard
   ============================================================ */
.setup-wizard-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: swOverlayIn 0.2s ease;
}
@keyframes swOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.setup-wizard {
    background: #fff; border-radius: 20px; width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 32px 64px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.06);
    animation: swSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; flex-direction: column;
}
@keyframes swSlideIn { from { opacity: 0; transform: scale(0.95) translateY(12px); } to { opacity: 1; transform: none; } }

/* Header */
.setup-wizard-header {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 24px 24px 16px; position: relative;
}
.setup-wizard-header-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-light));
    color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.setup-wizard-title { font-size: 1.2rem; font-weight: 700; color: #0f172a; margin: 0; line-height: 1.3; }
.setup-wizard-subtitle { font-size: 0.82rem; color: #64748b; margin: 2px 0 0; }
.setup-wizard-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: transparent; color: #94a3b8; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.setup-wizard-close:hover { background: #f1f5f9; color: #475569; }

/* Progress */
.setup-wizard-progress {
    padding: 0 24px 16px; display: flex; align-items: center; gap: 12px;
}
.setup-wizard-progress-bar {
    flex: 1; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden;
}
.setup-wizard-progress-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent));
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.setup-wizard-progress-text { font-size: 0.75rem; color: #64748b; white-space: nowrap; font-weight: 500; }

/* Steps list */
.setup-wizard-steps { padding: 0 16px; flex: 1; overflow-y: auto; }
.setup-wizard-step {
    display: flex; gap: 12px; padding: 4px 0;
    position: relative;
}
.setup-wizard-step::before {
    content: ''; position: absolute; left: 23px; top: 38px; bottom: -4px;
    width: 2px; background: #e2e8f0;
}
.setup-wizard-step:last-child::before { display: none; }
.setup-wizard-step.is-complete::before { background: var(--accent); }

/* Step indicator circle */
.setup-wizard-step-indicator {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid #e2e8f0; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; color: #94a3b8;
    transition: all 0.2s; margin-top: 4px; position: relative; z-index: 1;
}
.setup-wizard-step.is-active .setup-wizard-step-indicator {
    border-color: var(--accent); color: var(--accent); background: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}
.setup-wizard-step.is-complete .setup-wizard-step-indicator {
    border-color: #059669; background: #059669; color: #fff;
}

/* Step body */
.setup-wizard-step-body { flex: 1; min-width: 0; padding-bottom: 8px; }
.setup-wizard-step-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    cursor: pointer; padding: 6px 10px; border-radius: 10px;
    transition: background 0.15s;
}
.setup-wizard-step-header:hover { background: #f8fafc; }
.setup-wizard-step-title { font-size: 0.9rem; font-weight: 600; color: #1e293b; }
.setup-wizard-step-title i { margin-right: 6px; color: #64748b; font-size: 0.85rem; }
.setup-wizard-step.is-complete .setup-wizard-step-title { color: #059669; }
.setup-wizard-step-desc { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }

/* Badge */
.setup-wizard-badge {
    font-size: 0.68rem; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; white-space: nowrap; letter-spacing: 0.02em;
}
.setup-wizard-badge.is-done { background: #ecfdf5; color: #059669; }
.setup-wizard-badge.is-todo { background: #f1f5f9; color: #64748b; }

/* Step content (inline form) */
.setup-wizard-step-content {
    padding: 12px 10px 4px;
    animation: swStepIn 0.2s ease;
}
@keyframes swStepIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.setup-wizard-form { display: flex; flex-direction: column; gap: 10px; }
.setup-wizard-field label {
    font-size: 0.78rem; font-weight: 600; color: #374151; margin-bottom: 4px; display: block;
}
.setup-wizard-field .form-control,
.setup-wizard-field .form-select {
    font-size: 0.85rem; padding: 8px 12px; border-radius: 8px;
    border: 1.5px solid #e2e8f0;
}
.setup-wizard-field .form-control:focus,
.setup-wizard-field .form-select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}
.setup-wizard-field-row { display: flex; gap: 10px; }
.setup-wizard-field-row > .setup-wizard-field { flex: 1; }
.setup-wizard-actions {
    display: flex; align-items: center; gap: 8px; padding-top: 4px;
}
.setup-wizard-hint {
    font-size: 0.78rem; color: var(--accent); background: var(--accent-light);
    padding: 6px 10px; border-radius: 6px;
}
.setup-wizard-warning {
    font-size: 0.8rem; color: #1d4ed8; background: #eff6ff;
    padding: 8px 12px; border-radius: 8px; margin-bottom: 8px;
}

/* Messages */
.setup-wizard-error {
    font-size: 0.8rem; color: #dc2626; background: #fef2f2;
    padding: 8px 12px; border-radius: 8px; margin-top: 8px;
}
.setup-wizard-success {
    font-size: 0.8rem; color: #059669; background: #ecfdf5;
    padding: 8px 12px; border-radius: 8px; margin-top: 8px;
}
.setup-wizard-complete-msg {
    font-size: 0.82rem; color: #374151; padding: 4px 0;
}

/* Footer */
.setup-wizard-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex; align-items: center; gap: 12px;
}
.setup-wizard-footer-hint { font-size: 0.75rem; color: #94a3b8; }
.setup-wizard-complete-banner {
    display: flex; align-items: center; gap: 10px; flex: 1;
    padding: 10px 14px; border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}
.setup-wizard-complete-banner strong { display: block; font-size: 0.88rem; }
.setup-wizard-complete-banner span { display: block; font-size: 0.78rem; opacity: 0.85; }
.setup-wizard-complete-actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Step just-completed pulse animation */
.setup-wizard-step.is-just-completed .setup-wizard-step-indicator {
    animation: swCheckPulse 0.6s ease;
}
@keyframes swCheckPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    40% { transform: scale(1.25); box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
    100% { transform: scale(1); box-shadow: none; }
}

/* Dashboard setup banner (shown when wizard is dismissed but incomplete) */
.setup-banner {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-light) 100%);
    border: 1.5px solid #c7d2fe; border-radius: 14px;
    padding: 18px 22px; display: flex; align-items: center; gap: 16px;
    margin-bottom: 1.25rem; cursor: default;
    transition: box-shadow 0.2s;
}
.setup-banner:hover { box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.1); }
.setup-banner-icon {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.setup-banner-text { flex: 1; }
.setup-banner-text strong { color: #1e293b; font-size: 0.92rem; display: block; }
.setup-banner-text span { color: #64748b; font-size: 0.8rem; }

/* ────────────────────────────────────────────────────────────────────────
   Setup Wizard — Dual-mode additions
   (mode picker, branding step, multi-item tables, suggestions, finish)
   All colors via --ae-* tokens.
   ──────────────────────────────────────────────────────────────────────── */

/* Mode picker */
.setup-wizard-mode-picker {
    display: flex; align-items: stretch; gap: 16px;
    padding: 20px 24px 28px;
    flex-wrap: wrap;
}
.setup-wizard-mode-card {
    position: relative;
    flex: 1 1 0;
    min-width: 200px;
    min-height: 172px;
    text-align: left;
    padding: 22px 22px 20px;
    border: 1.5px solid var(--ae-border);
    border-radius: 16px;
    background: var(--ae-surface);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex; flex-direction: column; gap: 6px;
}
.setup-wizard-mode-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--ae-primary);
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.12);
}
.setup-wizard-mode-card:disabled { opacity: 0.5; cursor: wait; }
.setup-wizard-mode-card.is-recommended { border-color: var(--ae-primary); }
.setup-wizard-mode-card-pill {
    position: absolute; top: -10px; right: 16px;
    background: var(--ae-primary); color: #fff;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
}
.setup-wizard-mode-card-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.10); color: var(--ae-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.setup-wizard-mode-card-title { font-size: 1rem; font-weight: 700; color: var(--ae-text); }
.setup-wizard-mode-card-meta  { font-size: 0.75rem; color: var(--ae-text-muted); font-weight: 500; }
.setup-wizard-mode-card-desc  { font-size: 0.82rem; color: var(--ae-text-muted); line-height: 1.4; margin-top: 4px; flex: 1 1 auto; }

/* Header — mode badge + switch link */
.setup-wizard-mode-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ae-bg);
    color: var(--ae-text-muted);
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}
.setup-wizard-switch-link {
    background: none; border: none;
    color: var(--ae-primary);
    font-size: 0.78rem; font-weight: 500;
    padding: 0; margin-left: 8px;
    cursor: pointer;
    text-decoration: underline;
}
.setup-wizard-switch-link:hover { color: var(--ae-text); }

/* Branding step */
.setup-wizard-branding .image-upload-widget { max-width: 220px; }
.setup-wizard-color-row { display: flex; gap: 8px; align-items: center; }
.setup-wizard-color-swatch {
    width: 40px; height: 38px;
    border: 1.5px solid var(--ae-border);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: var(--ae-surface);
}
.setup-wizard-color-row .form-control { flex: 1; max-width: 140px; }
.setup-wizard-confirm-toggle {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px;
    margin-top: 4px;
    border-radius: 10px;
    background: var(--ae-bg);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ae-text);
}
.setup-wizard-confirm-toggle input[type="checkbox"] { margin-top: 2px; }

/* Multi-item table */
.setup-wizard-multi { display: flex; flex-direction: column; gap: 14px; }
.setup-wizard-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    border: 1px solid var(--ae-border);
    border-radius: 10px;
    overflow: hidden;
}
.setup-wizard-mini-table th {
    background: var(--ae-bg);
    color: var(--ae-text-muted);
    font-weight: 600;
    font-size: 0.72rem; letter-spacing: 0.03em; text-transform: uppercase;
    padding: 8px 12px;
    text-align: left;
}
.setup-wizard-mini-table td {
    padding: 8px 12px;
    border-top: 1px solid var(--ae-border);
    color: var(--ae-text);
}
.setup-wizard-mini-table tr:nth-child(even) td { background: var(--ae-bg); }
.setup-wizard-mini-empty {
    text-align: center !important;
    color: var(--ae-text-muted);
    font-style: italic;
    padding: 16px !important;
}
.setup-wizard-multi-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding-top: 6px;
    border-top: 1px dashed var(--ae-border);
    flex-wrap: wrap;
}
.setup-wizard-multi-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Suggestions panel */
.setup-wizard-suggestions {
    border: 1px dashed var(--ae-border);
    border-radius: 10px;
    background: var(--ae-bg);
}
.setup-wizard-suggestions-toggle {
    width: 100%;
    background: none; border: none;
    text-align: left;
    padding: 10px 14px;
    font-size: 0.85rem; font-weight: 600;
    color: var(--ae-text);
    cursor: pointer;
    display: flex; align-items: center; gap: 6px;
}
.setup-wizard-suggestions-toggle:hover { color: var(--ae-primary); }
.setup-wizard-suggestions-body {
    padding: 4px 14px 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.setup-wizard-suggestions-hint {
    font-size: 0.76rem;
    color: var(--ae-text-muted);
    margin: 0 0 6px;
}
.setup-wizard-suggestion-row {
    display: flex; gap: 10px; align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--ae-surface);
    cursor: pointer;
    font-size: 0.82rem;
}
.setup-wizard-suggestion-row.is-disabled { opacity: 0.55; cursor: not-allowed; }
.setup-wizard-suggestion-row .form-control { flex: 1; max-width: 240px; }
.setup-wizard-suggestion-meta {
    margin-left: auto;
    font-size: 0.72rem; color: var(--ae-text-muted);
    font-variant-numeric: tabular-nums;
}
.setup-wizard-suggestions-warn {
    font-size: 0.76rem;
    color: var(--ae-warning, #d97706);
    margin: 6px 0 0;
}

/* Finish step */
.setup-wizard-finish { display: flex; flex-direction: column; gap: 14px; }
.setup-wizard-finish-hero {
    text-align: center;
    padding: 8px 0 4px;
}
.setup-wizard-finish-hero i {
    color: var(--ae-warning, #d97706);
    font-size: 2rem;
    display: block;
    margin-bottom: 4px;
}
.setup-wizard-finish-hero h4 {
    font-size: 1.05rem; font-weight: 700;
    margin: 0; color: var(--ae-text);
}
.setup-wizard-finish-hero p {
    font-size: 0.85rem;
    color: var(--ae-text-muted);
    margin: 4px 0 0;
}
.setup-wizard-finish-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.setup-wizard-finish-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    aspect-ratio: 1;
    padding: 12px;
    border: 1.5px solid var(--ae-border);
    border-radius: 12px;
    background: var(--ae-surface);
    color: var(--ae-text);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
    font-size: 0.82rem; font-weight: 500;
    text-align: center;
}
.setup-wizard-finish-card:hover {
    border-color: var(--ae-primary);
    transform: translateY(-1px);
    color: var(--ae-text);
}
.setup-wizard-finish-card i { font-size: 1.4rem; color: var(--ae-primary); }

@media (max-width: 576px) {
    .setup-wizard { max-width: 100%; border-radius: 16px; }
    .setup-wizard-field-row { flex-direction: column; }
    .setup-wizard-mode-picker { flex-direction: column; }
    .setup-wizard-finish-grid { grid-template-columns: 1fr; }
    .setup-wizard-multi-footer { flex-direction: column; align-items: stretch; }
}

/* ────────────────────────────────────────────────────────────────────────
   Setup Wizard — Overview row layout (no inline forms)
   ──────────────────────────────────────────────────────────────────────── */
.setup-wizard-step-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    min-height: 76px;
    box-sizing: border-box;
}
.setup-wizard-step-text { flex: 1; min-width: 0; }
.setup-wizard-step-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.setup-wizard-step-link {
    background: none; border: none;
    color: var(--ae-primary);
    font-size: 0.78rem; font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    text-decoration: none;
}
.setup-wizard-step-link:hover { text-decoration: underline; }

/* "View all steps" link in OnboardingTasksBadge dropdown */
.onboarding-tasks-overview {
    width: 100%;
    background: var(--ae-bg);
    border: none;
    border-top: 1px solid var(--ae-border);
    padding: 10px 14px;
    text-align: center;
    color: var(--ae-primary);
    font-size: 0.83rem; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.onboarding-tasks-overview:hover { background: rgba(var(--accent-rgb), 0.06); }

/* ────────────────────────────────────────────────────────────────────────
   Coach-mark — floating tooltip pinned to a key element on each page.
   Uses direct colors (--ae-* tokens are not defined globally in this stylesheet).
   ──────────────────────────────────────────────────────────────────────── */
.coachmark-bubble {
    position: fixed;
    z-index: 99999;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
    padding: 14px 16px;
    font-size: 0.85rem;
    color: #0f172a;
    animation: coachmarkIn 0.2s ease-out;
}
@keyframes coachmarkIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.coachmark-arrow {
    position: absolute;
    width: 14px; height: 14px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}
.coachmark-bubble[data-arrow="bottom"] .coachmark-arrow { top: -7px; }
.coachmark-bubble[data-arrow="top"] .coachmark-arrow {
    bottom: -7px;
    transform: rotate(225deg);
}
.coachmark-header {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 0.92rem;
    margin-bottom: 6px;
    color: #0f172a;
}
.coachmark-header i { color: var(--accent); font-size: 1rem; }
.coachmark-header span { flex: 1; }
.coachmark-close {
    background: none; border: none;
    width: 22px; height: 22px;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.coachmark-close:hover { background: #f1f5f9; color: #0f172a; }
.coachmark-body {
    color: #475569;
    line-height: 1.45;
    margin-bottom: 12px;
}
.coachmark-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.coachmark-skip { color: #64748b !important; padding: 4px 8px; }

/* Pulsing outline on the anchor element so the user knows what to act on */
.coachmark-anchor-pulse {
    position: relative;
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
    animation: coachmarkAnchorPulse 1.6s ease-out infinite;
    border-radius: 8px;
}
@keyframes coachmarkAnchorPulse {
    0%   { box-shadow: 0 0 0 0   rgba(var(--accent-rgb), 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0);  }
    100% { box-shadow: 0 0 0 0   rgba(var(--accent-rgb), 0);  }
}

/* ---- Theme Picker ---- */
.theme-picker-wrapper {
    position: relative;
}

.theme-picker-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    padding: 0;
}
.theme-picker-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.theme-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    padding: 14px;
    z-index: 500;
    min-width: 210px;
    animation: themePickerIn 0.15s ease;
}
@keyframes themePickerIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.theme-picker-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 10px;
}

.theme-swatch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 10px;
    transition: background 0.12s;
}
.theme-swatch:hover { background: #f1f5f9; }
.theme-swatch.active { background: #f1f5f9; }

.theme-swatch-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    position: relative;
    transition: border-color 0.12s, transform 0.12s;
    flex-shrink: 0;
}
.theme-swatch.active .theme-swatch-circle {
    border-color: #1e293b;
    transform: scale(1.1);
}
.theme-swatch-circle::after {
    content: "";
    display: none;
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
}
.theme-swatch.active .theme-swatch-circle::after {
    display: block;
}

.theme-swatch-name {
    font-size: 0.67rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}
.theme-swatch.active .theme-swatch-name {
    color: #1e293b;
    font-weight: 700;
}

.theme-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 499;
}

/* ---- Topbar right cluster ---- */
.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — Customize (show/hide dashlets) panel
══════════════════════════════════════════════════════════════ */
.customize-wrapper {
    position: relative;
}
.customize-overlay {
    position: fixed;
    inset: 0;
    z-index: 1059;
}
.customize-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 272px;
    background: var(--card-bg, #fff);
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    border: 1px solid var(--border-color, #e2e8f0);
    z-index: 1060;
    overflow: hidden;
    animation: customizeFadeIn .15s ease;
}
@keyframes customizeFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.customize-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-size: .875rem;
    color: var(--text-main, #1e293b);
}
.customize-panel-body {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
}
.customize-panel-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}
.dashlet-toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background .12s;
    font-size: .85rem;
    user-select: none;
}
.dashlet-toggle-item:hover {
    background: var(--hover-bg, #f8fafc);
}
.dashlet-toggle-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.dashlet-toggle-label {
    flex: 1;
    color: var(--text-main, #1e293b);
    transition: opacity .12s;
}
.dashlet-toggle-item.is-hidden .dashlet-toggle-label {
    opacity: .45;
    text-decoration: line-through;
}
.dashlet-toggle-eye {
    font-size: 1rem;
    flex-shrink: 0;
    transition: color .12s;
}
.dashlet-toggle-eye.visible { color: #22c55e; }
.dashlet-toggle-eye.hidden  { color: #cbd5e1; }

/* ---- Excel Import Wizard ---- */
.excel-wizard-modal .modal-dialog { max-width: 1080px; }
.excel-wizard-steps {
    display: flex;
    align-items: center;
    gap: 10px;
}
.excel-wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: .9rem;
}
.excel-wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
}
.excel-wizard-step.is-active { color: var(--accent); font-weight: 600; }
.excel-wizard-step.is-active .step-number { background: var(--accent); color: #fff; }
.excel-wizard-step.is-done { color: #059669; }
.excel-wizard-step.is-done .step-number { background: #059669; color: #fff; }
.excel-wizard-divider {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.excel-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 36px 24px;
    text-align: center;
    background: #f8fafc;
    transition: border-color .15s, background .15s;
}
.excel-dropzone.is-dragging { border-color: var(--accent); background: var(--accent-light); }
.excel-file-input { max-width: 320px; margin: 0 auto; display: block; }
.excel-match-table th { background: #f8fafc; }
.excel-preview-table-wrap { max-height: 420px; overflow: auto; }
.excel-preview-table th { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
.table-danger-subtle td { background: #fef2f2; }

/* ─── Shared "card list" editor pattern ───────────────────────────
   Used by: ServicePricingTiersEditor, ServiceExtrasEditor,
   ProviderAvailabilityEditor, RoomsEditor.
   Each editor has its own <style> block with extras (e.g. tier
   reorder buttons), but the row layout is consistent. */
.ae-card-list { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; }
.ae-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
/* The header action (e.g. "+ Add tier") must keep its full width on one line — flex items
   shrink by default, which squeezed the button column and wrapped the label onto two rows. */
.ae-card-header > .btn { flex-shrink: 0; white-space: nowrap; }

.ae-rows { display: flex; flex-direction: column; gap: 8px; }
.ae-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; transition: box-shadow .15s, border-color .15s; }
.ae-row:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15, 23, 42, .04); }
.ae-row-main { flex: 1; min-width: 0; }
.ae-row-title { font-weight: 600; color: #0f172a; }
.ae-row-description { line-height: 1.4; }
.ae-row-description :where(p, h1, h2, h3, ul, ol) { margin: 0 0 4px 0; }
.ae-row-meta { text-align: right; min-width: 110px; }
.ae-row-price { font-weight: 600; color: #6f2a81; }
.ae-row-actions { display: flex; gap: 6px; }

.ae-empty { text-align: center; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 18px; font-size: 0.875rem; }

.ae-form { margin-top: 16px; padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }

/* ══════════════════════════════════════════════════════════════
   CONTEXTUAL HELP — Button + slide-in drawer + article styles
   ══════════════════════════════════════════════════════════════ */
.help-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.help-trigger:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: #c7d2fe;
}
.help-trigger.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.help-trigger-label { line-height: 1; }

.help-trigger-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.help-trigger-floating:hover {
    background: var(--accent-text);
    color: #fff;
    border-color: var(--accent-text);
    transform: scale(1.05);
}

.help-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.help-drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: calc(100vw - 40px);
    background: #fff;
    box-shadow: -16px 0 40px -12px rgba(15, 23, 42, 0.2);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}
.help-drawer.is-open { transform: translateX(0); }

.help-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-shrink: 0;
}
.help-drawer-pivots {
    display: flex;
    gap: 4px;
    background: var(--accent-light);
    padding: 3px;
    border-radius: 8px;
}
.help-drawer-pivot {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.help-drawer-pivot.is-active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.help-drawer-pivot i { font-size: 0.85rem; margin-right: 4px; }

.help-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.help-drawer-close:hover { background: #f1f5f9; }

.help-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.help-drawer-browse { padding-top: 16px; }

.help-drawer-search {
    position: relative;
    margin-bottom: 16px;
}
.help-drawer-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
}
.help-drawer-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}
.help-drawer-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.help-drawer-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}
.help-drawer-empty-icon {
    margin: 0 auto 16px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.help-drawer-empty h3 { font-size: 1rem; margin-bottom: 8px; color: #0f172a; }
.help-drawer-empty p { font-size: 0.875rem; margin-bottom: 16px; }

.help-browse-group { margin-bottom: 20px; }
.help-browse-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-left: 4px;
}
.help-browse-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.help-browse-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.help-browse-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.help-browse-item-title {
    display: block;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.875rem;
}
.help-browse-item-summary {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* Article rendering */
.help-article-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 8px;
}
.help-article-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}
.help-article-summary {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.5;
}
.help-article-body {
    color: #1e293b;
    font-size: 0.92rem;
    line-height: 1.65;
}
.help-article-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 24px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}
.help-article-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 18px 0 6px 0;
}
.help-article-body p { margin: 0 0 12px 0; }
.help-article-body ul, .help-article-body ol { padding-left: 22px; margin: 0 0 12px 0; }
.help-article-body li { margin-bottom: 4px; }
.help-article-body code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}
.help-article-body img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    background: #f8fafc;
    min-height: 80px;
    color: #94a3b8;
    font-size: 0.75rem;
    /* Browsers render the alt text + broken-image icon until the screenshot is
       captured. Centre and pad so the placeholder doesn't look like a layout bug. */
    display: block;
    text-align: center;
    padding: 8px;
}
.help-article-body figure { margin: 16px 0; }
.help-article-body figcaption {
    font-size: 0.78rem;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
}
.help-article-body blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    color: #312e81;
}
.help-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}
.help-article-body th, .help-article-body td {
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    text-align: left;
}
.help-article-body th { background: #f8fafc; font-weight: 600; }
.help-article-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 600px) {
    .help-drawer { width: 100%; max-width: 100%; }
    .help-trigger-label { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   KNOWLEDGE BASE — /admin/help and /help index pages
   ══════════════════════════════════════════════════════════════ */
.help-index-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }
.help-index-hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    margin-bottom: 32px;
    box-shadow: 0 12px 32px -8px rgba(var(--accent-rgb), 0.35);
}
.help-index-hero h1 { font-size: 1.85rem; font-weight: 700; margin: 0 0 6px 0; }
.help-index-hero p { font-size: 1rem; opacity: 0.92; margin: 0 0 18px 0; }
.help-index-hero-search {
    position: relative;
    max-width: 520px;
}
.help-index-hero-search input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
}
.help-index-hero-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.help-index-category {
    margin-bottom: 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px;
}
.help-index-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}
.help-index-category-title i {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.help-index-category-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 14px 42px;
}
.help-index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.help-index-list a {
    display: block;
    padding: 10px 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.help-index-list a:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.help-index-list-title { display: block; font-weight: 600; font-size: 0.875rem; }
.help-index-list-summary { display: block; font-size: 0.78rem; color: #64748b; margin-top: 2px; }

.help-article-page {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 36px;
}
.help-article-page .help-article-title { font-size: 1.75rem; }

/* ============================================================
   SHARED COMPONENT LIBRARY ("Calm Canvas")
   Reusable on ANY admin page (scoped under .admin-wrapper), fully
   token-driven so every component follows the active theme. Lifted
   here from the appointments page so it is part of the common
   template. The .ap-* rules are appointments-specific layout only.
   ============================================================ */
.admin-wrapper .mh-appts{ background:var(--ae-bg); border-radius:16px; padding:24px 26px; }

.admin-wrapper .ap-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:20px; }
.admin-wrapper .ap-h1{ font-size:26px; font-weight:700; letter-spacing:-.025em; margin:0; line-height:1.1; color:var(--ae-text); }
.admin-wrapper .ap-subh{ color:var(--ae-text-muted); font-size:14px; margin-top:5px; }

.admin-wrapper .mh-btn{ display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:var(--ae-r);
    font-weight:600; font-size:13.5px; cursor:pointer; border:1px solid var(--ae-border); background:var(--ae-surface);
    color:var(--ae-text-subtle); white-space:nowrap; font-family:inherit; transition:background .12s,border-color .12s; text-decoration:none; }
.admin-wrapper .mh-btn:hover{ background:var(--ae-hover); }
.admin-wrapper .mh-btn.primary{ background:var(--ae-primary); border-color:var(--ae-primary); color:var(--ae-accent-ink); }
.admin-wrapper .mh-btn.primary:hover{ filter:brightness(.95); }
.admin-wrapper .mh-btn.soft{ background:var(--ae-accent-soft); border-color:transparent; color:var(--ae-primary); }
.admin-wrapper .mh-btn.soft:hover{ background:color-mix(in srgb, var(--ae-primary) 16%, transparent); }

.admin-wrapper .mh-iconbtn{ width:32px; height:32px; border-radius:var(--ae-r); display:inline-grid; place-items:center; cursor:pointer;
    border:1px solid var(--ae-border); background:var(--ae-surface); color:var(--ae-text-muted); transition:background .12s,color .12s; position:relative; text-decoration:none; }
.admin-wrapper .mh-iconbtn:hover{ background:var(--ae-hover); color:var(--ae-text); }
.admin-wrapper .mh-iconbtn:disabled{ opacity:.45; cursor:default; }
.admin-wrapper .mh-iconbtn.accent:hover{ background:var(--ae-accent-soft); color:var(--ae-primary); border-color:color-mix(in srgb, var(--ae-primary) 30%, transparent); }
.admin-wrapper .mh-iconbtn.danger:hover{ background:var(--ae-pill-danger-bg); color:var(--ae-pill-danger-fg); border-color:color-mix(in srgb, var(--ae-danger) 30%, transparent); }
.admin-wrapper .mh-iconbtn.success:hover{ background:var(--ae-pill-ok-bg); color:var(--ae-pill-ok-fg); border-color:color-mix(in srgb, var(--ae-success) 30%, transparent); }
.admin-wrapper .mh-iconbtn.warn{ background:var(--ae-pill-warn-bg); border-color:color-mix(in srgb, var(--ae-warning) 35%, transparent); color:var(--ae-pill-warn-fg); }
.admin-wrapper .mh-iconbtn .ic-badge{ position:absolute; top:-5px; right:-5px; min-width:16px; height:16px; padding:0 4px;
    border-radius:99px; background:var(--ae-danger); color:#fff; font-size:10px; font-weight:700; display:grid; place-items:center; }
.admin-wrapper .mh-actions{ display:flex; gap:6px; justify-content:flex-end; align-items:center; }

.admin-wrapper .mh-toolbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:20px; }
.admin-wrapper .mh-stepper{ display:flex; align-items:center; gap:4px; background:var(--ae-surface); border:1px solid var(--ae-border); border-radius:var(--ae-r); padding:5px; }
.admin-wrapper .mh-step-btn{ width:32px; height:32px; border-radius:calc(var(--ae-r) - 2px); display:grid; place-items:center; color:var(--ae-text-muted); cursor:pointer; border:none; background:none; }
.admin-wrapper .mh-step-btn:hover{ background:var(--ae-hover); color:var(--ae-text); }
.admin-wrapper .mh-range{ font-weight:600; font-size:14px; padding:0 10px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.admin-wrapper .mh-seg{ color:var(--ae-primary); font-weight:600; font-size:13.5px; padding:9px 14px; border-radius:var(--ae-r); background:var(--ae-accent-soft); cursor:pointer; border:none; font-family:inherit; white-space:nowrap; }
.admin-wrapper .mh-chip{ display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:var(--ae-r); cursor:pointer; font-weight:600; font-size:13.5px; border:1px solid var(--ae-border); background:var(--ae-surface); color:var(--ae-text-subtle); white-space:nowrap; font-family:inherit; }
.admin-wrapper .mh-chip:hover{ background:var(--ae-hover); }
.admin-wrapper .mh-chip.on{ background:var(--ae-primary); border-color:var(--ae-primary); color:var(--ae-accent-ink); }
.admin-wrapper .mh-chip.on-warn{ background:var(--ae-pill-warn-dot); border-color:var(--ae-pill-warn-dot); color:#fff; }
.admin-wrapper .mh-chiplink{ border:none; background:none; color:var(--ae-soft); font-weight:600; font-size:13px; cursor:pointer; font-family:inherit; display:inline-flex; align-items:center; gap:5px; padding:6px; }
.admin-wrapper .mh-chiplink:hover{ color:var(--ae-text); }
.admin-wrapper .mh-toolbar-count{ margin-left:auto; color:var(--ae-text-muted); font-size:13.5px; font-weight:500; white-space:nowrap; }
.admin-wrapper .mh-toolbar-count b{ color:var(--ae-text); font-weight:700; }

.admin-wrapper .ap-day{ margin-bottom:16px; }
.admin-wrapper .ap-dayhead{ display:flex; align-items:baseline; gap:10px; padding:0 4px 10px; }
.admin-wrapper .ap-dayhead b{ font-size:15px; font-weight:700; color:var(--ae-text); }
.admin-wrapper .ap-dayhead span{ color:var(--ae-soft); font-size:13px; font-variant-numeric:tabular-nums; }
.admin-wrapper .ap-dayhead i{ flex:1; height:1px; background:var(--ae-border); margin-left:6px; }

.admin-wrapper .mh-card{ background:var(--ae-surface); border:1px solid var(--ae-border); border-radius:var(--ae-r-card); overflow:hidden; box-shadow:var(--ae-shadow); }
.admin-wrapper .ap-grid{ display:grid; grid-template-columns:30px 64px minmax(0,1fr) 184px 152px 116px 124px; gap:14px; align-items:center; } /* Appointments-specific layout */
.admin-wrapper .mh-trow{ padding:11px 18px; border-top:1px solid var(--ae-line-soft); }
.admin-wrapper .mh-trow:first-child{ border-top:none; }
.admin-wrapper .mh-trow:hover{ background:var(--ae-hover); }
.admin-wrapper .ap-toggle{ border:none; background:none; cursor:pointer; color:var(--ae-soft); display:grid; place-items:center; width:24px; height:24px; border-radius:6px; padding:0; }
.admin-wrapper .ap-toggle:hover{ background:var(--ae-line-soft); color:var(--ae-text); }
.admin-wrapper .ap-time{ font-weight:700; font-size:15px; font-variant-numeric:tabular-nums; color:var(--ae-text); }
.admin-wrapper .ap-svc{ font-weight:600; font-size:15px; letter-spacing:-.01em; color:var(--ae-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-wrapper .ap-cellsub{ color:var(--ae-text-muted); font-size:12.5px; margin-top:2px; display:inline-flex; align-items:center; gap:5px; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.admin-wrapper .mh-namecell{ display:flex; align-items:center; gap:10px; min-width:0; }
.admin-wrapper .mh-namecell .nm{ font-size:14px; color:var(--ae-text); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-wrapper .row-event{ background:var(--ae-bg-soft); }
.admin-wrapper .row-canceled{ opacity:.55; }
.admin-wrapper .ap-evbadge{ display:inline-block; padding:2px 7px; border-radius:5px; font-size:.62rem; letter-spacing:.4px; font-weight:700; color:#fff; vertical-align:middle; margin-left:8px; }
.admin-wrapper .ap-hidbadge{ display:inline-flex; align-items:center; gap:4px; padding:2px 7px; border-radius:5px; font-size:.6rem; letter-spacing:.3px; font-weight:700; background:#475569; color:#fff; vertical-align:middle; margin-left:8px; }

/* Offering-type badge (Group class / Private session / Program) — soft tinted pill so the
   admin can tell each row's booking mode apart at a glance without competing with the
   status pill on the right. */
.admin-wrapper .ap-typebadge{ display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:var(--ae-r-pill); font-size:.62rem; letter-spacing:.2px; font-weight:700; text-transform:uppercase; vertical-align:middle; margin-left:8px; }
.admin-wrapper .ap-typebadge .bi{ font-size:.72rem; }
.admin-wrapper .ap-typebadge.tb-group{ background:#E7EFEE; color:#3C7D74; }
.admin-wrapper .ap-typebadge.tb-private{ background:#F1EAE6; color:#A2674E; }
.admin-wrapper .ap-typebadge.tb-program{ background:#EBEAF2; color:#5A549A; }

.admin-wrapper .mh-ava{ width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-weight:700; flex-shrink:0; }

.admin-wrapper .mh-status{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:var(--ae-r-pill); font-size:12.5px; font-weight:600; white-space:nowrap; text-transform:capitalize; }
.admin-wrapper .mh-dot{ width:6px; height:6px; border-radius:50%; }
.admin-wrapper .t-approved{ background:var(--ae-pill-ok-bg); color:var(--ae-pill-ok-fg); } .admin-wrapper .t-approved .mh-dot{ background:var(--ae-pill-ok-dot); }
.admin-wrapper .t-pending{ background:var(--ae-pill-warn-bg); color:var(--ae-pill-warn-fg); } .admin-wrapper .t-pending .mh-dot{ background:var(--ae-pill-warn-dot); }
.admin-wrapper .t-canceled{ background:var(--ae-pill-danger-bg); color:var(--ae-pill-danger-fg); } .admin-wrapper .t-canceled .mh-dot{ background:var(--ae-pill-danger-dot); }
.admin-wrapper .t-hidden{ background:var(--ae-pill-muted-bg); color:var(--ae-pill-muted-fg); } .admin-wrapper .t-hidden .mh-dot{ background:var(--ae-pill-muted-dot); }
.admin-wrapper .t-noshow{ background:var(--ae-pill-noshow-bg); color:var(--ae-pill-noshow-fg); } .admin-wrapper .t-noshow .mh-dot{ background:var(--ae-pill-noshow-dot); }

.admin-wrapper .mh-capnum{ font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; margin-bottom:5px; white-space:nowrap; color:var(--ae-text); }
.admin-wrapper .mh-capnum small{ color:var(--ae-soft); font-weight:500; }
.admin-wrapper .mh-bar{ height:5px; border-radius:99px; background:var(--ae-track); overflow:hidden; }
.admin-wrapper .mh-bar i{ display:block; height:100%; border-radius:99px; }

.admin-wrapper .ap-part{ background:var(--ae-bg-soft); border-top:1px solid var(--ae-line-soft); padding:8px 20px 18px 64px; }
.admin-wrapper .ap-parthead{ display:flex; align-items:center; gap:9px; padding:14px 0 12px; }
.admin-wrapper .ap-parthead b{ font-size:13.5px; font-weight:700; color:var(--ae-text); }
.admin-wrapper .ap-pgrid{ display:grid; grid-template-columns:minmax(160px,1.3fr) 120px 64px 150px minmax(110px,1fr) 140px; gap:12px; align-items:center; } /* Appointments-specific layout */
.admin-wrapper .ap-phead{ font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--ae-soft); font-weight:700; padding:0 14px 6px; }
.admin-wrapper .ap-prow{ padding:11px 14px; background:var(--ae-surface); border:1px solid var(--ae-border); border-radius:calc(var(--ae-r-card) - 4px); margin-bottom:8px; }
.admin-wrapper .ap-prow.is-canceled{ opacity:.55; }
.admin-wrapper .ap-pname{ font-weight:600; font-size:14px; color:var(--ae-text); display:flex; align-items:center; gap:6px; }
.admin-wrapper .ap-pname a{ color:var(--ae-primary); display:inline-flex; }
.admin-wrapper .ap-pmail{ color:var(--ae-soft); font-size:12.5px; margin-top:1px; }
.admin-wrapper .ap-pmeta{ font-size:13px; color:var(--ae-text-subtle); font-variant-numeric:tabular-nums; }
.admin-wrapper .ap-pmeta small{ color:var(--ae-soft); }
.admin-wrapper .ap-pkg{ font-size:12.5px; color:var(--ae-primary); display:inline-flex; align-items:center; gap:5px; }
.admin-wrapper .ap-guest{ display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:99px; background:var(--ae-chip); color:var(--ae-text-subtle); font-size:12px; margin:2px 4px 2px 0; }
.admin-wrapper .ap-guest .gx{ border:none; background:none; cursor:pointer; color:var(--ae-soft); font-size:11px; line-height:1; padding:0; display:inline-flex; }
.admin-wrapper .ap-guest .gx:hover{ color:var(--ae-danger); }

.admin-wrapper .ap-empty{ display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:70px 20px; color:var(--ae-text-muted); }
.admin-wrapper .ap-empty .ic{ width:56px; height:56px; border-radius:16px; background:var(--ae-surface); border:1px solid var(--ae-border); display:grid; place-items:center; color:var(--ae-primary); margin-bottom:16px; }

/* ============================================================
   BOOTSTRAP RESKIN — token-driven, scoped under .admin-wrapper so the
   login/public pages (outside .admin-wrapper) stay untouched. The extra
   .admin-wrapper class beats Bootstrap on specificity + source order, so
   no !important is needed (except .text-muted, which Bootstrap !importants).
   ============================================================ */
.admin-wrapper .btn{ border-radius:var(--ae-r); font-weight:600; }
.admin-wrapper .btn-primary{ background:var(--ae-primary); border-color:var(--ae-primary); color:var(--ae-accent-ink); }
.admin-wrapper .btn-primary:hover,
.admin-wrapper .btn-primary:focus,
.admin-wrapper .btn-primary:active{ background:var(--ae-primary); border-color:var(--ae-primary); color:var(--ae-accent-ink); filter:brightness(.95); }
.admin-wrapper .btn-outline-primary{ color:var(--ae-primary); border-color:var(--ae-primary); }
.admin-wrapper .btn-outline-primary:hover{ background:var(--ae-primary); border-color:var(--ae-primary); color:#fff; }
.admin-wrapper .btn-secondary{ background:var(--ae-bg-soft); border-color:var(--ae-border); color:var(--ae-text-subtle); }
.admin-wrapper .btn-secondary:hover{ background:var(--ae-hover); border-color:var(--ae-border); color:var(--ae-text); }
.admin-wrapper .btn-outline-secondary{ color:var(--ae-text-subtle); border-color:var(--ae-border); }
.admin-wrapper .btn-outline-secondary:hover{ background:var(--ae-hover); border-color:var(--ae-border); color:var(--ae-text); }
.admin-wrapper .btn-success{ background:var(--ae-success); border-color:var(--ae-success); color:#fff; }
.admin-wrapper .btn-danger{ background:var(--ae-danger); border-color:var(--ae-danger); color:#fff; }
.admin-wrapper .btn-outline-success{ color:var(--ae-success); border-color:color-mix(in srgb, var(--ae-success) 55%, transparent); }
.admin-wrapper .btn-outline-success:hover{ background:var(--ae-success); border-color:var(--ae-success); color:#fff; }
.admin-wrapper .btn-outline-danger{ color:var(--ae-danger); border-color:color-mix(in srgb, var(--ae-danger) 55%, transparent); }
.admin-wrapper .btn-outline-danger:hover{ background:var(--ae-danger); border-color:var(--ae-danger); color:#fff; }
.admin-wrapper .btn-light{ background:var(--ae-bg-soft); border-color:var(--ae-border); color:var(--ae-text-subtle); }
.admin-wrapper .btn-light:hover{ background:var(--ae-hover); color:var(--ae-text); }
.admin-wrapper .btn-link{ color:var(--ae-primary); }

.admin-wrapper .card{ border-radius:var(--ae-r-card); border:1px solid var(--ae-border); background:var(--ae-surface); box-shadow:var(--ae-shadow); }
.admin-wrapper .card .card{ box-shadow:none; }

.admin-wrapper .table{ --bs-table-bg:transparent; --bs-table-color:var(--ae-text); color:var(--ae-text); }
.admin-wrapper .table-hover>tbody>tr:hover>*{ background:var(--ae-hover); }

.admin-wrapper .badge{ border-radius:var(--ae-r-pill); font-weight:600; }

.admin-wrapper .form-control,
.admin-wrapper .form-select{ border-radius:var(--ae-r); border-color:var(--ae-border); color:var(--ae-text); background:var(--ae-surface); }
.admin-wrapper .form-control:focus,
.admin-wrapper .form-select:focus{ border-color:var(--ae-primary); box-shadow:0 0 0 3px color-mix(in srgb, var(--ae-primary) 18%, transparent); }
.admin-wrapper .form-control::placeholder{ color:var(--ae-soft); }
.admin-wrapper .form-check-input:checked{ background-color:var(--ae-primary); border-color:var(--ae-primary); }
.admin-wrapper .form-check-input:focus{ border-color:var(--ae-primary); box-shadow:0 0 0 3px color-mix(in srgb, var(--ae-primary) 18%, transparent); }

.admin-wrapper .nav-tabs{ border-bottom-color:var(--ae-border); }
.admin-wrapper .nav-tabs .nav-link{ color:var(--ae-text-subtle); border-radius:var(--ae-r) var(--ae-r) 0 0; }
.admin-wrapper .nav-tabs .nav-link:hover{ border-color:transparent; color:var(--ae-text); }
.admin-wrapper .nav-tabs .nav-link.active{ color:var(--ae-primary); background:transparent; border-color:transparent; border-bottom:2px solid var(--ae-primary); }

.admin-wrapper .modal-content{ border-radius:var(--ae-r-card); border:1px solid var(--ae-border); background:var(--ae-surface); color:var(--ae-text); }
.admin-wrapper .modal-header,
.admin-wrapper .modal-footer{ border-color:var(--ae-line-soft); }
/* ---- data-mode="dark" rules (apply to any dark theme) ---- */
[data-mode="dark"] .btn-close{ filter:invert(1) grayscale(100%) brightness(1.6); }
/* The MotionHub logo art is dark — float it on a white chip so it stays legible. */
[data-mode="dark"] .sidebar-brand-logo{ background:#fff; border-radius:9px; padding:5px 8px; box-sizing:border-box; }
/* Scrollbar thumb border matches the panel, not the (darker) bg. */
[data-mode="dark"] ::-webkit-scrollbar-thumb{ border-color:var(--ae-surface); }

.admin-wrapper .alert{ border-radius:var(--ae-r); }

.admin-wrapper .pagination{ --bs-pagination-color:var(--ae-text-subtle); --bs-pagination-bg:var(--ae-surface); --bs-pagination-border-color:var(--ae-border); --bs-pagination-hover-bg:var(--ae-hover); --bs-pagination-hover-color:var(--ae-text); --bs-pagination-active-bg:var(--ae-primary); --bs-pagination-active-border-color:var(--ae-primary); --bs-pagination-active-color:var(--ae-accent-ink); }

.admin-wrapper .list-group-item{ border-color:var(--ae-border); background:var(--ae-surface); color:var(--ae-text); }
.admin-wrapper .list-group-item-action:hover{ background:var(--ae-hover); }
.admin-wrapper .list-group-item.active{ background:var(--ae-primary); border-color:var(--ae-primary); color:var(--ae-accent-ink); }

.admin-wrapper .dropdown-menu{ border-radius:var(--ae-r-card); border-color:var(--ae-border); background:var(--ae-surface); box-shadow:var(--ae-shadow); }
.admin-wrapper .dropdown-item{ color:var(--ae-text); }
.admin-wrapper .dropdown-item:hover{ background:var(--ae-hover); color:var(--ae-text); }

.admin-wrapper .text-muted{ color:var(--ae-text-muted) !important; }

/* ---- Theme picker (profile dropdown) ---- */
.profile-dropdown-themewrap { padding: 8px 12px 4px; }
.profile-theme-swatches { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 8px; }
.profile-theme-swatch {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--sw);
    border: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
    cursor: pointer; padding: 0;
    transition: transform .12s ease, box-shadow .12s ease;
}
.profile-theme-swatch:hover { transform: scale(1.12); }
.profile-theme-swatch.is-active {
    box-shadow: 0 0 0 2px var(--sidebar-dropdown-bg), 0 0 0 4px var(--accent);
}
